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]>
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
[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.