[erlang-questions] atoms with newlines

Valentin Micic <>
Wed Feb 26 10:56:14 CET 2014


If this is *really* necessary, wouldn't it be less confusing (or even more consistent) to consider:

1>  'foo'  \
1>  'bar'.
foobar
2>

whereas: 

3> 'foo
3>bar'
'foo\nbar'
4>

includes a new line -- as already does.

Kind regards

V/

On 26 Feb 2014, at 11:29 AM, Hynek Vychodil wrote:

> I fully agree with Richard. Backslash is escape character and it should escape next character so this newline should be omitted. It is definitely bug and unexpected behavior.
> 
> With best regards
>    Hynek Vychodil
> 
> 
> On Tue, Feb 18, 2014 at 11:57 PM, Richard A. O'Keefe <> wrote:
> 
> On 19/02/2014, at 10:33 AM, Vlad Dumitrescu wrote:
> > Eshell V5.10.4  (abort with ^G)
> > 1> 'foo\n\
> > 1> bar'.
> > 'foo\n\nbar'
> >
> > I had expected that <backslash><newline> would
> > - be rejected as a syntax error, or
> > - be discarded like in C and Prolog.
> >
> > I did _not_ expect it to turn into <newline>.
> >
> >
> > Actually, what I was referring to was that that last backslash isn't really needed at all.
> 
> No, the last backslash IS needed because I *don't* want
> the newline.  In ISO Prolog I can write
>         |p('foo\|
>         |bar\|
>         |zoo').'|
> where the vertical bars show record boundaries,
> and get the same effect as
>         |p('foobarzoo').|
> 
> You are concerned about atoms that include newline characters.
> I am concerned about atoms that for one reason or another
> need to be split over lines WITHOUT introducing newline characters.
> 
> I just want \<newline> to work sensibly and to be so documented.
> 
> 
> 
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
> 
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140226/2af08a1c/attachment.html>


More information about the erlang-questions mailing list