The sentinel cannot carry a return value, from the notes:

DH: Mark's proposal is broken, because it doesn't work with return values of generators.

MM: Agreed.




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  <https://mail.mozilla.org/listinfo/es-discuss>

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to