Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Serialization of EFunHandler function objects isn't implemented #48

Closed
eriksoe opened this Issue · 4 comments

3 participants

@eriksoe

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

=== Observed behaviour:
** exception error: {not_implemented,"Encode for erjang.EFunHandler2",
"erjang.EObject.encode(EObject.java:435)"}
in function term_to_binary/1

@edwardw

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.
@edwardw

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.

@edwardw

Fixed.

@krestenkrab
Owner

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.