Closed eriksoe closed 13 years ago
At present, the EFun objects for exported functions do not contain their module and function name except as encoded in the class name.
Related, EFun subclasses for closures contain much code which could be moved to a common superclass for all similar closures:
I suggest that common superclasses be introduced:
In addition to solving the present issue for exported functions, class sizes (and possibly module loading time?) would be reduced.
Note that while erlang:term_to_binary(fun erlang:'not'/1). fails, an equivalent function object can be encoded: erlang:term_to_binary(fun(X)->erlang:'not'(X) end). with success. (This is due to encode() being code generated for all local functions but for none of the exported ones.)
Implemented (along with common superclasses for exported functions).
==== Current behaviour: 1> erlang:term_to_binary(fun erlang:'not'/1). \ exception error: {not_implemented,"Encode for erjang.m.erlang.ErlBif$FN_not__1", "erjang.EObject.encode(EObject.java:435)"}
==== Desired behaviour: Function objects for exported functions should be serialized using EOutputStream.write_external_fun(module, function, arity).