On Wed, Feb 25, 2009 at 6:19 AM, glow <glo...@gmail.com> wrote: > > Hi everyone! > I am currently learning Lisp and Clojure. A few days ago i read how > "if" in Arc works and I wonder why it is not the same in Clojure: > (if a b ; if a then b > c d ; elseif c then d > e) ; else e. > I thought a bit about it and it seems that Clojure hasn't improved > Common Lisp's (in my humble opinion) crippled "if" and "cond". In CL > "cond" took any number of arguments, but they were pairs (additional > parentheses), and Clojure mimicked it (thus allowing only even number > of arguments). Dropping this parentheses is just one step from the > full "if" condtional syntax. You must admit that the last in condition > in "cond" is usually "true" and it is a workaround compared to Arc > syntax. Just by adding odd number of arguments to "cond" we would have > conditional replacing both "if" and "cond". Why have two weaker tools > instead of one beautiful and powerful? > The new syntax is already used in condp:
(condp x pred a then-a b then-b c then-c else-expr) In case of cond, I don't know. Clojure *is* a Lisp, and coming from Scheme, I find the close conformance of Clojure's cond and Lisp/Scheme's easier on the eye. Regards, -- miʃel salim • http://hircus.jaiku.com/ IUCS • msa...@cs.indiana.edu Fedora • sali...@fedoraproject.org MacPorts • hir...@macports.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---