Paste: rpn calculator

Author: mnestic
Mode: factor
Date: Tue, 13 Jan 2009 22:43:44
Plain Text |
! http://www.reddit.com/r/programming/comments/7pg5b/an_rpn_calculator_in_46_languages_and_growing/c070ns9

USING: continuations eval io kernel prettyprint sequences ;
IN: rpn
: rpn ( -- )
    [
        readln "USE: math " prepend
        [ eval ] [ "Please enter a valid expression." ] recover
        pprint nl t
    ] loop ;

MAIN: rpn

Annotation: fep

Author: mnestic
Mode: factor
Date: Wed, 14 Jan 2009 06:03:56
Plain Text |
! deploy using the following, then in the console do C{ 0 1 }
! to fep.  C{ 1 0 } is fine.  C{ 0 1 } is fine in the UI.

USING: tools.deploy.config ;
H{
    { deploy-threads? f }
    { deploy-math? t }
    { deploy-name "rpn" }
    { deploy-c-types? f }
    { deploy-word-props? f }
    { deploy-io 2 }
    { deploy-ui? f }
    { "stop-after-last-window?" t }
    { deploy-word-defs? f }
    { deploy-compiler? t }
    { deploy-reflection 6 }
}

New Annotation

Summary:
Author:
Mode:
Body: