Go:
deleted by creator
“We wanted it to work like Perl,” said someone who should have been killed on the spot.
const that = this;
Yeah, this is that.
Rust: do you mean Self or self?
this
is commonly used with a similar meaning toself
in cases whereself
can’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.