[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*To*: bug-lisp at MIT-MC*From*: Rod Brooks <ROD at SU-AI>*Date*: Mon, 8 Dec 80 07:09:00 GMT*Original-date*: 07 Dec 1980 2309-PST

SUBST definition changed? This happens at SAIL and MC: (setq x '(a b)) (A B) (setq y '(a b)) (A B) (eq x y) NIL (subst 'foo x (list y y y)) (FOO FOO FOO) Whereas the online definition (at SAIL) for SUBST is: (subst x y z) substitutes x for all occurrences of y in z, and returns the modified copy of z. The original z is unchanged, as subst recursively copies all of z replacing elements eq to y as it goes. If x and y are nil, z is just copied, which is a convenient way to copy arbitrary list structure. ... subst could have been defined by: (defun subst (x y z) (cond ((eq z y) x) ;if item eq to y, replace. ((atom z) z) ;if no substructure, return arg. ((cons (subst x y (car z)) ;otherwise recurse. (subst x y (cdr z)))))) Is this change "official" or accidental (i.e. will it stay this way, or might it change back)?

- Prev by Date:
**YES-OR-NO-P** - Next by Date:
**PURCOPY and DEFVST's** - Previous by thread:
**YES-OR-NO-P** - Next by thread:
**PURCOPY and DEFVST's** - Index(es):