2 ;;; $Id: tl-list.el,v 0.3 1994/07/16 04:08:52 morioka Exp morioka $
10 (defun put-alist (item value alist)
11 "\t(put-alist <ITEM> <VALUE> <ALIST>)\n
12 If there is a pair whose car is <ITEM>, replace its cdr by <VALUE>.
13 If there is not such pair, create new pair (<ITEM> . <VALUE>) and
14 return new alist whose car is the new pair and cdr is <ALIST>.
15 [mol's ELIS emulating function]"
16 (if (assoc item alist)
18 (rplacd (assoc item alist) value)
20 (cons (cons item value) alist)
23 (defun del-alist (item alist)
24 "\t(del-alist <ITEM> <ALIST>)\n
25 If there is a pair whose key is <ITEM>, delete it from <ALIST>.
26 [mol's ELIS emulating function]"
27 (if (equal item (car (car alist)))
34 (if (equal item (car (car r)))
47 (defun fetch-field (key alist)
50 (fset 'put-field 'put-alist)
51 (fset 'delete-field 'del-alist)