-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support ES6 iterators #12
Comments
(btw, I'm not actually using ES6 yet, but I'm writing an iterator-heavy app and trying to standardize on ES6 style. For now I'll just write wrappers around RBTree.) |
Yeah, the backwards-incompatibility of ES6 iterators with mine is a bit unfortunate. I'll have to think for a bit about how to best solve this. For now, it's not really an issue because ES6 hasn't even been standardized yet. Thanks for the heads up, though! |
It's a bit of an annoyance because many engines already support iterators/generators and many ES6 features can be compiled to ES5, but generators allow a simple solution that works well enough:
|
Just wanted to mention that ES6 is complete now, with a standardized iterator interface! |
Ok, here's the plan:
What do you guys think? |
What about I do see the value of having old-style iterators also, because they are more flexible. A single old-style iterator can go forwards or backwards or even switch in the middle of iteration. |
The ES6 iterator protocol is a bit different than what js_bintrees implements. Any chance js_bintrees could add support for this?
This would allow code like this in ES6:
Unfortunately this would be a backward-incompatible change. The only two ideas that spring to mind are:
Thanks for writing js_bintrees!
The text was updated successfully, but these errors were encountered: