[erlang-questions] distinguish proplists vs. lists of proplists
Tue Sep 15 22:46:56 CEST 2015
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.
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?
On 15 Sep 2015 22:12, "Adam Krupicka" <akrupicka@REDACTED> wrote:
> > In Adam’s example, the first function clause and guard sequence will
> match against a list of lists and any proplist.
> Oh yeah, missed that (:
> If you want to distinguish a list maybe containing two-element tuples
> from a proplist, you're gonna have a bad time. If it's just about
> telling a list of lists from a list of non-lists, that's easy enough ^^
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions