[erlang-questions] atoms with newlines

PAILLEAU Eric eric.pailleau@REDACTED
Thu Feb 27 23:14:51 CET 2014


Hi,
Richard, I understood the thread.
I only wondering why \n is allowed in atoms, in general.
I agree that the parser should considere 'aaaa' 'bbbb' the same manner 
"aaaa" "bbbb"
and concatenate...
This would solve your problem...
I suppose you have certainly thought to this unsatisfactory solution :

A = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAA".
list_to_atom(A).

regards


Le 27/02/2014 22:51, Richard A. O'Keefe a écrit :
>
> On 28/02/2014, at 2:44 AM, PAILLEAU Eric wrote:
>> Maybe not very homogeneous...
>>
>> By the way, I do not really see the need to include \n in atoms...
>
> The current thread is about *NOT* including \n in atoms.
>
> An atom in Erlang may be up to 255 characters long.
> If you are trying to keep your source files to a reasonable
> width limit, this means that
>
> 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
> AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\
> AAAAAAAAAAAAAAAAAAAAAAA'
>
> has to be broken up across multiple lines.
>
> Except that you can't, because there is currently no way
> NOT to include a newline in an atom literal.
>
> There is also no Atom1 ++ Atom2.
>
> The NAME_MAX limit is typically 255 on the machines I use.
> Being able to write _any_ simple file name as an Erlang
> atom is often handy.
>
>>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>




More information about the erlang-questions mailing list