[erlang-questions] Typed records and erl_parse

Ulf Wiger (TN/EAB) ulf.wiger@REDACTED
Tue Dec 5 12:01:55 CET 2006

Being a confessed parse_transform fetishist, I stick to syntax tools as
much as I can. Syntax_tools will of course be affected, but I see no
compatibility problem there. 

In general, I think that using syntax_tools is the answer for those who
want to be immune to changes like the one you propose.

Record fields are also used to represent dotted module names in the
parse tree. I wouldn't mind seeing that go away. Even syntax_tools
doesn't handle it consistently.(*)

(*) Try, for example to add a custom attribute with dotted module names
in it; create syntax trees with e.g. epp_dodger, and then try reverting
them to erl_parse forms. Since record fields are overloaded, erl_syntax
has to be able to determine when they are actually record fields, and
when they are supposedly module names. In this case, it probably can't.

Ulf W

-----Original Message-----
From: erlang-questions-bounces@REDACTED
[mailto:erlang-questions-bounces@REDACTED] On Behalf Of Tobias Lindahl
Sent: den 5 december 2006 10:52
To: erlang-questions
Cc: Kostis Sagonas
Subject: [erlang-questions] Typed records and erl_parse

Short version:

Who would suffer if we changed the format of the record attribute given
by erl_parse?

Slightly longer version:

We are experimenting with adding type annotations in record declarations
in order to make use of them in the Dialyzer. Since we don't want to
keep this in a separate declaration we have changed our version of the
erl_parse to have a different representation of the record attribute.

In principle, the format of the record attribute can be made backwards
compatible, but we forsee some future problems in keeping different
formats of the current records and their typed counterparts, so we would
really like to make them the same attribute whether they have type
information or not.

Of course, we also have to change some parts of the compiler in order to
make this work, but before we go about and do these changes we would
like to know if there are people out there (outside of the compiler) who
rely on the format of what the erl_parse gives you for records.

So, again. Who would suffer if we changed the format of the record
attribute given by erl_parse?

erlang-questions mailing list

More information about the erlang-questions mailing list