locally.lsp 765 Bytes
Newer Older
1 2 3 4 5
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sat Jan  8 06:02:47 2005
;;;; Contains: Tests of LOCALLY

6

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

(deftest locally.1
  (locally)
  nil)

(deftest locally.2
  (locally (values)))

(deftest locally.3
  (locally (values 1 2 3 4))
  1 2 3 4)

(deftest locally.4
  (locally (declare) t)
  t)

(deftest locally.5
  (locally (declare) (declare) (declare) t)
  t)

(deftest locally.6
  (let ((x 'a))
    (declare (special x))
    (let ((x 'b))
      (values
       x
       (locally (declare (special x)) x)
       x)))
  b a b)

(deftest locally.7
  (locally (declare))
  nil)
40 41 42 43 44

;;; Macros are expanded in the appropriate environment

(deftest locally.8
  (macrolet ((%m (z) z))
sds's avatar
sds committed
45
            (locally (expand-in-current-env (%m :good))))
46
  :good)