[rust-dev] A couple of tweaks to make typeclasses easier?

Kevin Atkinson kevin at atkinson.dhs.org
Thu Jan 26 18:35:40 PST 2012

On Thu, 26 Jan 2012, Graydon Hoare wrote:

> On 1/25/2012 12:12 PM, Patrick Walton wrote:
>> (1) Typeclass imports become "import impl". So you'd write "import impl
>> driver::diagnostic::handler" where you'd write "import
>> driver::diagnostic::handler" today. This way, when you look at a method
>> call and you don't know where it's coming from, you just grep for
>> "import impl" and look at all the implementations in scope.
>> (2) Change method calls to '->', like C++, Perl, and PHP. That operator
>> is free and it has precedent. And getting away from overloading the dot
>> worked well when we changed module access from '.' to '::'.
>> Thoughts?
> A bit opposed to both, sadly. I quite like picking up impls "by accident" via 
> "import foo::*", and dislike the aesthetic of ->.

As a potential user of the language, I have to agree with Graydon.  In 
particular I do not like the idea of having to use a different symbol for 
what I see as method access and field access.

More information about the Rust-dev mailing list