| 1 | 29a30,33
|
|---|
| 2 | > (define-syntax test-pp
|
|---|
| 3 | > (syntax-rules()
|
|---|
| 4 | > ((_ x) (begin (newline)(pp 'x)(pp x)))))
|
|---|
| 5 | >
|
|---|
| 6 | 73a78,86
|
|---|
| 7 | > (test-pp p1)
|
|---|
| 8 | > (test-pp (slot-ref p1 'x))
|
|---|
| 9 | > (test-pp (slot-ref p1 'y))
|
|---|
| 10 | >
|
|---|
| 11 | >
|
|---|
| 12 | > (test-pp p2)
|
|---|
| 13 | > (test-pp (slot-ref p2 'x))
|
|---|
| 14 | > (test-pp (slot-ref p2 'y))
|
|---|
| 15 | >
|
|---|
| 16 | 118a132,146
|
|---|
| 17 | > (test-pp p3)
|
|---|
| 18 | > (test-pp (pos-x p3))
|
|---|
| 19 | > (test-pp (pos-y p3))
|
|---|
| 20 | >
|
|---|
| 21 | > (test-pp p4)
|
|---|
| 22 | > (test-pp (pos-x p4))
|
|---|
| 23 | > (test-pp (pos-y p4))
|
|---|
| 24 | >
|
|---|
| 25 | > (move p4 10 11)
|
|---|
| 26 | >
|
|---|
| 27 | > (test-pp p4)
|
|---|
| 28 | > (test-pp (pos-x p4))
|
|---|
| 29 | > (test-pp (pos-y p4))
|
|---|
| 30 | >
|
|---|
| 31 | >
|
|---|
| 32 | 134c162
|
|---|
| 33 | < (if (null? (memq ':class-allocation slot))
|
|---|
| 34 | ---
|
|---|
| 35 | > (if (not (memq ':class-allocation slot))
|
|---|
| 36 | 167a196,197
|
|---|
| 37 | > (test-pp s2)
|
|---|
| 38 | > (test-pp (slot-ref s2 'name))
|
|---|
| 39 | 169a200,212
|
|---|
| 40 | > (test-pp s1)
|
|---|
| 41 | > (test-pp (slot-ref s1 'name))
|
|---|
| 42 | >
|
|---|
| 43 | > (test-pp s2)
|
|---|
| 44 | > (test-pp (slot-ref s2 'name))
|
|---|
| 45 | >
|
|---|
| 46 | > (test-pp s3)
|
|---|
| 47 | > (test-pp (slot-ref s3 'name))
|
|---|
| 48 | >
|
|---|
| 49 | > (test-pp <ship>)
|
|---|
| 50 | > (test-pp (class-direct-slots <ship>))
|
|---|
| 51 | >
|
|---|
| 52 | > (test-pp (map (lambda(x) (cons x (slot-ref x 'name))) (siblings s1)))
|
|---|
| 53 | 216c259
|
|---|
| 54 | < (if (null? entry)
|
|---|
| 55 | ---
|
|---|
| 56 | > (if (not entry)
|
|---|
| 57 | 222c265
|
|---|
| 58 | < (if (null? entry)
|
|---|
| 59 | ---
|
|---|
| 60 | > (if (not entry)
|
|---|
| 61 | 256a300,304
|
|---|
| 62 | > (test-pp (slot-ref person1 'name))
|
|---|
| 63 | >
|
|---|
| 64 | > (slot-set! person1 'age 20)
|
|---|
| 65 | > (test-pp (slot-ref person1 'age))
|
|---|
| 66 | >
|
|---|
| 67 | 358a407,409
|
|---|
| 68 | > (test-pp (equal? (test-around (make-generic)) '(foo bar baz)))
|
|---|
| 69 | >
|
|---|
| 70 | > (test-pp (equal? (test-around (make-around-generic)) '(bar foo baz)))
|
|---|
| 71 | 360,361c411
|
|---|
| 72 | < (equal? (test-around (make-generic)) '(foo bar baz))
|
|---|
| 73 | < (equal? (test-around (make-around-generic)) '(bar foo baz))
|
|---|
| 74 | ---
|
|---|
| 75 | > 'examples_all_done
|
|---|