comparison lisp/cl-macs.el @ 5342:174aed57a32a

Require that NAME be an unquoted symbol, #'block, #'return-from 2011-01-22 Aidan Kehoe <kehoea@parhasard.net> * cl-macs.el (block, return-from): Require that NAME be a symbol in these macros, as always documented in the #'block docstring and as required by Common Lisp. * descr-text.el (unidata-initialize-unihan-database): Correct the use of non-symbols in #'block and #'return-from in this function.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 22 Jan 2011 17:20:19 +0000
parents ba62563ec7c7
children b4ef3128160c
comparison
equal deleted inserted replaced
5340:9dd4559b9e9a 5342:174aed57a32a
743 dynamically scoped: Only references to it within BODY will work. These 743 dynamically scoped: Only references to it within BODY will work. These
744 references may appear inside macro expansions, but not inside functions 744 references may appear inside macro expansions, but not inside functions
745 called from BODY." 745 called from BODY."
746 (if (cl-safe-expr-p (cons 'progn body)) (cons 'progn body) 746 (if (cl-safe-expr-p (cons 'progn body)) (cons 'progn body)
747 (list 'cl-block-wrapper 747 (list 'cl-block-wrapper
748 (list* 'catch (list 'quote (intern (format "--cl-block-%s--" name))) 748 (list* 'catch (list 'quote (intern (concat "--cl-block-"
749 (symbol-name name) "--")))
749 body)))) 750 body))))
750 751
751 (defvar cl-active-block-names nil) 752 (defvar cl-active-block-names nil)
752 753
753 (put 'cl-block-wrapper 'byte-compile 754 (put 'cl-block-wrapper 'byte-compile
786 "Return from the block named NAME. 787 "Return from the block named NAME.
787 This jumps out to the innermost enclosing `(block NAME ...)' form, 788 This jumps out to the innermost enclosing `(block NAME ...)' form,
788 returning RESULT from that form (or nil if RESULT is omitted). 789 returning RESULT from that form (or nil if RESULT is omitted).
789 This is compatible with Common Lisp, but note that `defun' and 790 This is compatible with Common Lisp, but note that `defun' and
790 `defmacro' do not create implicit blocks as they do in Common Lisp." 791 `defmacro' do not create implicit blocks as they do in Common Lisp."
791 (let ((name2 (intern (format "--cl-block-%s--" name)))) 792 (let ((name2 (intern (concat "--cl-block-" (symbol-name name) "--"))))
792 (list 'cl-block-throw (list 'quote name2) result))) 793 (list 'cl-block-throw (list 'quote name2) result)))
793 794
794 795
795 ;;; The "loop" macro. 796 ;;; The "loop" macro.
796 797