[erlang-questions] erl_parse:abstract on a fun

David Sveningsson <>
Wed Jan 28 13:40:15 CET 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, I recently ran into an issue where I am calling erl_parse:abstract
on a fun which fails with function_clause. What I need is to convert any
term to abstract form and in this case it was a stacktrace containing a fun.

Now I see two alternatives for solving this:

1) Try to convert the fun to abstract form for and wrap it somehow.
2) Replace the fun with erlang:fun_to_list/1 or similar, and live having
the "string representation".

Either way seems a bit difficult as it would involve traversing an
unknown term and replacing funs as needed.

Is this possible to do? Or is there a simpler way?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmAUi8ACgkQ6pa1H/H5pqXsQACfaFQCUueG6O66kpHzS3iYynXR
tlcAoOHYQckpDWX+8OlQ3dHmyuS94bBv
=PCO6
-----END PGP SIGNATURE-----



More information about the erlang-questions mailing list