Let's take a step back and look at this idea from a new user's view.
The way I see it, whatever we do, we'll have to explain to users how
to create sets. Hashmaps, and vectors follow (roughly) the JSON/Python
syntax:

vector = [1 2 3 4]
map = {1 2 3 4}

So how to these languages represent sets?

Python does it via extra syntax sugar:

set = {"foo", "bar"}
map = {"foo": "bar", "foo2" : "bar2"}

I think the thing we have to keep in mind is that I can't think of a
single other language that has set literals. So whatever we come up
with will be a bit bizzare to new users. So let's look at the options
given above:

{{"foo"}}  ;; looks like a hash of a hash
<{"foo"}> ;; could work, but no other form in all of clojure has two
forms at the end.
#{"foo"} ;; not exactly pretty

My thoughts are this...who actually uses the literal hash set? In the
thousands of lines of Clojure code I've written a hash set once. So my
first reaction is why have a literal at all? Why not use:

On top of that, lets say we do want a literal syntax...if we have to
teach some bizarre syntax that people will rarely use...what's the big
difference between #{} and <{}> ?

If we want to actually go back to the original lisps, they didn't have
any special syntax at all, besides the quote literal. This isn't
ruby/python/C#. If something can be implemented without syntactic
sugar, most times it should be. So my question for Cedric is...why all
the fuss about set? Why not just use (set ["foo", "bar"]) it's clean,
and makes plenty of sense to newbies.

Timothy

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

Reply via email to