Subject: Re: bug#48219: 27.1.90; CL-LOOP facility fails with hash tables

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 02 Jul 2022 13:24:36 +0200

Stefan Monnier <[email-masked]> writes:

>> Yes, that does seem wrong.
>
> Agreed, but I don't know what the code is supposed to do when `database`
> is not-nil, so I can't even tell if the code is meaningful.

(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))

Hm...  Oh, yeah -- that's not really a meaningful loop statement, is it?
But by analogue, this equally pointless loop returns nil:

(cl-loop
 for database in '((1) (2))
 for entry in database
 collect entry)

So I guess the original loop should also do that.

But since it's a meaningless loop, perhaps erroring out in the hash
table case is fine, too?

>> 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.  😀
>
> Well, it's fairly obvious: we should just fix the problem.
> Next!

Whew!  That was simple!

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no