On Fri, May 3, 2013 at 3:12 AM, Patrick Walton <[email protected]> wrote:
>
> The alternative is `as`, like OCaml. However, this conflicts with `as` in
> the expression grammar. A subset of the expression grammar is part of the
> pattern grammar in order to permit matching against constants. Removing
> `as` expressions from the subset of expression productions permitted in
> patterns would mean that this would no longer do what you expect:
>
> match 22.0f32 / 7.0f32 {
> math::PI as f32 => println("Good grief!"),
> _ => {}
> }
>
You could emit a warning or an error if the bound name is the same as the
name of a type.
--
Your ship was destroyed in a monadic eruption.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev