~p

Joe Armstrong joe@REDACTED
Tue Mar 9 11:28:23 CET 2004


  My friend Frej has been venting his irritation over the behaviour of
~P in io:format "why isn't it more helpful" he says?

  ~P tries to guess the type of a list and concludes that either the augment
can be printed as a string of ASCII printables or not - why so definitive?

  Why not print list (or binary) elements  as follows:

  small positive or negative ints (< 31 ) as they are

  large ints in Hex

  Sequences of 2 or more characters in a..zA..Z1..9 would be enough to
signify the start of an ASCII string which gets printed as a string.

  IMHO the purpose  of ~P is to be "helpful"  rather than precise (~p
is precise, if you need it).
  

  /Joe









More information about the erlang-questions mailing list