comparison lisp/bytecomp.el @ 373:6240c7796c7a r21-2b2

Import from CVS: tag r21-2b2
author cvs
date Mon, 13 Aug 2007 11:04:06 +0200
parents cc15677e0335
children 8626e4521993
comparison
equal deleted inserted replaced
372:49e1ed2d7ed8 373:6240c7796c7a
3123 ;; optimize (/= X Y) to (not (= X Y)) 3123 ;; optimize (/= X Y) to (not (= X Y))
3124 ((= len 3) (byte-compile-form-do-effect `(not (= ,@(cdr form))))) 3124 ((= len 3) (byte-compile-form-do-effect `(not (= ,@(cdr form)))))
3125 (t (byte-compile-normal-call form))))) 3125 (t (byte-compile-normal-call form)))))
3126 3126
3127 (defun byte-compile-buffer-substring (form) 3127 (defun byte-compile-buffer-substring (form)
3128 (let ((len (length form))) 3128 ;; buffer-substring used to take exactly two args, but now takes 0-3.
3129 ;; buffer-substring used to take exactly two args, but now takes 0-3. 3129 ;; convert 0-2 to two args and use special bytecode operand.
3130 ;; convert 0-2 to two args and use special bytecode operand. 3130 ;; convert 3 args to a normal call.
3131 ;; convert 3 args to a normal call. 3131 (case (length (cdr form))
3132 (cond ((= len 1) (setq form (append form '(nil nil))) 3132 (0 (byte-compile-two-args (append form '(nil nil))))
3133 (= len 2) (setq form (append form '(nil))))) 3133 (1 (byte-compile-two-args (append form '(nil))))
3134 (cond ((= len 3) (byte-compile-two-args form)) 3134 (2 (byte-compile-two-args form))
3135 ((= len 4) (byte-compile-normal-call form)) 3135 (3 (byte-compile-normal-call form))
3136 (t (byte-compile-subr-wrong-args form "0-3"))))) 3136 (t (byte-compile-subr-wrong-args form "0-3"))))
3137 3137
3138 (defun byte-compile-list (form) 3138 (defun byte-compile-list (form)
3139 (let ((count (length (cdr form)))) 3139 (let ((count (length (cdr form))))
3140 (cond ((= count 0) 3140 (cond ((= count 0)
3141 (byte-compile-constant nil)) 3141 (byte-compile-constant nil))