[erlang-questions] : Why ~n instead of n?

Raimo Niskanen raimo+erlang-questions@REDACTED
Thu Jan 18 08:39:28 CET 2007


On Wed, Jan 17, 2007 at 06:16:26PM -0500, Robert Baruch wrote:
> 
> On Jan 17, 2007, at 5:38 PM, Robert Virding wrote:
> 
> > Hopefully there will be no lightning strike. :-)
> >
> > There was meant to be a difference: \n is the newline character  
> > while ~n
> > is causes a system-dependant new line in the current implementation.
> > There is in fact no difference.
> 
> OK, so if I were running on a Windows system, ~n should emit \r\n  
> (i.e. hex 0x0D, 0x0A), and on *nix, \n (i.e. 0x0A). But when you say  
> "in fact no difference", does that mean that although ~n *should*  
> emit 0x0D 0x0A on a Windows system, it in fact doesn't?
> 

You are absolutely right!


> Thanks,
> 
> --Rob
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list