chickadee » srfi-196 » range-take-right

range-take-right range countprocedure

Returns a range which contains the first/last count elements of range. These procedures run in O(1) time. The average accessing time of the resulting ranges is asymptotically bounded by the average accessing time of range.

Examples:

(range->list (range-take (numeric-range 0 10) 5))
  ⇒ (0 1 2 3 4)

(range->list (range-take-right (numeric-range 0 10) 5))
  ⇒ (5 6 7 8 9)