unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: "Juan José García Ripoll" <juanjose.garcia.ripoll@csic.es>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, 48219@debbugs.gnu.org
Subject: bug#48219: 27.1.90; CL-LOOP facility fails with hash tables
Date: Fri, 01 Jul 2022 14:03:21 +0200	[thread overview]
Message-ID: <87mtdt59bq.fsf@gnus.org> (raw)
In-Reply-To: <86eeemnawu.fsf@csic.es> ("Juan José García Ripoll"'s message of "Tue, 04 May 2021 10:46:57 +0200")

Juan José García Ripoll <juanjose.garcia.ripoll@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





  reply	other threads:[~2022-07-01 12:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04  8:46 bug#48219: 27.1.90; CL-LOOP facility fails with hash tables Juan José García Ripoll
2022-07-01 12:03 ` Lars Ingebrigtsen [this message]
2022-07-01 14:03   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-02 11:24     ` Lars Ingebrigtsen
2022-07-02 20:20       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-03 12:18         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mtdt59bq.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=48219@debbugs.gnu.org \
    --cc=juanjose.garcia.ripoll@csic.es \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).