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

Michael McDaniel <>
Wed Jan 17 23:20:40 CET 2007


On Wed, Jan 17, 2007 at 10:14:41PM +0000, autophile wrote:
> 
> Does anyone know why there is a ~n in the io:fwrite format when n seems to work just as well? Is it there for historical reasons? Am I committing a sin by using n and could lightning strike my program dead under some obscure circumstance?
> 
> Thanks,
> 
> --Rob
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

 How are you using it?  My results appear to be different
 from yours ...


$ uname -a
Linux delora 2.6.17-10-386 #2 Fri Oct 13 18:41:40 UTC 2006 i686 GNU/Linux
$
$ erl
Erlang (BEAM) emulator version 5.5.2 [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.5.2  (abort with ^G)
1> io:fwrite('~pn', [{a,b,c}]).
{a,b,c}nok
2> io:fwrite('~p~n', [{a,b,c}]).
{a,b,c}
ok
3> q().
ok
4> $
$


~Michael




More information about the erlang-questions mailing list