<div dir="ltr"><div dir="ltr">Den mån 5 aug. 2019 kl 13:45 skrev Raimo Niskanen <<a href="mailto:raimo%2Berlang-questions@erlang.org">raimo+erlang-questions@erlang.org</a>>:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> <br>
> But maybe it's "just" something that was a challenge to implement, and<br>
> will be fixed to match the current documentation in a future release...<br>
<br>
I think it is precisely like that.  It is documented as it was intended,<br>
but implementing it was a challenge so it got only partly implemented.<br>
(constructing a new term for map lookup in the context of a pattern match<br>
proved an unexpectedly hard problem, I guess)<br></blockquote><div><br></div><div>IIRC the case that was troublesome was the failure case, say</div><div><br></div><div><font face="monospace">K = a</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">case Map of</font></div><div><font face="monospace">   #{ K + 1 := V } -> V;</font></div><div><font face="monospace">   ...</font></div><div><br></div><div>Meaning it is essentially no trouble to evaluate the key expression before the case expression, however the semantics for what should happen if the key expression fails were never really defined.</div><div>The easy option it just to throw an exception and that makes some sort of sense, but it could make more sense that we say "the pattern does not match" and then test the next clause in the case expression. This latter option is also a bit harder to implement ofc. The core and kernel language does not really expect this behaviour :) go and figure ^^</div><div><br></div><div>In other words - it is not implemented because we, well I, missed this case when defining the semantics. </div><div><br></div><div>My bad.</div><div>Björn-Egil</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
So it is a known limitation, to us that know it ;-)<br>
unfortunately not nicely documented,<br>
and the goal is to fix it some day...<br>
<br>
<a href="http://erlang.org/pipermail/erlang-questions/2016-May/089269.html" rel="noreferrer" target="_blank">http://erlang.org/pipermail/erlang-questions/2016-May/089269.html</a><br><br></blockquote></div></div>