From: Elliot Temple Date: 2006-06-16T15:29:22+09:00 Subject: Re: Symbol#to_proc Problem On Jun 15, 2006, at 9:44 PM, Logan Capaldo wrote: > Yeah I don't believe it's possible to have this work both ways. > > You could do > > class Symbol > def unary_meth > lambda { |obj| obj.send(self) } > end > > def nary_meth > lambda { |obj, *args| obj.send(self, *args) } > end > end > > [[1,2,3], [4,5,6]].map &:reverse.unary_meth > > { 1=2, 3=>4 }.map &:foo.nary_meth > > This is one of those cases where you can't have your cake and eat > it too. that is helpful, thanks is there a reason it's important for *args to force an array to split up, instead of just being empty? -- Elliot Temple http://www.curi.us/blog/