On Tue, Feb 24, 2009 at 4:15 PM, Joshua Fox <joshuat...@gmail.com> wrote: > Why do many core macros pass bindings as a vector, then destructure them in > various ways into symbols and values. > This is instead of just providing the symbol and value, e.g., > (defmacro my-macro > [s v & body] > `(let [~s ~v] ....... > > In at least five macros in core.clj, this was changed recently, as validated > by an IllegalArgumentException. What is the reasoning behind the newer > design? > In some cases, I think this is done because there could be multiple pairs of > symbol-values in the bindings, but in other cases, the vector is expected to > have exactly two items.
This change was made in early November last year. Before that, it was "confusing for people because they don't know if they need a vector or not, for each macro.": http://tinyurl.com/bro73k --Chouser --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---