<p dir="ltr">If you flip the order of the clauses it will work better. However there is no safe way of distinguishing them, a prop*list* is just a list where the elements should have a predefined structure.</p>
<p dir="ltr">Wouldn't it be better to have two functions, one which works on proplists and one which works on lists of proplists? Or use maps instead of proplists?</p>
<p dir="ltr">Robert<br>
</p>
<div class="gmail_quote">On 15 Sep 2015 22:12, "Adam Krupicka" <<a href="mailto:akrupicka@mail.muni.cz">akrupicka@mail.muni.cz</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> In Adam’s example, the first function clause and guard sequence will match against a list of lists and any proplist.<br>
<br>
Oh yeah, missed that (:<br>
<br>
If you want to distinguish a list maybe containing two-element tuples<br>
from a proplist, you're gonna have a bad time. If it's just about<br>
telling a list of lists from a list of non-lists, that's easy enough ^^<br>
<br>
A.<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>