dialyzer and non-proper lists
Ulf Wiger (AL/EAB)
ulf.wiger@REDACTED
Fri Sep 16 11:25:36 CEST 2005
It's been argued that non-proper lists can always be
avoided at minimal expense.
How about this example:
20> [ets:insert(T, {"foo-" ++ integer_to_list(N)}) || N <- lists:seq(1,10)].
[true,true,true,true,true,true,true,true,true,true]
21> ets:select(T, [{{"foo" ++ '_'},[],['$_']}]).
[{"foo-6"},
{"foo-7"},
{"foo-3"},
{"foo-8"},
{"foo-2"},
{"foo-9"},
{"foo-10"},
{"foo-5"},
{"foo-4"},
{"foo-1"}]
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()
/Uffe
More information about the erlang-questions
mailing list