Hello all, I have a quick question:
Is it possible to create a Lisp style apply function with Ruby, and
would I have to use eval to create one? The function would work as
follows:
But all apply does in lisp is call a function and pass it the rest of
the arguments as a list. The semantic definition of +(1,2,3) is an
entirely separate issue.
Hello all, I have a quick question:
Is it possible to create a Lisp style apply function with Ruby, and
would I have to use eval to create one? The function would work as
follows:
Yes, that was exactly what I was looking for. I guess that I was a bit off
target as to what the Lisp apply function does, but the code you posted
has the exact behaviour I was looking for.