Newbie question

Lennart Öhman lennart.ohman@REDACTED
Sun Nov 9 00:26:49 CET 2003


Hi,
since strings in Erlang simply are lists of ascii values
the shell tries to display such as strings rather than
lists of integers. You presume correctly, "\b" is the
printable representation of backspace.

(So all lists containing only printable ascii values will
  be displayed as strings. All other lists as lists).

Best Regards,
Lennart

Try: io:format("~w",[ [8] ])

Eljakim Schrijvers wrote:
> Having used Miranda as well as Mathematic for a long time
> I figured it was time to look into Erlang.
> 
> I ran into the following strange behaviour (line 18>)
> 16> [X || X <- [7,8], X>3].
> [7,8]
> 17> [X || X <- [7], X>3].
> [7]
> 18> [X || X <- [8], X>3].
> "\b"
> 
> I do not understand what the "\b" means, or where it comes
> from. I presume the system looks at [8] as a representation
> of the ASCII \b character??
> 
> How can I tell it to just respond with [8] on my screen?
> 
> Yours,
> 
> Kim

-- 
-------------------------------------------------------------
Lennart Ohman                   phone   : +46-8-587 623 27
Sjoland & Thyselius Telecom AB  cellular: +46-70-552 6735
Sehlstedtsgatan 6               fax     : +46-8-667 8230
SE-115 28 STOCKHOLM, SWEDEN     email   : lennart.ohman@REDACTED




More information about the erlang-questions mailing list