Re: maps: pattern-match absent key?
Björn-Egil Dahlberg <[email protected]> Tue, 18 Feb 2014 21:23:00 +0100
| Newsgroups | gmane.comp.lang.erlang.patches |
|---|---|
| Message-ID | <CAMjYFoOS-dERrOVGYZ2n5EbnVOS-oe1jYJNXicCO_MPY2-yLyg@mail.gmail.com> |
Yes, with fail clauses.
f(#{ a := _ }) -> {a,present};
f(_) -> {a,absent}.
2014-02-18 20:55 GMT+01:00 Daniel Goertzen <[email protected]>:
> Is there a way to pattern-match the absence of a key in a map?
>
> Dan.
>
> _______________________________________________
> erlang-patches mailing list
> [email protected]
> http://erlang.org/mailman/listinfo/erlang-patches
>
>
_______________________________________________
erlang-patches mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-patches