Add an example showing the "lazy eval" aspects of map() to 'Iterable collections' page #5619
Labels
a.tut.codelab
Relates to codelabs hosted on dart.dev.
dev.code-samples
e1-hours
Can complete in < 8 hours of normal, not dedicated, work
fix.examples
Adds or changes example
from.page-issue
Reported in a reader-filed concern
p.iterables
p2-medium
Necessary but not urgent concern. Resolve when possible.
Page URL
https://dart.dev/codelabs/iterables/
Page source
https://github.com/dart-lang/site-www/tree/main/./src/content/codelabs/iterables.md
Describe the problem
At mapping, we read:
Suggesting to add an example showing the "on-demand" aspect of this evaluation, in particular that even previously computed mappings may be recomputed (unless the implementation cacches them). Attention needs to paid to immutability of the mapped structure.
Expected fix
Example code:
Result:
Additional context
No response
I would like to fix this problem.
The text was updated successfully, but these errors were encountered: