So now all I'd like in Erlang is...

Chris Pressey cpressey@REDACTED
Wed Feb 18 19:55:59 CET 2004


On Tue, 17 Feb 2004 19:58:25 -0500
Shawn Pearce <spearce@REDACTED> wrote:

> I've often wondered why Erlang code is:
> 
> 	foo(X) ->
> 		ok.
> 
> and not:
> 
> 	Foo = fun(X) ->
> 		ok
> 	end.
> 
> with call sites using:
> 
> 	Foo(x).
> 
> instead of:
> 
> 	foo(x).
> 
> In other words, why are named functions different from lambdas?  Why
> not make all named functions actually global variables which are
> assigned to a lambda when the module loads?

How would that work w.r.t. dynamic code reloading?

-Chris



More information about the erlang-questions mailing list