- [Function]
(
next
pattern [length])
Returns one or more elements from pattern according to length. If length is unspecified or false then just the next element from pattern is returned. If length is a number then that many elements are read from the pattern and returned in a list. Otherwise if length is true then the next period's worth data is read from the pattern.
(define p (new cycle :of '(a b c d) )) (next p) ⇒ a (next p) ⇒ b (next p 6) ⇒ (c d a b c d) (next p #t) ⇒ (a b c d)
See Also:
- eod? [Function]
- eop? [Function]
- map-pattern-data [Function]
- pattern-state [Function]
- pattern-value [Function]
- pattern? [Function]