[erlang-questions] Pmods, packages, Unicode source code and column numbers in compiler - what will happen in R16?

Vlad Dumitrescu vladdu55@REDACTED
Fri Oct 19 09:07:02 CEST 2012


On Thu, Oct 18, 2012 at 11:50 PM, Richard O'Keefe <ok@REDACTED> wrote:
>
> On 18/10/2012, at 8:55 PM, Vlad Dumitrescu wrote:
>>
>> If the package feature is dropped, does this mean that the associated
>> lexical rule for atom names is also dropped? I would like to have it
>> removed too, as the dot character is already overloaded and makes
>> lexers harder to implement.
>
> Dots were allowed in atom names long before packages were dreamed of.
> The idea is that main.node@REDACTED can be an atom without
> needing quotes.

Right, I forgot about that. A problem is that this solution only goes
half way, because as per http://tools.ietf.org/html/rfc1123#page-13
labels in host names can start with digits and foo.3net.com as an atom
has to be quoted, as have IP addresses, but I guess we have to live
with it.

> I've written a couple of lexical analysers for Erlang, and it's not
> _that_ hard.  Leaving @ out of the discussion,
>         variable = [_[:upper:]][_[:alnum:]]*
>         atom = [.]?[[:lower:]]([[:digit:]]|[_[:upper:]]|[.]?[[:lower:]])*
> with the added weirdness that a leading "." is discarded.

True, but if the "dot within atom" rule would have become unnecessary,
there would be no reason to have lexing rules more complicated than
needed. The dot can have now three lexical meanings, float decimal
point, atom "separator" and full stop, and upon seeing "2." we can't
decide which case it is without further input.

best regards,
Vlad



More information about the erlang-questions mailing list