[erlang-questions] questions about dict

Dustin Sallings dustin@REDACTED
Tue Aug 21 18:25:35 CEST 2007

On Aug 21, 2007, at 2:07 , Richard Carlsson wrote:

> Why do you need that test? Do you have some X that migh be a dict and
> might be something else? In that case, I'd say that it's better, both
> style wise and for practical reasons, to wrap your data in tagged
> tuples so that you can distinguish between them easily, regardless
> of their actual representation.

	I have some code that reads a custom binary format[0] into erlang  
terms for a load test tool I've written.  The code that wrote the  
custom binary format was python and was very straightforward to write  
in python and read in erlang.

	I ran into problems when I tried to write erlang terms back into the  
binary format because it isn't obvious when I've encountered a dict.   
I suppose {badrecord,dict} is probably the best option.

[0] The format basically consists of dicts, tuples, and lists of  
dicts, tuples, lists, strings, floats, and numbers.

Dustin Sallings

More information about the erlang-questions mailing list