We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5c23d5 commit 966fe92Copy full SHA for 966fe92
tests/clos.lisp
@@ -124,6 +124,27 @@
124
125
126
;;; test change-class rotatef psetf
127
+
128
+;;; rotatef test
129
+#+jscl
130
+(let ((a 1)
131
+ (b 2)
132
+ (c 3)
133
+ (d #(1 2 3)))
134
+ (!rotatef a b c)
135
+ (test (equal '(2 3 1) (list a b c)))
136
137
+ (test (equal '(3 1 2) (list a b c)))
138
+ (!rotatef (aref d 0) (aref d 2))
139
+ (test (equal '(3 2 1) (jscl::vector-to-list d))))
140
141
+(let* ((a '(1 2))
142
+ (b '(3 4))
143
+ (c '(a b))
144
+ (d (list a b c)))
145
+ (!rotatef (nth 0 d) (nth 2 d))
146
+ (test (equal '((a b) (3 4) (1 2)) d)))
147
148
(defclass rectangle ()
149
((height :initform 0.0 :initarg :height)
150
(width :initform 0.0 :initarg :width)))
0 commit comments