On 6/10/12 11:30 AM, Patrick Walton wrote:
I like this. The only concern, as a comment pointed out, is that "*" might be slightly confusing; maybe "ref" is better.

Yes, gasche stated that using a keyword like `copy` and a sigil like `*` seemed inconsistent. I can see that, I suppose, though I think that using a keyword like `ref` that appears nowhere else in the language seems even more inconsistent, not to mention heavyweight (who wants to write `let (ref x, ref y) = pair`?).

I assume that Cyclone's reasoning with `*x` was that—like other patterns—it's the inverse of what you would do to create the value. That is, if the value is being matched is 3, and the pattern is `*x`, then `x` is bound to something such that writing `*x` gives you 3. This is consistent with other patterns (e.g., if the value is `@3`, and you write the pattern `@x`, then `x` is bound to something where writing `@x` gives you `@3`).


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

Reply via email to