unable to call class's module_info
-
Philipp Pirozhkov
- Assigned user set to Tony Arcieri
-
Tony Arcieri
- State changed from new to resolved
I added a hack to facilitate calling module_info the way it worked before for the time being. Expect this to get merged into the reflection functions for modules and go away in the future. Reopen if it's not working the way it did before.
-
Philipp Pirozhkov
Still fails:
reia::apply(controller, :module_info, [:compile])same as:
Home.module_info(:compile)Yes, it's a workaround to make a laaaaaarge pattern matching, but that looks too ugly
-
Tony Arcieri
Okay, pull again and you should be able to pass a parameter to module_info just like you can in Erlang, e.g:
Object.module_info(:compile)Also note you don't need anything ugly to get that out of the returned module_info() data... this will get it for you:
compile_info = [info | (:compile, info) in Object.module_info()][0]If you want to get to the time from the raw module_info structure, you can use:
time = [[time | (:time, time) in info] | (:compile, info) in Object.module_info()][0][0] -
Philipp Pirozhkov
- Tag changed from block to dispatch
thanks for nice list comprehension tip!
but module_info call still doesn't work using meta-call:
Binary.module_info() @@@ works finereia::apply(:'Binary', :module_info, []) @@@ fails with:
exception error: undefined function 'Binary':module_info/2 in function reia:apply/4 in call from reia_erl:erl_funcall/3 in call from erl_eval:do_apply/5 in call from eval_shim:exprs/2 in call from reia_erl:erl_funcall/3 in call from 'Eval':exprs/2Looks like reia:apply/3 calls apply/4 and it calls erlang:apply(:'Binary', :module_info, [{}, nil]) that is unexpected by Binary to accept block and empty hash, too
do not take this into account if there will be a different solution later, i have an erlang::apply instead of reia::apply workaround for that
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.