Source

pcl-cvs / test-dll.el

Full commit
(require 'dll)


(prog1 nil (setq a (dll-create-from-list '(one two three four))))

(dll-first a)
a
(dll-element dll (dll-nth a 0))
(dll-element dll (dll-nth a 1))
(dll-element dll (dll-nth a 2))
(dll-element dll (dll-nth a 3))
(dll-nth a 4)
(dll-nth a 5)
(dll-element dll (dll-nth a -1))
(dll-element dll (dll-nth a -2))
(dll-element dll (dll-nth a -3))
(dll-element dll (dll-nth a -4))
a
(dll-nth a 0)
(dll-nth a 1)
(dll-nth a 2)
(dll-nth a 3)
(dll-nth a 4)
(dll-nth a -1)
(dll-nth a -2)
(dll-nth a -3)
(dll-nth a -4)
(dll-nth a -5)

(dll-nth a -6)

(dll-map 'princ a)

(prog1 nil (setq b (dll-create)))

(dll-length a)
(dll-length b)

(dll-p a)
(dll-p (current-buffer))

(prog1 nil (dll-enter-first b 'foo))
(prog1 nil (dll-enter-first b 'bar))
(dll-map 'princ b)
(prog1 nil (dll-enter-last b 'tail))
(dll-first b)
(dll-last b)
(prog1 nil (setq c (dll-nth b -1)))
(prog1 nil (dll-enter-before b c 'ST))
(prog1 nil (setq c (dll-next b c)))
(prog1 nil (setq c (dll-previous b c)))
(dll-element dll c)
(prog1 nil (dll-delete b c))
(dll-empty b)
(dll-empty (dll-create))
(prog1 nil (setq e (dll-copy b)))
(eq e b)
(prog1 nil (setq e (dll-create-from-list '(18 45 8954 6542 237 236))))
(dll-map-reverse (function (lambda (foo) (princ foo) (terpri))) e)
(dll-map (function (lambda (foo) (princ foo) (terpri))) e)
(prog1 nil (dll-sort e '<))
(dll-all e)
(prog1 nil (dll-filter e (function (lambda (foo)
				     (= (* 2 (/ foo 2)) foo)))))