3 ms·
I kind of wish x.f(y) was the same as f(x, y) in javascript.
by Tarean 9y ago
I kind of wish x.f(y) was the same as f(x, y) in javascript.
- masklinn 9y agoHow would dispatching work exactly, e.g. how would you override valueOf or toString?
- Tarean 9y agoOn retrospect I probably want it to be more like lua? f(this, other) -> f.call(this, other) obj.f(other) -> obj.f.call(obj, other) and then replace implicit this with the first argument? It is a tiny but more verbose but gets rid of all the confusion around implicit this rules so it seems like a win.
- girvo 9y agoThat’s one of my favourite features of Nim.