I believe you might have seen :when in the binding vector of either a for or deseq form. Their special usage is documented here: http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/for
In any event, James explained the distinction quite well. Macros are often used to create special syntax for domain specific functionality. In the ns macro, this is to simplify the specification for required libraries, classes, etc. in a given namespace. You noticed the similarity to the standalone 'require', 'use', and 'import' macros for a reason. The ns macro was designed to make adding those options to the ns form look and feel like the standalone forms. In the case of the 'for' macro, it is to allow for powerfully expressive list comprehensions. This is tangential but I think you might enjoy seeing how far you can go with list comprehensions in Clojure: http://programming-puzzler.blogspot.com/2013/03/logic-programming-is-overrated.html On Thursday, July 3, 2014 2:24:51 PM UTC-4, g vim wrote: > > On 03/07/2014 18:36, James Reeves wrote: > > > > The reason for this is to make it clear that you're not executing the > > require function directly, but instead passing options to the ns form. > > > > I don't understand "not executing the require function directly". > > I've also seen the when function called as :when in the body of a let > statement so could you elaborate on this non-macro example? I need to be > clear on when it is preferable to use a keyword function rather than a > normal function call. > > gvim > -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.