Paste: fibonacci closure

Author: mk
Mode: factor
Date: Thu, 16 Sep 2010 13:55:45
Plain Text |
USING: kernel locals math namespaces ;
IN: myclos

: fibo ( -- quot )
    [let
        0 :> a!
        1 :> b!
        [
            b dup a +
            b! a!
            b
        ]
    ] ;

Annotation: fixed USING:

Author: mk
Mode: factor
Date: Thu, 16 Sep 2010 14:25:04
Plain Text |
USING: kernel locals math ;
IN: myclos

: fibo ( -- quot )
    [let
        0 :> a!
        1 :> b!
        [
            b dup a +
            b! a!
            b
        ]
    ] ;

New Annotation

Summary:
Author:
Mode:
Body: