[erlang-bugs] erl_eval funs
Tue Sep 17 16:11:03 CEST 2013
I just saw this. How could shell ever realise that you are referring to an internal function inside an unspecified module? The fun returned by m:f() contains this information.
----- Original Message -----
> From: "Fred Hebert" <>
> To: "Tony Rogvall" <>
> Cc: "erlang-bugs Bugs" <>
> Sent: Saturday, 7 September, 2013 5:55:57 PM
> Subject: Re: [erlang-bugs] erl_eval funs
> This is a 'problem' for all funs going in the shell and evaluator, and
> they also hit escripts without a module name.
> It's about a fun of that type being seen as a local one rather than an
> auto-imported one, and so they get attached to erl_eval like other
> evaluated funs. This works with any other auto-imported function in the
> shell (say process_info/1-2).
> I guess there needs to be an extension to the entire chain to fix this.
> On 09/07, Tony Rogvall wrote:
> > R16B01
> > The following code compile and works when in a module:
> > -module(m).
> > -export([f/0]).
> > f() ->
> > fun abs/1.
> > > (m:f())(-3).
> > 3
> > But
> > > > (fun abs/1)(-3).
> > ** exception error: undefined function erl_eval:abs/1
> > /Tony
> > _______________________________________________
> > erlang-bugs mailing list
> > http://erlang.org/mailman/listinfo/erlang-bugs
> erlang-bugs mailing list
More information about the erlang-bugs