Special syntax for dictionaries
Tim Fletcher
mail@REDACTED
Thu May 6 14:41:42 CEST 2010
> You must hate the <<...>> used for binaries, then.
I don't, so it's probably because <{ uses two *different* characters
that I find it a little peculiar.
> What semicolon? ":" is a colon.
My mistake. I meant colon, and no idea why I typed semicolon.
> I'm not sure what brackets [] have to do with it; if you
> mean there are no parentheses, there's not the slightest
> reason why there should not be:
Parentheses. British usage of the word "brackets" usually means
parentheses. Sorry for the additional confusion.
What I meant was that <<{erlang:list_to_integer}>> can't be confused
with a function call because there are no parentheses. But as Robert
clearly explains, the key point is that the values *can* be function
calls, which gives rise to ambiguity. That's the "problem" that I did
not forsee with using colons that I was asking about in my first
question.
> Why do we find it easier to argue about the colour of the paint
> for the Ark than to climb aboard?
Just because syntax might be a relatively trivial issue does not mean
that it can't be discussed and alternatives considered/compared. I
don't have anything to add to the "more important" discussion on
"should we add frames/structs?" because I think they are a sound idea
in principle and would much prefer using them to records.
It is also my opinion that using a tilde is not the best syntax to use
for seperating the keys and values. Whilst it can't be confused with
any existing syntax, I don't think it makes the meaning of the code
very clear. Looking at <{foo ~ bar}> doesn't make me think of "a key/
name mapped to a value". It looks more like some binary operator.
Tim
More information about the erlang-questions
mailing list