Query about external format for lists (strings)

Lawrie Brown <>
Fri Jan 17 01:29:40 CET 2003

Hi everyone

As part of my work developing the runtime for the EC Erlang Compiler,
I've recently been implementing its support for the external binary
format, based heavily on the low-level (en/decode*.c) erl_interface
code, but adapted to suit the rather different term coding we use. I
have a query about the list coding.  From my reading of the code, and
playing with binaries created on a standard erlang node, I take it that
a list is always terminated with the ER_NIL_EXT (106) tag. However the
code for encoding very large strings in encode_string.c as lists does
not seem to write this trailing marker.  Should it do so??? It confused
me at first since I based my overall list encoder on it, then wondered
why the binary from a conventional Erlang node for a list which I
decoded and then regenerated as a binary wasn't the same size as the
original, sigh.

Anyway, I'd appreciate any feedback:

1) confirming that ALL lists (incl those generated for very large strings)
   should always be terminated by ER_NIL_EXT;

2) and if so, whether the code in erl_interface*/src/en/decode_string.c
   is hence incorrect.


------------------------------------ <*> ------------------------------------
Post: Dr Lawrie Brown, Computer Science, , Canberra 2600 Australia
Phone: 02 6268 8816    Fax: 02 6268 8581    Web: http://www.adfa.edu.au/~lpb/ 

More information about the erlang-questions mailing list