* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice. */
-/* Software engineering face-lift by Greg J. Badros, 11-Dec-1999,
- gjb@cs.washington.edu, http://www.cs.washington.edu/homes/gjb */
\f
"@lisp\n"
"(define x 'normal-binding)\n"
"@result{} x\n"
- "(define a-cont (call-with-current-continuation \n"
+ "(define a-cont (call-with-current-continuation\n"
" (lambda (escape)\n"
" (let ((old-x x))\n"
" (dynamic-wind\n"
" ;;\n"
" (lambda () (set! x old-x)))))))\n"
"\n"
- ";; Prints: \n"
+ ";; Prints:\n"
"special-binding\n"
";; Evaluates to:\n"
"@result{} a-cont\n"
#undef FUNC_NAME
#endif
-static void
-scm_swap_bindings (SCM glocs, SCM vals)
+void
+scm_swap_bindings (SCM vars, SCM vals)
{
SCM tmp;
while (SCM_NIMP (vals))
{
- tmp = SCM_GLOC_VAL (SCM_CAR (glocs));
- SCM_GLOC_SET_VAL (SCM_CAR (glocs), SCM_CAR (vals));
+ tmp = SCM_VARIABLE_REF (SCM_CAR (vars));
+ SCM_VARIABLE_SET (SCM_CAR (vars), SCM_CAR (vals));
SCM_SETCAR (vals, tmp);
- glocs = SCM_CDR (glocs);
+ vars = SCM_CDR (vars);
vals = SCM_CDR (vals);
}
}
#endif
{
wind_key = SCM_CAR (wind_elt);
- /* key = #t | symbol | thunk | list of glocs | list of fluids */
+ /* key = #t | symbol | thunk | list of variables | list of fluids */
if (SCM_NIMP (wind_key))
{
- if (SCM_TYP3 (wind_key) == scm_tc3_cons_gloc)
- scm_swap_bindings (wind_key, SCM_CDR (wind_elt));
- else if (SCM_TYP3 (wind_key) == scm_tc3_cons)
- scm_swap_fluids (wind_key, SCM_CDR (wind_elt));
+ if (SCM_CONSP (wind_key))
+ {
+ if (SCM_VARIABLEP (SCM_CAR (wind_key)))
+ scm_swap_bindings (wind_key, SCM_CDR (wind_elt));
+ else if (SCM_FLUIDP (SCM_CAR (wind_key)))
+ scm_swap_fluids (wind_key, SCM_CDR (wind_elt));
+ }
else if (SCM_GUARDSP (wind_key))
SCM_BEFORE_GUARD (wind_key) (SCM_GUARD_DATA (wind_key));
else if (SCM_TYP3 (wind_key) == scm_tc3_closure)
wind_key = SCM_CAR (wind_elt);
if (SCM_NIMP (wind_key))
{
- if (SCM_TYP3 (wind_key) == scm_tc3_cons_gloc)
- scm_swap_bindings (wind_key, from);
- else if (SCM_TYP3 (wind_key) == scm_tc3_cons)
- scm_swap_fluids_reverse (wind_key, from);
+ if (SCM_CONSP (wind_key))
+ {
+ if (SCM_VARIABLEP (SCM_CAR (wind_key)))
+ scm_swap_bindings (wind_key, SCM_CDR (wind_elt));
+ else if (SCM_FLUIDP (SCM_CAR (wind_key)))
+ scm_swap_fluids_reverse (wind_key, SCM_CDR (wind_elt));
+ }
else if (SCM_GUARDSP (wind_key))
SCM_AFTER_GUARD (wind_key) (SCM_GUARD_DATA (wind_key));
else if (SCM_TYP3 (wind_key) == scm_tc3_closure)
{
tc16_guards = scm_make_smob_type ("guards", 0);
scm_set_smob_print (tc16_guards, guards_print);
-#ifndef SCM_MAGIC_SNARFER
#include "libguile/dynwind.x"
-#endif
}
/*