Re: Clojure special forms

2013-04-30 Thread David Simmons
Thanks Christophe. Love the book BTW. cheers Dave -- -- 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

Re: Clojure special forms

2013-04-30 Thread David Simmons
Hi All thank you for your answers. I think I now understand (@Gregory - completely agree about Clojure being pragmatic). Onwards and Upwards Kind Regards Dave -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: Clojure special forms

2013-04-30 Thread Christophe Grand
Hi David, Special forms exist because they have special semantics and evaluation rules. Is there some overlap between them? Absolutely: when you have fn you don't need let. Still we have let. About reduce: originally reduce was pure clojure with no interop, the .reduce you see is just for the chu

Re: Clojure special forms

2013-04-30 Thread Gregory Graham
This shows the pragmatic nature of Clojure. A founding idea of Lisp is that the whole language can be built up from a handful of simple elements, and this is a good thing for a lot of reasons. However, practical concerns such as efficiency and interoperability may lead implementers to access the

Re: Clojure special forms

2013-04-30 Thread Tassilo Horn
Michael Klishin writes: Hi Michael, > or http://clojure-doc.org/articles/language/macros.html#special_forms :) Technically, fn, letfn, and loop are no special forms but macros built on top of the real special forms fn*, letfn*, and loop*. That distinction is made for let/let* in the itemize li

Re: Clojure special forms

2013-04-29 Thread David Simmons
Hi Both. Thank you for your prompt replies. Maybe I'm being purist but if one of the special forms is the dot you have all of Java to play with so presumably you could produce any of the other clojure functions. I thought that the special forms enabled you to produce all other elements of the l

Re: Clojure special forms

2013-04-29 Thread Baishampayan Ghose
Absolutely! Thanks Michael. Sent from phone. Please excuse brevity. On 29 Apr 2013 18:36, "Michael Klishin" wrote: > > 2013/4/29 Baishampayan Ghose > >> For the real special forms you will have to look at the Clojure >> compiler source starting from here - >> >> https://github.com/clojure/cloju

Re: Clojure special forms

2013-04-29 Thread Michael Klishin
2013/4/29 Baishampayan Ghose > For the real special forms you will have to look at the Clojure > compiler source starting from here - > > https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L39 > or http://clojure-doc.org/articles/language/macros.html#special_forms

Re: Clojure special forms

2013-04-29 Thread Baishampayan Ghose
So reduce here is actually written in Java, hence the call to the .reduce method. It's perfectly possible to write reduce in pure Clojure today but it's probably not done that way because of performance reasons. For the real special forms you will have to look at the Clojure compiler source starti

Clojure special forms

2013-04-29 Thread David Simmons
Hi I am just setting out to learn Clojure (my 2nd attempt) and am starting to feel more comfortable with the language (and very excited about the possibilities). However, I'm reading Clojure Programming (Emerick, Carper and Grand) and read that Special forms are the primitive building blocks o