Changeset 0e3f80d
- Timestamp:
- Sep 2, 2022, 10:59:55 AM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 836cf647
- Parents:
- c87b604
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/proposals/iterators.md
rc87b604 r0e3f80d 58 58 returns a range object, which can be used as any other type. 59 59 60 It might not cover every single case with the same syntax (the `@` syntax may 61 not translate to operators very well), but should be able to maintain every 62 option with some library range. 63 60 64 Library Enhancements 61 65 -------------------- … … 82 86 ------------ 83 87 Python 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. 88 does many of the same things as the special for loops (the finite and 89 half-open ranges). 90 91 In addition, it has many dedicated iterator constructors and transformers, 92 and many containers can both produce and be constructed from iterators. 85 93 86 94 + https://docs.python.org/3/reference/datamodel.html#object.__iter__ 87 95 + https://docs.python.org/3/library/functions.html#func-range 88 96 89 C++ has many iterator tools at well, except for the fact it's `iterators`are97 C++ has many iterator tools at well, except for the fact it's "iterators" are 90 98 not what are usually called iterators (as above) but rather an abstraction of 91 pointers. 99 pointers. The notable missing feature is that a single iterator has no 100 concept of being empty or not, instead it must be compared to the end 101 iterator. 102 103 However, C++ ranges have an interface much more similar to iterators. 104 They do appear to be a wrapper around the "pointer" iterators. 105 106 + https://en.cppreference.com/w/cpp/ranges 92 107 93 108 Rust also has a imperative implementation of a functional style of iterators,
Note: See TracChangeset
for help on using the changeset viewer.