Hello -<br>I was considering writing an EEP for adding the possibility of having pattern matching in guards (as well as a test in expressions), when I noticed hints around the 'net that this had already been discussed at some point.<br>
<br>In particular, EEP-29 mentions it:<br><ul><li><p>Stage 0:
Allow pattern matching in guards.
This is the subject of another EEP, as it is
desirable in itself. This MUST be implemented
first before implementing Stage 1, because that's
what we want inlinable pattern calls to expand to.</p></li></ul>as well as this post:<br><pre style="margin-left:40px"><b>Robert Virding> </b>No, you cannot do pattern matching in guards.
It has been discussed and would be possible, but for now you can't.</pre>Does anyone know what the status is of this idea?<br>I see no existing EEP for it, but that of course doesn't mean that it isn't done elsewhere - or has for some reason been dropped.<br>
<br>Thanks,<br>Erik Søe Sørensen<br><br>PS: For what it's worth: EEP-29 goes on to say this in the "reference implementation" section:<br><div style="margin-left:40px">Given stage 0, this stage 1 is within my
knowledge and abilities, but I don't understand the Erlang
VM well enough to do stage 0.<br></div>From my knowledge of the Erlang VM and in particular the byte code format, I'm reasonably certain that at least for the semantics I have in mind, no VM changes are needed -- i.e., only compiler and shell will need to be extended.<br>
<br> <a href="http://www.erlang.org/eeps/eep-0029.html">http://www.erlang.org/eeps/eep-0029.html</a><br> <a href="http://erlang.org/pipermail/erlang-questions/2009-December/048562.html">http://erlang.org/pipermail/erlang-questions/2009-December/048562.html</a><br>