summaryrefslogtreecommitdiffstats
path: root/samples/recursion.sample
blob: 7dc833bbbc91778b4a7d78c8df72c06cc6c666d1 (plain)
1
2
3
4
5
6
7
define factorial
--  Integer -> Integer
    dup 0 eq? not
        [ dup 1 - factorial * ]
        [ drop 1 ] cond ;

5 factorial .