comparison lisp/cl-macs.el @ 5376:4b529b940e2e

Eliminate unused blocks named nil, too, cl-macs.el, bytecomp.el 2011-03-17 Aidan Kehoe <kehoea@parhasard.net> * bytecomp.el (byte-compile-catch): * bytecomp.el (byte-compile-throw): * cl-macs.el (return-from): With `block' and `return-from', a nil NAME is perfectly legitimate, and the corresponding `catch' statements need be removed by the byte-compiler. 5dd1ba5e0113 , my change of 2011-02-12, didn't do this; correct that now.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 17 Mar 2011 21:07:16 +0000
parents 8b70d37ab80e
children a32a108ae815
comparison
equal deleted inserted replaced
5375:2fba45e5b48d 5376:4b529b940e2e
765 This jumps out to the innermost enclosing `(block NAME ...)' form, 765 This jumps out to the innermost enclosing `(block NAME ...)' form,
766 returning RESULT from that form (or nil if RESULT is omitted). 766 returning RESULT from that form (or nil if RESULT is omitted).
767 This is compatible with Common Lisp, but note that `defun' and 767 This is compatible with Common Lisp, but note that `defun' and
768 `defmacro' do not create implicit blocks as they do in Common Lisp." 768 `defmacro' do not create implicit blocks as they do in Common Lisp."
769 `(throw ',(or (cdr (assq name cl-active-block-names)) 769 `(throw ',(or (cdr (assq name cl-active-block-names))
770 (prog1 (copy-symbol name) 770 ;; Tell the byte-compiler the original name of the block,
771 (and-fboundp 'byte-compile-warn (cl-compiling-file) 771 ;; leave any warning to it.
772 (byte-compile-warn 772 (let ((copy-symbol (copy-symbol name)))
773 "return-from: no enclosing block named `%s'" 773 (put copy-symbol 'cl-block-name name)
774 name)))) 774 copy-symbol))
775 ,result)) 775 ,result))
776 776
777 ;;; The "loop" macro. 777 ;;; The "loop" macro.
778 778
779 (defvar args) (defvar loop-accum-var) (defvar loop-accum-vars) 779 (defvar args) (defvar loop-accum-var) (defvar loop-accum-vars)
780 (defvar loop-bindings) (defvar loop-body) (defvar loop-destr-temps) 780 (defvar loop-bindings) (defvar loop-body) (defvar loop-destr-temps)