dialyzer and non-proper lists

Kostis Sagonas kostis@REDACTED
Fri Sep 16 13:26:20 CEST 2005


Ulf Wiger wrote:
 >
 > It's been argued that non-proper lists can always be 
 > avoided at minimal expense.
 > 
 > How about this example:
 > 
 > ...
 > 21> ets:select(T, [{{"foo" ++ '_'},[],['$_']}]).
 > ...
 > 
 > Never mind the ++. It expands before the select() call into
 > [$f, $o, $o | '_'], which is still a non-proper list, and the way
 > you're supposed to do it in ets:match() and ets:select()

>From the little I understand this example, apologies if I have totally
misunderstood this, I would say that this has nothing to do with
improper lists, but with (arguably brain-damaged design decisions) to:

 1. Have match specifications described as lists, and

 2. Being unable to have general selectors such as

	lists:prefix("foo", '$1')

    in the guard list (i.e., in the [] in Ulf's example above),
    which arguably are more natural.  Btw, is there any really good
    reason why the so called GuardList has to be restricted to
    Erlang guards?

Kostis




More information about the erlang-questions mailing list