3 ms·
That's exactly what I meant with other bad ideas just snowballed on top of it It still baffles me how people can invent two separate ways to invoke someth
by frowaway001 12y ago
That's exactly what I meant with
other bad ideas just snowballed on top of it
It still baffles me how people can invent two separate ways to invoke something, () and [], and pretend that's a good idea.
If they used [] for types, they wouldn't have needed to consider such a bad idea.
Now, Rust has to deal with all the random syntax quirks caused by misusing <> for Generics, and it does it pretty badly: As an example, the Foo::<Bar>:: syntax is even worse than Java's Fuz.<Baz>Meth() hack.
- kibwen 12y agoRust would have needed to do `Foo::[Bar]` anyway in order to deal with the ambiguity surrounding the `[]` operator, as explained in a comment upthread (using `()` instead for indexing is not as simple of a substitution as it seems). In any case, I plan to propose a backwards-compatible extension to Rust's grammar post-1.0 which will make `Foo<Bar>` possible. Finally, I should note that personally I prefer D's syntax for generics, though I'm ambivalent about the particular sigil used (Rust already uses `!` for a fine purpose).