On Tue, Apr 17, 2012 at 9:16 PM, Dmitri <[email protected]> wrote: > (map? foo bar baz) would return bar if foo is a map and baz otherwise.
To elaborate on Alan's response, consider: (if (map? foo) (/ bar 0) baz) If map? were 'merely' a variadic function, (map? foo (/ bar 0) baz) would fail because (/ bar 0) would be evaluated and then passed as an argument, along with foo and baz. So, no, the simple answer is that you can't just make the test functions variadic and get the same behavior as an if form (hence Alan's suggestion of a macro-generating macro to create new macros for the forms you want). (Apologies if I'm laboring the point here) -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-1880) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
