Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Serialization of EFunHandler function objects isn't implemented #48

eriksoe opened this Issue · 4 comments

3 participants


==== To reproduce:
1> erlang:term_to_binary(fun erlang:is_lt/2).

=== Observed behaviour:
** exception error: {not_implemented,"Encode for erjang.EFunHandler2",
in function term_to_binary/1


But it does work for existing functions, such as:
```1> erlang:term_to_binary(fun erlang:is_pid/1).

But I can't figure out why it only fails for non-existing functions.

I think I've figured this out. In order to implement erjang.EObject$encode method for ejang.EFunHandler, we need something similar to erjang.EFun$make_encode_method_for_exported and add it to erjang.EFun$get_fun_with_handler. It seems to be impossible because we don't know module and function name of certain EFunHandler instance unless its invoke method has been, well, invoked.

If such observation is true, I think this issue can't be solved.




Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.