Discussion:
Iter: __iterable__ support?
Fredrik
2010-11-20 23:51:36 UTC
Permalink
Hi.

In Iter.js I find this, regarding the support for the __iterator__
pattern.

//-------------------------------
// XXX: We can't support JavaScript 1.7 __iterator__ directly
// because of Object.prototype.__iterator__
//-------------------------------

In Git/SVN the only message to the (reverted) change (2006-05-18) is
"oops" :)

The Google Closure library seems to sniff for it for example, see:
http://closure-library.googlecode.com/svn/docs/closure_goog_iter_iter.js.source.html

Is this still applicable? Supporting __iterable__ would be very useful
I'd say.
.. Guess this more or less a question for Bob himself but if anyone
has knowledge about this issue please enlighten!

Regards
// Fredrik Blomqvist
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to mochikit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en.
Fredrik
2010-11-20 23:55:39 UTC
Permalink
FYI, here the actual links to the changes:

adding __iterator__: https://github.com/mochi/mochikit/blob/b54de3b0429396cb86edd2c1ade0860831b65379/MochiKit/Iter.js
.. dropping __iterator_:
https://github.com/mochi/mochikit/blob/3022d8755cf932a9581f0ba19134472a368c6d64/MochiKit/Iter.js
Post by Fredrik
Hi.
In Iter.js I find this, regarding the support for the __iterator__
pattern.
//-------------------------------
// XXX: We can't support JavaScript 1.7 __iterator__ directly
//      because of Object.prototype.__iterator__
//-------------------------------
In Git/SVN the only message to the (reverted) change (2006-05-18) is
"oops" :)
The Google Closure library seems to sniff for it for example, see:http://closure-library.googlecode.com/svn/docs/closure_goog_iter_iter...
Is this still applicable? Supporting __iterable__ would be very useful
I'd say.
.. Guess this more or less a question for Bob himself but if anyone
has knowledge about this issue please enlighten!
Regards
// Fredrik Blomqvist
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to mochikit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en.
Bob Ippolito
2010-11-21 00:35:19 UTC
Permalink
If I remember correctly the problem is that __iterator__ was defined
on Object.prototype (to iterate over keys), so everything had it, and
it made the registry worthless. Maybe if we moved that code to after
the registry, or maybe checked to see if iterator.__iterator__ !==
Object.prototype.__iterator__ before the registry, and then just a
regular check after.

It looks like they moved that behavior to Iterator though, so maybe
it's ok to bring back.
Post by Fredrik
adding __iterator__: https://github.com/mochi/mochikit/blob/b54de3b0429396cb86edd2c1ade0860831b65379/MochiKit/Iter.js
https://github.com/mochi/mochikit/blob/3022d8755cf932a9581f0ba19134472a368c6d64/MochiKit/Iter.js
Post by Fredrik
Hi.
In Iter.js I find this, regarding the support for the __iterator__
pattern.
//-------------------------------
// XXX: We can't support JavaScript 1.7 __iterator__ directly
//      because of Object.prototype.__iterator__
//-------------------------------
In Git/SVN the only message to the (reverted) change (2006-05-18) is
"oops" :)
The Google Closure library seems to sniff for it for example, see:http://closure-library.googlecode.com/svn/docs/closure_goog_iter_iter...
Is this still applicable? Supporting __iterable__ would be very useful
I'd say.
.. Guess this more or less a question for Bob himself but if anyone
has knowledge about this issue please enlighten!
Regards
// Fredrik Blomqvist
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en.
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to mochikit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en.
Fredrik Blomqvist
2010-11-23 23:07:21 UTC
Permalink
Thanks, I was afraid there was some even more subtle issue involved.
I've now re-enable it in my fork of MochiKit, see:
https://github.com/blq/mochikit/commit/1352ea316184b83ccffc30d19d65faa0431ce43b
Unit tests pass but I'll let it "spin around" in my code for a while
before merging it into MochiKit master.
----
.. speaking of iterators, I've recently been toying with extensions to
the Iter module. Filling in gaps from itertools, adding some
tree-iterators etc. See if you find something you like here:
https://github.com/blq/mochikit/blob/master/MochiKit/Iter-ext.js

