Paste: factorial

Author: osa1
Mode: factor
Date: Fri, 14 Sep 2012 15:47:33
Plain Text |
USING: kernel prettyprint math ;

IN: fac

: fac ( x -- y )
    dup 1 =
    [ drop 1 ]
    [ dup 1 - fac * ]
    if ;

10 fac

Annotation: up

Author: osa1
Mode: factor
Date: Fri, 14 Sep 2012 15:56:44
Plain Text |
➜  ~  cat fac.factor
USING: kernel prettyprint math ;

IN: fac


: fac ( x -- y )
    dup 1 =
    [ drop 1 ]
    [ dup 1 - fac * ]
    if ;

10 fac
➜  ~  factor fac.factor
Quotation's stack effect does not match call site
quot   [ 10 fac ]
effect (( -- ))

New Annotation

Summary:
Author:
Mode:
Body: