I completely agree with this. Personally, I think that something along the lines of Haskell-style lazy lists fits best with WL’s paradigms. In the past I did an exercise to try an implement this from scratch , though I’m aware that similar functionalities are already hidden in the language. The advantage of lazy lists is that you can capture the stateful part of the iteration in the held tail of the list explicitly. So you can have a function that extracts a few elements from the lazy list and then also returns the tail to allow further extraction of elements.
sjoerds
(Sjoerd Smit)
2
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Simple computation runs out of memory | 9 | 12323 | June 4, 2022 | |
| How to find combinations of letters? | 2 | 11912 | November 16, 2014 | |
| Is there a function for combinatorial optimization in Wolfram Language? | 0 | 2624 | April 19, 2023 | |
| Permutations, one at a time? | 4 | 9225 | May 5, 2014 | |
| Get the final iterated values for the given equation? | 0 | 3369 | May 26, 2020 |