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

Well, __iter__ was baked into Python decades(?) ago, so there’s no danger anybody might have their own __iter__ methods that mean something else. But now that JS is adding iteration methods to the language, there are lots of libraries and frameworks that have their own incompatible ways of greenspunning these features.

The [Symbol.iterator] expression resolves to a string that is guaranteed to be unique, so there is no possibility of breaking backwards-compatibility with someone who picked the exact same magic name.

(There’s a major headache involved when code crosses execution contexts, I don’t pretend to understand how that works yet.)



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

Search: