3 ms·
There's nothing Rust-specific about methods having a self argument. All languages with methods have such a thing. I'm really unsure of what your specific compla
by kibwen 11y ago
There's nothing Rust-specific about methods having a self argument. All languages with methods have such a thing. I'm really unsure of what your specific complaint is here.
- EugeneOZ 11y agoAll languages? Maybe Java, or JavaScript, PHP, C#, Go? Or just Rust and Python?
- kibwen 11y agoYes, all languages, though in Rust and Python they are explicit rather than implicit at the definition site. And note that although Rust makes them explicit for technical reasons (allowing you to control the manner in which the receiver is taken), their explicitness in Python is only because Guido wanted people to understand that methods require a receiver parameter in order to operate, a misunderstanding which appears to be the root of your confusion.