Iteration protocol: a sentinel value?

Axel Rauschmayer axel at rauschma.de
Mon May 13 23:57:56 PDT 2013


In the TC39 meeting notes, Mark suggested something similar (but more sophisticated) which was rejected and I am wondering why.

Herman’s protocol is (roughly):
- Values v: { value: v }
- After last value: { done: true }

With a sentinel value, this would look like:
- Values v: v
- After last value: SENTINEL_VALUE (defined once, somewhere)

The latter seems simpler to me – what’s wrong with it?

Thanks!

Axel

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130514/640eee81/attachment.html>


More information about the es-discuss mailing list