This looks great!
Personally, I was happy when I saw the r#catch
syntax. It’s reasonably short, fits decently with other syntax, and doesn’t take up a new sigil that I’d rather keep for a more important use.
I think that having a short syntax is far more important in C# because of reflection and anonymous struct literals. Razor uses things like new { @class = "errorbox" }
all over the place as an inefficient associative container, with the field names appearing in the output. I hope Rust doesn’t develop such a pattern.
A possible extension: this could allow both identifier#catch
and keyword#catch
(probably with shorter prefixes) as a way to also expose catch
in Rust 1.0 (or multi-version) code.