mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-13 21:02:47 -08:00
WITH-COUNT did not allow inserting declarations at the beginning of the body
This commit is contained in:
parent
480e227d2c
commit
39e7f02a79
1 changed files with 3 additions and 2 deletions
|
|
@ -16,13 +16,14 @@
|
|||
|
||||
(defmacro with-count ((count &optional (value count) &key (output nil output-p))
|
||||
&body body)
|
||||
(setf body `(locally ,@body))
|
||||
`(let ((,count (sequence-count ,value)))
|
||||
(declare (fixnum ,count))
|
||||
,(if output-p
|
||||
`(if (plusp ,count)
|
||||
,@body
|
||||
,body
|
||||
,output)
|
||||
`(progn ,@body))))
|
||||
body)))
|
||||
|
||||
(defmacro with-predicate ((predicate) &body body)
|
||||
`(let ((,predicate (si::coerce-to-function ,predicate)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue