Deutsch   English   Français   Italiano  
<102vfms$3e82v$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: "B. Pym" <Nobody447095@here-nor-there.org>
Newsgroups: comp.lang.lisp
Subject: Re: SBCL complains where Lispwork does not: loop for i for j
Date: Wed, 18 Jun 2025 22:47:57 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <102vfms$3e82v$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Date: Thu, 19 Jun 2025 00:47:57 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="552a7f8b7ef24a959eabae8d64e92502";
	logging-data="3612767"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX196WqnHbfzZ0cUTVcfzooGi"
User-Agent: XanaNews/1.18.1.6
Cancel-Lock: sha1:7vjqVKpUMLbTgHFdwW9W3LKbGC4=

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