diff options
| author | Richard M. Stallman | 2002-03-31 16:22:58 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-03-31 16:22:58 +0000 |
| commit | 1fc9ee97d308e1f237b54cb44926da8e18cfe269 (patch) | |
| tree | 7f2f7440be3b1665eba657eed78dcb1706ac6e69 | |
| parent | abfb6b461327f5de3ded8145db23b7a107a5ec4a (diff) | |
| download | emacs-1fc9ee97d308e1f237b54cb44926da8e18cfe269.tar.gz emacs-1fc9ee97d308e1f237b54cb44926da8e18cfe269.zip | |
(side-effect-free-fns, side-effect-and-error-free-fns):
Add many functions, remove some.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/byte-opt.el | 57 |
2 files changed, 43 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aff3a5c0425..755519d93bf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2002-03-31 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/byte-opt.el (side-effect-free-fns) | ||
| 4 | (side-effect-and-error-free-fns): Add many functions, remove some. | ||
| 5 | |||
| 1 | 2002-03-30 Richard M. Stallman <rms@gnu.org> | 6 | 2002-03-30 Richard M. Stallman <rms@gnu.org> |
| 2 | 7 | ||
| 3 | * menu-bar.el (menu-bar-tools-menu): Rename gdb item to say GDB. | 8 | * menu-bar.el (menu-bar-tools-menu): Rename gdb item to say GDB. |
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 28112cc8201..5441083a8b2 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el | |||
| @@ -1143,44 +1143,63 @@ | |||
| 1143 | ;;; (foo)) | 1143 | ;;; (foo)) |
| 1144 | ;;; Further optimizations will turn (progn (list 1 2 3) 'foo) into 'foo. | 1144 | ;;; Further optimizations will turn (progn (list 1 2 3) 'foo) into 'foo. |
| 1145 | 1145 | ||
| 1146 | ;;; Some of these functions have the side effect of allocating memory | ||
| 1147 | ;;; and it would be incorrect to replace two calls with one. | ||
| 1148 | ;;; But we don't try to do those kinds of optimizations, | ||
| 1149 | ;;; so it is safe to list such functions here. | ||
| 1150 | ;;; Some of these functions return values that depend on environment | ||
| 1151 | ;;; state, so that constant folding them would be wrong, | ||
| 1152 | ;;; but we don't do constant folding based on this list. | ||
| 1153 | |||
| 1146 | ;;; I wonder if I missed any :-\) | 1154 | ;;; I wonder if I missed any :-\) |
| 1147 | (let ((side-effect-free-fns | 1155 | (let ((side-effect-free-fns |
| 1148 | '(% * + - / /= 1+ 1- < <= = > >= abs acos append aref ash asin atan | 1156 | '(% * + - / /= 1+ 1- < <= = > >= abs acos append aref ash asin atan |
| 1149 | assoc assq | 1157 | assoc assq |
| 1150 | boundp buffer-file-name buffer-local-variables buffer-modified-p | 1158 | boundp buffer-file-name buffer-local-variables buffer-modified-p |
| 1151 | buffer-substring | 1159 | buffer-substring byte-code-function-p |
| 1152 | capitalize car-less-than-car car cdr ceiling char-after char-before | 1160 | capitalize car-less-than-car car cdr ceiling char-after char-before |
| 1153 | concat coordinates-in-window-p | 1161 | char-equal char-to-string char-width |
| 1154 | char-width copy-marker cos count-lines | 1162 | compare-strings concat coordinates-in-window-p |
| 1155 | default-boundp default-value documentation downcase | 1163 | copy-alist copy-sequence copy-marker cos count-lines |
| 1156 | elt exp expt fboundp featurep | 1164 | decode-time default-boundp default-value documentation downcase |
| 1165 | elt exp expt encode-time error-message-string | ||
| 1166 | fboundp fceiling featurep ffloor | ||
| 1157 | file-directory-p file-exists-p file-locked-p file-name-absolute-p | 1167 | file-directory-p file-exists-p file-locked-p file-name-absolute-p |
| 1158 | file-newer-than-file-p file-readable-p file-symlink-p file-writable-p | 1168 | file-newer-than-file-p file-readable-p file-symlink-p file-writable-p |
| 1159 | float floor format frame-visible-p | 1169 | float float-time floor format format-time-string frame-visible-p |
| 1170 | fround ftruncate | ||
| 1160 | get gethash get-buffer get-buffer-window getenv get-file-buffer | 1171 | get gethash get-buffer get-buffer-window getenv get-file-buffer |
| 1161 | hash-table-count | 1172 | hash-table-count |
| 1162 | int-to-string | 1173 | int-to-string intern-soft |
| 1163 | keymap-parent | 1174 | keymap-parent |
| 1164 | length local-variable-if-set-p local-variable-p log log10 logand | 1175 | length local-variable-if-set-p local-variable-p log log10 logand |
| 1165 | logb logior lognot logxor lsh | 1176 | logb logior lognot logxor lsh |
| 1177 | make-list make-string make-symbol | ||
| 1166 | marker-buffer max member memq min mod | 1178 | marker-buffer max member memq min mod |
| 1167 | next-window nth nthcdr number-to-string | 1179 | next-window nth nthcdr number-to-string |
| 1168 | parse-colon-path prefix-numeric-value previous-window propertize | 1180 | parse-colon-path plist-get plist-member |
| 1169 | radians-to-degrees rassq regexp-quote reverse round | 1181 | prefix-numeric-value previous-window prin1-to-string propertize |
| 1182 | radians-to-degrees rassq rassoc read-from-string regexp-quote | ||
| 1183 | region-beginning region-end reverse round | ||
| 1170 | sin sqrt string string< string= string-equal string-lessp string-to-char | 1184 | sin sqrt string string< string= string-equal string-lessp string-to-char |
| 1171 | string-to-int string-to-number substring symbol-function symbol-plist | 1185 | string-to-int string-to-number substring sxhash symbol-function |
| 1172 | symbol-value | 1186 | symbol-name symbol-plist symbol-value |
| 1173 | tan unibyte-char-to-multibyte upcase user-variable-p vconcat | 1187 | tan truncate |
| 1188 | unibyte-char-to-multibyte upcase user-full-name | ||
| 1189 | user-login-name user-original-login-name user-variable-p | ||
| 1190 | vconcat | ||
| 1174 | window-buffer window-dedicated-p window-edges window-height | 1191 | window-buffer window-dedicated-p window-edges window-height |
| 1175 | window-hscroll window-minibuffer-p window-width | 1192 | window-hscroll window-minibuffer-p window-width |
| 1176 | zerop)) | 1193 | zerop)) |
| 1177 | (side-effect-and-error-free-fns | 1194 | (side-effect-and-error-free-fns |
| 1178 | '(arrayp atom | 1195 | '(arrayp atom |
| 1179 | bobp bolp buffer-end buffer-list buffer-size buffer-string bufferp | 1196 | bobp bolp bool-vector-p |
| 1197 | buffer-end buffer-list buffer-size buffer-string bufferp | ||
| 1180 | car-safe case-table-p cdr-safe char-or-string-p commandp cons consp | 1198 | car-safe case-table-p cdr-safe char-or-string-p commandp cons consp |
| 1181 | current-buffer current-global-map current-indentation | 1199 | current-buffer current-global-map current-indentation |
| 1182 | current-local-map current-minor-mode-maps | 1200 | current-local-map current-minor-mode-maps current-time |
| 1183 | dot dot-marker eobp eolp eq equal eventp | 1201 | current-time-string current-time-zone |
| 1202 | eobp eolp eq equal eventp | ||
| 1184 | floatp following-char framep | 1203 | floatp following-char framep |
| 1185 | get-largest-window get-lru-window | 1204 | get-largest-window get-lru-window |
| 1186 | hash-table-p | 1205 | hash-table-p |
| @@ -1194,14 +1213,14 @@ | |||
| 1194 | one-window-p overlayp | 1213 | one-window-p overlayp |
| 1195 | point point-marker point-min point-max preceding-char processp | 1214 | point point-marker point-min point-max preceding-char processp |
| 1196 | recent-keys recursion-depth | 1215 | recent-keys recursion-depth |
| 1197 | selected-frame selected-window sequencep stringp subrp symbolp | 1216 | safe-length selected-frame selected-window sequencep |
| 1198 | standard-case-table standard-syntax-table syntax-table-p | 1217 | standard-case-table standard-syntax-table stringp subrp symbolp |
| 1218 | syntax-table syntax-table-p | ||
| 1199 | this-command-keys this-command-keys-vector this-single-command-keys | 1219 | this-command-keys this-command-keys-vector this-single-command-keys |
| 1200 | this-single-command-raw-keys | 1220 | this-single-command-raw-keys |
| 1201 | user-full-name user-login-name user-original-login-name | ||
| 1202 | user-real-login-name user-real-uid user-uid | 1221 | user-real-login-name user-real-uid user-uid |
| 1203 | vector vectorp visible-frame-list | 1222 | vector vectorp visible-frame-list |
| 1204 | window-configuration-p window-live-p windowp))) | 1223 | wholenump window-configuration-p window-live-p windowp))) |
| 1205 | (while side-effect-free-fns | 1224 | (while side-effect-free-fns |
| 1206 | (put (car side-effect-free-fns) 'side-effect-free t) | 1225 | (put (car side-effect-free-fns) 'side-effect-free t) |
| 1207 | (setq side-effect-free-fns (cdr side-effect-free-fns))) | 1226 | (setq side-effect-free-fns (cdr side-effect-free-fns))) |