subst


(subst newItem oldItem list)

This function replaces all occurrences of oldItem in input list with newItem, and returns the modified list.

Arguments

newItem  any Lisp atom or list
oldItem  any Lisp atom or list
list  any Lisp list

Return

the list with all replaced items (or the original list, if oldItem is not present)

Example

(setq lst (list 0 1 2 3 -99 5 6 -99))
(subst 0 -99 lst)
returns (0 1 2 3 0 5 6 0)

Remarks




©  Bricsys NV. All rights reserved.