Nice trick!

--

class Symbol
     def to_proc
         Proc.new { |obj, *args| obj.send(self, *args) }
     end
end

puts ["foo", "bar", "cat", "dog"].collect  &:reverse!
oof
rab
tac
god


##

But why does this not work?

a = &:foo

sym.rb:9: parse error, unexpected tAMPER
a = &:reverse!

( Using ruby ruby 1.8.4 (2005-12-24) [i486-linux] )



--
Brad Phelan
Object Oriented Template Engine For Ruby ( alpha )
http://rubyforge.org/projects/galena/