[erlang-questions] alternate forms for comparisons >= and =<

Robert Virding rvirding@REDACTED
Thu Mar 27 00:10:31 CET 2008

On 26/03/2008, Richard A. O'Keefe <ok@REDACTED> wrote:
> And surely "#" (which also has a "" association) should be left
> associative,
> so that X#state.thingy#thingy.whatsit does the right thing?  Ditto for
> X#state{thingy=T}#state{whojacky=W}, which I know can be done in one
> step.

The reason the associativity of # is what it is is actually to force using
parentheses in these case. While this may seem perverse at the time records
were added we were discussing whether to allow not just giving the key by
its name, an atom, but also expressions which evaluate to the key name. This
was never implemented but we wanted the parser to be ready for such a change
and I felt that you could easily get completely incomprehensible expressions
without parentheses. The problem would not be for the parser of course but
for the poor human reader.

Perhaps this was being over cautious.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080327/7408de15/attachment.htm>

More information about the erlang-questions mailing list