fix: more strange Lisp example

This commit is contained in:
Eatswap 2022-12-11 19:50:07 +08:00
parent 9346a85884
commit 5d31db1584
Signed by: Eatswap
GPG Key ID: BE661106A1F3FA0B
1 changed files with 3 additions and 2 deletions

View File

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