Changeset 0e3f80d


Ignore:
Timestamp:
Sep 2, 2022, 10:59:55 AM (2 years ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
836cf647
Parents:
c87b604
Message:

Added some more notes to the iterators proposal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/proposals/iterators.md

    rc87b604 r0e3f80d  
    5858returns a range object, which can be used as any other type.
    5959
     60It might not cover every single case with the same syntax (the `@` syntax may
     61not translate to operators very well), but should be able to maintain every
     62option with some library range.
     63
    6064Library Enhancements
    6165--------------------
     
    8286------------
    8387Python has a robust iterator tool set. It also has a `range` built-in which
    84 does many of the same things as the special for loops.
     88does many of the same things as the special for loops (the finite and
     89half-open ranges).
     90
     91In addition, it has many dedicated iterator constructors and transformers,
     92and many containers can both produce and be constructed from iterators.
    8593
    8694+   https://docs.python.org/3/reference/datamodel.html#object.__iter__
    8795+   https://docs.python.org/3/library/functions.html#func-range
    8896
    89 C++ has many iterator tools at well, except for the fact it's `iterators` are
     97C++ has many iterator tools at well, except for the fact it's "iterators" are
    9098not what are usually called iterators (as above) but rather an abstraction of
    91 pointers.
     99pointers. The notable missing feature is that a single iterator has no
     100concept of being empty or not, instead it must be compared to the end
     101iterator.
     102
     103However, C++ ranges have an interface much more similar to iterators.
     104They do appear to be a wrapper around the "pointer" iterators.
     105
     106+   https://en.cppreference.com/w/cpp/ranges
    92107
    93108Rust also has a imperative implementation of a functional style of iterators,
Note: See TracChangeset for help on using the changeset viewer.