comparison lisp/emacs-lisp/bytecomp.el @ 74285:bdb0d9c34bd4

(byte-compile-get-constant): Replace incorrect use of assoc-default with a loop.
author Richard M. Stallman <rms@gnu.org>
date Tue, 28 Nov 2006 02:22:17 +0000
parents 1080f62d73e3
children 5a84c691a685
comparison
equal deleted inserted replaced
74284:efbf3bcfde0b 74285:bdb0d9c34bd4
2862 (push tmp byte-compile-variables)) 2862 (push tmp byte-compile-variables))
2863 (byte-compile-out base-op tmp))) 2863 (byte-compile-out base-op tmp)))
2864 2864
2865 (defmacro byte-compile-get-constant (const) 2865 (defmacro byte-compile-get-constant (const)
2866 `(or (if (stringp ,const) 2866 `(or (if (stringp ,const)
2867 (assoc-default ,const byte-compile-constants 2867 ;; In a string constant, treat properties as significant.
2868 'equal-including-properties nil) 2868 (let (result)
2869 (dolist (elt byte-compile-constants)
2870 (if (equal-including-properties (car elt) ,const)
2871 (setq result elt)))
2872 result)
2869 (assq ,const byte-compile-constants)) 2873 (assq ,const byte-compile-constants))
2870 (car (setq byte-compile-constants 2874 (car (setq byte-compile-constants
2871 (cons (list ,const) byte-compile-constants))))) 2875 (cons (list ,const) byte-compile-constants)))))
2872 2876
2873 ;; Use this when the value of a form is a constant. This obeys for-effect. 2877 ;; Use this when the value of a form is a constant. This obeys for-effect.