reia::apply only works with modules, not class objects
-
Philipp Pirozhkov
adding
apply({object, {Pid, _Module}}, Method, Arguments) -> reia_class:call(Pid, {Method, Arguments});to reia.erl helps to resolve this
-
Philipp Pirozhkov
There's a more complex case:
>> class A .. def a(x) .. Local.puts(x.inspect()) .. => ~ok >> a=A.start() => #<Object> >> reia::apply(a, ~a, ["aa"]) "aa" => nil >> reia::apply(a, ~a, [("aa")]) "aa" => nil >> reia::apply(a, ~a, [[("aa")]]) ["aa"] => nil>> class B .. def b(x,y) .. Local.puts(x.inspect()) .. Local.puts(y.inspect()) .. => ~ok >> b=B.start() => #<Object> >> reia::apply(b, ~b, ["bb","cc"]) "bb" "cc" => nil >> reia::apply(b, ~b, [[("bb")],"cc"]) ["bb"] "cc" => nil >> reia::apply(b, ~b, [("bb","qq"),"cc"]) exception throw: {error,unknown_receiver, {{string,<<"bb">>},{string,<<"qq">>}}} in function reia_class:call/2 in call from reia_erl:erl_funcall/3 in call from erl_eval:do_apply/5 in call from eval_shim:exprs/3 in call from reia_erl:erl_funcall/3 in call from 'Eval':exprs/2 >> reia::apply(b, ~b, [[("bb","qq")],"cc"]) exception throw: {error,unknown_receiver, {{string,<<"bb">>},{string,<<"qq">>}}} in function reia_class:call/2 in call from reia_erl:erl_funcall/3 in call from erl_eval:do_apply/5 in call from eval_shim:exprs/3 in call from reia_erl:erl_funcall/3 in call from 'Eval':exprs/2 -
Philipp Pirozhkov
the second issue isn't major, i've found a workaround to pass arguments as a hash instead of tuple array
-
Tony Arcieri
- State changed from new to resolved
This is resolved by the new reia:spawn/spawn_link and reia:invoke functions.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
