mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-18 01:30:27 +02:00
Remove with-fluids; replaced by with-fluid* and inlined push-fluid primops
* libguile/vm-i-system.c (push-fluid, pop-fluid): * doc/ref/vm.texi (Dynamic Environment Instructions): Rename wind-fluids to push-fluid, and unwind-fluids to pop-fluid. They now only work on one fluid binding at a time. * module/ice-9/boot-9.scm (with-fluid*): Implement in Scheme in terms of primcalls to push-fluid and pop-fluid. (custom-throw-handler, catch, with-throw-handler): Use with-fluid* instead of with-fluids, as with-fluids is no longer available before psyntax is loaded. (with-fluids): Define in Scheme in terms of with-fluid*. * libguile/fluids.c (scm_with_fluid): Rename from scm_with_fluids, and don't expose to Scheme. * libguile/eval.c (eval): Remove SCM_M_WITH_FLUIDS case. * libguile/expand.c (expand_with_fluids): Remove with-fluids syntax. (DYNLET): Remove, no longer defining dynlet in the %expanded-vtables. * libguile/expand.h: Remove dynlet definitions. * module/ice-9/eval.scm (primitive-eval): Remove with-fluids case. * libguile/memoize.c (do_push_fluid, do_pop_fluid): New primitive helpers, like wind and unwind. (memoize): Memoize wind and unwind primcalls. Don't memoize dynlet to with-fluids. (scm_init_memoize): Initialize push_fluid and pop_fluid here. * libguile/memoize.h (SCM_M_WITH_FLUIDS): Remove definition. * module/ice-9/psyntax.scm (build-dynlet): Remove; this just supported with-fluids, which is now defined in boot-9. * module/ice-9/psyntax-pp.scm: Regenerate. * doc/ref/compiler.texi (Tree-IL): * module/language/tree-il.scm: * module/language/tree-il/analyze.scm: * module/language/tree-il/canonicalize.scm: * module/language/tree-il/compile-glil.scm: * module/language/tree-il/cse.scm: * module/language/tree-il/debug.scm: * module/language/tree-il/effects.scm: Remove <dynlet>. Add cases for primcalls to push-fluid and pop-fluid in compile-glil.scm and effects.scm. * module/language/tree-il/peval.scm (peval): Factor out with-temporaries; probably a bad idea, but works for now. Factor out make-begin0 (a better idea). Inline primcalls to with-fluid*, and remove dynlet cases. * module/language/tree-il/primitives.scm (*interesting-primitive-names*): Add with-fluid*.
This commit is contained in:
parent
5e0253f19e
commit
c32b7c4cef
24 changed files with 178 additions and 351 deletions
|
@ -40,7 +40,6 @@
|
|||
#include "libguile/eq.h"
|
||||
#include "libguile/expand.h"
|
||||
#include "libguile/feature.h"
|
||||
#include "libguile/fluids.h"
|
||||
#include "libguile/goops.h"
|
||||
#include "libguile/hash.h"
|
||||
#include "libguile/hashtab.h"
|
||||
|
@ -265,28 +264,6 @@ eval (SCM x, SCM env)
|
|||
scm_define (CAR (mx), EVAL1 (CDR (mx), env));
|
||||
return SCM_UNSPECIFIED;
|
||||
|
||||
case SCM_M_WITH_FLUIDS:
|
||||
{
|
||||
long i, len;
|
||||
SCM *fluidv, *valuesv, walk, res;
|
||||
scm_i_thread *thread = SCM_I_CURRENT_THREAD;
|
||||
|
||||
len = scm_ilength (CAR (mx));
|
||||
fluidv = alloca (sizeof (SCM)*len);
|
||||
for (i = 0, walk = CAR (mx); i < len; i++, walk = CDR (walk))
|
||||
fluidv[i] = EVAL1 (CAR (walk), env);
|
||||
valuesv = alloca (sizeof (SCM)*len);
|
||||
for (i = 0, walk = CADR (mx); i < len; i++, walk = CDR (walk))
|
||||
valuesv[i] = EVAL1 (CAR (walk), env);
|
||||
|
||||
scm_dynstack_push_fluids (&thread->dynstack, len, fluidv, valuesv,
|
||||
thread->dynamic_state);
|
||||
res = eval (CDDR (mx), env);
|
||||
scm_dynstack_unwind_fluids (&thread->dynstack, thread->dynamic_state);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
case SCM_M_APPLY:
|
||||
/* Evaluate the procedure to be applied. */
|
||||
proc = EVAL1 (CAR (mx), env);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue