On 12/05/2011 5:49 PM, Patrick Walton wrote:

I lean toward (3), and, failing that, (5), but I'm not particularly in
favor of one solution or the other (although I'd prefer not to do (1); I
think _str is universally disliked). Mostly I just wanted to throw some
ideas out there.

I'd go with an even looser version of (3): make the builtin names reserved words only in the type namespace, not the module *or* value namespaces (or the field-label / method-name "namespaces", which we haven't mentioned yet since there are never scope-resolution issues to worry about)

At the moment things like "vec" can't be used as a value name because they're ambiguous as constructor prefixes ("vec(...)"), but that's temporary: vec(...) will soon be [...] and rec(...) will soon be {...}, and so on. Once that sort of change goes in, there's no reason we can't permit "auto vec = [];" when that's the most natural thing to write.

IOW the only reason they're not shadowable now is that I wanted maintenance programmers to "always be able to explicitly denote the types of the literals (that they are able to denote as values)". Since types are in their own namespace now -- or are going to be there soon -- there's no reason to restrict the other namespaces. That was coincidental with "only having one namespace".

-Graydon

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

Reply via email to