Re: Varför kan jag inte inte anropa A -- B -- C ?

Sven-Olof Nystr|m svenolof@REDACTED
Fri Oct 17 09:51:17 CEST 2003


Robert Virding writes:
 > Unfortunately you are all missing something, -- is a big joke. After
 > I had added the ++ syntax, it is just syntactic sugar really, I just had
 > to add -- as a joke. I was also planning to add ** and // but I
 > couldn't really come up with good list meanings so I dropped it.
 > That is why there is no really thought out semantics for --.
 > 
 > The operator associativity had to be the same as ++ though. Sometimes
 > I still get the feeling we should have done the same as Smalltalk.
 > 

Of course, this means that the minusminus operator is now part of the
language and must be supported in the future.

It is also difficult to understand your motivation for making the ++
operator right-associative. What prevents a compiler from implementing
(X ++ Y) ++ Z as "first concatenate Y and Z, then concatenate X with
the result"?

Sven-Olof





More information about the erlang-questions mailing list