mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-15 22:01:36 -08:00
ECL now supports IF/WHILE statements interleaved with FOR/AS
This commit is contained in:
parent
9a8e037d75
commit
271db1483d
1 changed files with 8 additions and 2 deletions
|
|
@ -932,6 +932,12 @@ collected result will be returned as the value of the LOOP."
|
|||
(declare (si::c-local))
|
||||
`(return-from ,(car *loop-names*) ,form))
|
||||
|
||||
(defun loop-pseudo-body (form)
|
||||
(declare (si::c-local))
|
||||
(cond ((or *loop-emitted-body* *loop-inside-conditional*)
|
||||
(push form *loop-body*))
|
||||
(t (push form *loop-before-loop*) (push form *loop-after-body*))))
|
||||
|
||||
(defun loop-emit-body (form)
|
||||
(declare (si::c-local))
|
||||
(setq *loop-emitted-body* t)
|
||||
|
|
@ -1173,7 +1179,7 @@ collected result will be returned as the value of the LOOP."
|
|||
(when (loop-tequal (car *loop-source-code*) :end)
|
||||
(loop-pop-source))
|
||||
(when it-p (setq form `(setq ,it-p ,form)))
|
||||
(loop-emit-body
|
||||
(loop-pseudo-body
|
||||
`(if ,(if negatep `(not ,form) form)
|
||||
,then
|
||||
,@else))))))
|
||||
|
|
@ -1350,7 +1356,7 @@ collected result will be returned as the value of the LOOP."
|
|||
|
||||
(defun loop-do-while (negate kwd &aux (form (loop-get-form)))
|
||||
(loop-disallow-conditional kwd)
|
||||
(loop-emit-body `(,(if negate 'when 'unless) ,form (go end-loop))))
|
||||
(loop-pseudo-body `(,(if negate 'when 'unless) ,form (go end-loop))))
|
||||
|
||||
|
||||
(defun loop-do-with ()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue