On Jul 7, 2006, at 12:43 PM, Sean O'Halpin wrote:

> On 7/7/06, dblack / wobblini.net <dblack / wobblini.net> wrote:
>> Hi --
>>
>> On Fri, 7 Jul 2006, ara.t.howard / noaa.gov wrote:
>>
>> > On Fri, 7 Jul 2006, Logan Capaldo wrote:
>> >
>> >> Steal another name from lisp?
>> >>
>> >> obj.apply(:meth, 1, 2, 3)
>> >>
>> >> It's not send, but it's not funcall either.
>> >>
>> >> obj apply your :meth function to the arguments 1,2,3
>> >>
>> >> Just throwing stuff out there, feel free to ignore me :)
>> >
>> > i was just about to suggest that name.  still, there is nothing  
>> which implies
>> > are receiverless context sensitive call that can access private  
>> methods with
>> > that name is there?
>>
>> No -- which is why I like it much more than 'funcall' and  
>> such :-)  It
>> doesn't introduce the criterion of "receiverlessness" into a  
>> situation
>> where the concept of having or not having a receiver isn't relevant.
>>
>>
>> David
>>
>
> FWIW, I'm already using apply, i.e.:
>
> module Enumerable
>  def apply(&block)
>    map {|i| i.instance_eval(&block) }
>  end
> end
>
> which seems more in keeping with its meaning in lisp (though not
> really the same).
>
> Regards,
> Sean
>

I disagree, yours is not especially closer to the Lisp meaning of  
apply. The only difference (AFAIK) between Lisp's funcall and Lisp's  
apply is how the argument list is expressed:

[1]> (funcall #'+ 1 2)
3
[2]> (apply #'+ '(1 2))
3



Of course this probably means we should have #funcall and #apply <g>

obj.funcall(:meth, 1, 2)
obj.apply(:meth, [1, 2])