diff lisp/bytecomp.el @ 5263:0d436a78c514

Add an implementation for #'the, cl-macs.el lisp/ChangeLog addition: 2010-09-16 Aidan Kehoe <kehoea@parhasard.net> * cl-macs.el (the): Add a docstring and an implementation for this macro. * bytecomp.el (byte-compile-initial-macro-environment): Add #'the to this, checking byte-compile-delete-errors to decide whether to make the type assertion. Change the initvalue to use backquote and preceding commas for the lambda expressions, to allow the latter to be compiled.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 16 Sep 2010 13:36:03 +0100
parents 2e528066e2fc
children 5663ae9a8989
line wrap: on
line diff
--- a/lisp/bytecomp.el	Tue Sep 07 17:03:46 2010 +0100
+++ b/lisp/bytecomp.el	Thu Sep 16 13:36:03 2010 +0100
@@ -493,13 +493,21 @@
 	  (fset (car elt) (cdr elt)))))))
 
 (defconst byte-compile-initial-macro-environment
-  '((byte-compiler-options . (lambda (&rest forms)
-			       (apply 'byte-compiler-options-handler forms)))
-    (eval-when-compile . (lambda (&rest body)
-			   (list 'quote (byte-compile-eval (cons 'progn body)))))
-    (eval-and-compile . (lambda (&rest body)
-			  (byte-compile-eval (cons 'progn body))
-			  (cons 'progn body))))
+  `((byte-compiler-options
+      . ,#'(lambda (&rest forms)
+	     (apply 'byte-compiler-options-handler forms)))
+    (eval-when-compile
+      . ,#'(lambda (&rest body)
+	     (list 'quote (byte-compile-eval (cons 'progn body)))))
+    (eval-and-compile
+      . ,#'(lambda (&rest body)
+	     (byte-compile-eval (cons 'progn body))
+	     (cons 'progn body)))
+    (the .
+      ,#'(lambda (&rest body)
+	   (if byte-compile-delete-errors
+	       (second body)
+	     (apply (cdr (symbol-function 'the)) body)))))
   "The default macro-environment passed to macroexpand by the compiler.
 Placing a macro here will cause a macro to have different semantics when
 expanded by the compiler as when expanded by the interpreter.")