-
Notifications
You must be signed in to change notification settings - Fork 0
/
clisp.loop
46 lines (44 loc) · 1.89 KB
/
clisp.loop
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
(macroexpand-1 ' (loop for i from 0 below n
for elt in l
for tail on l
collect elt into q
finally (return (values q (rest tail)))))
(macrolet ((loop-finish () (system::loop-finish-error)))
(block nil
(let ((i 0)
(#:limit-8783 n))
(progn
(let ((#:list-8784 nil))
(let nil
(let ((elt nil))
(let ((tail nil))
(let nil
(let ((#:q8785 nil)
(q nil))
(macrolet ((loop-finish () '(go system::end-loop)))
(tagbody
(setq #:list-8784 l)
(setq tail l)
system::begin-loop
(when (>= i #:limit-8783)
(loop-finish))
(when (endp #:list-8784)
(loop-finish))
(setq elt (car #:list-8784))
(when (atom tail)
(loop-finish))
(progn
(let ((#:addlist-8786 (list elt)))
(if q
(setf #:q8785 (setf (cdr #:q8785) #:addlist-8786))
(setf #:q8785 (setf q #:addlist-8786)))))
(psetq i (+ i 1))
(psetq #:list-8784 (cdr #:list-8784))
(psetq tail (cdr tail))
(go system::begin-loop)
system::end-loop
(macrolet ((loop-finish ()
(system::loop-finish-warn)
'(go system::end-loop)))
(progn
(return (values q (rest tail)))))))))))))))))