<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 2, 2012, at 2:43 PM, Mark S. Miller wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div class="gmail_quote">On Tue, Oct 2, 2012 at 2:18 PM, Rick Waldron <span dir="ltr"><<a href="mailto:firstname.lastname@example.org" target="_blank">email@example.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; "><div class="gmail_quote"><div class="im">
<div><br></div></div><div>The direct reasoning for the resolution was:</div><div><br></div><div>"<span style="white-space:pre-wrap">Cannot be both iterable </span><span style="white-space:pre-wrap">and array-like"</span></div>
<div><span style="white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">It's possible that this could be added to the agenda for november, if Brendan wants to discuss SpiderMonkey's experience implementing it. It seems to me that if they're not having issues then it's at least worth a mention.</span></div>
</div></blockquote><div><br></div><div><div>Please do. I'd really like to see a more pleasant resolution if one can be found. What does SpiderMonkey actually do?</div></div><div><br></div></div></blockquote></div><br><div>This thread from July is relevant <a href="https://mail.mozilla.org/pipermail/es-discuss/2012-July/023918.html">https://mail.mozilla.org/pipermail/es-discuss/2012-July/023918.html</a> </div><div><br></div><div>In particular</div><div><blockquote type="cite"><pre>On Jul 5, 2012, at 10:54 AM, Brendan Eich wrote:
><i> Allen privately observed that Array forEach skips holes, matching for-in. That counts for a lot with me -- we have only a blind for(i=0;i<a.length;i++)... loop not skipping holes, but of course it wouldn't. That is weak precedent on which to build for-of.
Specifically, for consistency, I think
for (let v of array) console.log(v);
should yield the same results.
.forEach skips "holes" so the default iterator for arrays should too. All the other "Array extras" also have the skipping behavior.
</i>><i> Map may win at some point, who knows? It's not winning if one wants an array, numeric indexing, .length, the usual prototype methods.
We could consider also have "dense" interators available:
for (let v of array.denseValues) console.log(v);
</pre></blockquote><div><br></div><div>Hopefully we don't have to re-discuss too much of this. </div></div><div><br></div><div>allen</div></body></html>