[neptune.cs.kent.edu]{1}-> gcl GCL (GNU Common Lisp) 2.6.5 ANSI Oct 7 2004 11:43:51 Source License: LGPL(gcl,gmp), GPL(unexec,bfd) Binary License: GPL due to GPL'ed components: (READLINE BFD UNEXEC) Modifications of this banner must retain notice of a compatible license Dedicated to the memory of W. Schelter Use (help) to get some basic information on how to use GCL. >3 3 >3.14 3.1400000000000001 >'ken and tom KEN > Error in EVAL [or a callee]: The variable AND is unbound. Fast links are on: do (use-fast-links nil) for debugging Broken at EVAL. Type :H for Help. 1 (Abort) Return to top level. dbl:>> Error in EVALHOOK [or a callee]: The variable TOM is unbound. Fast links are on: do (use-fast-links nil) for debugging Broken at EVALHOOK. 1 (Abort) Return to debug level 1. 2 Return to top level. dbl:>>>1 Broken at EVAL. dbl:>>1 Top level. >'(ken and tom) (KEN AND TOM) >(car '(ken and tom)) KEN >(cdr '(ken and tom)) (AND TOM) >(= 3 2) NIL >(= 3 3) T >(>= 4 5) NIL >(if (> 4 3) 4 3) 4 >(defun max (a b) (if (> a b) a b) ) Warning: MAX is being redefined. MAX >(max 17 12) 17 >(max 17 20) 20 >(max 17 17) 17 >(defun square (x) (* x x)) SQUARE >(square 4) 16 >(square 10) 100 >(trace square) (SQUARE) >(square 4) 1> (SQUARE 4) <1 (SQUARE 16) 16 >(defun sum (low sum) (if (> low high) 0 (+ low (sum (+ low 1) high)))) SUM >(sum 1 3) Error in IF [or a callee]: The variable HIGH is unbound. Fast links are on: do (use-fast-links nil) for debugging Broken at >. Type :H for Help. 1 (Abort) Return to top level. dbl:>>1 Top level. >(defun sum (low high) (if (> low high) 0 (+ low (sum (+ low 1) high)))) SUM >(sum 1 3) 6 >(trace sum) (SUM) >(sum 1 3) 1> (SUM 1 3) 2> (SUM 2 3) 3> (SUM 3 3) 4> (SUM 4 3) <4 (SUM 0) <3 (SUM 3) <2 (SUM 5) <1 (SUM 6) 6 >(bye)