Different results using Lists & tuples

Mikael Karlsson mikael.karlsson@REDACTED
Fri Aug 15 15:41:50 CEST 2003


Same problem as before Jilani,
lists and strings are the same in erlang, 
for lists with values < 255. 
Use io:format("~w~n",[Yourlist])

1> A=[64,71,53,67,55,58,77,56,51,76,68].
"@G5C7:M83LD"
2> B={64,71,53,67,55,58,77,56,51,76,68}.
{64,71,53,67,55,58,77,56,51,76,68}
3> io:format("~w~n",[A]).
[64,71,53,67,55,58,77,56,51,76,68]
ok
4> io:format("~p~n",[A]).
"@G5C7:M83LD"
ok

/Mikael

fredag 15 augusti 2003 14:29 skrev Jilani Khaldi:
> Hi All,
>
> having
>
> -module(statistics).
> -export([set_xi/0,...]).
> ...
> set_xi() -> Xi = [64,71,53,67,55,58,77,56,51,76,68], X1. %% (1)
> ...
>
> why
>
> statistics:set_xi()
> gives as result "@G5C7:M983LD"  // seems a segment:offset memory address
>
> but if I change (1) in
> set_xi() -> Xi = {64,71,53,67,55,58,77,56,51,76,68}, X1.
> it gives {64,71,53,67,55,58,77,56,51,76,68} // as expected ?
>
> Thanks!
>
> jilani




More information about the erlang-questions mailing list