Grabbing a subset of a range if a particular value is found?

Gary Willoughby dev at nomad.so
Tue Sep 24 13:48:41 PDT 2013


I'm using std.range.recurrence to generate a range but i want to 
stop it generating and grab the range when a particular value is 
added. e.g.:

     recurrence!("a[n-1] + a[n-2]")(1, 2)
     .take(10)
     .writeln;

This writes ten numbers to the command line which is fair enough 
but what would be the preferred method to keep building the range 
until an element calculated is above a particular value.


More information about the Digitalmars-d-learn mailing list