Re: Parser bug: if missing ", " in list between records, the first is ignored, and no parser warnings are given.

PAILLEAU Eric <[email protected]>
Newsgroups gmane.comp.lang.erlang.bugs
Message-ID <[email protected]>
Proof :

Eshell V6.0  (abort with ^G)
1> rd(test, {a=3, b=6}).
test

2> {test, 2, 6},{test,5,6}.
#test{a = 5,b = 6}

3> {test, 2, 6}{test,5,6}.
* 1: syntax error before: '{'



Le 16/11/2014 19:15, PAILLEAU Eric a écrit :
>
> 1>  #test{a=2}#test{a=3}.
> #test{a = 3,b = 6}
>
> but
>
> 2> {test, 2,6}{test, 3, 6}.
> * 1: syntax error before: '{'
>
> ---8<------------------------------------------------------------------
> 10.8  Internal Representation of Records
>
> Record expressions are translated to tuple expressions during
> compilation. A record defined as
>
> -record(Name, {Field1,...,FieldN}).
>
> is internally represented by the tuple
>
> {Name,Value1,...,ValueN}
>
> where each ValueI is the default value for FieldI.
> ---8<------------------------------------------------------------------
>
> I don't have any opinion on whether this syntax should be allowed or
> not, but parser should not fail on second notation in such case.
>
> MHO.
> _______________________________________________
> erlang-bugs mailing list
> [email protected]
> http://erlang.org/mailman/listinfo/erlang-bugs
>

_______________________________________________
erlang-bugs mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-bugs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.