Agree on looking from the angle of data structure and their internal
presentation. But conceptually, [] and {} are just syntax sugars:
  [x y] -> (vector x y)
  {x y} -> (hash-map x y)
  #{x y} -> (hash-set x y)
The 2 element structures are all become 3 element lists.

Louis

On Dec 29, 7:03 am, James Reeves <jree...@weavejester.com> wrote:
> On 29 December 2011 04:49, Louis Yu Lu <louisy...@gmail.com> wrote:
>
> > Instead of using overloaded (), may be f[x] will cause less trouble,
> > and more inline with clojure's syntax as [ ] already being used for
> > defining the arguments of the function.
>
> I think you need to look at this from a slightly different angle.
>
> In Clojure, as in all Lisps, code is represented by data structures.
> In Clojure, (x y) is a linked list of two elements, [x y] is a vector,
> and {x y} a map. You need to think about Clojure code in terms of the
> data structures beneath.
>
> So you're proposing that x[y] be considered a two-element list. This
> is an unusual syntax for defining a list in any language I know, and
> looks confusingly similar to a single element followed by a vector.
>
> Try not to ask the question, "What syntax is good for representing a
> function call?" and instead ask, "What syntax is good for representing
> a linked list of elements?"
>
> - James

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