/[guile]/guile/guile-core/libguile/eval.c
ViewVC logotype

Diff of /guile/guile-core/libguile/eval.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.306 by dirk, Tue May 6 20:17:26 2003 UTC revision 1.307 by dirk, Mon May 19 20:15:08 2003 UTC
# Line 623  scm_m_delay (SCM xorig, SCM env SCM_UNUS Line 623  scm_m_delay (SCM xorig, SCM env SCM_UNUS
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
# Line 667  scm_m_do (SCM xorig, SCM env SCM_UNUSED) Line 667  scm_m_do (SCM xorig, SCM env SCM_UNUSED)
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    
# Line 1413  unmemocopy (SCM x, SCM env) Line 1413  unmemocopy (SCM x, SCM env)
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);
# Line 2208  dispatch: Line 2208  dispatch:
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);

Legend:
Removed from v.1.306  
changed lines
  Added in v.1.307

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26