[erlang-questions] erl_syntax:revert with binary arg

Max Kuznecov <>
Thu Sep 6 15:27:06 CEST 2012


Hi

I'm creating some dynamic module generation stuff and I found a
strange behavior,
erl_syntax:revert doesn't seem to work with binaries:

It works with strings (and other types)

> erl_syntax:revert(erl_syntax:string("DATA")).
{string,0,"DATA"}

but

> erl_syntax:revert(erl_syntax:binary(<<"DATA">>)).
** exception error: no function clause matching
                    erl_syntax:'-revert/1-lc$^1/1-1-'(<<"DATA">>)
(erl_syntax.erl, line 6508)
     in function  erl_syntax:'-revert/1-lc$^0/1-0-'/1 (erl_syntax.erl,
line 6508)
     in call from erl_syntax:revert/1 (erl_syntax.erl, line 6508)

Is there any special trick to handle binaries in revert()?

Thanks.

-- 
~syhpoon



More information about the erlang-questions mailing list