1 (defpackage :sb-cltl2-tests
2 (:use :sb-cltl2 :cl :sb-rt))
3 (in-package :sb-cltl2-tests)
8 (declare (special *x*))
11 (deftest compiler-let.1
13 (compiler-let ((*x* :inner))
14 (list *x* (*x*-value))))
17 (defvar *expansions* nil)
18 (defmacro macroexpand-macro (arg)
19 (push arg *expansions*)
22 (deftest macroexpand-all.1
24 (macroexpand-all '(defmethod foo ((x fixnum)) (1+ x)))
28 (deftest macroexpand-all.2
29 (let ((*expansions* nil))
30 (macroexpand-all '(list (macroexpand-macro 1)
31 (let (macroexpand-macro :no)
32 (macroexpand-macro 2))))
33 (remove-duplicates (sort *expansions* #'<)))
36 (deftest macroexpand-all.3
37 (let ((*expansions* nil))
38 (compile nil '(lambda ()
39 (macrolet ((foo (key &environment env)
40 (macroexpand-all `(bar ,key) env)))
43 (push key *expansions*)
46 (remove-duplicates *expansions*))
50 (multiple-value-bind (expansion macro-p)
51 (macroexpand 'srlt env)
52 (when macro-p (eval expansion))))
53 (defmacro testr (&environment env)
54 `',(getf (smv env) nil))
56 (deftest macroexpand-all.4
57 (macroexpand-all '(symbol-macrolet ((srlt '(nil zool))) (testr)))
58 (symbol-macrolet ((srlt '(nil zool))) 'zool))