On May 4, 2009, at 10:33 PM, Mark Volkmann wrote:
I have a collection I need to pass to foo after the first arg like this:(foo "some value" my-collection) What I need is a way to expand my-collection into individual arguments that are passed to foo so that they will be collected back into other-args as a sequence. I could create a new sequence containing "some value" and the items in my-collection and then use apply on foo and the new sequence. Is there a better way?
Apply takes any number of individual elements before the final collection:
(apply foo "some value" my-collection) Here's a concrete example: user=> (apply + 3 4 [5 6 7]) 25 --Steve
smime.p7s
Description: S/MIME cryptographic signature