loop1 ( ..a quot: ( ..a -- ..a obj ? ) -- ..a obj )


Vocabulary
combinators.extras

Inputs
quota quotation with stack effect ( ..a -- ..a obj ? )


Outputs
objan object


Word description
Similar to loop. Calls the the quotation repeatedly until it outputs f. While it does so, discards obj. When the loop finishes, leavesobjon the stack.

Definition


: loop1 ( ..a quot: ( ..a -- ..a obj ? ) -- ..a obj )
[ call ] keep [ [ drop ] ] dip [ loop1 ] curry compose when
; inline recursive