[erlang-bugs] R16 breaks dots

Anthony Ramine <>
Sat Mar 30 10:42:04 CET 2013


Hello,

While I find the prospect of refusing to upgrade Erlang because it can't be made to look like JavaScript anymore (are you seriously serious?), I do want to know why dots aren't allowed in atoms anymore and would like to see them back too.

It was pretty useful to be able to write unquoted fully-qualified node names in the prompt, e.g. 

Furthermore, it feels to me like their removal was a mistake, as demonstrated by this:

1> foo.bar.
* 1: syntax error before: '.'
1> foo. bar.
foo
2> bar.
bar

What you can see here is that the blanks after a dot are still mandatory to properly parse a '.' character as a 'dot' token, terminating an expression in the shell (or a form in a module), this was mandatory to distinguish dot terminators from dots in atoms.

If dots are really to not be allowed anymore in atoms, the blanks should be made optional, to be consistent with the rest of the language where blanks are optional before or after a symbol (with the notable exception of a match '=' followed by a binary literal '<<...>>').

Anyway, for the original complaint of Erlang's syntax not being the same as JavaScript and compatibility concerns, it should be noted that *syntax is nothing* and that all that matters are semantics. The ones from JS being at antipodes from Erlang's, I think it's a good thing you can't mistake one for another. It should also be noted that there is nothing "more modern" about JS' syntax when compared to the one of Erlang.

Regards,

-- 
Anthony Ramine

Le 29 mars 2013 à 21:34, Josh Marchán a écrit :

> It's widely known that it's useful to be able to use
> dots/periods/full-stops (choose your dialect) in Erlang code to maximize
> compatibility, specially with more modern languages like JavaScript.
> 
> Unfortunately for the world of Erlang, R16 breaks something that has been
> tremendously useful. I am no longer able to do this:
> 
> console.log("Hello from erlang", 1, 2, "More string here", TildePMe)
> 
> which is leading to a lot of confusion when I regularly switch between
> JavaScript and Erlang.
> 
> I would like to formally request that $. once again become a valid
> character in Erlang identifiers. Until such a time, I regret I must divest
> from version upgrades. I look forward to your response (and prompt bugfix).
> -- 
> Josh Marchán



More information about the erlang-bugs mailing list