|
|
| Author |
Message |
|
| def |
Posted: Sat Jun 16, 2007 11:07 pm |
|
|
|
Joined: 14 Jun 2007
Posts: 4
Location: South Africa
|
Quote: Hi,
I'm just trying to help to get the documentation improved for future users; I will report anything that I find.
As in another topic, there are some things that can be hyperlinked liked the references to man(x) pages, like "erlang(3)".
I've noticed in the html docs: /doc/reference_manual/data_types.html
Some of the examples that are given don't give the same output on my Erlang R11B via the Erlang emulator/shell v 5.5.4, for example,
Quote: 5> list_to_binary("hello").
<<104,101,108,108,111>>
Instead I get Quote: 56> list_to_binary("hello").
<<"hello">>
What's the correct behaviour? Or is the output of an array of integers just automatically being converted to a string by the "print"ing to the console/shell?
I tried this on a windows xp machine.
<<104,101,108,108,111>> and <<"hello">> are the same, as the string datatype does not exist. It is represented as a list of ascii by the VM. The output, I would guess, is not defined between releases.
With strings, the shell will notice if a list consists of ascii and print it out as a string. That is obviously not the case with binaries. |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|