Difference between revisions of "Higher Order Range Pattern"
(Created page with "From David Simcha's [http://www.youtube.com/watch?feature=player_detailpage&v=yMNMV9JlkcQ#t=769 D-Specific Design Patterns] talk at DConf 2013.") |
|||
Line 1: | Line 1: | ||
From David Simcha's [http://www.youtube.com/watch?feature=player_detailpage&v=yMNMV9JlkcQ#t=769 D-Specific Design Patterns] talk at DConf 2013. | From David Simcha's [http://www.youtube.com/watch?feature=player_detailpage&v=yMNMV9JlkcQ#t=769 D-Specific Design Patterns] talk at DConf 2013. | ||
+ | |||
+ | == Problem: Need to transform a range before passing to a function/object == | ||
+ | Want: | ||
+ | * O(1) auxiliary memory usage | ||
+ | * O(1) preprocessing time | ||
+ | * Minimal wasted effort if only part of the range is consumed. | ||
+ | |||
+ | == Solution: Process the range lazily == |
Revision as of 06:53, 1 March 2014
From David Simcha's D-Specific Design Patterns talk at DConf 2013.
Problem: Need to transform a range before passing to a function/object
Want:
- O(1) auxiliary memory usage
- O(1) preprocessing time
- Minimal wasted effort if only part of the range is consumed.