On Tue, Jul 22, 2014 at 3:44 AM, Matt Rice <[email protected]> wrote:

> On Sun, Jul 20, 2014 at 8:00 PM, Jonathan S. Shapiro <[email protected]>
> wrote:
>
> > This can be viewed as type, or it can be viewed as a known constraint on
> a
> > value of some type. How do we want to think about this case?
>
> so it came to mind that 'typestate' is much like a constraint on a
> value of some type.
>

Yes and no. Yes, it's a constraint on the value of some type. The
difference between normal constraints and typestate is that the typestate
constraint is associated with control flow as well. The "type" assigned to
a variable can therefore change as you proceed through the program.

You can probably dig up one of the original typestate papers by Rob[ert]
Strom and Shaula Yemini. The idea is clearly described, and the papers had
usefully illustrative use cases.


> and that rust had/removed typestate, after a little looking into it,
> it seems they replaced it with 'viewed as a type', in the form of
> phantom types with a private constructor...
>

Is it me, or does Rust seem to be wandering in the weeds these days? I
don't track them actively enough to know.

Not that I'm in any position to cast nasturtiums at Rust...


shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to