unix% stk-simply Welcome to the STk interpreter version 4.0.1-ucb1.16 [Darwin-7.2.0-ppc] Copyright (c) 1993-1999 Erick Gallesio - I3S - CNRS / ESSI Modifications by UCB EECS Instructional Support Group Questions, comments, or bug reports to . STk> (+ 1 (if #f 2 3)) 4 STk> (cond ( #f ghghgh) ( #t 'hi)) hi STk> pi *** Error: unbound variable: pi Current eval stack: __________________ 0 pi STk> (define pi 3.14159) pi STk> pi 3.14159 STk> (+ pi 10) 13.14159 STk> (* pi 10) 31.4159 STk> (define (fav-pie pi) (se 'i 'like pi)) fav-pie STk> (fav-pie 'cherry) (i like cherry) STk> (define (square x) (* x x)) square STk> (square 10) 100 STk> x *** Error: unbound variable: x Current eval stack: __________________ 0 x STk> word #[closure arglist=x 265200] STk> (define (smush s word) (se s word)) smush STk> (smush '(hi there) 'dan) (hi there dan) STk> word #[closure arglist=x 265200] STk> (define *pi* 3.14159) *pi* STk> (let ( (a (+ 1 1) ) (b 3) ) (+ a b)) 5 STk> a *** Error: unbound variable: a Current eval stack: __________________ 0 a STk> (let ((bff '(sally jane sue johansen))) (se 'I 'love bff 'oh bff 'is 'great)) (i love sally jane sue johansen oh sally jane sue johansen is great) STk> (+ 1 (define *e* 2.718)) *** Error: +: not a number: *e* Current eval stack: __________________ 0 (apply fn (map maybe-num args)) STk> (random 10) 8 STk> (random 10) 1 STk> (define (sie) (if (even? (random 10)) (* (random 10) (random 10)) (random 10))) sie STk> (sie) 48 STk> (define (sie2) (let ((r (random 10))) (if (even? r) (* r r) r))) sie2 STk> (sie2) 0 STk> (sie2) 64 STk> (sie2) 64 STk> (sie2) 5