Regards
// Fredrik Blomqvist
Post by Bob Ippolito
If I remember correctly the problem is that __iterator__ was defined
on Object.prototype (to iterate over keys), so everything had it, and
it made the registry worthless. Maybe if we moved that code to after
the registry, or maybe checked to see if iterator.__iterator__ !==
Object.prototype.__iterator__ before the registry, and then just a
regular check after.
It looks like they moved that behavior to Iterator though, so maybe
it's ok to bring back.
Post by Fredrik
adding __iterator__: https://github.com/mochi/mochikit/blob/b54de3b0429396cb86edd2c1ade0860831b65379/MochiKit/Iter.js
https://github.com/mochi/mochikit/blob/3022d8755cf932a9581f0ba19134472a368c6d64/MochiKit/Iter.js
Post by Fredrik
Hi.
In Iter.js I find this, regarding the support for the __iterator__
pattern.
//-------------------------------
// XXX: We can't support JavaScript 1.7 __iterator__ directly
//      because of Object.prototype.__iterator__
//-------------------------------
In Git/SVN the only message to the (reverted) change (2006-05-18) is
"oops" :)
The Google Closure library seems to sniff for it for example, see:http://closure-library.googlecode.com/svn/docs/closure_goog_iter_iter...
Is this still applicable? Supporting __iterable__ would be very useful
I'd say.
.. Guess this more or less a question for Bob himself but if anyone
has knowledge about this issue please enlighten!
Regards
// Fredrik Blomqvist
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en.
--
// Fredrik Blomqvist
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to mochikit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en.
Fredrik
2010-11-23 22:58:01 UTC
Permalink
Thanks, I was afraid there was some more subtle issue involved.
I've now re-enabled it in my MochiKit fork, see:
https://github.com/blq/mochikit/commit/1352ea316184b83ccffc30d19d65faa0431ce43b
Unit-tests pass, but I'll let it "spin around" in my code for a while
before a merge into MochiKit master.
---
...speaking of iterators, I've recently been toying around with
further extensions to the Iter-lib,
filling gaps from itertools, adding tree-iterators etc, see if you
find something you like here: https://github.com/blq/mochikit/blob/master/MochiKit/Iter-ext.js

Regards
// Fredrik Blomqvist
Post by Bob Ippolito
If I remember correctly the problem is that __iterator__ was defined
on Object.prototype (to iterate over keys), so everything had it, and
it made the registry worthless. Maybe if we moved that code to after
the registry, or maybe checked to see if iterator.__iterator__ !==
Object.prototype.__iterator__ before the registry, and then just a
regular check after.
It looks like they moved that behavior to Iterator though, so maybe
it's ok to bring back.
adding __iterator__:https://github.com/mochi/mochikit/blob/b54de3b0429396cb86edd2c1ade086...
https://github.com/mochi/mochikit/blob/3022d8755cf932a9581f0ba1913447...
Post by Fredrik
Hi.
In Iter.js I find this, regarding the support for the __iterator__
pattern.
//-------------------------------
// XXX: We can't support JavaScript 1.7 __iterator__ directly
//      because of Object.prototype.__iterator__
//-------------------------------
In Git/SVN the only message to the (reverted) change (2006-05-18) is
"oops" :)
The Google Closure library seems to sniff for it for example, see:http://closure-library.googlecode.com/svn/docs/closure_goog_iter_iter...
Is this still applicable? Supporting __iterable__ would be very useful
I'd say.
.. Guess this more or less a question for Bob himself but if anyone
has knowledge about this issue please enlighten!
Regards
// Fredrik Blomqvist
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
For more options, visit this group athttp://groups.google.com/group/mochikit?hl=en.
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to mochikit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en.
Fredrik
2010-11-21 00:52:41 UTC
Permalink
ok, thanks. I was afraid there was some more subtle issue I missed.
I guess I'll simply throw it in again in, initially in my fork, and
see if it breaks anything (different browsers...).
If successful I'd say it should be re-enabled.

(.. by the way, speaking of iterators, I have been doing a lot of
iterator experiments in my fork lately.
More itertools extensions, tree iterators etc, see:
https://github.com/blq/mochikit/blob/master/MochiKit/Iter-ext.js )

Regards
// Fredrik Blomqvist
Post by Bob Ippolito
If I remember correctly the problem is that __iterator__ was defined
on Object.prototype (to iterate over keys), so everything had it, and
it made the registry worthless. Maybe if we moved that code to after
the registry, or maybe checked to see if iterator.__iterator__ !==
Object.prototype.__iterator__ before the registry, and then just a
regular check after.
It looks like they moved that behavior to Iterator though, so maybe
it's ok to bring back.
adding __iterator__:https://github.com/mochi/mochikit/blob/b54de3b0429396cb86edd2c1ade086...
https://github.com/mochi/mochikit/blob/3022d8755cf932a9581f0ba1913447...
Post by Fredrik
Hi.
In Iter.js I find this, regarding the support for the __iterator__
pattern.
//-------------------------------
// XXX: We can't support JavaScript 1.7 __iterator__ directly
//      because of Object.prototype.__iterator__
//-------------------------------
In Git/SVN the only message to the (reverted) change (2006-05-18) is
"oops" :)
The Google Closure library seems to sniff for it for example, see:http://closure-library.googlecode.com/svn/docs/closure_goog_iter_iter...
Is this still applicable? Supporting __iterable__ would be very useful
I'd say.
.. Guess this more or less a question for Bob himself but if anyone
has knowledge about this issue please enlighten!
Regards
// Fredrik Blomqvist
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
For more options, visit this group athttp://groups.google.com/group/mochikit?hl=en.
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to mochikit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en.
Fredrik Blomqvist
2010-11-23 23:05:26 UTC
Permalink
Thanks, I was afraid there was some even more subtle issue involved.
I've now re-enable it in my fork of MochiKit, see:
https://github.com/blq/mochikit/commit/1352ea316184b83ccffc30d19d65faa0431ce43b
Unit tests pass but I'll let it "spin around" in my code for a while
before merging it into MochiKit master.
----
.. speaking of iterators, I've recently been toying with extensions to
the Iter module. Filling in gaps from
itertools, adding some tree-iterators etc. See if you find something
you like here: https://github.com/blq/mochikit/blob/master/MochiKit/Iter-ext.js

