Possible bug using funs

Fredrik Linder <>
Wed Jul 17 00:44:35 CEST 2002

Hi, I get the following error when writing a fun:

The only differense (as I can see) is the order of the two clauses in the
funs; T2 has the empty list test as its first clause while T1 has the empty
list test as its last clause:

17> T2=fun([],[],Acc,Cont)->lists:reverse(Acc);
,Cont) end.
18> T2([1,2],[1,2],[],T2).
}|Acc],Cont); ([],[],Acc,Cont)->lists:reverse(Acc) end.
20> T1([1,2],[1,2],[],T1).
** exited: {{illegal_pattern,{cons,1,{var,1,'H1'},{var,1,'T1'}}},
            [{erl_eval,expr,3}]} **

I'm using: Erlang 5.1/OTP R8B


More information about the erlang-questions mailing list