Re: Re: Varför kan jag inte inte anropa A -- B -- C ?
Robert Virding
robert.virding@REDACTED
Fri Oct 17 13:47:52 CEST 2003
----- Original Message -----
From: "Sven-Olof Nystr|m" <svenolof@REDACTED>
To: "Robert Virding" <robert.virding@REDACTED>
Cc: "Pierpaolo BERNARDI" <bernardp@REDACTED>;
<erlang-questions@REDACTED>
Sent: Friday, October 17, 2003 9:51 AM
Subject: Re: Re: Varför kan jag inte inte anropa A -- B -- C ?
> 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.
Yes, I know. Wonderful isn't it?
> 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"?
Just to make the associativity relate to how you would like it to work.
If the terms are expressions it makes it a little clearer what is happening.
At least I think so.
Robert
More information about the erlang-questions
mailing list