diff options
author | Andy Wingo <wingo@pobox.com> | 2010-02-25 00:32:40 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-02-25 00:43:52 +0100 |
commit | 1371fe9b149da699320567e5160160169ecdb0be (patch) | |
tree | 244f36b304b9014c9d97fe093965d8410c09023c | |
parent | b3950ad6d88c5675dadb74c8ce5668daaa1b8692 (diff) | |
download | guile-1371fe9b149da699320567e5160160169ecdb0be.tar.gz |
eval.scm's handling of with-fluids doesn't leave the VM
* module/ice-9/eval.scm (primitive-eval): Implement with-fluids in terms
of with-fluids, to avoid recursively calling the VM via with-fluids*.
-rw-r--r-- | module/ice-9/eval.scm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/module/ice-9/eval.scm b/module/ice-9/eval.scm index f7cb6ce3e..e38f2df67 100644 --- a/module/ice-9/eval.scm +++ b/module/ice-9/eval.scm @@ -307,7 +307,11 @@ (('with-fluids (fluids vals . exp)) (let* ((fluids (map (lambda (x) (eval x env)) fluids)) (vals (map (lambda (x) (eval x env)) vals))) - (with-fluids* fluids vals (lambda () (eval exp env))))) + (let lp ((fluids fluids) (vals vals)) + (if (null? fluids) + (eval exp env) + (with-fluids (((car fluids) (car vals))) + (lp (cdr fluids) (cdr vals))))))) (('prompt (tag exp . handler)) (@prompt (eval tag env) |