Re: SBCL complains where Lispwork does not: loop for i for j

Liste des GroupesRevenir à cl lisp 
Sujet : Re: SBCL complains where Lispwork does not: loop for i for j
De : Nobody447095 (at) *nospam* here-nor-there.org (B. Pym)
Groupes : comp.lang.lisp
Date : 18. Jun 2025, 23:47:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <102vfms$3e82v$1@dont-email.me>
User-Agent : XanaNews/1.18.1.6
 JT> CL-USER 1 > (loop for i for j in '(a b c) collect (cons i j))
 JT> => ((0 . A) (1 . B) (2 . C))
 
and, do you really like that code? is it readable?
if I encounter such stuff, i'd yell "WTF??".
 
 JT> I found a way around it 'for i from 0'
 
as others have noted, canonic way is to use upfrom. for i upfrom 0.
perfectly readable and makes sense for anybody, even if they do not know the
language.

Let's see if we can make it shorter by using a Lispy language
instead of CL.

Gauche Scheme

(map cons (liota) '(a b c))
  ===>
((0 . a) (1 . b) (2 . c))

Date Sujet#  Auteur
18 Jun 25 o Re: SBCL complains where Lispwork does not: loop for i for j1B. Pym

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal