Handbook
Glossary
(circular-while) ( ... iterator quot: ( ... obj -- ... ? ) -- ... )
Vocabulary
circular
.
private
Inputs
iterator
an
object
quot
a
quotation
with stack effect
( ... obj -- ... ? )
Outputs
None
Definition
USING:
accessors
kernel
math
sequences
;
IN:
circular.private
:
(circular-while)
( ... iterator quot: ( ... obj -- ... ? ) -- ... )
[
[
[
n>>
]
[
circular>>
]
bi
nth
]
dip
call
]
2keep
rot
[
[
dup
n>>
>>last-start
]
dip
]
when
over
[
n>>
]
[
[
last-start>>
]
[
circular>>
length
]
bi
+
]
bi
=
[
2drop
]
[
[
[
1
+
]
change-n
]
dip
(circular-while)
]
if
;
inline
recursive