Re:Rust is surprisingly expressive
by saryant on Saturday December 28, 2013 @10:47PM
(#6978235)
This is essentially a Scala "self-type".
"self" isn't a keyword, you can call it whatever you like.
[ Parent
| on HN ]
Hah, now that is nice.
I forget what convoluted use case I wanted it for. I ended up solving it using composition instead (which is the right solution 99% of the time anyway. :) )
Still though, I love using interfaces as contracts, so I get frequently annoyed at how poorly my tools (limited to C++2003 right now) support doing such!