comparison 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
comparison
equal deleted inserted replaced
5262:75bcb5bef459 5263:0d436a78c514
491 (if (symbolp elt) 491 (if (symbolp elt)
492 (fmakunbound elt) 492 (fmakunbound elt)
493 (fset (car elt) (cdr elt))))))) 493 (fset (car elt) (cdr elt)))))))
494 494
495 (defconst byte-compile-initial-macro-environment 495 (defconst byte-compile-initial-macro-environment
496 '((byte-compiler-options . (lambda (&rest forms) 496 `((byte-compiler-options
497 (apply 'byte-compiler-options-handler forms))) 497 . ,#'(lambda (&rest forms)
498 (eval-when-compile . (lambda (&rest body) 498 (apply 'byte-compiler-options-handler forms)))
499 (list 'quote (byte-compile-eval (cons 'progn body))))) 499 (eval-when-compile
500 (eval-and-compile . (lambda (&rest body) 500 . ,#'(lambda (&rest body)
501 (byte-compile-eval (cons 'progn body)) 501 (list 'quote (byte-compile-eval (cons 'progn body)))))
502 (cons 'progn body)))) 502 (eval-and-compile
503 . ,#'(lambda (&rest body)
504 (byte-compile-eval (cons 'progn body))
505 (cons 'progn body)))
506 (the .
507 ,#'(lambda (&rest body)
508 (if byte-compile-delete-errors
509 (second body)
510 (apply (cdr (symbol-function 'the)) body)))))
503 "The default macro-environment passed to macroexpand by the compiler. 511 "The default macro-environment passed to macroexpand by the compiler.
504 Placing a macro here will cause a macro to have different semantics when 512 Placing a macro here will cause a macro to have different semantics when
505 expanded by the compiler as when expanded by the interpreter.") 513 expanded by the compiler as when expanded by the interpreter.")
506 514
507 (defvar byte-compile-macro-environment byte-compile-initial-macro-environment 515 (defvar byte-compile-macro-environment byte-compile-initial-macro-environment