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

Robert Baruch <>
Thu Jan 18 00:16:26 CET 2007


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?

Thanks,

--Rob




More information about the erlang-questions mailing list