[erlang-bugs] Parser bug: if missing ", " in list between records, the first is ignored, and no parser warnings are given.

Roland Karlsson roland.karlsson@REDACTED
Mon Nov 17 19:51:32 CET 2014


Not necessarily. Sometimes you
get syntactical clashes which forces paranthesis
or sometimes even blank spaces.

Erlang is not well syntactically designed.

But in this particular case no such clash is
evident - so a paranthesis is not needed
other than for avoiding unreadability.

I know of no such other case. But I do not know all.
So --- maybe someone has an example?
An example where a paranthesis is needed even
though it would be unambiguous without.


/Roland



On Mon, 17 Nov 2014 18:28:06 +0100
Vlad Dumitrescu <vladdu55@REDACTED> wrote:

> On Mon, Nov 17, 2014 at 4:56 PM, Robert Virding <rvirding@REDACTED> wrote:
> 
> > The obvious solution is to reinstate the need to wrap the "thing" before
> > the # with parentheses when it is and expression. Then the problem would go
> > away. :-)
> >
> 
> Is a single variable not an expression? It would be inconsistent if only
> some expressions would need parentheses!
> 
> ;-)
> 
> regards,
> Vlad
> 
> 
> 
> > Robert
> >
> >
> > On 16 November 2014 22:12, PAILLEAU Eric <eric.pailleau@REDACTED> wrote:
> >
> >> Le 16/11/2014 21:54, Roland Karlsson a écrit :
> >>
> >>>
> >>> Concatenating of two strings is an exception I assume.
> >>> I am not knowledgeable enough in Erlang syntax to explain why it works.
> >>> Need help of someone else.
> >>>
> >>
> >> It is written in documentation.
> >>
> >> "Two adjacent string literals are concatenated into one. This is done at
> >> compile-time and does not incur any runtime overhead"
> >>
> >> I don't fight for this syntax, I think it add more inconsistency in
> >> syntax.
> >>
> >> By the way, this syntax only work at first expansion ,
> >> this below module will never compile ...
> >>
> >> ---8<---------------------------------------
> >> -module(test).
> >>
> >> -export([main/0]).
> >>
> >> -record(test,{a=0, b=0}).
> >>
> >> main() -> left()right().
> >>
> >> left() -> #test{2}.
> >>
> >> right() -> #test{a=6}.
> >> ---8<---------------------------------------
> >>
> >>
> >> "You are misunderstanding the record and tuple syntax."
> >>
> >> Not at all .
> >>
> >> Documentation says "However, record is not a true data type. Instead
> >> record expressions are translated to tuple expressions during compilation. "
> >>
> >> Records are not existing in Erlang , only in syntax.
> >>
> >> my last mail on this.
> >> Anyway, I will never use this syntax.
> >>
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> erlang-bugs mailing list
> >> erlang-bugs@REDACTED
> >> http://erlang.org/mailman/listinfo/erlang-bugs
> >>
> >
> >
> > _______________________________________________
> > erlang-bugs mailing list
> > erlang-bugs@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-bugs
> >
> >

-- 
Roland Karlsson <roland.karlsson@REDACTED>




More information about the erlang-bugs mailing list