Paste: unidiomatic fact-iter

Author: luis
Mode: factor
Date: Sat, 29 Aug 2009 01:25:44
Plain Text |
:: (fact-iter) ( p i n -- n! )
    i n > [ p ] [ i p * i 1 + n (fact-iter) ] if ;

:: fact-iter ( n -- n! )
    1 1 n (fact-iter) ;

Annotation: with combinators

Author: alec
Mode: factor
Date: Sat, 29 Aug 2009 01:40:18
Plain Text |
: (fact-iter) ( p i n -- n! ) 2dup > [ 2drop ] [ [ dup 1 + [ * ] dip ] dip (fact-iter) ] if ;

New Annotation

Summary:
Author:
Mode:
Body: