[erlang-bugs] bug

Bjorn Gustavsson bjorn@REDACTED
Thu Nov 29 16:32:03 CET 2007


"Joe Armstrong" <erlang@REDACTED> writes:

> -module(bug).
> 
> -compile(export_all).
> 
> start() ->
>     lists:filter(fun is_reference/1, [1,2,3]).
> 
> %% this program compiles correctly
> %% it should fail with a missing function

Maybe. I am not sure whether this is a bug or a feature.

I would be interested to hear more opinions about it before
changing it.

> %% seems like there is a name collision with the guard test with the same name

Yes, the guard BIF is_reference/1 will be called, so the code will actually work.
If you include a reference in the input list, it will be included in the output
list.

/Bjorn

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



More information about the erlang-bugs mailing list