Would it not be possible to have "new" be a keyword, yet not a reserved
word (since they are not the same thing). This leaves the possibility of
using it as a method name (e.g. Struct::new()), while still using it as an
operator.

--
Ziad


On Sat, Nov 30, 2013 at 1:07 AM, David Rajchenbach-Teller <
[email protected]> wrote:

> On 11/30/13 10:01 AM, Kevin Ballard wrote:
> > `new` isn't self-documenting. It's merely consistent with C++, but
> > consistency with C++ cannot be considered self-documentation because
> > there are a great many programmers out there who have never touched C++
> > (or any language with a `new` operator). To someone who hasn't
> > encountered `new` before, an equally-valid interpretation of `new Foo`
> > would be to construct a `Foo` value by invoking a standard initializer,
> > returning it by-value.
>
> I believe that Patrick's argument is that the primary target of Rust is
> people who are already familiar with C++. To them, `new` will be
> self-documenting. Programmers who are not familiar with `new` (who are
> getting rare these days) will still need to learn a new construct, just
> as they would with sigils.
>
> I do not have a very strong opinion, but I believe that `new` is indeed
> a good way to astonish the least amount of newcomers.
>
> Cheers,
>  David
>
> --
> David Rajchenbach-Teller, PhD
>  Performance Team, Mozilla
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to