On Wed, May 18, 2011 at 11:09 AM, Graydon Hoare <[email protected]> wrote:
>  - You have to put in an extra character : when you want types,

As far as I can tell you could even skip the ":" and not lose anyhing
because the other possible token is "=" (for an initializer, without
an explicit type) which isn't a valid token for a type.

So all these things parse unambiguously and without any back tracking,
and not even any lookahead.

let x int;
let y = x;
let z int = y;
let w int;
w = z;

That said, I'd probably prefer having an operator in between.

Also, I find that putting the name of something in a consistent place
(in the sense of "the name of a variable is always 4 characters in
from the left") makes it alot easier for humans to quickly scan for a
specific name. If there's a big old type there of variable length you
have to jump horizontally a lot. I would conjecture that you're
scanning for a name more often than for a type, so putting it first
makes sense.

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

Reply via email to