> Ben,
>
> So that works when it's being passed directly to send but it won't
> work when passed in from a splatted array!
>
> [1,2,3].send(*[:collect, &Proc.new{|x| x.to_s + "!"}])
> -> SyntaxError: (irb):1: expecting ']'
That doesn't work because you can't put a block in an array:
>> [:collect, &Proc.new{|x| x.to_s + '!'}]
SyntaxError: compile error
Instead of storing the call and args in an array, you might want to
consider a hash so you can label and handle blocks special case.
There's some ambiguity in just shoving it in at the end of the args
(is it a user argument or a handler?).
--
Kevin Clark
http://glu.ttono.us
--
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby