]> code.delx.au - gnu-emacs/commitdiff
* emacs-lisp/byte-opt.el (byte-optimize-pure-func): Remove function
authorChong Yidong <cyd@stupidchicken.com>
Fri, 6 Apr 2007 18:22:23 +0000 (18:22 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Fri, 6 Apr 2007 18:22:23 +0000 (18:22 +0000)
(originally checked in as byte-optimize-concat on 1997-11-02).

lisp/ChangeLog
lisp/emacs-lisp/byte-opt.el

index b5aa1965e93e0bb54c5a3fd9a28f72526e1e8860..88efc444fa43c6db02fe8fbdf49c103ef72080b8 100644 (file)
@@ -1,5 +1,9 @@
 2007-04-06  Chong Yidong  <cyd@stupidchicken.com>
 
+       * emacs-lisp/byte-opt.el (byte-optimize-pure-func): Remove
+       function (originally checked in as byte-optimize-concat on
+       1997-11-02).
+
        * mail/sendmail.el (mail-text, mail-mode): Revert extant pieces of
        1995-05-19 doc changes.
 
index 61f7268adff8300bfd72385bd7f06ec1fbae30e0..93d76c52076da0703329e69bea02ec74375f28e0 100644 (file)
        (byte-optimize-predicate form))
     form))
 
-(put 'concat 'byte-optimizer 'byte-optimize-pure-func)
-(put 'symbol-name 'byte-optimizer 'byte-optimize-pure-func)
-(put 'regexp-opt 'byte-optimizer 'byte-optimize-pure-func)
-(put 'regexp-quote 'byte-optimizer 'byte-optimize-pure-func)
-(put 'string-to-syntax 'byte-optimizer 'byte-optimize-pure-func)
-(defun byte-optimize-pure-func (form)
-  "Do constant folding for pure functions.
-This assumes that the function will not have any side-effects and that
-its return value depends solely on its arguments.
-If the function can signal an error, this might change the semantics
-of FORM by signaling the error at compile-time."
-  (let ((args (cdr form))
-       (constant t))
-    (while (and args constant)
-      (or (byte-compile-constp (car args))
-         (setq constant nil))
-      (setq args (cdr args)))
-    (if constant
-       (list 'quote (eval form))
-      form)))
-
 ;; Avoid having to write forward-... with a negative arg for speed.
 ;; Fixme: don't be limited to constant args.
 (put 'backward-char 'byte-optimizer 'byte-optimize-backward-char)