X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=tl-list.el;h=4c2a538693fa5d354675231d44ca72b79c7ef1e8;hb=b0328c066861ec36c6122f9331461175bda8b745;hp=9bb08b19e29c6479640bdfb0e7cfeefbb7990779;hpb=7ea8c7377706103d8f9afc39e3f29e5454ef6404;p=elisp%2Ftm.git diff --git a/tl-list.el b/tl-list.el index 9bb08b1..4c2a538 100644 --- a/tl-list.el +++ b/tl-list.el @@ -1,5 +1,5 @@ ;;; -;;; $Id: tl-list.el,v 2.0 1994/11/08 11:14:20 morioka Exp $ +;;; $Id: tl-list.el,v 2.5 1994/12/27 01:49:41 morioka Exp $ ;;; (provide 'tl-list) @@ -33,6 +33,27 @@ x)))) +(defun nth-prev (n ls) + "Return elements of LS until N - 1 th. [tl-list.el]" + (butlast ls (- (length ls) n)) + ) + +(defun except-nth (n ls) + "Return elements of LS except N th. [tl-list.el]" + (append (nth-prev n ls) (nthcdr (+ 1 n) ls)) + ) + +(defun last-element (ls) + "Return last element. [tl-list.el]" + (car (last ls)) + ) + + +;;; @ set +;;; +(fset 'is-member 'member) + + ;;; @ alist ;;; @@ -79,11 +100,30 @@ return new alist whose car is the new pair and cdr is . ;;; (defun fetch-field (key alist) - (assoc key alist)) + (assoc key alist) + ) + +(defun fetch-field-value (key alist) + (cdr (assoc key alist)) + ) (fset 'put-field 'put-alist) (fset 'delete-field 'del-alist) +(defun put-fields (tp c) + (catch 'tag + (let ((r tp) f ret) + (while r + (setq f (car r)) + (if (not (if (setq ret (fetch-field (car f) c)) + (equal (cdr ret)(cdr f)) + (setq c (cons f c)) + )) + (throw 'tag 'error)) + (setq r (cdr r)) + )) + c)) + ;;; @ field unifier ;;;