[erlang-questions] Orthogonality and Principle of least surprise Was: chained functions

Gleb Peregud gleber.p@REDACTED
Fri Feb 3 20:20:38 CET 2012


On Fri, Feb 3, 2012 at 19:18, Jon Watte <jwatte@REDACTED> wrote:
> The question is: why is the grammar like that?
> For people used to first class functions, Erlang doesn't actually live
> up to the expectation.
> I think there are both runtime efficiency and legacy implementation
> reasons for this.
>
> Note that it's a bit ambiguous what this would mean in the face of code loading:
>
> F = module:fun
> Now, reload "module"
> Does F() call the old code, or the new code? I could see an argument
> for either way, but the more useful behavior would be to call the new
> code.

AFAIK in case of fun module:func/X it will call current module
version, hence the newest



More information about the erlang-questions mailing list