News for hackers. Stuff that matters.
Re:Why is Common Lisp not the most popular programming langu... by d0mine on Thursday February 15, 2024 @02:22PM (#39387212)
Iterators can be shared in Python e.g., here's a well-known grouper recipe (traverse `it` iterator in chunks of `N` items each):

     zip(*[it]*N)
Example:

    >>> L = [1, 2, 3, 4]
    >>> *zip(*[iter(L)]*2),
    ((1, 2), (3, 4))
Here's the single result of the iter() call is shared. The purpose is to show that iterator can be shared in principle (ignore other aspects of the code).

There are no comments on this comment yet.