Proposed change to libraries

Bjorn Gustavsson bjorn@REDACTED
Mon Feb 7 14:56:50 CET 2005


Kostis Sagonas <kostis@REDACTED> writes:
[..]
> Besides checking that M and F are atoms, there needs to be a check that
> the {M,F} is a valid fun object and its arity is 1 (note the is_fun_arity
> new guard that is required in the second clause -- I wrote it as a comment
> but it really needs to be introduced in the language for the type inference
> algorithm to infer that the F in the first and the second clause are of
> the same type).
> 

Unfortunately, it is tricky to check that {M,F} is a valid fun. The module
M might not even be loaded.

It has been suggested earlier that we should add

        fun M:F/Arity

to the language. Unfortunately, we didn't add it in R10B. We could add
it in R11B.

Regarding the arity test for a "real" fun, we could add the guard BIF

        is_function(F, Arity)

in R11B.

/Björn
-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list