Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Iterator APIs?


So, I'm looking at how I want to handle custom iteration in for loops. There
are a bunch of approaches out in the wild, and I'm trying to figure out how I want
to have it done.

Python has generators (https://www.python.org/dev/peps/pep-0255/)
C++ has iterators (http://www.cs.northwestern.edu/~riesbeck/programming/c++/stl-iterators.html)
D has ranges (http://www.informit.com/articles/printerfriendly/1407357)
Common Lisp has the iterate module/macro/whatever (https://common-lisp.net/project/iterate/doc/Don_0027t-Loop-Iterate.html)

So, it's time for a gedanken experiment. What should iterating over things look like, in
an ideal world with unicorns?


Follow-Ups:
Re: Iterator APIs?Ryan <rymg19@xxxxxxxxx>