<div class="gmail_extra"><div class="gmail_quote">Den 23. apr. 2012 01.21 skrev Robert Virding <span dir="ltr"><<a href="mailto:rvirding@gmail.com" target="_blank">rvirding@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Just a few more comments. I will admit that I have fallen behind in<br>
this discussion though I am definitely interested in it. So in no<br>
specific order:<br>
<br>
- Joe is now considering his structs again and has plans of using a<br>
syntax like records but without the name. For example F =<br>
#{a=1,b="foo"} and perhaps F.a. This hasn't been finalised but in this<br>
form it would free ~ for use. If it is a good choice I don't know yet.<br>
So even if we don't get them soon we may at least get a syntax. :-)<br></blockquote><div><br>At present we have reached consensus on "P ?= E".  No tildes will be harmed.<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

- If we allowed variable binding in the guard with say Pat = Expr, how<br>
far would this get us?<br></blockquote><div>Making variable bindings work in guards is the major part. The minor one - using "?=" outside of guards, either purely as testing or as left operand of "andalso" - has been implemented, with the exception of warnings against unsafe subsequent uses.<br>
And that minor feature is probably the largest difference between the two EEPs, syntax aside.<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

- Just doing this would make for very few changes in Core as all the<br>
work is done in going from Core to Kernel erlang. We could keep<br>
#c_case{}. You would probably not have to change Kernel either, nor<br>
the beam as it should be enough with what is there.<br></blockquote><div>Indeed. #c_clause{} is the only candidate for change, really.<br>I just wonder how many producers and (especially) consumers of Core Erlang there are.<br>
If it's just the Beam and Hipe compilers that consume Core Erlang, then it's at least limited. But I fear there may be analysis tools etc. that would have to be taught the new kind of bindings.<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

- It would be interesting as it could the left-to-right nature of<br>
pattern matching as it is done today. Be more selective in the order<br>
you do matching.<br>
<br>
Robert<br>
<br>
P.S. Something completely different: the non-determinism in CSP is in<br>
the concurrency isn't? I am in the middle of a "discussion" about<br>
having a deterministic and defined semantics as opposed to having<br>
things undefined and implementation specific. I do have the book<br>
somewhere.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On 22 April 2012 00:32, Robert Virding <<a href="mailto:rvirding@gmail.com">rvirding@gmail.com</a>> wrote:<br>
> The actual pattern match compiler does a pretty straight forward<br>
> compilation of guards. It the optimiser which does some very weird<br>
> things and seems pretty incomprehensible. One though I had when doing<br>
> the pattern match compiler was whether we could instead move patterns<br>
> in the head explicitly into the guard, have everything there, and work<br>
> on that. That would optimise things like type tests in the guard. And<br>
> in the case variable binding. There was a paper describing this but I<br>
> can't remember it's name or author.<br>
><br>
> I would personally like to have variable binding in the guards. I have<br>
> a current use for it, so hurry up. :-)<br>
><br>
> Robert<br>
</div></div></blockquote></div><br></div>