bert.erl icon indicating copy to clipboard operation
bert.erl copied to clipboard

Having trouble encoding dict

Open appush opened this issue 14 years ago • 2 comments

Erlang R13B04

D1 = dict:new(). {dict,0,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}} D2 = dict:store(one,1,D1). {dict,1,16,16,8,80,48, {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}, {{[],[],[],[],[],[[one|1]],[],[],[],[],[],[],[],[],[],[]}}} bert:encode(D2). ** exception error: no function clause matching lists:map(#Fun<bert.0.13327860>,1) in function lists:map/2 in call from lists:map/2 in call from lists:map/2 in call from bert:encode_term/1 in call from lists:map/2 in call from bert:encode_term/1 in call from lists:map/2

appush avatar Apr 20 '10 04:04 appush

Ditto

woahdae avatar Jul 29 '10 02:07 woahdae

Most forks of the project are to fix this, but they do it in an obviously backwards-incompatible way. This change looks to be backwards compatible, and more importantly, more resistant to future change. I only tested it on R14A, but I'd be suprised if they changed the internal representation of a dict from a tuple with the first element of "dict".

woahdae avatar Jul 29 '10 18:07 woahdae