[erlang-questions] Maps Pattern Matching

Santosh Kumar santosh79@REDACTED
Tue Dec 9 21:19:45 CET 2014


Hi group,
A quick question wrt pattern matching on maps. I am currently working my
way through Joe's book and the following code from the book doesn't work:

Henry8 = #{ class => king, born => 1491, died => 1547 }.

#{born => 1491,class => king,died => 1547}

19> #{ born => B } = Henry8.

* 1: illegal pattern


It's not liking the pattern matching lookup. Also "B" is unbound (I made
sure of that). This is my version of Erlang:


Erlang (BEAM) emulator version 6.2

Compiled on Wed Oct 29 16:24:27 2014


Any idea why this wouldn't work?


Thank you,

Santosh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20141209/8d40b576/attachment.htm>


More information about the erlang-questions mailing list