> > Not really. (...) is a non-atomic s-expression. If it's evaluated > > unquoted, the first nested s-expression is evaluated and if it's not > > callable an exception is thrown. Macros, special forms (which are sort > > of like system-internal macros and are used to build all the other > > macros, and functions), Java constructors, Java methods, and functions > > are callable (and maps and keywords -- also vectors -- act as > > functions for this purpose). > > So, to paraphrase: "all of those things act like functions, parens > just call functions, so parens aren't overloaded." ..Which is about > two steps away from a tautology. :)
It's not a tautology, though your paraphrase isn't necessarily wrong for the quote given. As a previous poster mentioned, all of the code is represented as a data structure. In Lisp this is traditionally the humble list; I am not sure about Clojure's internals but I think it puts vectors and possibly even maps in there as well as the list. Once you start thinking about that and feeling okay with that and what it means in terms of evaluation (compilation), trouble with parenthesis typically vanishes soon after. What do I mean by evaluation? Start typing in the REPL. When you put in something, it gets evaluated. What gets evaluated must either be an immediate value (symbol, bound variable, or classic "primitive type" but that's a simplified can of worms nobody wants to open), or a list. Then how is a list evaluated? The list's head is evaluated (as a lambda expression or special form), and given the tail as its arguments. Then the arguments get evaluated in the same way...they're either immediate values, symbols, or lists themselves. And so on. (Note that this is all simplified, and there's a whole hidden discussion here about what it means to evaluate a list lazy or eager or adshfddskjfds...I don't really know how Clojure does it, this is just a discussion of Lisp in general for illustrative purposes). So, an open parenthesis is merely the start of the list. And, in terms of evaluation, we know exactly what that means. It's either a lambda expression or special form (and the two aren't mutually exclusive -- let is just another way of saying lambda, after all). -- Morgon -- 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