CMUCL commit: src (code/macros.lisp general-info/release-20b.txt)

Raymond Toy rtoy at common-lisp.net
Tue May 25 22:04:33 CEST 2010


    Date: Tuesday, May 25, 2010 @ 16:04:33
  Author: rtoy
    Path: /project/cmucl/cvsroot/src

Modified: code/macros.lisp general-info/release-20b.txt

code/macros.lisp:
o In DEFINE-COMPILER-MACRO, use the correct BLOCK name for SETF
  functions 
o Signal an error if the function name is not a valid function name.

general-info/release-20b.txt:
o Update.


------------------------------+
 code/macros.lisp             |   36 ++++++++++++++++++++----------------
 general-info/release-20b.txt |    3 +++
 2 files changed, 23 insertions(+), 16 deletions(-)


Index: src/code/macros.lisp
diff -u src/code/macros.lisp:1.119 src/code/macros.lisp:1.120
--- src/code/macros.lisp:1.119	Tue Apr 27 19:29:30 2010
+++ src/code/macros.lisp	Tue May 25 16:04:33 2010
@@ -5,7 +5,7 @@
 ;;; Carnegie Mellon University, and has been placed in the public domain.
 ;;;
 (ext:file-comment
-  "$Header: /project/cmucl/cvsroot/src/code/macros.lisp,v 1.119 2010-04-27 23:29:30 rtoy Exp $")
+  "$Header: /project/cmucl/cvsroot/src/code/macros.lisp,v 1.120 2010-05-25 20:04:33 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -150,21 +150,25 @@
   "Define a compiler-macro for NAME."
   (let ((whole (gensym "WHOLE-"))
 	(environment (gensym "ENV-")))
-    (multiple-value-bind
-	(body local-decs doc)
-	(parse-defmacro lambda-list whole body name 'define-compiler-macro
-			:environment environment)
-      (when doc
-	(intl::note-translatable intl::*default-domain* doc))
-      (let ((def `(lambda (,whole ,environment)
-		    , at local-decs
-		    (block ,name
-		      ,body))))
-	`(progn
-	   (eval-when (:compile-toplevel)
-	     (c::do-compiler-macro-compile-time ',name #',def))
-	   (eval-when (:load-toplevel :execute)
-	     (c::%define-compiler-macro ',name #',def ',lambda-list ,doc)))))))
+    (multiple-value-bind (validp block-name)
+	(valid-function-name-p name)
+      (unless validp
+	(simple-program-error (intl:gettext "~S is not a valid function name.") name))
+      (multiple-value-bind
+	    (body local-decs doc)
+	  (parse-defmacro lambda-list whole body name 'define-compiler-macro
+			  :environment environment)
+	(when doc
+	  (intl::note-translatable intl::*default-domain* doc))
+	(let ((def `(lambda (,whole ,environment)
+		      , at local-decs
+		      (block ,block-name
+			,body))))
+	  `(progn
+	     (eval-when (:compile-toplevel)
+	       (c::do-compiler-macro-compile-time ',name #',def))
+	     (eval-when (:load-toplevel :execute)
+	       (c::%define-compiler-macro ',name #',def ',lambda-list ,doc))))))))
 
 
 (defun c::%define-compiler-macro (name definition lambda-list doc)
Index: src/general-info/release-20b.txt
diff -u src/general-info/release-20b.txt:1.27 src/general-info/release-20b.txt:1.28
--- src/general-info/release-20b.txt:1.27	Fri May 21 15:26:52 2010
+++ src/general-info/release-20b.txt	Tue May 25 16:04:33 2010
@@ -74,6 +74,9 @@
       ENSURE-GENERIC-FUNCTION. 
     - Default documentation for short form of
       DEFINE-METHOD-COMBINATION is NIL, not "".
+    - DEFINE-COMPILER-MACRO no longer sets the wrong block name for
+      SETF functions.  We also check that the name is a valid function
+      name; an error is signaled if it's invalid.
 
   * Bugfixes:
     - On Unicode builds, printing of '|\|| and '|`| was incorrect



More information about the cmucl-commit mailing list