mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-17 09:10:22 +02:00
(SCM_TOP_LEVEL_LOOKUP_CLOSURE): New macro which replaces
SCM_CDR (scm_top_level_lookup_closure_var) everywhere.
This commit is contained in:
parent
51eb747ebf
commit
7e73eaee6e
5 changed files with 11 additions and 11 deletions
|
@ -263,7 +263,7 @@ SCM_DEFINE (scm_make_gloc, "make-gloc", 1, 1, 0,
|
||||||
#endif
|
#endif
|
||||||
SCM_VALIDATE_VARIABLE (1,var);
|
SCM_VALIDATE_VARIABLE (1,var);
|
||||||
if (SCM_UNBNDP (env))
|
if (SCM_UNBNDP (env))
|
||||||
env = scm_top_level_env (SCM_CDR (scm_top_level_lookup_closure_var));
|
env = scm_top_level_env (SCM_TOP_LEVEL_LOOKUP_CLOSURE);
|
||||||
else
|
else
|
||||||
SCM_VALIDATE_NULLORCONS (2,env);
|
SCM_VALIDATE_NULLORCONS (2,env);
|
||||||
return scm_make_memoized (SCM_VARVCELL (var) + 1, env);
|
return scm_make_memoized (SCM_VARVCELL (var) + 1, env);
|
||||||
|
@ -328,7 +328,7 @@ SCM_DEFINE (scm_memcons, "memcons", 2, 1, 0,
|
||||||
cdr = SCM_MEMOIZED_EXP (cdr);
|
cdr = SCM_MEMOIZED_EXP (cdr);
|
||||||
}
|
}
|
||||||
if (SCM_UNBNDP (env))
|
if (SCM_UNBNDP (env))
|
||||||
env = scm_top_level_env (SCM_CDR (scm_top_level_lookup_closure_var));
|
env = scm_top_level_env (SCM_TOP_LEVEL_LOOKUP_CLOSURE);
|
||||||
else
|
else
|
||||||
SCM_VALIDATE_NULLORCONS (3,env);
|
SCM_VALIDATE_NULLORCONS (3,env);
|
||||||
return scm_make_memoized (scm_cons (car, cdr), env);
|
return scm_make_memoized (scm_cons (car, cdr), env);
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
#include "libguile/eval.h"
|
#include "libguile/eval.h"
|
||||||
#include "libguile/macros.h"
|
#include "libguile/macros.h"
|
||||||
#include "libguile/modules.h"
|
#include "libguile/modules.h"
|
||||||
#include "libguile/root.h"
|
#include "libguile/fluids.h"
|
||||||
|
|
||||||
#include "libguile/validate.h"
|
#include "libguile/validate.h"
|
||||||
#include "libguile/evalext.h"
|
#include "libguile/evalext.h"
|
||||||
|
@ -79,7 +79,7 @@ SCM_DEFINE (scm_definedp, "defined?", 1, 1, 0,
|
||||||
|
|
||||||
if (SCM_UNBNDP (env))
|
if (SCM_UNBNDP (env))
|
||||||
vcell = scm_sym2vcell(sym,
|
vcell = scm_sym2vcell(sym,
|
||||||
SCM_CDR (scm_top_level_lookup_closure_var),
|
SCM_TOP_LEVEL_LOOKUP_CLOSURE,
|
||||||
SCM_BOOL_F);
|
SCM_BOOL_F);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -160,7 +160,7 @@ SCM_DEFINE (scm_fluid_ref, "fluid-ref", 1, 0, 0,
|
||||||
|
|
||||||
if (SCM_LENGTH (scm_root->fluids) <= n)
|
if (SCM_LENGTH (scm_root->fluids) <= n)
|
||||||
grow_fluids (scm_root, n+1);
|
grow_fluids (scm_root, n+1);
|
||||||
return SCM_VELTS(scm_root->fluids)[n];
|
return SCM_VELTS (scm_root->fluids)[n];
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@
|
||||||
#include "libguile/chars.h"
|
#include "libguile/chars.h"
|
||||||
#include "libguile/modules.h"
|
#include "libguile/modules.h"
|
||||||
#include "libguile/ports.h"
|
#include "libguile/ports.h"
|
||||||
#include "libguile/root.h"
|
#include "libguile/fluids.h"
|
||||||
#include "libguile/strings.h"
|
#include "libguile/strings.h"
|
||||||
#include "libguile/init.h"
|
#include "libguile/init.h"
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ gdb_eval (SCM exp)
|
||||||
}
|
}
|
||||||
SCM_BEGIN_FOREIGN_BLOCK;
|
SCM_BEGIN_FOREIGN_BLOCK;
|
||||||
{
|
{
|
||||||
SCM env = scm_top_level_env (SCM_CDR (scm_top_level_lookup_closure_var));
|
SCM env = scm_top_level_env (SCM_TOP_LEVEL_LOOKUP_CLOSURE);
|
||||||
gdb_result = scm_permanent_object (scm_ceval (exp, env));
|
gdb_result = scm_permanent_object (scm_ceval (exp, env));
|
||||||
}
|
}
|
||||||
SCM_END_FOREIGN_BLOCK;
|
SCM_END_FOREIGN_BLOCK;
|
||||||
|
@ -302,7 +302,7 @@ gdb_binding (SCM name, SCM value)
|
||||||
SCM_BEGIN_FOREIGN_BLOCK;
|
SCM_BEGIN_FOREIGN_BLOCK;
|
||||||
{
|
{
|
||||||
SCM vcell = scm_sym2vcell (name,
|
SCM vcell = scm_sym2vcell (name,
|
||||||
SCM_CDR (scm_top_level_lookup_closure_var),
|
SCM_TOP_LEVEL_LOOKUP_CLOSURE,
|
||||||
SCM_BOOL_T);
|
SCM_BOOL_T);
|
||||||
SCM_SETCDR (vcell, value);
|
SCM_SETCDR (vcell, value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
#include "libguile/eval.h"
|
#include "libguile/eval.h"
|
||||||
#include "libguile/variable.h"
|
#include "libguile/variable.h"
|
||||||
#include "libguile/alist.h"
|
#include "libguile/alist.h"
|
||||||
#include "libguile/root.h"
|
#include "libguile/fluids.h"
|
||||||
#include "libguile/strings.h"
|
#include "libguile/strings.h"
|
||||||
#include "libguile/vectors.h"
|
#include "libguile/vectors.h"
|
||||||
#include "libguile/weaks.h"
|
#include "libguile/weaks.h"
|
||||||
|
@ -398,7 +398,7 @@ scm_sysintern0 (const char *name)
|
||||||
{
|
{
|
||||||
SCM lookup_proc;
|
SCM lookup_proc;
|
||||||
if (scm_can_use_top_level_lookup_closure_var &&
|
if (scm_can_use_top_level_lookup_closure_var &&
|
||||||
SCM_NIMP (lookup_proc = SCM_CDR (scm_top_level_lookup_closure_var)))
|
SCM_NIMP (lookup_proc = SCM_TOP_LEVEL_LOOKUP_CLOSURE))
|
||||||
{
|
{
|
||||||
SCM sym = SCM_CAR (scm_intern0 (name));
|
SCM sym = SCM_CAR (scm_intern0 (name));
|
||||||
SCM vcell = scm_sym2vcell (sym, lookup_proc, SCM_BOOL_T);
|
SCM vcell = scm_sym2vcell (sym, lookup_proc, SCM_BOOL_T);
|
||||||
|
@ -420,7 +420,7 @@ scm_symbol_value0 (const char *name)
|
||||||
lookup closures are written in scheme which needs real symbols. */
|
lookup closures are written in scheme which needs real symbols. */
|
||||||
SCM symbol = scm_intern_obarray_soft (name, strlen (name), scm_symhash, 0);
|
SCM symbol = scm_intern_obarray_soft (name, strlen (name), scm_symhash, 0);
|
||||||
SCM vcell = scm_sym2vcell (SCM_CAR (symbol),
|
SCM vcell = scm_sym2vcell (SCM_CAR (symbol),
|
||||||
SCM_CDR (scm_top_level_lookup_closure_var),
|
SCM_TOP_LEVEL_LOOKUP_CLOSURE,
|
||||||
SCM_BOOL_F);
|
SCM_BOOL_F);
|
||||||
if (SCM_FALSEP (vcell))
|
if (SCM_FALSEP (vcell))
|
||||||
return SCM_UNDEFINED;
|
return SCM_UNDEFINED;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue