The Department of Computer Science & Engineering |
ERRATA
> (+ 12 4) 16to
> (+ 12 4) 16
(defun bstreep (tree) "A bstree is either an element, or a three-member 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 three-member 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 scalar-add1 (vector) "VECTOR is a list of numbers. Returns a list just like it, except that each number in it is incremented by 1." (check-type vector list) (typecase vector (null '()) (cons (cons (1+ (first vector)) (scalar-add1 (rest vector))))))to
(defun scalar-add1 (vector) "VECTOR is a list of numbers. Returns a list just like it, except that each number in it is incremented by 1." (check-type vector list) (typecase vector (null '()) (cons (cons (1+ (first vector)) (scalar-add1 (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 enclose-expression (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." (check-type expr list) (cond ((< (length expr) 3) expr) (t (combine-expr (second expr) (first expr) (enclose-expression (nthcdr 2 expr))))))to
17.34 (defun enclose-expression (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." (check-type expr list) (cond ((< (length expr) 3) expr) (t (enclose-expression (combine-expr (second expr) (first expr) (nthcdr 2 expr))))))
(defun lhs (rule) "Returns the right-hand side of the RULE." (check-type rule rule) (first rule))to
(defun lhs (rule) "Returns the left-hand side of the RULE." (check-type 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." (check-type subs list) (cond ((atom pat) (if (and (variablep pat) (boundp pat subs)) (bound-to pat subs) pat)) ((and (svariablep (first pat)) (boundp (first pat) subs)) (append (bound-to (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. (check-type pat (not (satisfies svariablep))) (check-type subs list) (cond ((atom pat) (if (and (variablep pat) (boundp pat subs)) (bound-to pat subs) pat)) ((and (svariablep (first pat)) (boundp (first pat) subs)) (append (bound-to (first pat) subs) (substitute (rest pat) subs))) (t (cons (substitute (first pat) subs) (substitute (rest pat) subs)))))
33.5 (defmethod < ((x t) (y t)) (check-type x (or character number symbol string)) (check-type x (or character number symbol string)) (member (type-of y) (member (type-of x) '(character number symbol string))))to
33.5 (defmethod < ((x t) (y t)) (check-type x (or character number symbol string)) (check-type x (or character number symbol string)) (member (gentype-of y) (member (gentype-of x) '(character number symbol string)))) (defun gentype-of (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 | |
---|