Here are some programs written in the Joe language. WARNING: I don't have a JOE interpreter, so I've never run these. I think they're correct, but if not, please let me know. You would run any of these using (interp (parse ') (mtSub)) [You could even define a Scheme function (define (run expr) (interp (parse expr) (mtSub))) and then you could just type (run '{+ 3 4}) ] {with {x 2} {with {y 12} {+ {* x x} {* y y}} }} {- 1 {- 2 {- 3 {- 4 {- 5 6}}}}} {with {x 3} ;; this should evaluate to a boolean value {= x 2}} {with {x 3} {= x 3}} {if {= {* 5 21} {* 7 15}} 9999 5555 } {with {x 9} ; you can change these vals, but the larger one should {with {y 3} ; always wind up at the left of the final number ; and the smaller one at the right {with {min {if {< x y} x y}} {with {max {if {< x y} y x}} {+ {* max 1000} min} ; output will be best if smaller is }}}} ; no more than two digits {with {double {fun {n} {* 2 n}}} {double 12}} {with {abs {fun {x} {if {< x 0} {- x} x}}} ;; absolute value {abs -101} } {rec {fac {fun {n} ;; basic factorial function {if {< n 2} 1 {* n {fac {- n 1}}} }} } {fac 7}} {with {sqrt {fun {n} ;; integer square root {with {new-guess {fun {g} {/ {+ g {/ n g}} 2}}} {rec {root-of-n {fun {s} ;; compute square root of (non-local) n {if {< n {* s s}} ;; if s is too big, get a new guess {root-of-n {new-guess s}} {if {with {s1 {+ s 1}} {< {* s1 s1} n}} ;; if s is too small, {root-of-n {new-guess s}} ;; get a new guess s} ;; otherwise, s is our answer }}} {root-of-n {/ n 2}} ;; use half of n as initial guess } }}} {sqrt 123} ;; so, try out our sqrt function }