Sujet : Re: the "loop" macro
De : Nobody447095 (at) *nospam* here-nor-there.org (B. Pym)
Groupes : comp.lang.lispDate : 23. Jun 2025, 09:45:00
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <103b46b$1560o$1@dont-email.me>
User-Agent : XanaNews/1.18.1.6
M. Pitman wrote:
(loop with best-foo = nil ;untested
for foo in (list foo1 foo2)
when (or (not best-foo)
(> (weight foo) (weight best-foo)))
do (setq best-foo foo)
finally (return best-foo))
Gauche Scheme:
(use gauche.collection :only (find-max))
(find-max '((a 2) (b 8) (c 5)) :key last)
===>
(b 8)