[erlang-questions] Retrieve all auto-imported functions

15 views
Skip to first unread message

José Valim

unread,
Jan 29, 2012, 1:40:18 PM1/29/12
to Erlang
Is there a way to retrieve all auto-imported functions in parse time and/or runtime?

erlang:module_info(exports) also returns non auto-imported functions.

Thanks in advance,

José Valim
Founder and Lead Developer

Bengt Kleberg

unread,
Jan 30, 2012, 1:32:40 AM1/30/12
to Erlang
No answer, just removing a dead-end. Given a simple module(*) I get the
following:
5> t:module_info(imports).
[]


Perhaps this is Erlang/OTPs way to remind us to avoid -import()?


bengt

(*)
-module(t).
-export([t/0]).
-import(lists, [reverse/1]).
t() -> reverse([1,2,3]).

_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions

Robert Virding

unread,
Jan 30, 2012, 12:48:16 PM1/30/12
to bengt kleberg, Erlang
I don't know why it does this, it doesn't make sense. Of course import in Erlang doesn't do what many expect, ALL it does is a little name munging so you don't need to write the module name when calling the imported functions. The functions aren't "imported" into the module in any way or become special in any way. It only provides some syntactic sugar and has no semantic meaning at all.

Robert

Reply all
Reply to author
Forward
0 new messages