Playing around with some adjacent sketches re: class syntax: https://gist.github.com/wycats/b2030bb205add6861ba7dc2279bcf625 … These guys are totally sketches, not proposals! But maybe interesting.
I'm also trying to work out whether people would expect -> to work with public stuff: class Person { private name; constructor(age) { this.age = age; } toString() { // would you write this->age? return `${this->name} aged ${this.age}` } }
-
-
It's a little hard to tell without being in the flow and churning out code. It seems much less likely with `.#`
-
not sure why that would be any more or less likely to happen with either. i assume accessing an undeclared private throws, so the bigger risk is going in the other direction, since normal access would silently return undefined
-
I could see getting into a mental model where I use private a lot and -> is just how I access stuff. I agree the other direction is pretty bad.
-
Consider this TS'ish snippet: class Person { private name; public age; toString() { // private and public look a lot alike, the only diff is the sigil } }
-
I guess I'm feeling like the -> sigil still treats the rhs like an unadorned name, which isn't quite enough. But this is just a feeling that came from writing a bunch of examples real quick. I can't be sure.
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

I can’t speak to that. The arrow looks like C++ to me, for better or worse
I can imagine it being confusing to a beginner that x=>y is a function but x->y is private access (if x is the same class as this). Not as bad as var, though