[erlang-bugs] Parser bug: if missing ", " in list between records, the first is ignored, and no parser warnings are given.
PAILLEAU Eric
eric.pailleau@REDACTED
Sun Nov 16 22:12:31 CET 2014
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.
More information about the erlang-bugs
mailing list