On 13-04-12 07:47 AM, Diggory Hardy wrote:
Hello list (new here),

May I comment on a post from this Monday?

Sure. But I ought to point out: we're in a "stabilizing and finalizing" phase with the language now -- picking through corner cases and remaining internal contradictions. Broad reorganization of assignment, equality and argument-passing is out of scope at this point. These ships sailed a year or two ago.

I agree with the majority on the list that requiring use of the ampersand when
calling is a useful feature, but why not automatic dereferencing everywhere?
There are two problems with this, namely comparison and assignment.

We auto-dereference on . (dot) already since it can't be overridden; most other operators we allow overriding, and those have the option of dereferencing when applied to pointers. Many do.

For the former, I think D really got it right with `x is y` to compare
references and `x == y` to compare objects/boxes. In the case of references to
references (e.g. ~@int) it would have to be decided which references were
compared by "is", but in any case "&" can be used to get a reference to
compare.

There are plenty of strategies for comparing. We permit overriding operator == for this reason. Adding another operator like 'is' doesn't seem like it'll make things more clear (memories of eq? eqv? and equal? from lisp). I'd prefer adding a PtrEq trait with .ptr_eq() for @, ~ and & types.

Second thing: why are semicolons required at the end of lines at all? Go,
Scala etc. manage fine without.

Most such rules wind up either whitespace sensitive or requiring a bunch of lookahead. We don't want either of those. This is a major bikeshed that _everyone_ has an opinion on; absent a syntactic ambiguity or error in our existing rules, we're going to leave it alone.

-Graydon

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

Reply via email to