;ELC ;;; compiled by cthomp@willow on Thu Aug 12 00:45:11 1993 ;;; from file /era/era-0.80/editor/lisp/pcl-cvs/dll.el ;;; emacs version 19.8 (beta8) Lucid. ;;; bytecomp version 2.15; 14-jul-93. ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "This file was compiled for Emacs 19.")) (byte-code "!!MMM" [require elib-node provide dll dll-get-dummy-node #[(dll) "A" [dll] 1] dll-list-nodes #[(dll) " !H = BHn +" [nil result dll-get-dummy-node dll dummy 0 node] 3] dll-set-from-node-list #[(dll list) " ! ! @ I @I @ Ak I I*" [dll-clear dll dll-get-dummy-node dummy left list 0 1] 4]] 2) (fset 'dll-element '(macro . #[(dll node) " D" [elib-node-data node] 2 "\ Get the element of a NODE in a doubly linked list DLL. Args: DLL NODE."])) (fset 'dll-create #[nil "#\nI\n\nI\n)B" [vector nil dummy-node 1 0 DL-LIST] 5 "\ Create an empty doubly linked list."]) (fset 'dll-p #[(object) "=" [object DL-LIST] 2 "\ Return t if OBJECT is a doubly linked list, otherwise return nil."]) (fset 'dll-enter-first #[(dll element) " ! #" [dll-enter-after dll dll-get-dummy-node element] 4 "\ Add an element first on a doubly linked list. Args: DLL ELEMENT."]) (fset 'dll-enter-last #[(dll element) " ! #" [dll-enter-before dll dll-get-dummy-node element] 4 "\ Add an element last on a doubly linked list. Args: DLL ELEMENT."]) (fset 'dll-enter-after #[(dll node element) " H # H I I)" [vector node 1 element new-node 0] 4 "\ In the doubly linked list DLL, insert a node containing ELEMENT after NODE. Args: DLL NODE ELEMENT."]) (fset 'dll-enter-before #[(dll node element) " H # H I I)" [vector node 0 element new-node 1] 4 "\ In the doubly linked list DLL, insert a node containing ELEMENT before NODE. Args: DLL NODE ELEMENT."]) (fset 'dll-next #[(dll node) "H !=?H" [node 1 dll-get-dummy-node dll] 3 "\ Return the node after NODE, or nil if NODE is the last node. Args: DLL NODE."]) (fset 'dll-previous #[(dll node) "H !=?H" [node 0 dll-get-dummy-node dll] 3 "\ Return the node before NODE, or nil if NODE is the first node. Args: DLL NODE."]) (fset 'dll-delete #[(dll node) "HHIHHIH" [node 0 1 2] 4 "\ Delete NODE from the doubly linked list DLL. Args: DLL NODE. Return the element of node."]) (fset 'dll-delete-first #[(dll) " !H\"" [dll-delete dll dll-get-dummy-node 1] 4 "\ Delete the first NODE from the doubly linked list DLL. Return the element. Args: DLL. Returns nil if the DLL was empty."]) (fset 'dll-delete-last #[(dll) " !H\"" [dll-delete dll dll-get-dummy-node 0] 4 "\ Delete the last NODE from the doubly linked list DLL. Return the element. Args: DLL. Returns nil if the DLL was empty."]) (fset 'dll-first #[(dll) " !H !=? !HH" [dll-get-dummy-node dll 1 2] 3 "\ Return the first element on the doubly linked list DLL. Return nil if the list is empty. The element is not removed."]) (fset 'dll-last #[(dll) " !H !=? !HH" [dll-get-dummy-node dll 0 2] 3 "\ Return the last element on the doubly linked list DLL. Return nil if the list is empty. The element is not removed."]) (fset 'dll-nth #[(dll n) " ! WĪ\nH W Z\n= VH Si\n=?+" [dll-get-dummy-node dll dummy n 0 1 branch node -1] 2 "\ Return the Nth node from the doubly linked list DLL. Args: DLL N N counts from zero. If DLL is not that long, nil is returned. If N is negative, return the -(N+1)th last element. Thus, (dll-nth dll 0) returns the first node, and (dll-nth dll -1) returns the last node."]) (fset 'dll-empty #[(dll) " !H !=" [dll-get-dummy-node dll 0] 3 "\ Return t if the doubly linked list DLL is empty, nil otherwise"]) (fset 'dll-length #[(dll) " !H \n= HTp+" [dll-get-dummy-node dll dummy 1 node 0 n] 3 "\ Returns the number of elements in the doubly linked list DLL."]) (fset 'dll-copy #[(dll &optional element-copy-fnc) " \n\"  H!\"\n \"l H\"\n \"q *" [dll-create dll-nth dll 0 node result element-copy-fnc dll-enter-last 2 dll-next] 6 "\ Return a copy of the doubly linked list DLL. If optional second argument ELEMENT-COPY-FNC is non-nil it should be a function that takes one argument, an element, and returns a copy of it. If ELEMENT-COPY-FNC is not given the elements are not copied."]) (fset 'dll-all #[(dll) " !H =H BHl +" [nil result dll-get-dummy-node dll dummy 0 node 2] 3 "\ Return all elements on the double linked list DLL as an ordinary list."]) (fset 'dll-clear #[(dll) " ! !I ! !I" [dll-get-dummy-node dll 0 1] 4 "\ Clear the doubly linked list DLL, i.e. make it completely empty."]) (fset 'dll-map #[(map-function dll) " !H\n=? H! Hn*" [dll-get-dummy-node dll dummy 1 node map-function 2] 4 "\ Apply MAP-FUNCTION to all elements in the doubly linked list DLL. The function is applied to the first element first."]) (fset 'dll-map-reverse #[(map-function dll) " !H\n=? H! Hn*" [dll-get-dummy-node dll dummy 0 node map-function 2] 4 "\ Apply MAP-FUNCTION to all elements in the doubly linked list DLL. The function is applied to the last element first."]) (fset 'dll-create-from-list #[(list) " \n \n@\"\nAt )" [dll-create dll list dll-enter-last] 4 "\ Given an elisp LIST create a doubly linked list with the same elements."]) (fset 'dll-sort #[(dll predicate) " !\"\" " [dll-set-from-node-list dll sort dll-list-nodes #[(x1 x2) " H H\"" [predicate x1 2 x2] 4]] 5 "\ Sort the doubly linked list DLL, stably, comparing elements using PREDICATE. Returns the sorted list. DLL is modified by side effects. PREDICATE is called with two elements of DLL, and should return T if the first element is \"less\" than the second."]) (fset 'dll-filter #[(dll predicate) " !H \n=? H H! \"c+" [dll-get-dummy-node dll dummy 1 node nil next predicate 2 dll-delete] 4 "\ Remove all elements in the doubly linked list DLL for which PREDICATE returns nil."])