[erlang-patches] maps: pattern-match absent key?

Björn-Egil Dahlberg wallentin.dahlberg@REDACTED
Tue Feb 18 21:23:00 CET 2014


Yes, with fail clauses.

f(#{ a := _ }) -> {a,present};
f(_) -> {a,absent}.



2014-02-18 20:55 GMT+01:00 Daniel Goertzen <daniel.goertzen@REDACTED>:

> Is there a way to pattern-match the absence of a key in a map?
>
> Dan.
>
> _______________________________________________
> erlang-patches mailing list
> erlang-patches@REDACTED
> http://erlang.org/mailman/listinfo/erlang-patches
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20140218/a1fa8cec/attachment.htm>


More information about the erlang-patches mailing list