[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#48219: 27.1.90; CL-LOOP facility fails with hash tables
From: |
Lars Ingebrigtsen |
Subject: |
bug#48219: 27.1.90; CL-LOOP facility fails with hash tables |
Date: |
Sat, 02 Jul 2022 13:24:36 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Stefan Monnier <monnier@iro.umontreal.ca> 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