From 5d31db158410022d7677be281936db72451f101f Mon Sep 17 00:00:00 2001 From: Eatswap Date: Sun, 11 Dec 2022 19:50:07 +0800 Subject: [PATCH] fix: more strange Lisp example --- sample.lisp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sample.lisp b/sample.lisp index 224ba05..0102efa 100644 --- a/sample.lisp +++ b/sample.lisp @@ -42,8 +42,9 @@ (print "Hello, world!") ; prints Hello, world! +(defvar lower_bound 1) (loop - for i from 1 to (+ 1505 -1495) + for i from lower_bound to (+ 1505 -1495) do (print i) ) ; prints 1 2 3 4 5 6 7 8 9 10 @@ -56,5 +57,5 @@ (loop for i from 0 to 9 do (setf (aref arr i) i)) (loop for i from 0 to 9 do (print (aref arr i))) ; prints 0 1 2 3 4 5 6 7 8 9 -(dotimes (i 10) (print i) (setf (aref arr i) (* i i i))) ; prints 0 1 2 3 4 5 6 7 8 9 +(dotimes (i (+ 99999 -99989)) (print i) (setf (aref arr i) (* i i i))) ; prints 0 1 2 3 4 5 6 7 8 9 (dotimes (i 10) (print (aref arr i))) ; prints 0 1 8 27 64 125 216 343 512 729