Wolodja, hello. On 2012 Jan 11, at 16:34, Wolodja Wentland wrote:
> I've stumbled over varargs in Clojure before and Alan Malloy came up with a > nice solution [0] which I expanded slightly: > > --- snip --- > (defmacro real-varargs [method required-count & array-type] > (let [args (repeatedly (inc required-count) gensym)] > `(let [f# (fn [~@args] > (~method ~@args))] > (fn [& args#] > (let [[before# after#] (split-at ~required-count args#)] > (apply f# `(~@before# ~(into-array ~@array-type after#)))))))) Thanks for this -- it looks entertaining. Clojure macros are coming next, for me (but I'm postponing them for the moment, because I'm trying to work out Racket macros, and trying to grok both at once could be injurious). Norman -- Norman Gray : http://nxg.me.uk -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en