[erlang-questions] questions about dict

Richard Carlsson richardc@REDACTED
Tue Aug 21 11:07:51 CEST 2007


Dustin Sallings wrote:
> 	2)  I can't seem to make a guard for a dict because the record  
> format is unavailable to me at compile time (I'm working around this  
> by matching tuple and hard-coding a tuple pattern for identifying a  
> dict).

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.

If, on the other hand, X should never be anything but a dict, then you
don't really need the test.

    /Richard



More information about the erlang-questions mailing list