1 ;;;; miscellaneous side-effectful tests of the MOP
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; While most of SBCL is derived from the CMU CL system, the test
7 ;;;; files (like this one) were written from scratch after the fork
10 ;;;; This software is in the public domain and is provided with
11 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
12 ;;;; more information.
14 ;;; this file attempts to test possible metacircularity issues arising
15 ;;; from changing discriminating functions.
21 (defclass gf1-class
(standard-generic-function) ()
22 (:metaclass funcallable-standard-class
))
25 (:generic-function-class gf1-class
))
26 (assert (= (gf1 3) 3))
28 (defclass gf2-class
(standard-generic-function) ()
29 (:metaclass funcallable-standard-class
))
31 (:method
((x number
)) x
)
32 (:generic-function-class gf2-class
))
33 (assert (= (gf2 4) 4))
36 (:method
((x symbol
)) (symbol-name x
))
37 (:generic-function-class gf1-class
))
38 (assert (string= (gf1a t
) "T"))
40 (defclass gf3-class
(standard-generic-function) ()
41 (:metaclass funcallable-standard-class
))
43 (:method
((x number
) (y number
)) (+ x y
))
44 (:generic-function-class gf3-class
))
45 (assert (= (gf3 1 2) 3))