Regards
// Fredrik Blomqvist
Post by Bob Ippolito
If I remember correctly the problem is that __iterator__ was defined
on Object.prototype (to iterate over keys), so everything had it, and
it made the registry worthless. Maybe if we moved that code to after
the registry, or maybe checked to see if iterator.__iterator__ !==
Object.prototype.__iterator__ before the registry, and then just a
regular check after.
It looks like they moved that behavior to Iterator though, so maybe
it's ok to bring back.
adding __iterator__:https://github.com/mochi/mochikit/blob/b54de3b0429396cb86edd2c1ade086...
https://github.com/mochi/mochikit/blob/3022d8755cf932a9581f0ba1913447...
Post by Fredrik
Hi.
In Iter.js I find this, regarding the support for the __iterator__
pattern.
//-------------------------------
// XXX: We can't support JavaScript 1.7 __iterator__ directly
//      because of Object.prototype.__iterator__
//-------------------------------
In Git/SVN the only message to the (reverted) change (2006-05-18) is
"oops" :)
The Google Closure library seems to sniff for it for example, see:http://closure-library.googlecode.com/svn/docs/closure_goog_iter_iter...
Is this still applicable? Supporting __iterable__ would be very useful
I'd say.
.. Guess this more or less a question for Bob himself but if anyone
has knowledge about this issue please enlighten!
Regards
// Fredrik Blomqvist
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
For more options, visit this group athttp://groups.google.com/group/mochikit?hl=en.
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to mochikit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en.
Fredrik Blomqvist
2010-11-24 08:59:17 UTC
Permalink
...OK... for some reason (many links?) Google apparently decided to
queue my messages *much* longer than usual. My very first reply is
still totally lost for example.. But, now I see my other attempts at
re-posting showed up all at once.. Sigh... :(

Apologize for the spam!
// Fredrik Blomqvist
Post by Fredrik Blomqvist
Thanks, I was afraid there was some even more subtle issue involved.
I've now re-enable it in my fork of MochiKit, see:https://github.com/blq/mochikit/commit/1352ea316184b83ccffc30d19d65fa...
Unit tests pass but I'll let it "spin around" in my code for a while
before merging it into MochiKit master.
----
.. speaking of iterators, I've recently been toying with extensions to
the Iter module. Filling in gaps from
itertools, adding some tree-iterators etc. See if you find something
you like here:https://github.com/blq/mochikit/blob/master/MochiKit/Iter-ext.js
Regards
// Fredrik Blomqvist
Post by Bob Ippolito
If I remember correctly the problem is that __iterator__ was defined
on Object.prototype (to iterate over keys), so everything had it, and
it made the registry worthless. Maybe if we moved that code to after
the registry, or maybe checked to see if iterator.__iterator__ !==
Object.prototype.__iterator__ before the registry, and then just a
regular check after.
It looks like they moved that behavior to Iterator though, so maybe
it's ok to bring back.
adding __iterator__:https://github.com/mochi/mochikit/blob/b54de3b0429396cb86edd2c1ade086...
https://github.com/mochi/mochikit/blob/3022d8755cf932a9581f0ba1913447...
Post by Fredrik
Hi.
In Iter.js I find this, regarding the support for the __iterator__
pattern.
//-------------------------------
// XXX: We can't support JavaScript 1.7 __iterator__ directly
//      because of Object.prototype.__iterator__
//-------------------------------
In Git/SVN the only message to the (reverted) change (2006-05-18) is
"oops" :)
The Google Closure library seems to sniff for it for example, see:http://closure-library.googlecode.com/svn/docs/closure_goog_iter_iter...
Is this still applicable? Supporting __iterable__ would be very useful
I'd say.
.. Guess this more or less a question for Bob himself but if anyone
has knowledge about this issue please enlighten!
Regards
// Fredrik Blomqvist
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
For more options, visit this group athttp://groups.google.com/group/mochikit?hl=en.
--
You received this message because you are subscribed to the Google Groups "MochiKit" group.
To post to this group, send email to ***@googlegroups.com.
To unsubscribe from this group, send email to mochikit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mochikit?hl=en.
Loading...