Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

Stay away from hurricanes for a while.


comp / comp.lang.lisp / re: continuing next iteration

SubjectAuthor
o re: continuing next iterationB. Pym

1
Subject: re: continuing next iteration
From: B. Pym
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Thu, 4 Jul 2024 02:11 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: No_spamming@noWhere_7073.org (B. Pym)
Newsgroups: comp.lang.lisp
Subject: re: continuing next iteration
Date: Thu, 4 Jul 2024 02:11:50 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <v650d5$2is8h$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Date: Thu, 04 Jul 2024 04:11:50 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="abb810ea9b3128bf26ac25de51191f89";
logging-data="2715921"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19LyOxFgjB0i+Lm6f7vRzIa"
User-Agent: XanaNews/1.18.1.6
Cancel-Lock: sha1:pZfg0oEfLEoj2yu9LboZRUb8dKo=
View all headers

> > (loop for i below 6
> finally (return (reverse (pairlis list list2)))
> do (format t "~d" i)
> collect i into list
> do (format t "^2 = ~2d~%" (* i i))
> collect (* i i) into list2)
> 0^2 = 0
> 1^2 = 1
> 2^2 = 4
> 3^2 = 9
> 4^2 = 16
> 5^2 = 25
> ((0 . 0) (1 . 1) (2 . 4) (3 . 9) (4 . 16) (5 . 25))

(do ((i 0 (+ i 1))
(_ 0 (format #t "^2 = ~2D~%" (* i i)))
(lst '() (cons i lst))
(lst2 '() (cons (* i i) lst2)))
((= i 6) (reverse (map cons lst lst2)))
(format #t "~D" i ))

===>
0^2 = 0
1^2 = 1
2^2 = 4
3^2 = 9
4^2 = 16
5^2 = 25
((0 . 0) (1 . 1) (2 . 4) (3 . 9) (4 . 16) (5 . 25))

1

rocksolid light 0.9.8
clearnet tor