On Sun, 02 May 2010 13:06:56 +1000 Alex Osborne <a...@meshy.org> wrote: > e <evier...@gmail.com> writes: > > Can you imagine how disruptive it would be at this point to do it the > > other way around? If you were starting out today without any Lisp > > baggage, it seems TOTALLY obvious to me that lists would have been (1 > > 2 3), and the *calling of a function* would have been the different > > thing ... now that these other data structures represent themselves > > symbolically (vectors, sets, maps). > Interesting, although in the case of idiomatic Clojure it's actually > very rare to want to use a list literal. Most of the places you'd use a > list literal in other lisps, a vector probably makes more sense in > Clojure.
That was my conclusion as well - pragmatically, you want the shorter construct for the more common use case. > I'm also not sure the code-is-data thing works so well when > you reverse quotation like that as it means you'd have quotes on every > nested level instead of just the outside, which would make macros more > difficult to write (at least without any other changes), but I may be > misunderstanding your idea. I thought that as first, but then realized that you'd still want quote even if you had this change, because quote is more than just a symbolic representation of the list. It stops the evaluation of the contents of the list, which the other symbolic representations don't do. So [1 2 3 (print :hello)] will print the keyword :hello, then return [1 2 3 nil], but '(1 2 3 (print :hello)) doesn't print anything, and returns a list with four elements - 1, 2, 3 and the list with two elements, the symbol print and the keyword :hello. This should be compared with '[1 2 3 (print :hello)]. To get behavior similar to the vector constructs, you want to use list, which works like vector, except returning a list instead of a vector: (list 1 2 3 (print :hello)). It seems that what's missing here is a syntax for (list. I'm not sure it's needed, as it never appeared in LISP, but #[ seems to be the logical candidate: { - hash-map #{ - hash-set [ - vector #[ - list <mike -- Mike Meyer <m...@mired.org> http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. O< ascii ribbon campaign - stop html mail - www.asciiribbon.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 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