mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-04-28 20:30:54 -07:00
The macro expander for DOLIST in the compiler is now a compiler macro. It also uses an implicit TAGBODY around the body of the DOLIST.
This commit is contained in:
parent
3067537c33
commit
ad0c81bff4
1 changed files with 4 additions and 5 deletions
|
|
@ -39,7 +39,6 @@
|
|||
forms))
|
||||
|
||||
(defun expand-typep (form object type env)
|
||||
(declare (si::c-local))
|
||||
;; This function is reponsible for expanding (TYPEP object type)
|
||||
;; forms into a reasonable set of system calls. When it fails to
|
||||
;; match the compiler constraints on speed and space, it simply
|
||||
|
|
@ -171,8 +170,8 @@
|
|||
;;; other possible type checks.
|
||||
;;;
|
||||
|
||||
(eval-when (:load-toplevel)
|
||||
(defmacro dolist ((var expression &optional output-form) &body body &environment env)
|
||||
(define-compiler-macro dolist
|
||||
((var expression &optional output-form) &body body &environment env)
|
||||
(multiple-value-bind (declarations body)
|
||||
(si:process-declarations body nil)
|
||||
(let* ((list-var (gensym))
|
||||
|
|
@ -184,13 +183,13 @@
|
|||
(si::while ,list-var
|
||||
(let ((,var (first ,typed-var)))
|
||||
(declare ,@declarations)
|
||||
,@body)
|
||||
(tagbody
|
||||
,@body))
|
||||
(setq ,list-var (rest ,typed-var)))
|
||||
,(when output-form
|
||||
`(let ((,var nil))
|
||||
(declare ,@declarations)
|
||||
,output-form)))))))
|
||||
)
|
||||
|
||||
;;;
|
||||
;;; COERCE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue