Sha256: fb8759dfad26a3eae7fb0d62ed7f32121a70a0e67c5c36e7a57f938295a99768

Contents?: true

Size: 532 Bytes

Versions: 17

Compression:

Stored size: 532 Bytes

Contents

(datatype arith-expr

    X : number;
    ====================
    [num X] : arith-expr; 

    if (element? Op [+ - * /])
    X : arith-expr; Y : arith-expr;
    ===============================
    [X Op Y] : arith-expr;)

(define do-calculation
  {arith-expr --> number}
  [X + Y] -> (+ (do-calculation X) (do-calculation Y))
  [X - Y] -> (- (do-calculation X) (do-calculation Y))
  [X * Y] -> (* (do-calculation X) (do-calculation Y))
  [X / Y] -> (/ (do-calculation X) (do-calculation Y))
  [num X] -> X)



Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
shen-ruby-0.15.1 shen/release/test_programs/calculator.shen
shen-ruby-0.15.0 shen/release/test_programs/calculator.shen
shen-ruby-0.14.0 shen/release/test_programs/calculator.shen
shen-ruby-0.13.0 shen/release/test_programs/calculator.shen
shen-ruby-0.10.0 shen/release/test_programs/calculator.shen
shen-ruby-0.9.0 shen/release/test_programs/calculator.shen
shen-ruby-0.8.1 shen/release/test_programs/calculator.shen
shen-ruby-0.8.0 shen/release/test_programs/calculator.shen
shen-ruby-0.7.0 shen/release/test_programs/calculator.shen
shen-ruby-0.6.0 shen/release/test_programs/calculator.shen
shen-ruby-0.5.0 shen/release/test_programs/calculator.shen
shen-ruby-0.4.1 shen/release/test_programs/calculator.shen
shen-ruby-0.4.0 shen/release/test_programs/calculator.shen
shen-ruby-0.3.1 shen/release/test_programs/calculator.shen
shen-ruby-0.3.0 shen/release/test_programs/calculator.shen
shen-ruby-0.2.0 shen/release/test_programs/calculator.shen
shen-ruby-0.1.0 shen/release/test_programs/calculator.shen