dialyzer and non-proper lists

Ulf Wiger (AL/EAB) <>
Fri Sep 16 13:36:35 CEST 2005


Kostis Sagonas wrote:
>  Btw, is there any really good reason why
>  the so called GuardList has to be restricted to
>  Erlang guards?

Yes, I guess a very good reason is that the 
match specification is interpreted in the emulator
(e.g. ets or when determining whether to send a trace
message), and not in any process context.

I believe this is the reason why one didn't just 
call a user-supplied fun. (: Of course, in the case
of trace patterns, one really doesn't want erlang
functions to be called in the process of determining
whether to send a call trace message.

There are good reasons to use the Prefix ++ '_' 
pattern, esp. if the table is an ordered_set,
since that ought to give good performance even
when matching on the key. The current implementation
of select() (as I wrote in a very recent mail)
will always do a full linear search for patterns
such as (the hypothetical)

[{{'$1','$2'}, [{is_prefix, "foo", '$1'}], [{{'$1','$2'}}]}]

But while someone is hacking away in the emulator 
code, introducing this optimization should be 
short work. (:

/Uffe



More information about the erlang-questions mailing list