[erlang-bugs] R16 breaks dots

Fred Hebert mononcqc@REDACTED
Sat Mar 30 14:42:02 CET 2013


>From memory, the problem is that support for periods in atoms was there
in order to support packages, which would let you have an atom of the
form topdir.subdir.module to represent items.

When packages (an experimental feature few people used) got removed
along with parametrized modules in R16, the code that allowed full stops
in atoms also got the axe.

Since then (and before packages), what you need to do to get that is
wrap things up in single quotes. 'console.log'("Hello from Erlang").

Now for a less serious thing, I recommend you use the following in
Javascript:

    var Log = function(args) { console.log(args) }

And the following in Erlang:

    Log = fun(Args) -> io:format(Args) end

Which means you can now use the fantastic 'Log("Hello!")' function
everywhere you go!

As Anthony said, I'm a bit surprised you're not willing to upgrade
because the languages look different (they should look different, given
they *are* different, in my opinion).

Regards,
Fred.


On 03/29, Josh March�n wrote:
> 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



> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://erlang.org/mailman/listinfo/erlang-bugs




More information about the erlang-bugs mailing list