[erlang-questions] dict vs. ETS choice

Ulf Wiger ulf@REDACTED
Fri Jul 11 14:52:42 CEST 2014

On 11 Jul 2014, at 14:26, Daniel Goertzen <daniel.goertzen@REDACTED> wrote:

> Perhaps there are ways to mitigate the huge-printed-dict problem.  I've never taken a close look at it.

Even small dicts tend to look huge when printed. ;-)

I prototyped a slight improvement for dict (et al) printing in the shell, in:


Eshell V5.5.4 (abort with ^G)
1> rr(code:which(dict)).
2> fa(dict,fun(#dict{}=D) -> {custom,dict,true,dict:dict_to_list(D)}; (_) -> no end).
3> dict:from_list([{N,a} || N <- lists:seq(1,5)]).

That particular code is of course outdated now, since it was a patch on OTP sources from 2007.

Ulf W

Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.

More information about the erlang-questions mailing list