/[gcl]/gcl/ansi-tests/defgeneric-method-combination-append.lsp
ViewVC logotype

Diff of /gcl/ansi-tests/defgeneric-method-combination-append.lsp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by pfdietz, Wed Jun 4 01:04:49 2003 UTC revision 1.3 by pfdietz, Tue Jul 1 12:16:10 2003 UTC
# Line 16  Line 16 
16                    (:method append ((x rational)) (car (push '(c) *x*)))                    (:method append ((x rational)) (car (push '(c) *x*)))
17                    (:method append ((x number)) (car (push '(b) *x*)))                    (:method append ((x number)) (car (push '(b) *x*)))
18                    (:method append ((x t)) (car (push '(a) *x*)))))))                    (:method append ((x t)) (car (push '(a) *x*)))))))
19        (declare (type generic-function fn))
20      (flet ((%f (y)      (flet ((%f (y)
21                 (let ((*x* nil))                 (let ((*x* nil))
22                   (list (funcall fn y) *x*))))                   (list (funcall fn y) *x*))))
# Line 34  Line 35 
35                    (:method append ((x rational)) (car (push '(c) *x*)))                    (:method append ((x rational)) (car (push '(c) *x*)))
36                    (:method append ((x number)) (car (push '(b) *x*)))                    (:method append ((x number)) (car (push '(b) *x*)))
37                    (:method append ((x t)) (car (push '(a) *x*)))))))                    (:method append ((x t)) (car (push '(a) *x*)))))))
38        (declare (type generic-function fn))
39      (flet ((%f (y)      (flet ((%f (y)
40                 (let ((*x* nil))                 (let ((*x* nil))
41                   (list (funcall fn y) *x*))))                   (list (funcall fn y) *x*))))
# Line 52  Line 54 
54                    (:method append ((x rational)) (car (push '(c) *x*)))                    (:method append ((x rational)) (car (push '(c) *x*)))
55                    (:method append ((x number)) (car (push '(b) *x*)))                    (:method append ((x number)) (car (push '(b) *x*)))
56                    (:method append ((x t)) (car (push '(a) *x*)))))))                    (:method append ((x t)) (car (push '(a) *x*)))))))
57        (declare (type generic-function fn))
58      (flet ((%f (y)      (flet ((%f (y)
59                 (let ((*x* nil))                 (let ((*x* nil))
60                   (list (funcall fn y) *x*))))                   (list (funcall fn y) *x*))))
# Line 70  Line 73 
73                    (:method append ((x number)) '(c d))                    (:method append ((x number)) '(c d))
74                    (:method append ((x symbol)) '(e f))                    (:method append ((x symbol)) '(e f))
75                    (:method append ((x t)) '(g h))))))                    (:method append ((x t)) '(g h))))))
76        (declare (type generic-function fn))
77      (values      (values
78       (funcall fn 0)       (funcall fn 0)
79       (funcall fn 4/3)       (funcall fn 4/3)
# Line 88  Line 92 
92                    (:method append ((x number)) '(b))                    (:method append ((x number)) '(b))
93                    (:method append ((x symbol)) '(c))                    (:method append ((x symbol)) '(c))
94                    (:method append ((x t)) 'd)))))                    (:method append ((x t)) 'd)))))
95        (declare (type generic-function fn))
96      (values      (values
97       (funcall fn 0)       (funcall fn 0)
98       (funcall fn 4/3)       (funcall fn 4/3)
# Line 108  Line 113 
113                    (:method append ((x number)) '(b))                    (:method append ((x number)) '(b))
114                    (:method append ((x symbol)) '(c))                    (:method append ((x symbol)) '(c))
115                    (:method append ((x t)) '(d))))))                    (:method append ((x t)) '(d))))))
116        (declare (type generic-function fn))
117      (values      (values
118       (funcall fn 0)       (funcall fn 0)
119       (funcall fn 4/3)       (funcall fn 4/3)
# Line 125  Line 131 
131                    (:method append ((x dgmc-class-03)) '(b))                    (:method append ((x dgmc-class-03)) '(b))
132                    (:method append ((x dgmc-class-02)) '(c))                    (:method append ((x dgmc-class-02)) '(c))
133                    (:method append ((x dgmc-class-01)) '(d))))))                    (:method append ((x dgmc-class-01)) '(d))))))
134        (declare (type generic-function fn))
135      (values      (values
136       (funcall fn (make-instance 'dgmc-class-01))       (funcall fn (make-instance 'dgmc-class-01))
137       (funcall fn (make-instance 'dgmc-class-02))       (funcall fn (make-instance 'dgmc-class-02))
# Line 145  Line 152 
152                    (:method :around ((x complex)) (call-next-method))                    (:method :around ((x complex)) (call-next-method))
153                    (:method :around ((x number)) (values 1 2 3 4 5 6))                    (:method :around ((x number)) (values 1 2 3 4 5 6))
154                    (:method append ((x t)) '(b))))))                    (:method append ((x t)) '(b))))))
155        (declare (type generic-function fn))
156      (values      (values
157       (multiple-value-list (funcall fn 'a))       (multiple-value-list (funcall fn 'a))
158       (multiple-value-list (funcall fn 10))       (multiple-value-list (funcall fn 10))
# Line 156  Line 164 
164    (handler-case    (handler-case
165     (let ((fn (eval '(defgeneric dg-mc.append.9 (x)     (let ((fn (eval '(defgeneric dg-mc.append.9 (x)
166                        (:method-combination append)))))                        (:method-combination append)))))
167         (declare (type generic-function fn))
168       (funcall fn '(a)))       (funcall fn '(a)))
169     (error () :error))     (error () :error))
170    :error)    :error)
# Line 181  Line 190 
190                       (:method-combination append)                       (:method-combination append)
191                       (:method :around ((x t)) '(a))                       (:method :around ((x t)) '(a))
192                       (:method append ((x integer)) x)))))                       (:method append ((x integer)) x)))))
193        (declare (type generic-function fn))
194      (handler-case (funcall fn '(b))      (handler-case (funcall fn '(b))
195                    (error () :error)))                    (error () :error)))
196    :error)    :error)

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26