Get rid of 'repeat' experiment
parent
973ed2c7ea
commit
f0ae853bca
|
@ -53,25 +53,14 @@ M: object zero? drop f ;
|
||||||
|
|
||||||
: ceiling ( x -- y ) neg floor neg ; foldable
|
: ceiling ( x -- y ) neg floor neg ; foldable
|
||||||
|
|
||||||
G: repeat 1 standard-combination ; inline
|
: (repeat) ( i n quot -- )
|
||||||
|
pick pick >= [
|
||||||
: (repeat-fixnum) ( i n quot -- )
|
|
||||||
pick pick fixnum>= [
|
|
||||||
3drop
|
3drop
|
||||||
] [
|
] [
|
||||||
[ swap >r call 1 fixnum+fast r> ] keep (repeat-fixnum)
|
[ swap >r call 1+ r> ] keep (repeat)
|
||||||
] if ; inline
|
] if ; inline
|
||||||
|
|
||||||
M: fixnum repeat 0 -rot (repeat-fixnum) ;
|
: repeat 0 -rot (repeat) ; inline
|
||||||
|
|
||||||
: (repeat-bignum) ( i n quot -- )
|
|
||||||
pick pick bignum>= [
|
|
||||||
3drop
|
|
||||||
] [
|
|
||||||
[ swap >r call 1 bignum+ r> ] keep (repeat-bignum)
|
|
||||||
] if ; inline
|
|
||||||
|
|
||||||
M: bignum repeat 0 -rot (repeat-bignum) ;
|
|
||||||
|
|
||||||
: times ( n quot -- | quot: -- )
|
: times ( n quot -- | quot: -- )
|
||||||
swap [ >r dup slip r> ] repeat drop ; inline
|
swap [ >r dup slip r> ] repeat drop ; inline
|
||||||
|
|
Loading…
Reference in New Issue