--- I replaced uses of "keep" by "bi" in those two files. I cannot tell whether I prefer the one or the other, as using "bi" with quotations returning more than one value on the stack may seem strange, but I'm getting slowly used to it.
Feel free to "git am" if you wish, this message should be in the right format. extra/math/primes/primes.factor | 8 ++++---- extra/project-euler/169/169.factor | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extra/math/primes/primes.factor b/extra/math/primes/primes.factor index 685124e..1c14715 100644 --- a/extra/math/primes/primes.factor +++ b/extra/math/primes/primes.factor @@ -13,7 +13,7 @@ PRIVATE> : next-prime ( n -- p ) dup 999983 < [ - primes-under-million [ [ <=> ] binsearch 1+ ] keep nth + primes-under-million [ [ <=> ] binsearch 1+ ] [ nth ] bi ] [ next-odd find-prime-miller-rabin ] if ; foldable @@ -37,7 +37,7 @@ PRIVATE> { { [ dup 2 < ] [ drop { } ] } { [ dup 1000003 < ] - [ primes-under-million [ [ <=> ] binsearch 1+ 0 swap ] keep <slice> ] } + [ primes-under-million [ [ <=> ] binsearch 1+ 0 swap ] [ <slice> ] bi ] } { [ t ] [ primes-under-million 1000003 lprimes-from rot [ <= ] curry lwhile list>array append ] } @@ -45,7 +45,7 @@ PRIVATE> : primes-between ( low high -- seq ) primes-upto - >r 1- next-prime r> - [ [ <=> ] binsearch ] keep [ length ] keep <slice> ; foldable + [ 1- next-prime ] dip + [ [ <=> ] binsearch ] [ length ] [ <slice> ] tri ; foldable : coprime? ( a b -- ? ) gcd nip 1 = ; foldable diff --git a/extra/project-euler/169/169.factor b/extra/project-euler/169/169.factor index 61645bf..d699af3 100644 --- a/extra/project-euler/169/169.factor +++ b/extra/project-euler/169/169.factor @@ -30,7 +30,7 @@ MEMO: fn ( n -- x ) { { [ dup 2 < ] [ drop 1 ] } { [ dup odd? ] [ 2/ fn ] } - { [ t ] [ 2/ [ fn ] keep 1- fn + ] } + { [ t ] [ 2/ [ fn ] [ 1- fn ] bi + ] } } cond ; : euler169 ( -- result ) -- 1.5.5.rc2.155.gb0a67 ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk