emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: edebug specs for cl-loop


From: Stefan Monnier
Subject: Re: edebug specs for cl-loop
Date: Fri, 10 Aug 2012 12:20:04 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

>>> Indeed, yes it is working in both cases WITHOUT your commented edebug
>>> specs too.  So I am a little bit lost because it was not working some
>>> days ago without them.
>> At some point, there was a bug where the debug spec set on `cl-loop' did
>> not apply to the `loop' alias.  Maybe that's what you bumped into.
> This one is not working without the commented stuff of cl-macs:

> (loop for (k . v) in '((a . 1) (b . 2) (c . 3))
>       collect (cons k (1+ v)))

> ==> edebug-syntax-error: Invalid read syntax: "Dotted spec required."

Good point.  The patch below should address this issue,


        Stefan


=== modified file 'lisp/emacs-lisp/cl-macs.el'
--- lisp/emacs-lisp/cl-macs.el  2012-08-06 19:53:45 +0000
+++ lisp/emacs-lisp/cl-macs.el  2012-08-10 15:49:23 +0000
@@ -731,7 +731,12 @@
   finally return EXPR, named NAME.
 
 \(fn CLAUSE...)"
-  (declare (debug (&rest &or symbolp form)))
+  (declare (debug (&rest &or
+                         ;; These are usually followed by a symbol, but it can
+                         ;; actually be any destructuring-bind pattern.
+                         [[&or "for" "as" "with" "and"] sexp]
+                         ;; Simple default, which covers 99% of the cases.
+                         symbolp form)))
   (if (not (memq t (mapcar 'symbolp (delq nil (delq t (cl-copy-list 
loop-args))))))
       `(cl-block nil (while t ,@loop-args))
     (let ((cl--loop-args loop-args) (cl--loop-name nil) (cl--loop-bindings nil)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]