GNU bug report logs -
#48219
27.1.90; CL-LOOP facility fails with hash tables
Previous Next
Full log
View this message in rfc822 format
Juan José García Ripoll <juanjose.garcia.ripoll <at> csic.es> writes:
> (cl-loop
> for database in nil
> for aux = (message "databse: %S" database)
> for entry being the hash-values of database
> do (message "FOO %S" database))
>
> This code should do nothing, because variable DATABASE runs over an empty list. Yet the macroexpansion of the loop produces code that tries to run over the entries of DATABASE, which is NIL.
>
> (cl--block-wrapper
> (catch '--cl-block-nil--
> (let* ((--cl-var-- nil)
> (database nil)
> (aux nil))
> (cl-block --cl-finish--
> (maphash (lambda (--cl-var-- entry)
> (or (consp --cl-var--) (cl-return-from --cl-finish-- nil))
> (setq database (car --cl-var--))
> (setq aux (message "databse: %S" database))
> (message "FOO %S" database)
> (setq --cl-var-- (cdr --cl-var--)))
> database))
> nil)))
(I'm going through old bug reports that unfortunately weren't resolved
at the time.)
Yes, that does seem wrong. I had a brief look at cl--parse-loop-clause,
but this is code I haven't looked at before, and I'm not sure I
understand the control flow here. Adding Stefan to the CCs; I'm sure he
can tell what should be done immediately. 😀
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 3 years and 39 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.