add `variable-reference->module-path-index'
This commit is contained in:
parent
b374d0d015
commit
1bf1564f90
|
@ -397,6 +397,17 @@ result is a @tech{resolved module path} naming the module.
|
|||
If @racket[varref] refers to a @tech{top-level variable}, then the
|
||||
result is @racket[#f].}
|
||||
|
||||
|
||||
@defproc[(variable-reference->module-path-index [varref variable-reference?])
|
||||
(or/c module-path-index? #f)]{
|
||||
|
||||
If @racket[varref] refers to a @tech{module-level variable}, the
|
||||
result is a @tech{module path index} naming the module.
|
||||
|
||||
If @racket[varref] refers to a @tech{top-level variable}, then the
|
||||
result is @racket[#f].}
|
||||
|
||||
|
||||
@defproc[(variable-reference->module-source [varref variable-reference?])
|
||||
(or/c symbol? (and/c path? complete-path?) #f)]{
|
||||
|
||||
|
@ -407,6 +418,7 @@ typically, but not always, the same as in the resolved module path).
|
|||
If @racket[varref] refers to a @tech{top-level variable}, then the
|
||||
result is @racket[#f].}
|
||||
|
||||
|
||||
@defproc[(variable-reference->phase [varref variable-reference?])
|
||||
exact-nonnegative-integer?]{
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
Version 5.3.0.8
|
||||
Added variable-reference->module-path-index
|
||||
|
||||
Version 5.3.0.7
|
||||
compiler/zo-struct: added cancel-id field to phase-shift
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,53,46,51,46,48,46,55,84,0,0,0,0,0,0,0,0,0,0,
|
||||
SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,53,46,51,46,48,46,56,84,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,51,0,0,0,1,0,0,10,0,14,0,
|
||||
19,0,32,0,39,0,42,0,49,0,56,0,60,0,65,0,69,0,74,0,83,
|
||||
19,0,26,0,29,0,36,0,43,0,47,0,60,0,65,0,69,0,74,0,83,
|
||||
0,87,0,93,0,107,0,121,0,124,0,130,0,134,0,136,0,147,0,149,0,
|
||||
163,0,170,0,192,0,194,0,208,0,19,1,48,1,59,1,70,1,96,1,129,
|
||||
1,162,1,221,1,21,2,99,2,155,2,160,2,180,2,73,3,93,3,145,3,
|
||||
211,3,100,4,242,4,40,5,51,5,130,5,0,0,92,7,0,0,69,35,37,
|
||||
109,105,110,45,115,116,120,29,11,11,11,64,99,111,110,100,72,112,97,114,97,
|
||||
109,101,116,101,114,105,122,101,66,108,101,116,114,101,99,62,111,114,66,117,110,
|
||||
108,101,115,115,66,100,101,102,105,110,101,63,97,110,100,64,108,101,116,42,63,
|
||||
109,105,110,45,115,116,120,29,11,11,11,64,99,111,110,100,66,108,101,116,114,
|
||||
101,99,62,111,114,66,117,110,108,101,115,115,66,100,101,102,105,110,101,63,97,
|
||||
110,100,72,112,97,114,97,109,101,116,101,114,105,122,101,64,108,101,116,42,63,
|
||||
108,101,116,64,119,104,101,110,68,104,101,114,101,45,115,116,120,29,11,11,11,
|
||||
65,113,117,111,116,101,29,94,2,15,68,35,37,107,101,114,110,101,108,11,29,
|
||||
94,2,15,68,35,37,112,97,114,97,109,122,11,62,105,102,65,98,101,103,105,
|
||||
|
@ -17,8 +17,8 @@
|
|||
20,112,97,114,97,109,101,116,101,114,105,122,97,116,105,111,110,45,107,101,121,
|
||||
61,118,73,100,101,102,105,110,101,45,118,97,108,117,101,115,97,36,11,8,240,
|
||||
248,81,0,0,95,159,2,17,36,36,159,2,16,36,36,159,2,16,36,36,16,
|
||||
20,2,10,2,2,2,3,2,2,2,4,2,2,2,6,2,2,2,7,2,2,
|
||||
2,8,2,2,2,9,2,2,2,5,2,2,2,11,2,2,2,12,2,2,97,
|
||||
20,2,10,2,2,2,3,2,2,2,5,2,2,2,6,2,2,2,7,2,2,
|
||||
2,8,2,2,2,9,2,2,2,4,2,2,2,11,2,2,2,12,2,2,97,
|
||||
37,11,8,240,248,81,0,0,93,159,2,16,36,37,16,2,2,13,161,2,2,
|
||||
37,2,13,2,2,2,13,96,38,11,8,240,248,81,0,0,16,0,96,11,11,
|
||||
8,240,248,81,0,0,16,0,18,98,64,104,101,114,101,13,16,6,36,2,14,
|
||||
|
@ -28,13 +28,13 @@
|
|||
2,18,248,22,98,199,249,22,73,2,19,248,22,100,201,12,27,248,22,75,248,
|
||||
22,157,4,196,28,248,22,81,193,20,14,159,37,36,37,28,248,22,81,248,22,
|
||||
75,194,248,22,74,193,249,22,150,4,80,158,39,36,251,22,83,2,18,248,22,
|
||||
74,199,249,22,73,2,9,248,22,75,201,11,18,100,10,13,16,6,36,2,14,
|
||||
74,199,249,22,73,2,8,248,22,75,201,11,18,100,10,13,16,6,36,2,14,
|
||||
2,2,11,11,11,8,32,8,31,8,30,8,29,16,4,11,11,2,20,3,1,
|
||||
8,101,110,118,49,53,53,52,52,16,4,11,11,2,21,3,1,8,101,110,118,
|
||||
49,53,53,52,53,27,248,22,75,248,22,157,4,196,28,248,22,81,193,20,14,
|
||||
159,37,36,37,28,248,22,81,248,22,75,194,248,22,74,193,249,22,150,4,80,
|
||||
158,39,36,250,22,83,2,22,248,22,83,249,22,83,248,22,83,2,23,248,22,
|
||||
74,201,251,22,83,2,18,2,23,2,23,249,22,73,2,6,248,22,75,204,18,
|
||||
74,201,251,22,83,2,18,2,23,2,23,249,22,73,2,5,248,22,75,204,18,
|
||||
100,11,13,16,6,36,2,14,2,2,11,11,11,8,32,8,31,8,30,8,29,
|
||||
16,4,11,11,2,20,3,1,8,101,110,118,49,53,53,52,55,16,4,11,11,
|
||||
2,21,3,1,8,101,110,118,49,53,53,52,56,248,22,157,4,193,27,248,22,
|
||||
|
@ -81,25 +81,25 @@
|
|||
11,2,12,36,46,37,16,0,36,16,1,2,13,37,11,11,11,16,0,16,0,
|
||||
16,0,36,36,11,12,11,11,16,0,16,0,16,0,36,36,16,11,16,5,11,
|
||||
20,15,16,2,20,14,159,36,36,37,80,158,36,36,36,20,113,159,36,16,1,
|
||||
2,13,16,1,33,33,10,16,5,2,7,88,163,8,36,37,53,37,9,223,0,
|
||||
2,13,16,1,33,33,10,16,5,2,6,88,163,8,36,37,53,37,9,223,0,
|
||||
33,34,36,20,113,159,36,16,1,2,13,16,0,11,16,5,2,12,88,163,8,
|
||||
36,37,53,37,9,223,0,33,35,36,20,113,159,36,16,1,2,13,16,0,11,
|
||||
16,5,2,9,88,163,8,36,37,53,37,9,223,0,33,36,36,20,113,159,36,
|
||||
16,1,2,13,16,1,33,37,11,16,5,2,6,88,163,8,36,37,56,37,9,
|
||||
16,5,2,8,88,163,8,36,37,53,37,9,223,0,33,36,36,20,113,159,36,
|
||||
16,1,2,13,16,1,33,37,11,16,5,2,5,88,163,8,36,37,56,37,9,
|
||||
223,0,33,38,36,20,113,159,36,16,1,2,13,16,1,33,39,11,16,5,2,
|
||||
11,88,163,8,36,37,58,37,9,223,0,33,42,36,20,113,159,36,16,1,2,
|
||||
13,16,0,11,16,5,2,5,88,163,8,36,37,53,37,9,223,0,33,44,36,
|
||||
13,16,0,11,16,5,2,4,88,163,8,36,37,53,37,9,223,0,33,44,36,
|
||||
20,113,159,36,16,1,2,13,16,0,11,16,5,2,10,88,163,8,36,37,54,
|
||||
37,9,223,0,33,45,36,20,113,159,36,16,1,2,13,16,0,11,16,5,2,
|
||||
4,88,163,8,36,37,56,37,9,223,0,33,46,36,20,113,159,36,16,1,2,
|
||||
9,88,163,8,36,37,56,37,9,223,0,33,46,36,20,113,159,36,16,1,2,
|
||||
13,16,0,11,16,5,2,3,88,163,8,36,37,58,37,9,223,0,33,47,36,
|
||||
20,113,159,36,16,1,2,13,16,1,33,49,11,16,5,2,8,88,163,8,36,
|
||||
20,113,159,36,16,1,2,13,16,1,33,49,11,16,5,2,7,88,163,8,36,
|
||||
37,54,37,9,223,0,33,50,36,20,113,159,36,16,1,2,13,16,0,11,16,
|
||||
0,94,2,16,2,17,93,2,16,9,9,36,0};
|
||||
EVAL_ONE_SIZED_STR((char *)expr, 2028);
|
||||
}
|
||||
{
|
||||
SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,53,46,51,46,48,46,55,84,0,0,0,0,0,0,0,0,0,0,
|
||||
SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,53,46,51,46,48,46,56,84,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,109,0,0,0,1,0,0,8,0,21,0,
|
||||
26,0,43,0,65,0,94,0,109,0,127,0,139,0,155,0,169,0,191,0,207,
|
||||
0,224,0,246,0,1,1,7,1,16,1,23,1,30,1,42,1,58,1,82,1,
|
||||
|
@ -600,7 +600,7 @@
|
|||
EVAL_ONE_SIZED_STR((char *)expr, 10438);
|
||||
}
|
||||
{
|
||||
SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,53,46,51,46,48,46,55,84,0,0,0,0,0,0,0,0,0,0,
|
||||
SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,53,46,51,46,48,46,56,84,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,12,0,0,0,1,0,0,15,0,40,0,
|
||||
57,0,75,0,97,0,120,0,140,0,162,0,169,0,176,0,183,0,0,0,179,
|
||||
1,0,0,74,35,37,112,108,97,99,101,45,115,116,114,117,99,116,1,23,115,
|
||||
|
@ -627,7 +627,7 @@
|
|||
EVAL_ONE_SIZED_STR((char *)expr, 501);
|
||||
}
|
||||
{
|
||||
SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,53,46,51,46,48,46,55,84,0,0,0,0,0,0,0,0,0,0,
|
||||
SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,53,46,51,46,48,46,56,84,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,81,0,0,0,1,0,0,7,0,18,0,
|
||||
45,0,51,0,64,0,73,0,80,0,102,0,124,0,150,0,158,0,170,0,185,
|
||||
0,201,0,219,0,239,0,251,0,11,1,34,1,46,1,77,1,84,1,89,1,
|
||||
|
@ -984,7 +984,7 @@
|
|||
EVAL_ONE_SIZED_STR((char *)expr, 7421);
|
||||
}
|
||||
{
|
||||
SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,53,46,51,46,48,46,55,84,0,0,0,0,0,0,0,0,0,0,
|
||||
SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,7,53,46,51,46,48,46,56,84,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,11,0,0,0,1,0,0,10,0,16,0,
|
||||
29,0,44,0,58,0,78,0,90,0,104,0,118,0,170,0,0,0,98,1,0,
|
||||
0,69,35,37,98,117,105,108,116,105,110,65,113,117,111,116,101,29,94,2,2,
|
||||
|
|
|
@ -75,6 +75,7 @@ static Scheme_Object *namespace_undefine_variable(int, Scheme_Object *[]);
|
|||
static Scheme_Object *namespace_mapped_symbols(int, Scheme_Object *[]);
|
||||
static Scheme_Object *namespace_module_registry(int, Scheme_Object *[]);
|
||||
static Scheme_Object *variable_p(int, Scheme_Object *[]);
|
||||
static Scheme_Object *variable_modidx(int, Scheme_Object *[]);
|
||||
static Scheme_Object *variable_module_path(int, Scheme_Object *[]);
|
||||
static Scheme_Object *variable_module_source(int, Scheme_Object *[]);
|
||||
static Scheme_Object *variable_namespace(int, Scheme_Object *[]);
|
||||
|
@ -650,6 +651,7 @@ static void make_kernel_env(void)
|
|||
GLOBAL_PRIM_W_ARITY("namespace-module-registry", namespace_module_registry, 1, 1, env);
|
||||
|
||||
GLOBAL_PRIM_W_ARITY("variable-reference?", variable_p, 1, 1, env);
|
||||
GLOBAL_PRIM_W_ARITY("variable-reference->module-path-index", variable_modidx, 1, 1, env);
|
||||
GLOBAL_PRIM_W_ARITY("variable-reference->resolved-module-path", variable_module_path, 1, 1, env);
|
||||
GLOBAL_PRIM_W_ARITY("variable-reference->module-source", variable_module_source, 1, 1, env);
|
||||
GLOBAL_PRIM_W_ARITY("variable-reference->empty-namespace", variable_namespace, 1, 1, env);
|
||||
|
@ -1844,6 +1846,27 @@ static Scheme_Object *variable_module_path(int argc, Scheme_Object *argv[])
|
|||
return scheme_false;
|
||||
}
|
||||
|
||||
static Scheme_Object *variable_modidx(int argc, Scheme_Object *argv[])
|
||||
{
|
||||
Scheme_Env *env;
|
||||
|
||||
if (!SAME_TYPE(SCHEME_TYPE(argv[0]), scheme_global_ref_type))
|
||||
env = NULL;
|
||||
else
|
||||
env = scheme_get_bucket_home((Scheme_Bucket *)SCHEME_PTR1_VAL(argv[0]));
|
||||
|
||||
if (!env)
|
||||
scheme_wrong_type("variable-reference->module-path-index", "variable-reference", 0, argc, argv);
|
||||
|
||||
if (env->module) {
|
||||
if (!env->link_midx)
|
||||
return env->module->self_modidx;
|
||||
else
|
||||
return env->link_midx;
|
||||
} else
|
||||
return scheme_false;
|
||||
}
|
||||
|
||||
static Scheme_Object *variable_module_source(int argc, Scheme_Object *argv[])
|
||||
{
|
||||
Scheme_Env *env;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#define USE_COMPILED_STARTUP 1
|
||||
|
||||
#define EXPECTED_PRIM_COUNT 1047
|
||||
#define EXPECTED_PRIM_COUNT 1048
|
||||
#define EXPECTED_UNSAFE_COUNT 79
|
||||
#define EXPECTED_FLFXNUM_COUNT 69
|
||||
#define EXPECTED_FUTURES_COUNT 13
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
consistently.)
|
||||
*/
|
||||
|
||||
#define MZSCHEME_VERSION "5.3.0.7"
|
||||
#define MZSCHEME_VERSION "5.3.0.8"
|
||||
|
||||
#define MZSCHEME_VERSION_X 5
|
||||
#define MZSCHEME_VERSION_Y 3
|
||||
#define MZSCHEME_VERSION_Z 0
|
||||
#define MZSCHEME_VERSION_W 7
|
||||
#define MZSCHEME_VERSION_W 8
|
||||
|
||||
#define MZSCHEME_VERSION_MAJOR ((MZSCHEME_VERSION_X * 100) + MZSCHEME_VERSION_Y)
|
||||
#define MZSCHEME_VERSION_MINOR ((MZSCHEME_VERSION_Z * 1000) + MZSCHEME_VERSION_W)
|
||||
|
|
Loading…
Reference in New Issue
Block a user