<div class="gmail_quote">2009/2/19 fess <span dir="ltr"><<a href="mailto:fess-erlang@fess.org">fess-erlang@fess.org</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>
</div>something like Richards abstract patterns.<br>
<br>
also floating guards on the LHS of a match seem like they could make<br>
code much more concise and readable, and erlang-like [ to me ]<br>
<br> 
 { X when is_integer(X), [ "x" | Rest ] } = string:to_integer(Str),<br>
   { Y when is_integer(Y), _ } = string:to_integer(Rest),</blockquote><div><br>Sorry, but I must point out that you can do this in LFE already:<br><br>(let* ((#(x ("x" . rest)) (when (is_integer x)) (: string to_integer str))<br>
       (#(y _) (when (is_integer y)) (: string to_integer rest)))<br>  ... )<br><br>Anywhere you can have a pattern you can always follow it with a guard of the form (when <test>).<br><br>Getting back to the question at hand I personally find then more difficult to read. But that may very well be because I am not used to it.<br>
<br>One good point with this suggestion though is that it moves guards back to be what they originally were intended, simple tests which were parts the pattern matching which could not easily be written in the pattern. It might lessen the confusion of guards not being real expressions.<br>
<br>Robert<br><br></div></div>