The Department of Computer Science & Engineering 
ERRATA
> (+ 12 4) 16to
> (+ 12 4) 16
(defun bstreep (tree) "A bstree is either an element, or a threemember list, the first of which is an element." (or (typep tree 'util:element) (and (listp tree) (= (length tree) 3) (typep (first tree) 'util:element))))to
(defun bstreep (tree) "A bstree is either an element, or a threemember list, the first of which is an element." (or (typep tree 'util:element) (and (listp tree) (= (length tree) 3) (typep (first tree) 'util:element))))
(defun scalaradd1 (vector) "VECTOR is a list of numbers. Returns a list just like it, except that each number in it is incremented by 1." (checktype vector list) (typecase vector (null '()) (cons (cons (1+ (first vector)) (scalaradd1 (rest vector))))))to
(defun scalaradd1 (vector) "VECTOR is a list of numbers. Returns a list just like it, except that each number in it is incremented by 1." (checktype vector list) (typecase vector (null '()) (cons (cons (1+ (first vector)) (scalaradd1 (rest vector))))))
> (defmethod < ((x number) (y number)) (lisp:< x y)) > (< 3 5) T > (< 5 3) NIL #<method (TICLOS:METHOD < (NUMBER NUMBER))>to
> (defmethod < ((x number) (y number)) (lisp:< x y)) #<method (TICLOS:METHOD < (NUMBER NUMBER))> > (< 3 5) T > (< 5 3) NIL
17.34 (defun encloseexpression (expr) "EXPR is a list representing an arithmetic expression (using only the operators + and ) in normal infix notation. Returns a list whose one member is EXPR transformed into Cambridge Prefix Notation." (checktype expr list) (cond ((< (length expr) 3) expr) (t (combineexpr (second expr) (first expr) (encloseexpression (nthcdr 2 expr))))))to
17.34 (defun encloseexpression (expr) "EXPR is a list representing an arithmetic expression (using only the operators + and ) in normal infix notation. Returns a list whose one member is EXPR transformed into Cambridge Prefix Notation." (checktype expr list) (cond ((< (length expr) 3) expr) (t (encloseexpression (combineexpr (second expr) (first expr) (nthcdr 2 expr))))))
(defun lhs (rule) "Returns the righthand side of the RULE." (checktype rule rule) (first rule))to
(defun lhs (rule) "Returns the lefthand side of the RULE." (checktype rule rule) (first rule))
(defun substitute (pat subs) "Returns a tree like PAT, but with every variable that is bound in the substitution SUBS replaced by the term it is bound to." (checktype subs list) (cond ((atom pat) (if (and (variablep pat) (boundp pat subs)) (boundto pat subs) pat)) ((and (svariablep (first pat)) (boundp (first pat) subs)) (append (boundto (first pat) subs) (substitute (rest pat) subs))) (t (cons (substitute (first pat) subs) (substitute (rest pat) subs)))))to
(defun substitute (pat subs) "Returns a tree like PAT, but with every variable that is bound in the substitution SUBS replaced by the term it is bound to." ;; pat cannot be a sequence variable because there might be no ;; environment to splice its value into. (checktype pat (not (satisfies svariablep))) (checktype subs list) (cond ((atom pat) (if (and (variablep pat) (boundp pat subs)) (boundto pat subs) pat)) ((and (svariablep (first pat)) (boundp (first pat) subs)) (append (boundto (first pat) subs) (substitute (rest pat) subs))) (t (cons (substitute (first pat) subs) (substitute (rest pat) subs)))))
33.5 (defmethod < ((x t) (y t)) (checktype x (or character number symbol string)) (checktype x (or character number symbol string)) (member (typeof y) (member (typeof x) '(character number symbol string))))to
33.5 (defmethod < ((x t) (y t)) (checktype x (or character number symbol string)) (checktype x (or character number symbol string)) (member (gentypeof y) (member (gentypeof x) '(character number symbol string)))) (defun gentypeof (o) "Returns the general type of the object O." (typecase o (character 'character) (number 'number) (symbol 'symbol) (string 'string)))
(let* ( {symbol  (symbol form)}*)
[(declare (special variables))]
forms)
to the variables is done in order so that one variable may be used
in the initialization form of a later variable.
to
(let* ( {symbol  (symbol form)}*)
[(declare (special variables))]
forms)
Exactly like let except that the assigning of initial values to the
variables is done in order so that one variable may be used in the
initialization form of a later variable.
(ed [symbol])
Invokes the editor. If symbol is included, tries to let you edit
the function named symbol, which might involve loading the file
where it is defined into the editor. This function might not be
implemented.
Stuart C. Shapiro <shapiro@cse.buffalo.edu>

UNIVERSITY AT BUFFALO  SHAPIRO'S COMMON LISP  PUBLISHER'S COMMON LISP  COMPUTER SCIENCE PRESS  W. H. FREEMAN  
