interesting to me that <> wasn't used for anything to add to the "literal
syntax".  folks in another thread were using sequences for set theory.  But
maybe there needs to be a set notation.  If that makes sense, {} should be
sets, just like in math, <> should be vectors, just like in math, and []
could be maps.  I know, I know, it's kinda late to be arguing to change this
stuff.  Another idea that fits in better would be to use <> as an
alternative to quoting a list . . . and still not do anything for sets.

On Sun, Jan 25, 2009 at 8:25 PM, Stephen C. Gilardi <squee...@mac.com>wrote:

>
> On Jan 25, 2009, at 8:05 PM, wubbie wrote:
>
>  Wait... I just tried (first (list (+ 1 2) (+ 3 4))) and got 3!
>> So (list a b c) is different than '( a b c)? I thought they are
>> equivalent!
>>
>
> Right, as your experiment shows, the ' in '(a b c) quotes both the list
> itself and all of its contents.
>
> Using vectors to hold your data can be a convenient way to experiment
> because you don't have to worry about avoiding the special evaluation rules
> for lists.
>
> user=> [(+ 1 2) (+ 3 4)]
> [3 7]
>
> One strategy for working with Clojure is to favor using:
>
>        - lists mostly for function calls,
>        - vectors, maps, and sets mostly for collecting data, and
>        - seqs (and the seq functions) mostly for manipulating data.
>
> Clojure's rich set of literal syntax for collections other than lists is
> very helpful in keeping code readable while following that strategy.
>
> --Steve
>
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to