2
;;;; Author: Paul Dietz
3
;;;; Created: Sat Mar 28 07:37:21 1998
4
;;;; Contains: Testing of CL Features related to "CONS", part 10
8
(compile-and-load "cons-aux.lsp")
15
(last (copy-tree '(a b)))
19
(last (copy-tree '(a b . c)))
23
(last (copy-tree '(a b c d)) 0)
27
(last (copy-tree '(a b c d)) 1)
31
(last (copy-tree '(a b c d)) 2)
35
(last (copy-tree '(a b c d)) 5)
52
(eqt (last x (1+ most-positive-fixnum)) x))
56
(let ((x '(a b c . d)))
57
(eqt (last x (1+ most-positive-fixnum)) x))
61
(let ((x '(a b c . d)))
62
(eqt (last x most-positive-fixnum) x))
66
(let ((x '(a b c . d)))
67
(eqt (last x (1- most-positive-fixnum)) x))
73
(last (progn (setf x (incf i)) (list 'a 'b 'c 'd))
80
(values (last (progn (incf i) (list 'a 'b 'c 'd))) i))
84
(signals-error (last (list 'a 'b 'c) -1) type-error)
88
(signals-error (last (list 'a 'b 'c) 'a) type-error)
92
(signals-error (last (list 'a 'b 'c) 10.0) type-error)
96
(signals-error (last (list 'a 'b 'c) -10.0) type-error)
100
(signals-error (last (list 'a 'b 'c) #\w) type-error)
103
(deftest last.error.6
104
(signals-error (last) program-error)
107
(deftest last.error.7
108
(signals-error (last '(a b c) 2 nil) program-error)
111
(deftest last.error.8
112
(signals-error (locally (last (list 'a 'b 'c) 'a) t)