623 |
|
|
624 |
;; becomes |
;; becomes |
625 |
|
|
626 |
(#@do (varn ... var2 var1) |
(#@do (<init1> <init2> ... <initn>) |
627 |
(<init1> <init2> ... <initn>) |
(varn ... var2 var1) |
628 |
(<test> <return>) |
(<test> <return>) |
629 |
(<body>) |
(<body>) |
630 |
<step1> <step2> ... <stepn>) ;; missing steps replaced by var |
<step1> <step2> ... <stepn>) ;; missing steps replaced by var |
667 |
x = SCM_CDR (x); |
x = SCM_CDR (x); |
668 |
SCM_ASSYNT (scm_ilength (SCM_CAR (x)) >= 1, scm_s_test, "do"); |
SCM_ASSYNT (scm_ilength (SCM_CAR (x)) >= 1, scm_s_test, "do"); |
669 |
x = scm_cons2 (SCM_CAR (x), SCM_CDR (x), steps); |
x = scm_cons2 (SCM_CAR (x), SCM_CDR (x), steps); |
670 |
x = scm_cons2 (vars, inits, x); |
x = scm_cons2 (inits, vars, x); |
671 |
return scm_cons (SCM_IM_DO, x); |
return scm_cons (SCM_IM_DO, x); |
672 |
} |
} |
673 |
|
|
1413 |
break; |
break; |
1414 |
case SCM_BIT7 (SCM_IM_DO): |
case SCM_BIT7 (SCM_IM_DO): |
1415 |
{ |
{ |
1416 |
/* format: (#@do (nk nk-1 ...) (i1 ... ik) (test) (body) s1 ... sk), |
/* format: (#@do (i1 ... ik) (nk nk-1 ...) (test) (body) s1 ... sk), |
1417 |
* where nx is the name of a local variable, ix is an initializer for |
* where ix is an initializer for a local variable, nx is the name of |
1418 |
* the local variable, test is the test clause of the do loop, body is |
* the local variable, test is the test clause of the do loop, body is |
1419 |
* the body of the do loop and sx are the step clauses for the local |
* the body of the do loop and sx are the step clauses for the local |
1420 |
* variables. */ |
* variables. */ |
1421 |
SCM names, inits, test, memoized_body, steps, bindings; |
SCM names, inits, test, memoized_body, steps, bindings; |
1422 |
|
|
1423 |
x = SCM_CDR (x); |
x = SCM_CDR (x); |
|
names = SCM_CAR (x); |
|
|
x = SCM_CDR (x); |
|
1424 |
inits = scm_reverse (unmemocopy (SCM_CAR (x), env)); |
inits = scm_reverse (unmemocopy (SCM_CAR (x), env)); |
1425 |
|
x = SCM_CDR (x); |
1426 |
|
names = SCM_CAR (x); |
1427 |
env = SCM_EXTEND_ENV (names, SCM_EOL, env); |
env = SCM_EXTEND_ENV (names, SCM_EOL, env); |
1428 |
x = SCM_CDR (x); |
x = SCM_CDR (x); |
1429 |
test = unmemocopy (SCM_CAR (x), env); |
test = unmemocopy (SCM_CAR (x), env); |
2208 |
x = SCM_CDR (x); |
x = SCM_CDR (x); |
2209 |
{ |
{ |
2210 |
/* Compute the initialization values and the initial environment. */ |
/* Compute the initialization values and the initial environment. */ |
2211 |
SCM init_forms = SCM_CADR (x); |
SCM init_forms = SCM_CAR (x); |
2212 |
SCM init_values = SCM_EOL; |
SCM init_values = SCM_EOL; |
2213 |
while (!SCM_NULLP (init_forms)) |
while (!SCM_NULLP (init_forms)) |
2214 |
{ |
{ |
2215 |
init_values = scm_cons (EVALCAR (init_forms, env), init_values); |
init_values = scm_cons (EVALCAR (init_forms, env), init_values); |
2216 |
init_forms = SCM_CDR (init_forms); |
init_forms = SCM_CDR (init_forms); |
2217 |
} |
} |
2218 |
|
x = SCM_CDR (x); |
2219 |
env = SCM_EXTEND_ENV (SCM_CAR (x), init_values, env); |
env = SCM_EXTEND_ENV (SCM_CAR (x), init_values, env); |
2220 |
} |
} |
2221 |
x = SCM_CDDR (x); |
x = SCM_CDR (x); |
2222 |
{ |
{ |
2223 |
SCM test_form = SCM_CAR (x); |
SCM test_form = SCM_CAR (x); |
2224 |
SCM body_forms = SCM_CADR (x); |
SCM body_forms = SCM_CADR (x); |