Allowing side-effects in guards would certainly not be in the Erlang spirit. I wouldn't dare suggesting that :-)<br>The left-hand expression in a pattern test expression which occurs within a guard is naturally(?) subject to the normal constraints for what is allowed in a guard.<br>
I should perhaps state that explicitly in the specification.<br><br>/Erik<br><br><div class="gmail_quote">Den 13. apr. 2012 02.54 skrev Michael Truog <span dir="ltr"><<a href="mailto:mjtruog@gmail.com">mjtruog@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div bgcolor="#ffffff" text="#000000">
Your idea is interesting. However, doesn't it ruin the simplicity
of guards? It seems as if this proposal would make guards generate
side-effects which should impact both testability and optimization
opportunities. Isn't this a concern?<div><div class="h5"><br>
<br>
On 04/12/2012 04:51 PM, Erik Søe Sørensen wrote:
</div></div><blockquote type="cite"><div><div class="h5">Hello
all -
<br>
<br>
Attached is a proposal to add to the Erlang language an operator
which allows for pattern matching to be used in new contexts, in
particular within guard expressions.
<br>
<br>
I hope the writeup to be in the expected format, as well as
describing a sufficiently interesting idea.
<br>
<br>
Regards,
<br>
Erik Søe Sørensen
<br>
<br>
</div></div><pre><fieldset></fieldset>
_______________________________________________
eeps mailing list
<a href="mailto:eeps@erlang.org" target="_blank">eeps@erlang.org</a>
<a href="http://erlang.org/mailman/listinfo/eeps" target="_blank">http://erlang.org/mailman/listinfo/eeps</a>
</pre>
</blockquote>
<br>
</div>
</blockquote></div><br>