On 09/24/2011 05:32 PM, Jesse Ruderman wrote:
I marked interner::get as "pure" on the basis that once it succeeds,
it always succeeds and always returns the same thing. I hope this is
reasonable.

The key typestate guarantee still holds: once you've checked it, you
can rely on it. But you can't hoist the check arbitrarily far like you
can with most preds.
Hi Jesse,

We have an 'if checked ... ' form which just takes a different path if the predicate is false, so it seems to me that predicates should be expected not to fail. I think a predicate based on interner::get should have to do an unchecked validation of the length of interner's vector and not just let interner::get fail.

What do you mean by 'can't hoist the check arbitrarily far'?

Regards,
Brian
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to