0.7.8.26:
authorAlexey Dejneka <adejneka@comail.ru>
Fri, 11 Oct 2002 02:11:06 +0000 (02:11 +0000)
committerAlexey Dejneka <adejneka@comail.ru>
Fri, 11 Oct 2002 02:11:06 +0000 (02:11 +0000)
        Fixed bug 48c: SYMBOL-MACROLET should signal PROGRAM-ERROR if
        the introduced macro has a bound SPECIAL declaration.

BUGS
NEWS
src/code/defmacro.lisp
src/compiler/ir1-translators.lisp
src/compiler/main.lisp
tests/compiler.pure.lisp
version.lisp-expr

diff --git a/BUGS b/BUGS
index 4c07d1d..e932280 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -264,11 +264,6 @@ WORKAROUND:
        d: (DEFGENERIC IF (X)) should signal a PROGRAM-ERROR, but instead
           causes a COMPILER-ERROR.
 
        d: (DEFGENERIC IF (X)) should signal a PROGRAM-ERROR, but instead
           causes a COMPILER-ERROR.
 
-48:
-  SYMBOL-MACROLET bugs reported by Peter Van Eynde July 25, 2000:
-       c: SYMBOL-MACROLET should signal PROGRAM-ERROR if something
-          it binds is declared SPECIAL inside.
-
 51:
   miscellaneous errors reported by Peter Van Eynde July 25, 2000:
        a: (PROGN
 51:
   miscellaneous errors reported by Peter Van Eynde July 25, 2000:
        a: (PROGN
diff --git a/NEWS b/NEWS
index f29756b..9603f80 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1319,6 +1319,8 @@ changes in sbcl-0.7.9 relative to sbcl-0.7.8:
     so it can be non-toplevel.
   * fixed bugs 46h and 46i: TWO-WAY- and CONCATENATED-STREAM creation
     functions now check the types of their inputs as required by ANSI.
     so it can be non-toplevel.
   * fixed bugs 46h and 46i: TWO-WAY- and CONCATENATED-STREAM creation
     functions now check the types of their inputs as required by ANSI.
+  * fixed bug 48c: SYMBOL-MACROLET signals PROGRAM-ERROR when an
+    introduced symbol is DECLAREd to be SPECIAL.
 
 planned incompatible changes in 0.7.x:
 * When the profiling interface settles down, maybe in 0.7.x, maybe
 
 planned incompatible changes in 0.7.x:
 * When the profiling interface settles down, maybe in 0.7.x, maybe
index b93621b..2bc701b 100644 (file)
@@ -42,6 +42,8 @@
             ;; old note (ca. 1985, maybe:-): "Eventually %%DEFMACRO
             ;; should deal with clearing old compiler information for
             ;; the functional value."
             ;; old note (ca. 1985, maybe:-): "Eventually %%DEFMACRO
             ;; should deal with clearing old compiler information for
             ;; the functional value."
+            ,@(unless set-args-p
+                '((declare (ignore lambda-list))))
             (ecase (info :function :kind name)
               ((nil))
               (:function
             (ecase (info :function :kind name)
               ((nil))
               (:function
index f2e860e..2298154 100644 (file)
     (compiler-style-warn "duplicate definitions in ~S" definitions))
   (let* ((processed-definitions (mapcar definitionize-fun definitions))
          (*lexenv* (make-lexenv definitionize-keyword processed-definitions)))
     (compiler-style-warn "duplicate definitions in ~S" definitions))
   (let* ((processed-definitions (mapcar definitionize-fun definitions))
          (*lexenv* (make-lexenv definitionize-keyword processed-definitions)))
-    (funcall fun)))
+    (funcall fun definitionize-keyword processed-definitions)))
 
 ;;; Tweak *LEXENV* to include the DEFINITIONS from a MACROLET, then
 ;;; call FUN (with no arguments).
 
 ;;; Tweak *LEXENV* to include the DEFINITIONS from a MACROLET, then
 ;;; call FUN (with no arguments).
   defined. Name is the local macro name, Lambda-List is the DEFMACRO style
   destructuring lambda list, and the Forms evaluate to the expansion. The
   Forms are evaluated in the null environment."
   defined. Name is the local macro name, Lambda-List is the DEFMACRO style
   destructuring lambda list, and the Forms evaluate to the expansion. The
   Forms are evaluated in the null environment."
-  (funcall-in-macrolet-lexenv definitions
-                             (lambda ()
-                               (ir1-translate-locally body start cont))))
+  (funcall-in-macrolet-lexenv
+   definitions
+   (lambda (&key funs)
+     (declare (ignore funs))
+     (ir1-translate-locally body start cont))))
 
 (defun funcall-in-symbol-macrolet-lexenv (definitions fun)
   (%funcall-in-foomacrolet-lexenv
 
 (defun funcall-in-symbol-macrolet-lexenv (definitions fun)
   (%funcall-in-foomacrolet-lexenv
   body, references to a Name will effectively be replaced with the Expansion."
   (funcall-in-symbol-macrolet-lexenv
    macrobindings
   body, references to a Name will effectively be replaced with the Expansion."
   (funcall-in-symbol-macrolet-lexenv
    macrobindings
-   (lambda ()
-     (ir1-translate-locally body start cont))))
+   (lambda (&key vars)
+     (ir1-translate-locally body start cont :vars vars))))
 
 ;;; not really a special form, but..
 (def-ir1-translator declare ((&rest stuff) start cont)
 
 ;;; not really a special form, but..
 (def-ir1-translator declare ((&rest stuff) start cont)
 ;;; but we don't need to worry about that within an IR1 translator,
 ;;; since toplevel-formness is picked off by PROCESS-TOPLEVEL-FOO
 ;;; forms before we hit the IR1 transform level.
 ;;; but we don't need to worry about that within an IR1 translator,
 ;;; since toplevel-formness is picked off by PROCESS-TOPLEVEL-FOO
 ;;; forms before we hit the IR1 transform level.
-(defun ir1-translate-locally (body start cont)
+(defun ir1-translate-locally (body start cont &key vars funs)
   (declare (type list body) (type continuation start cont))
   (multiple-value-bind (forms decls) (parse-body body nil)
   (declare (type list body) (type continuation start cont))
   (multiple-value-bind (forms decls) (parse-body body nil)
-    (let ((*lexenv* (process-decls decls nil nil cont)))
+    (let ((*lexenv* (process-decls decls vars funs cont)))
       (ir1-convert-aux-bindings start cont forms nil nil))))
 
 (def-ir1-translator locally ((&body body) start cont)
       (ir1-convert-aux-bindings start cont forms nil nil))))
 
 (def-ir1-translator locally ((&body body) start cont)
index e297258..fd27819 100644 (file)
 ;;; Process a top level use of LOCALLY, or anything else (e.g.
 ;;; MACROLET) at top level which has declarations and ordinary forms.
 ;;; We parse declarations and then recursively process the body.
 ;;; Process a top level use of LOCALLY, or anything else (e.g.
 ;;; MACROLET) at top level which has declarations and ordinary forms.
 ;;; We parse declarations and then recursively process the body.
-(defun process-toplevel-locally (body path compile-time-too)
+(defun process-toplevel-locally (body path compile-time-too &key vars funs)
   (declare (list path))
   (multiple-value-bind (forms decls) (parse-body body nil)
     (let* ((*lexenv*
   (declare (list path))
   (multiple-value-bind (forms decls) (parse-body body nil)
     (let* ((*lexenv*
-           (process-decls decls nil nil (make-continuation)))
+           (process-decls decls vars funs (make-continuation)))
           ;; Binding *POLICY* is pretty much of a hack, since it
           ;; causes LOCALLY to "capture" enclosed proclamations. It
           ;; is necessary because CONVERT-AND-MAYBE-COMPILE uses the
           ;; Binding *POLICY* is pretty much of a hack, since it
           ;; causes LOCALLY to "capture" enclosed proclamations. It
           ;; is necessary because CONVERT-AND-MAYBE-COMPILE uses the
                      ((macrolet)
                       (funcall-in-macrolet-lexenv
                        magic
                      ((macrolet)
                       (funcall-in-macrolet-lexenv
                        magic
-                       (lambda ()
+                       (lambda (&key funs)
+                         (declare (ignore funs))
                          (process-toplevel-locally body
                                                    path
                                                    compile-time-too))))
                      ((symbol-macrolet)
                       (funcall-in-symbol-macrolet-lexenv
                        magic
                          (process-toplevel-locally body
                                                    path
                                                    compile-time-too))))
                      ((symbol-macrolet)
                       (funcall-in-symbol-macrolet-lexenv
                        magic
-                       (lambda ()
+                       (lambda (&key vars)
                          (process-toplevel-locally body
                                                    path
                          (process-toplevel-locally body
                                                    path
-                                                   compile-time-too)))))))
+                                                   compile-time-too
+                                                   :vars vars)))))))
                 ((locally)
                  (process-toplevel-locally (rest form) path compile-time-too))
                 ((progn)
                 ((locally)
                  (process-toplevel-locally (rest form) path compile-time-too))
                 ((progn)
index c36dbea..58baf1f 100644 (file)
              (list (mext '(1 2))
                    (mint (1 2)))))
          '((:MEXT 1 2) (:MINT (:MEXT 1 2)))))
              (list (mext '(1 2))
                    (mint (1 2)))))
          '((:MEXT 1 2) (:MINT (:MEXT 1 2)))))
+
+;;; bug 48c: SYMBOL-MACROLET should signal PROGRAM-ERROR if introduced
+;;; symbol is declared to be SPECIAL
+(multiple-value-bind (result error)
+    (ignore-errors (funcall (lambda ()
+                              (symbol-macrolet ((s '(1 2)))
+                                  (declare (special s))
+                                s))))
+  (assert (null result))
+  (assert (typep error 'program-error)))
index 47c9931..2dcb0b8 100644 (file)
@@ -18,4 +18,4 @@
 ;;; internal versions off the main CVS branch, it gets hairier, e.g.
 ;;; "0.pre7.14.flaky4.13".)
 
 ;;; internal versions off the main CVS branch, it gets hairier, e.g.
 ;;; "0.pre7.14.flaky4.13".)
 
-"0.7.8.25"
+"0.7.8.26"