try this one:
(list,1,2,3)
:)
Per: I'd say it's also weird if you're coming from a Lisp background - just
weird in the opposite direction. But not so weird that it's not useful,
mostly for separating key/value pairs from other key/value pairs in a map.
It's like Perl's fat comma arrow
Well, for the comma to be useful, it cannot require whitespace
separation on either side. It would be weird if you had to write [1 ,
2 , 3]. So, it shouldn't be surprising that 'list,' is read as 'list'
when '123,' is read as '123'.
Regarding the strangeness of comma-as-whitespace if you're
I did not want to argue for or against the , as whitespace feature, but just
wanted to point out the possible gotchas that we probably should warn novice
clojure programmers for. I actually hit my head when I was trying to initialize
a map with some nil value for :b, like:
user {:a, a, :b,,
So, it's all some form of RTFM... but one could argue that this novel use of
commas in the syntax results in adding a little incidental complexity to
the language ;-)
You put some pretty specific assumptions into your code: commas as
separators, commas with a proper place in Clojure syntax,
On Apr 2, 2010, at 7:14 PM, Armando Blancas wrote:
So, it's all some form of RTFM... but one could argue that this novel use of
commas in the syntax results in adding a little incidental complexity to
the language ;-)
My wrong assumption was: whitespace and commas are separators instead
Even though the specs clearly say that commas are whitespace, the following
repl session doesn't feel intuitively right:
...
user (list 1 2 3)
(1 2 3)
user (list 1, 2, 3)
(1 2 3)
user (list 1, 2, , 3)
(1 2 3)
user (list 1, 2, nil , 3)
(1 2 nil 3)
...
, is same as , , is same as ... big gotcha
It doesn't feel right only if you still think you are programming in
an Algol-style language where , is a separator token.
I can't imagine this is going to change.
-Per
On Fri, Apr 2, 2010 at 12:37 PM, Frank Siebenlist
frank.siebenl...@gmail.com wrote:
Even though the specs clearly say that