fix: more strange Lisp example
This commit is contained in:
parent
9346a85884
commit
5d31db1584
|
|
@ -42,8 +42,9 @@
|
||||||
|
|
||||||
(print "Hello, world!") ; prints Hello, world!
|
(print "Hello, world!") ; prints Hello, world!
|
||||||
|
|
||||||
|
(defvar lower_bound 1)
|
||||||
(loop
|
(loop
|
||||||
for i from 1 to (+ 1505 -1495)
|
for i from lower_bound to (+ 1505 -1495)
|
||||||
do (print i)
|
do (print i)
|
||||||
) ; prints 1 2 3 4 5 6 7 8 9 10
|
) ; 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 (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
|
(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
|
(dotimes (i 10) (print (aref arr i))) ; prints 0 1 8 27 64 125 216 343 512 729
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue