List questions

Robert Virding <>
Fri Sep 10 10:22:40 CEST 1999


Klacke <> writes:
> > Those of us raised on late night TV in America in the 1970s will
> > simply quote:
> > 
> >   "It's a dessert topping *and* a floor wax!"
>
>Uhhh... we're all lost in Europe, I can imagine a 
>disgusting commercial though.  
>
>As for the:
>
> >  > 19> [40].
> >  > "("
>
>behaviour, I'd say it's almost a bug, and it should be fixed.
>
>The proper solution is to subtag integers as characters
>(that is: to introduce a builtin char type) which has
>the characteristics of an integer except that a new
>guard test like:
>
>f(C) when char(C) ->
>
>returns true for chars but not for ints, and
>
>$X + 2.
>
>should also return a char .... and so on.
>
>
>I think the OTP folks are/have been doing something like this ????

This has been discussed many times and made it into Standard Erlang 
(which only exists as a spec).  There were plans how characters could 
be introduced into OTP and still be backwards compatible (this is as 
trivial as it sounds).  I don't know if it is still in the pipe-line.

The current solution in which the shell prints lists of integers as 
strings if the values are within range is definitely not perfect but 
probably better than always printing them as lists.

For those who are interested the actual work is done in io_lib:fwrite 
with the ~p and ~P options.  RTFM.

	Robert





More information about the erlang-questions mailing list