A little bikeshedding:

Tags
----

In my experience "tag" has been confusing for newcomers to the language. It's consistent in that it's the only way to define a nominal type, but nominal types are more of a compiler writer's construct than a construct users of the language are used to thinking about. So I suggest instead that we change the keyword for variant-typed tags to "variant", and in the documentation, change the previous usages of "variant" to "case". The word "variant" suggests what the type actually means, and a lot of potential users of Rust will be coming from languages like C++, in which sum types don't exist. It's a lot easier to explain to newcomers "a variant value is one of several cases" than to say "a tag value is one of several variants".

Additionally, "variant" and "case" match OCaml.

Unfortunately, "variant" is 7 letters, which breaks our 5-character limit for keywords, but I think "var" would be even more confusing.

Note that this means that will want a "newtype" keyword for the newtype syntax, and it could well just be "newtype" like Haskell.

Logging
-------

"log_err" is a bit unsightly, and I'm worried about releasing 0.1 without a nice-looking "hello world" program. So I propose renaming it to "print". Other suggestions welcome.

This way our "hello world" program will look like:

    fn main() {
        print "Hello world!";
    }

Thoughts?

Patrick
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to