Catch-all proposal based on proxies

David-Sarah Hopwood david-sarah at jacaranda.org
Thu Dec 10 18:14:38 PST 2009


Mike Samuel wrote:
> Proxy based iterators work well with existing loop constructs though
>     while ('next' in iterator) doSomething(iterator.next);

I don't understand what advantage this has over
      while (iterator.hasNext()) doSomething(iterator.next());

If next() has side-effects (moving to the next element), it shouldn't
be a getter.

-- 
David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 292 bytes
Desc: OpenPGP digital signature
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20091211/af17fb3b/attachment.bin>


More information about the es-discuss mailing list