Mercurial > hg > xemacs-beta
comparison lisp/cl-macs.el @ 5475:248176c74e6b
Merge with trunk.
author | Mats Lidell <matsl@xemacs.org> |
---|---|
date | Sat, 23 Apr 2011 23:47:13 +0200 |
parents | 4dee0387b9de f9dc75bdbdc4 |
children | f2881cb841b4 |
comparison
equal
deleted
inserted
replaced
5474:4dee0387b9de | 5475:248176c74e6b |
---|---|
617 | 617 |
618 ;;;###autoload | 618 ;;;###autoload |
619 (defmacro load-time-value (form &optional read-only) | 619 (defmacro load-time-value (form &optional read-only) |
620 "Like `progn', but evaluates the body at load time. | 620 "Like `progn', but evaluates the body at load time. |
621 The result of the body appears to the compiler as a quoted constant." | 621 The result of the body appears to the compiler as a quoted constant." |
622 (if (cl-compiling-file) | 622 (let ((gensym (gensym))) |
623 (let* ((temp (gentemp "--cl-load-time--")) | 623 ;; The body of this macro really should be (cons 'progn form), with the |
624 (set (list 'set (list 'quote temp) form))) | 624 ;; hairier stuff in a shadowed version in |
625 (if (and (fboundp 'byte-compile-file-form-defmumble) | 625 ;; byte-compile-initial-macro-environment. That doesn't work because |
626 (boundp 'this-kind) (boundp 'that-one)) | 626 ;; cl-macs.el doesn't respect byte-compile-macro-environment, which is |
627 (fset 'byte-compile-file-form | 627 ;; something we should change. |
628 (list 'lambda '(form) | 628 (put gensym 'cl-load-time-value-form form) |
629 (list 'fset '(quote byte-compile-file-form) | 629 (set gensym (eval form)) |
630 (list 'quote | 630 `(symbol-value ',gensym))) |
631 (symbol-function 'byte-compile-file-form))) | |
632 (list 'byte-compile-file-form (list 'quote set)) | |
633 '(byte-compile-file-form form))) | |
634 ;; XEmacs change | |
635 (print set (symbol-value ;;'outbuffer | |
636 'byte-compile-output-buffer | |
637 ))) | |
638 (list 'symbol-value (list 'quote temp))) | |
639 (list 'quote (eval form)))) | |
640 | |
641 | 631 |
642 ;;; Conditional control structures. | 632 ;;; Conditional control structures. |
643 | 633 |
644 ;;;###autoload | 634 ;;;###autoload |
645 (defmacro case (expr &rest clauses) | 635 (defmacro case (expr &rest clauses) |