defclass-02.lsp 16.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Fri Apr 25 07:16:57 2003
;;;; Contains: Tests of DEFCLASS with simple inheritance

(in-package :cl-test)

;;;

(defclass class-0201 ()
  ((a :initform 'x) (b :allocation :instance) (c :reader class-0201-c)))

(defclass class-0202 (class-0201)
  (d (e :initform 'y) (f :allocation :instance)))

(deftest class-0201.1
  (let ((c (make-instance 'class-0201)))
    (values (map-slot-boundp* c '(a b c))
sds's avatar
sds committed
19 20 21 22 23 24 25
            (map-slot-exists-p* c '(a b c))
            (slot-value c 'a)
            (map-typep* c (list 'class-0201 'class-0202
                                (find-class 'class-0201)
                                (find-class 'class-0202)))
            (class-name (class-of c))
            ))
26 27 28 29 30 31 32 33 34
  (t nil nil)
  (t t t)
  x
  (t nil t nil)
  class-0201)

(deftest class-0202.1
  (let ((c (make-instance 'class-0202)))
    (values (map-slot-boundp* c '(a b c d e f))
sds's avatar
sds committed
35 36 37 38 39 40
            (map-slot-value c '(a e))
            (map-typep* c (list 'class-0201 'class-0202
                                (find-class 'class-0201)
                                (find-class 'class-0202)))
            (class-name (class-of c))
            ))
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
  (t nil nil nil t nil)
  (x y)
  (t t t t)
  class-0202)

;;;


(defclass class-0203 ()
  ((a :allocation :class) (b :allocation :instance)))

(defclass class-0204 (class-0203)
  (c d))

(deftest class-0203.1
  (let ((c1 (make-instance 'class-0203))
sds's avatar
sds committed
57
        (c2 (make-instance 'class-0204)))
58 59 60 61 62 63 64 65
    (values
     (map-slot-boundp* c1 '(a b))
     (map-slot-boundp* c2 '(a b c d))
     (setf (slot-value c1 'a) 'x)
     (map-slot-boundp* c1 '(a b))
     (map-slot-boundp* c2 '(a b c d))
     (slot-value c1 'a)
     (slot-value c2 'a)
66
     (eqt (slot-makunbound c1 'a) c1)
67 68 69 70 71 72 73 74 75 76 77 78
     (map-slot-boundp* c1 '(a b))
     (map-slot-boundp* c2 '(a b c d))))
  (nil nil)
  (nil nil nil nil)
  x
  (t nil)
  (t nil nil nil)
  x x
  t
  (nil nil)
  (nil nil nil nil))

sds's avatar
sds committed
79

80 81
(deftest class-0203.2
  (let ((c1 (make-instance 'class-0203))
sds's avatar
sds committed
82
        (c2 (make-instance 'class-0204)))
83 84 85 86 87 88 89 90
    (values
     (map-slot-boundp* c1 '(a b))
     (map-slot-boundp* c2 '(a b c d))
     (setf (slot-value c1 'a) 'x)
     (map-slot-boundp* c1 '(a b))
     (map-slot-boundp* c2 '(a b c d))
     (slot-value c1 'a)
     (slot-value c2 'a)
91
     (eqt (slot-makunbound c2 'a) c2)
92 93 94 95 96 97 98 99 100 101 102 103
     (map-slot-boundp* c1 '(a b))
     (map-slot-boundp* c2 '(a b c d))))
  (nil nil)
  (nil nil nil nil)
  x
  (t nil)
  (t nil nil nil)
  x x
  t
  (nil nil)
  (nil nil nil nil))

pfdietz's avatar
pfdietz committed
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
;;;

(defclass class-0205a ()
  ((a :initform 'x)
   (b :initform 'y)
   c))

(defclass class-0205b (class-0205a)
  ((a :initform 'z)
   b
   (c :initform 'w)))

(deftest class-0205a.1
  (let ((c (make-instance 'class-0205a)))
    (values
     (slot-value c 'a)
     (slot-value c 'b)
     (slot-boundp c 'c)))
  x y nil)

(deftest class-0205b.1
  (let ((c (make-instance 'class-0205b)))
    (map-slot-value c '(a b c)))
  (z y w))

;;;

(defclass class-0206a ()
  ((a :allocation :instance)
   (b :allocation :class)))

(defclass class-0206b (class-0206a)
  ((a :allocation :class)
   (b :allocation :instance)))

(deftest class-0206.1
sds's avatar
sds committed
140 141
  (let ((c1 (make-instance 'class-0206a))
        (c2 (make-instance 'class-0206b)))
pfdietz's avatar
pfdietz committed
142 143 144 145 146 147 148 149 150
    (values
     (map-slot-boundp* c1 '(a b))
     (map-slot-boundp* c2 '(a b))
     (setf (slot-value c1 'a) 'x)
     (setf (slot-value c1 'b) 'y)
     (map-slot-boundp* c1 '(a b))
     (map-slot-boundp* c2 '(a b))
     (map-slot-value c1 '(a b))
     (progn (slot-makunbound c1 'a)
sds's avatar
sds committed
151 152
            (slot-makunbound c1 'b)
            (setf (slot-value c2 'a) 'x))
pfdietz's avatar
pfdietz committed
153 154 155 156 157
     (setf (slot-value c2 'b) 'y)
     (map-slot-boundp* c1 '(a b))
     (map-slot-boundp* c2 '(a b))
     (map-slot-value c2 '(a b))
     (progn (slot-makunbound c2 'a)
sds's avatar
sds committed
158 159
            (slot-makunbound c2 'b)
            nil)))
pfdietz's avatar
pfdietz committed
160 161 162 163 164 165 166 167 168 169 170
  (nil nil) (nil nil)
  x y
  (t t) (nil nil)
  (x y)
  x y
  (nil nil) (t t)
  (x y)
  nil)

;;;

pfdietz's avatar
pfdietz committed
171 172
;;; Show shadowing of slots by :allocation

pfdietz's avatar
pfdietz committed
173 174 175 176 177 178 179 180 181 182 183
(defclass class-0207a ()
  ((a :allocation :class)))

(defclass class-0207b (class-0207a)
  ((a :allocation :instance)))

(defclass class-0207c (class-0207b)
  ((a :allocation :class)))

(deftest class-0207.1
  (let ((c1 (make-instance 'class-0207a))
sds's avatar
sds committed
184 185
        (c2 (make-instance 'class-0207b))
        (c3 (make-instance 'class-0207c)))
pfdietz's avatar
pfdietz committed
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216
    (slot-makunbound c1 'a)
    (slot-makunbound c2 'a)
    (slot-makunbound c3 'a)
    (values
     (setf (slot-value c1 'a) 'x)
     (slot-boundp* c1 'a)
     (slot-boundp* c2 'a)
     (slot-boundp* c3 'a)
     (slot-value c1 'a)
     (setf (slot-value c2 'a) 'y)
     (slot-boundp* c1 'a)
     (slot-boundp* c2 'a)
     (slot-boundp* c3 'a)
     (slot-value c1 'a)
     (slot-value c2 'a)
     (setf (slot-value c3 'a) 'z)
     (slot-boundp* c1 'a)
     (slot-boundp* c2 'a)
     (slot-boundp* c3 'a)
     (slot-value c1 'a)
     (slot-value c2 'a)
     (slot-value c3 'a)))
  x
  t nil nil
  x
  y
  t t nil
  x y
  z
  t t t
  x y z)
pfdietz's avatar
pfdietz committed
217

218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
;;;

;;; Initforms are inherited even if :allocation changes

(defclass class-0208a ()
  ((a :allocation :class :initform 'x)))

(defclass class-0208b (class-0208a)
  ((a :allocation :instance)))

(deftest class-0208.1
  (values
   (slot-value (make-instance 'class-0208a) 'a)
   (slot-value (make-instance 'class-0208b) 'a))
  x x)
233 234 235 236 237 238 239 240 241

;;;

;;; That was failing when things were reloaded.
;;; Try a test that redefines it

(deftest class-redefinition.1
  (let*
    ((cobj1 (eval '(defclass class-0209a ()
sds's avatar
sds committed
242
                     ((a :allocation :class :initform 'x)))))
243
     (cobj2 (eval '(defclass class-0209b (class-0209a)
sds's avatar
sds committed
244
                     ((a :allocation :instance)))))
245
     (cobj3 (eval '(defclass class-0209a ()
sds's avatar
sds committed
246
                     ((a :allocation :class :initform 'x)))))
247
     (cobj4 (eval '(defclass class-0209b (class-0209a)
sds's avatar
sds committed
248
                     ((a :allocation :instance))))))
249
    (values
250 251
     (eqt cobj1 cobj3)
     (eqt cobj2 cobj4)
252
     (class-name cobj1)
pfdietz's avatar
pfdietz committed
253
     (class-name cobj2)
254 255 256 257 258 259 260
     (slot-value (make-instance 'class-0209a) 'a)
     (slot-value (make-instance 'class-0209b) 'a)))
  t t
  class-0209a
  class-0209b
  x x)

261 262 263 264
(deftest class-redefinition.2
  (let*
      (
       (cobj1 (eval '(defclass class-0210a ()
sds's avatar
sds committed
265
                       ((a :allocation :class)))))
266
       (cobj2 (eval '(defclass class-0210b (class-0210a)
sds's avatar
sds committed
267
                       ((a :allocation :instance)))))
268
       (cobj3 (eval '(defclass class-0210c (class-0210b)
sds's avatar
sds committed
269
                       ((a :allocation :class)))))
270
       (dummy (progn
sds's avatar
sds committed
271 272 273 274
                (setf (slot-value (make-instance 'class-0210a) 'a) :bad1)
                (make-instance 'class-0210b)
                (make-instance 'class-0210c)
                nil))
275
       (cobj4 (eval '(defclass class-0210a ()
sds's avatar
sds committed
276
                       ((a :allocation :class)))))
277
       (cobj5 (eval '(defclass class-0210b (class-0210a)
sds's avatar
sds committed
278
                       ((a :allocation :instance)))))
279
       (cobj6 (eval '(defclass class-0210c (class-0210b)
sds's avatar
sds committed
280
                       ((a :allocation :class))))))
281 282 283 284 285 286 287 288
    (list
     (eqt cobj1 cobj4)
     (eqt cobj2 cobj5)
     (eqt cobj3 cobj6)
     (class-name cobj1)
     (class-name cobj2)
     (class-name cobj3)
     (let ((c1 (make-instance 'class-0210a))
sds's avatar
sds committed
289 290
           (c2 (make-instance 'class-0210b))
           (c3 (make-instance 'class-0210c)))
291 292 293 294
       (slot-makunbound c1 'a)
       (slot-makunbound c2 'a)
       (slot-makunbound c3 'a)
       (list
sds's avatar
sds committed
295 296 297 298 299 300 301 302 303 304 305 306 307
        (setf (slot-value c1 'a) 'x)
        (and (slot-boundp* c1 'a) (slot-value c1 'a))
        (slot-boundp* c2 'a)
        (slot-boundp* c3 'a)
        (setf (slot-value c2 'a) 'y)
        (and (slot-boundp* c1 'a) (slot-value c1 'a))
        (and (slot-boundp* c2 'a) (slot-value c2 'a))
        (slot-boundp* c3 'a)
        (setf (slot-value c3 'a) 'z)
        (and (slot-boundp* c1 'a) (slot-value c1 'a))
        (and (slot-boundp* c2 'a) (slot-value c2 'a))
        (and (slot-boundp* c3 'a) (slot-value c3 'a))))))
  (t t t
308 309 310 311 312 313 314 315 316 317
     class-0210a
     class-0210b
     class-0210c
     (x
      x nil nil
      y
      x y nil
      z
      x y z)))

318 319 320 321 322
;;; Same as class-redefinition.1, but reverse the order in which
;;; the classes are redefined.
(deftest class-redefinition.3
  (let*
    ((cobj1 (eval '(defclass class-redef-03a ()
sds's avatar
sds committed
323
                     ((a :allocation :class :initform 'x)))))
324
     (cobj2 (eval '(defclass class-redef-03b (class-redef-03a)
sds's avatar
sds committed
325
                     ((a :allocation :instance)))))
326
     (cobj4 (eval '(defclass class-redef-03b (class-redef-03a)
sds's avatar
sds committed
327
                     ((a :allocation :instance)))))
328
     (cobj3 (eval '(defclass class-redef-03a ()
sds's avatar
sds committed
329
                     ((a :allocation :class :initform 'x))))))
330 331 332 333 334 335 336 337 338 339 340 341
    (values
     (eqt cobj1 cobj3)
     (eqt cobj2 cobj4)
     (class-name cobj1)
     (class-name cobj2)
     (slot-value (make-instance 'class-redef-03a) 'a)
     (slot-value (make-instance 'class-redef-03b) 'a)))
  t t
  class-redef-03a
  class-redef-03b
  x x)

342 343 344 345 346 347 348 349 350 351 352 353 354 355
;;; Initforms are inherited even if :allocation changes

(defclass class-0211a ()
  ((a :allocation :instance :initform 'x)))

(defclass class-0211b (class-0211a)
  ((a :allocation :class)))

(deftest class-0211.1
  (values
   (slot-value (make-instance 'class-0211a) 'a)
   (slot-value (make-instance 'class-0211b) 'a))
  x x)

356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601
;;;

;;; Inheritance of :initargs

(defclass class-0212a ()
  ((a :initarg :a1)))

(defclass class-0212b (class-0212a)
  ((a :initarg :a2)
   (b :initarg :b)))

(deftest class-0212.1
  (let ((c (make-instance 'class-0212a :a1 'x)))
    (values
     (typep* c 'class-0212a)
     (typep* c 'class-0212b)
     (slot-value c 'a)
     (slot-exists-p c 'b)))
  t nil x nil)

(deftest class-0212.2
  (let ((c (make-instance 'class-0212b :a1 'x)))
    (values
     (typep* c 'class-0212a)
     (typep* c 'class-0212b)
     (slot-value c 'a)
     (slot-boundp* c 'b)))
  t t x nil)

(deftest class-0212.3
  (let ((c (make-instance 'class-0212b :a2 'x :b 'y)))
    (values
     (typep* c 'class-0212a)
     (typep* c 'class-0212b)
     (slot-value c 'a)
     (slot-value c 'b)))
  t t x y)

(deftest class-0212.4
  (let ((c (make-instance 'class-0212b :a1 'z :a2 'x :b 'y)))
    (values
     (typep* c 'class-0212a)
     (typep* c 'class-0212b)
     (slot-value c 'a)
     (slot-value c 'b)))
  t t z y)

(deftest class-0212.5
  (let ((c (make-instance 'class-0212b :a2 'x :b 'y :a1 'z)))
    (values
     (typep* c 'class-0212a)
     (typep* c 'class-0212b)
     (slot-value c 'a)
     (slot-value c 'b)))
  t t x y)

;;;

(defclass class-0213a ()
  ((a :initarg :a1)))

(defclass class-0213b (class-0213a)
  (b))

(deftest class-0213.1
  (let ((c (make-instance 'class-0213a :a1 'x)))
    (values
     (typep* c 'class-0213a)
     (typep* c 'class-0213b)
     (slot-value c 'a)
     (slot-exists-p c 'b)))
  t nil x nil)

(deftest class-0213.2
  (let ((c (make-instance 'class-0213b :a1 'x)))
    (values
     (typep* c 'class-0213a)
     (typep* c 'class-0213b)
     (slot-value c 'a)
     (slot-boundp* c 'b)))
  t t x nil)

;;;

(defclass class-0214a ()
  ((a :initarg :a1 :allocation :class)))

(defclass class-0214b (class-0214a)
  (b))

(deftest class-0214.1
  (let ((c (make-instance 'class-0214a :a1 'x)))
    (values
     (typep* c 'class-0214a)
     (typep* c 'class-0214b)
     (slot-value c 'a)
     (slot-exists-p c 'b)))
  t nil x nil)

(deftest class-0214.2
  (let ((c (make-instance 'class-0214b :a1 'y)))
    (values
     (typep* c 'class-0214a)
     (typep* c 'class-0214b)
     (slot-value c 'a)
     (slot-boundp* c 'b)))
  t t y nil)

;;;

(defclass class-0215a ()
  ((a :initarg :a1 :allocation :instance)))

(defclass class-0215b (class-0215a)
  ((a :allocation :class)))

(deftest class-0215.1
  (let ((c (make-instance 'class-0215a :a1 'x)))
    (values
     (typep* c 'class-0215a)
     (typep* c 'class-0215b)
     (slot-value c 'a)))
  t nil x)

(deftest class-0215.2
  (let ((c (make-instance 'class-0215b :a1 'y)))
    (values
     (typep* c 'class-0215a)
     (typep* c 'class-0215b)
     (slot-value c 'a)))
  t t y)


;;; Tests of defaulted initargs

(defclass class-0216a ()
  ((a :initarg :a1)
   (b :initarg :b1)))

(defclass class-0216b (class-0216a)
  ()
  (:default-initargs :a1 'x))

(deftest class-0216.1
  (let ((c (make-instance 'class-0216a)))
    (values
     (typep* c 'class-0216a)
     (typep* c 'class-0216b)
     (slot-boundp c 'a)
     (slot-boundp c 'b)))
  t nil nil nil)

(deftest class-0216.2
  (let ((c (make-instance 'class-0216b)))
    (values
     (typep* c 'class-0216a)
     (typep* c 'class-0216b)
     (slot-value c 'a)
     (slot-boundp c 'b)))
  t t x nil)

;;;

(defclass class-0217a ()
  ((a :initarg :a1)
   (b :initarg :b1)
   (c :initarg :c1)
   (d :initarg :d1))
  (:default-initargs :a1 10 :b1 20))

(defclass class-0217b (class-0217a)
  ()
  (:default-initargs :a1 30 :c1 40))

(deftest class-0217.1
  (let ((c (make-instance 'class-0217a)))
    (values
     (map-slot-boundp* c '(a b c d))
     (map-slot-value c '(a b))))
  (t t nil nil)
  (10 20))

(deftest class-0217.2
  (let ((c (make-instance 'class-0217a :a1 'x :c1 'y)))
    (values
     (map-slot-boundp* c '(a b c d))
     (map-slot-value c '(a b c))))
  (t t t nil)
  (x 20 y))

(deftest class-0217.3
  (let ((c (make-instance 'class-0217b)))
    (values
     (map-slot-boundp* c '(a b c d))
     (map-slot-value c '(a b c))))
  (t t t nil)
  (30 20 40))

(deftest class-0217.4
  (let ((c (make-instance 'class-0217b :a1 'x :d1 'y)))
    (values
     (map-slot-boundp* c '(a b c d))
     (map-slot-value c '(a b c d))))
  (t t t t)
  (x 20 40 y))

;;;

(defclass class-0218a ()
  ((a :initarg :a1))
  (:default-initargs :a1 'x))

(defclass class-0218b (class-0218a)
  ((a :initform 'y)))

(deftest class-0218.1
  (let ((c (make-instance 'class-0218a)))
     (slot-value c 'a))
  x)

(deftest class-0218.2
  (let ((c (make-instance 'class-0218b)))
     (slot-value c 'a))
  x)

;;;

(declaim (special *class-0219-a-1* *class-0219-a-2*))

(defclass class-0219a ()
  ((a :initarg :a1))
  (:default-initargs :a1 (setf *class-0219-a-1* 'x)))

(defclass class-0219b ()
  ((a :initarg :a1))
  (:default-initargs :a1 (setf *class-0219-a-2* 'y)))

(deftest class-0219.1
  (let ((*class-0219-a-1* nil))
    (values
     (slot-value (make-instance 'class-0219a) 'a)
     *class-0219-a-1*))
  x x)

(deftest class-0219.2
  (let ((*class-0219-a-1* nil)
sds's avatar
sds committed
602
        (*class-0219-a-2* nil))
603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647
    (values
     (slot-value (make-instance 'class-0219b) 'a)
     *class-0219-a-1*
     *class-0219-a-2*))
  y nil y)

;;;

(defclass class-0220a ()
  ((a :type (integer 0 10) :initarg :a)))

(defclass class-0220b (class-0220a)
  ((a :type (integer -5 5))))

(deftest class-0220.1
  (slot-value (make-instance 'class-0220a :a 10) 'a)
  10)

(deftest class-0220.2
  (slot-value (make-instance 'class-0220a :a 0) 'a)
  0)

(deftest class-0220.3
  (slot-value (make-instance 'class-0220b :a 0) 'a)
  0)

(deftest class-0220.4
  (slot-value (make-instance 'class-0220b :a 5) 'a)
  5)

;;;

(defclass class-0221a ()
  (a b c)
  (:documentation "This is class class-0221a"))

(defclass class-0221b (class-0221a)
  ())

(defclass class-0221c (class-0221a)
  ()
  (:documentation "This is class class-0221c"))

(deftest class-0221.1
  (let* ((cl (find-class 'class-0221a))
sds's avatar
sds committed
648
         (doc (documentation cl t)))
649
    (or (null doc)
sds's avatar
sds committed
650
        (equalt doc "This is class class-0221a")))
651 652 653 654
  t)

(deftest class-0221.2
  (let* ((cl (find-class 'class-0221b))
sds's avatar
sds committed
655
         (doc (documentation cl t)))
656 657 658 659 660
    doc)
  nil)

(deftest class-0221.3
  (let* ((cl (find-class 'class-0221c))
sds's avatar
sds committed
661
         (doc (documentation cl t)))
662
    (or (null doc)
sds's avatar
sds committed
663
        (equalt doc "This is class class-0221c")))
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715
  t)

;;;

(defclass class-0222a ()
  ((s1 :reader s1-r :writer s1-w :accessor s1-acc)))

(defclass class-0222b (class-0222a)
  ())

(deftest class-0222.1
  (let ((c (make-instance 'class-0222a)))
    (values
     (s1-w 'x c)
     (s1-r c)
     (s1-acc c)
     (setf (s1-acc c) 'y)
     (s1-r c)))
  x x x y y)

(deftest class-0222.2
  (let ((c (make-instance 'class-0222b)))
    (values
     (s1-w 'x c)
     (s1-r c)
     (s1-acc c)
     (setf (s1-acc c) 'y)
     (s1-r c)))
  x x x y y)

;;;

(defclass class-0223a ()
  ((s1 :reader s-r :writer s-w :accessor s-acc)))

(defclass class-0223b (class-0223a)
  ((s2 :reader s-r :writer s-w :accessor s-acc)))

(deftest class-0223.1
  (let ((c (make-instance 'class-0223b)))
    (values
     (setf (slot-value c 's1) 'x)
     (setf (slot-value c 's2) 'y)
     (s-r c)
     (s-acc c)
     (s-w 'z c)
     (slot-value c 's1)
     (slot-value c 's2)
     (s-r c)
     (s-acc c)))
  x y y y z x z z z)