[rust-dev] Self and self in trait definitions

Mario Sopena Novales mario.sopena at gmail.com
Thu Apr 24 02:19:22 PDT 2014


Hi everyone,

I've been learning Rust for the last couple of weeks and I'm quite excited
with it. My experience is mainly in C and Rust feels like a nice
improvement. Thank you for the hard work!

I've recently found this bit of the tutorial:
http://static.rust-lang.org/doc/master/tutorial.html#type-parameterized-traits

and it got me confused for a while because of the similarity between self
and Self (just the 'S' in caps) even when they refer to completely
different things.

I would suggest to change the Self identifier to something less similar to
self which also hints as to what it is like selfT, Tself, self_type or
type(self). Maybe someone with more Rust experience can come up with better
suggestions.

I just think that self/Self is quite confusing and harder to parse for the
eye.

I'm happy to write a RFC if you think the idea has some merit.

Mario
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140424/61522af8/attachment.html>


More information about the Rust-dev mailing list