- cross-posted to:
- [email protected]
- cross-posted to:
- [email protected]
You must log in or # to comment.
Go:
deleted by creator
const that = this;Yeah, this is that.
Rust: do you mean Self or self?
thisis commonly used with a similar meaning toselfin cases whereselfcan’t be used because it is a reserved keyword.Example:
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<St1::Item>> { let this = self.project(); this.inner.poll_next(cx) }https://github.com/rust-lang/futures-rs/blob/master/futures-util/src/stream/select.rs#L113-L116
Any language feature with such a long definition is a bad language feature.
The less such features, the better the language.
Thus, javascript is not a “good” language for expressing your programs.
let self = this;
I did not know that about event handlers, that is actually super convenient
In python self is just a convention, you can call it whatever you want :)
and don’t ever pull the mask off by reading the descriptor and meta object protocol.




