1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 14:21:10 +02:00

* eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_0,

scm_trampoline_1, scm_trampoline_2): Postpone error cases to the
	end of an if-else-if-sequence of checks.
This commit is contained in:
Dirk Herrmann 2003-05-31 07:38:04 +00:00
parent 9a069bdd77
commit 2ca0d20720
2 changed files with 30 additions and 24 deletions

View file

@ -1,3 +1,9 @@
2003-05-31 Dirk Herrmann <D.Herrmann@tu-bs.de>
* eval.c (SCM_CEVAL, SCM_APPLY, scm_trampoline_0,
scm_trampoline_1, scm_trampoline_2): Postpone error cases to the
end of an if-else-if-sequence of checks.
2003-05-30 Dirk Herrmann <D.Herrmann@tu-bs.de> 2003-05-30 Dirk Herrmann <D.Herrmann@tu-bs.de>
* eval.c (SCM_CEVAL): Improved readability of call-with-values * eval.c (SCM_CEVAL): Improved readability of call-with-values

View file

@ -2868,9 +2868,7 @@ evapply: /* inputs: x, proc */
arg1 = SCM_EOL; arg1 = SCM_EOL;
goto type_dispatch; goto type_dispatch;
} }
else if (!SCM_I_OPERATORP (proc)) else if (SCM_I_OPERATORP (proc))
goto badfun;
else
{ {
arg1 = proc; arg1 = proc;
proc = (SCM_I_ENTITYP (proc) proc = (SCM_I_ENTITYP (proc)
@ -2882,6 +2880,8 @@ evapply: /* inputs: x, proc */
#endif #endif
goto evap1; goto evap1;
} }
else
goto badfun;
case scm_tc7_subr_1: case scm_tc7_subr_1:
case scm_tc7_subr_2: case scm_tc7_subr_2:
case scm_tc7_subr_2o: case scm_tc7_subr_2o:
@ -3011,9 +3011,7 @@ evapply: /* inputs: x, proc */
#endif #endif
goto type_dispatch; goto type_dispatch;
} }
else if (!SCM_I_OPERATORP (proc)) else if (SCM_I_OPERATORP (proc))
goto badfun;
else
{ {
arg2 = arg1; arg2 = arg1;
arg1 = proc; arg1 = proc;
@ -3026,6 +3024,8 @@ evapply: /* inputs: x, proc */
#endif #endif
goto evap2; goto evap2;
} }
else
goto badfun;
case scm_tc7_subr_2: case scm_tc7_subr_2:
case scm_tc7_subr_0: case scm_tc7_subr_0:
case scm_tc7_subr_3: case scm_tc7_subr_3:
@ -3095,9 +3095,7 @@ evapply: /* inputs: x, proc */
#endif #endif
goto type_dispatch; goto type_dispatch;
} }
else if (!SCM_I_OPERATORP (proc)) else if (SCM_I_OPERATORP (proc))
goto badfun;
else
{ {
operatorn: operatorn:
#ifdef DEVAL #ifdef DEVAL
@ -3118,6 +3116,8 @@ evapply: /* inputs: x, proc */
SCM_EOL)); SCM_EOL));
#endif #endif
} }
else
goto badfun;
case scm_tc7_subr_0: case scm_tc7_subr_0:
case scm_tc7_cxr: case scm_tc7_cxr:
case scm_tc7_subr_1o: case scm_tc7_subr_1o:
@ -3309,10 +3309,10 @@ evapply: /* inputs: x, proc */
x = SCM_ENTITY_PROCEDURE (proc); x = SCM_ENTITY_PROCEDURE (proc);
goto type_dispatch; goto type_dispatch;
} }
else if (!SCM_I_OPERATORP (proc)) else if (SCM_I_OPERATORP (proc))
goto badfun;
else
goto operatorn; goto operatorn;
else
goto badfun;
case scm_tc7_subr_2: case scm_tc7_subr_2:
case scm_tc7_subr_1o: case scm_tc7_subr_1o:
case scm_tc7_subr_2o: case scm_tc7_subr_2o:
@ -3762,9 +3762,7 @@ tail:
#endif #endif
RETURN (scm_apply_generic (proc, args)); RETURN (scm_apply_generic (proc, args));
} }
else if (!SCM_I_OPERATORP (proc)) else if (SCM_I_OPERATORP (proc))
goto badproc;
else
{ {
/* operator */ /* operator */
#ifdef DEVAL #ifdef DEVAL
@ -3785,6 +3783,8 @@ tail:
else else
goto badproc; goto badproc;
} }
else
goto badproc;
default: default:
badproc: badproc:
scm_wrong_type_arg ("apply", SCM_ARG1, proc); scm_wrong_type_arg ("apply", SCM_ARG1, proc);
@ -3895,9 +3895,9 @@ scm_trampoline_0 (SCM proc)
case scm_tcs_struct: case scm_tcs_struct:
if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC) if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC)
return scm_call_generic_0; return scm_call_generic_0;
else if (!SCM_I_OPERATORP (proc)) else if (SCM_I_OPERATORP (proc))
return NULL; return scm_call_0;
return scm_call_0; return NULL;
case scm_tc7_smob: case scm_tc7_smob:
if (SCM_SMOB_APPLICABLE_P (proc)) if (SCM_SMOB_APPLICABLE_P (proc))
return SCM_SMOB_DESCRIPTOR (proc).apply_0; return SCM_SMOB_DESCRIPTOR (proc).apply_0;
@ -4007,9 +4007,9 @@ scm_trampoline_1 (SCM proc)
case scm_tcs_struct: case scm_tcs_struct:
if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC) if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC)
return scm_call_generic_1; return scm_call_generic_1;
else if (!SCM_I_OPERATORP (proc)) else if (SCM_I_OPERATORP (proc))
return NULL; return scm_call_1;
return scm_call_1; return NULL;
case scm_tc7_smob: case scm_tc7_smob:
if (SCM_SMOB_APPLICABLE_P (proc)) if (SCM_SMOB_APPLICABLE_P (proc))
return SCM_SMOB_DESCRIPTOR (proc).apply_1; return SCM_SMOB_DESCRIPTOR (proc).apply_1;
@ -4086,9 +4086,9 @@ scm_trampoline_2 (SCM proc)
case scm_tcs_struct: case scm_tcs_struct:
if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC) if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC)
return scm_call_generic_2; return scm_call_generic_2;
else if (!SCM_I_OPERATORP (proc)) else if (SCM_I_OPERATORP (proc))
return NULL; return scm_call_2;
return scm_call_2; return NULL;
case scm_tc7_smob: case scm_tc7_smob:
if (SCM_SMOB_APPLICABLE_P (proc)) if (SCM_SMOB_APPLICABLE_P (proc))
return SCM_SMOB_DESCRIPTOR (proc).apply_2; return SCM_SMOB_DESCRIPTOR (proc).apply_2;