Jonathan Scott Duff wrote:

> This continues to make no sense to me. The "hypotheticality" of a
> variable seems quite orthogonal to what you do with it (bind, assign,
> whatever).  Why should these two things be intimate?

Because what you do with a hypothetical has to be reversible.
And binding is far more cheaply reversible than assignment.
It's also far cheaper in the forward direction. And that's
important in pattern matching, especially as we may be to-and-fro-ing
over the hypothetical many times.


> And if they are,
> does that mean that these:
> 
>       / (\S*) { let $x = .pos } \s* foo /
>       / (\S*) { let $x;  ... $x = .pos } \s* foo /
>       
> throw some sort of exception or error?

Compile-time syntax error, I'd expect.


> That could be surprising if
> the ellipses are really some long bit of code.  (Why is that scalar
> different from any other scalar?  Because it's hypothetical.

Yes. Because it's "reversible".


> Suddenly we've a new "class" of variable that people have to be aware of)

Yes.


Damian


Reply via email to