[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
LOOP question
- To: clisp-list@ma2s2.mathematik.uni-karlsruhe.de
- Subject: LOOP question
- From: Wilhelm Burger <wilbur@cast.uni-linz.ac.at>
- Date: Tue, 12 Sep 1995 16:13:10 +0200
- Cc: wilbur@cadillac
Hi,
I am having problems with the following loop construct which
evaluates differently in LUCID and CLISP:
;;;-------------------------------------------------
lucid> (loop for i in '(1 2 3)
for j = (1+ i)
for k = (1- i)
do (print (list j k))
collect (* j k))
(2 0)
(3 1)
(4 2)
(0 3 8)
;;;-------------------------------------------------
;;;-------------------------------------------------
clisp> (loop for i in '(1 2 3)
for j = (1+ i)
for k = (1- i)
do (print (list j k))
collect (* j k))
(2 0)
(3 1)
(4 2)
*** - argument to 1+ should be a number: NIL
1. Break>
;;;-------------------------------------------------
Are the 2 "for"-bindings for j and k resp. supposed (allowed) to be
evaluated when the end of the list has already been reached (i.e., when
i is NIL)?
Regards,
Wilbur.
---
Wilhelm Burger, Johannes Kepler University, A-4040 Linz, Austria
Email:wilbur@cast.uni-linz.ac.at/Tel: +43 732 2468 898, Fax: 893