projects
/
jscl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Remove duplicated string conversion
[jscl.git]
/
tests
/
iter-macros.lisp
1
; Tests for macros implementing iteration constructs
2
; DOTIMES
3
(test (let ((total 0))
4
(dotimes (n 6)
5
(incf total n))
6
(= total 15)))
7
8
; DOLIST
9
(test (let ((total 0))
10
(dolist (n '(1 2 3 4 5))
11
(incf total n))
12
(= total 15)))
13
14
; DO
15
(test (do ((a 0 b)
16
(b 1 (+ a b))
17
(n 0 (1+ n)))
18
((= n 10)
19
(= a 55))))
20
21
; DO*
22
(test (do* ((a 0 b)
23
(b 1 (+ a b))
24
(n 0 (1+ n)))
25
((= n 10)
26
(= a 512))))