tags:

views:

114

answers:

2

[97, 98, 99]. yields "abc", in the Erlang shell. I realize this is because the ASCII values of a, b and c are 97, 98 and 99 respectively.

So.. how would one go about returning [97,98,99] without Erlang translating it to ASCII?

+4  A: 

You can try io:format("~w~n", [ListHere]), which should simply avoid interpreting the data.

I GIVE TERRIBLE ADVICE
io:format("~w~n", [97,98,99]) is bringing up errors for me. Is that how you meant it?
`List = [97,98,99], io:format("~w~n", [List]).` which means `io:format("~w~n", [[97,98,99]]).`
Hynek -Pichi- Vychodil
A: 

Try this

YourList ++ [0]

With "abc"

"abc" ++ [0]

[97,98,99,0]

enokd
This is not a very good idea :) Manipulating your data just to not getting it translated? :) Don't do this... Sorry have a down vote good sir.
Mazen Harake
@Mazen - We are are only talking about the Shell (REPL). If someone wants to append a [0] to an expression they are evaluating in the shell, I say no foul. Just don't copy this expression into your source code like that.
dsmith
@dsmith fair enough :)
Mazen Harake