~nytpu/nytpu.lisp-utils

74caaba7bda9e2883c2fad01bb399b9befd4a609 — nytpu 28 days ago 2d9f36f master
BIND: fix issue if first form of BIND* is not a list

Fix issue when BIND* attempts to parse for declarations and the first form
isn't a list
1 files changed, 9 insertions(+), 6 deletions(-)

M bind.lisp
M bind.lisp => bind.lisp +9 -6
@@ 280,15 280,18 @@ value from the alist."
remaining body forms."
  (do* ((decls nil)
        (forms body (cdr forms))
        (form #1=(car forms) #1#)
        (decl #2=(cdr form) #2#))
        (form #1=(car forms) #1#))
      ((or (not forms)
           (atom form)
           (not (eq 'cl:declare (car form))))
       (values (nreverse decls) forms))
    ;; check if there are multiple declarations in one DECLARE form
    (if (consp (car decl))
        (setf decls (append (reverse decl) decls))
        (push decl decls))))
    (format t "~a~%" form)
    (when (listp form)
      (let ((decl (cdr form)))
        ;; check if there are multiple declarations in one DECLARE form
        (if (consp (car decl))
            (setf decls (append (reverse decl) decls))
            (push decl decls))))))

#|
(separate-declarations