Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Like the type annotations that are now in TypeScript?


Yup, that were in typescript, pascal (and rust, etc when they came out).

But there was no real progress after years of them pushing this syntax, but failing to actually define a type system that was coherent, or a model that would allow it.

As a result I proposed `for (of)` largely to prevent sane enumeration from being blocked on the intransigence of two people.

It's also worth noting that for(:) enumeration would not even preclude their syntax - it's certainly not grammatically ambiguous - and most real world code in languages that support enumeration directly and support inference doesn't explicitly specify the types , so the ugliness of `for(let a:type:expression)` would have be rare anyway.

shrug

Given that ECMA literally killed E4X a few years later the blanket ban on "for each" or "foreach" (because it would be "confusing" in E4X) is arguably worth than for(:), but again shrug




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: