core: drop global_p from variable.

* src/mes (struct scm): Remove field global_p.
 (VARIABLE_GLOBAL_P): Remove.
 (make_variable_): Remove global_p parameter.  Update callers.
* src/lib.c (display_helper): Drop VARIABLE_GLOBAL_P support.
This commit is contained in:
Jan Nieuwenhuizen 2018-04-21 13:19:54 +02:00
parent 82db3a941a
commit 0be441446e
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
4 changed files with 4 additions and 12 deletions

View file

@ -97,8 +97,6 @@
(display ">" port)) (display ">" port))
((variable? x) ((variable? x)
(display "#<variable " port) (display "#<variable " port)
(if (variable-global? x)
(display "*global* " port))
(display (car (core:car x)) port) (display (car (core:car x)) port)
(display ">" port)) (display ">" port))
((number? x) ((number? x)

View file

@ -116,8 +116,7 @@ gc_loop (SCM scan) ///((internal))
|| NTYPE (scan) == TCONTINUATION || NTYPE (scan) == TCONTINUATION
|| NTYPE (scan) == TMACRO || NTYPE (scan) == TMACRO
|| NTYPE (scan) == TPAIR || NTYPE (scan) == TPAIR
|| NTYPE (scan) == TVALUES || NTYPE (scan) == TVALUES)
|| NTYPE (scan) == TVARIABLE)
&& g_news[scan].cdr) // allow for 0 terminated list of symbols && g_news[scan].cdr) // allow for 0 terminated list of symbols
{ {
cdr = gc_copy (g_news[scan].cdr); cdr = gc_copy (g_news[scan].cdr);

View file

@ -85,8 +85,6 @@ display_helper (SCM x, int cont, char* sep, int fd, int write_p)
case TVARIABLE: case TVARIABLE:
{ {
fputs ("#<variable ", fd); fputs ("#<variable ", fd);
if (VARIABLE_GLOBAL_P (x) == cell_t)
fputs ("*global* ", fd);
display_helper (CAR (VARIABLE (x)), cont, "", fd, 0); display_helper (CAR (VARIABLE (x)), cont, "", fd, 0);
fputs (">", fd); fputs (">", fd);
break; break;

View file

@ -105,7 +105,6 @@ struct scm {
SCM cdr; SCM cdr;
SCM closure; SCM closure;
SCM continuation; SCM continuation;
SCM global_p;
SCM macro; SCM macro;
SCM vector; SCM vector;
int hits; int hits;
@ -265,7 +264,6 @@ int g_function = 0;
#define REF(x) g_cells[x].car #define REF(x) g_cells[x].car
#define STRING(x) g_cells[x].car #define STRING(x) g_cells[x].car
#define VARIABLE(x) g_cells[x].car #define VARIABLE(x) g_cells[x].car
#define VARIABLE_GLOBAL_P(x) g_cells[x].cdr
#define CLOSURE(x) g_cells[x].cdr #define CLOSURE(x) g_cells[x].cdr
#define CONTINUATION(x) g_cells[x].cdr #define CONTINUATION(x) g_cells[x].cdr
@ -288,7 +286,6 @@ int g_function = 0;
#define NAME(x) g_cells[x].name #define NAME(x) g_cells[x].name
#define STRING(x) g_cells[x].string #define STRING(x) g_cells[x].string
#define VARIABLE(x) g_cells[x].variable #define VARIABLE(x) g_cells[x].variable
#define VARIABLE_GLOBAL_P(x) g_cells[x].cdr
#define CLOSURE(x) g_cells[x].closure #define CLOSURE(x) g_cells[x].closure
#define MACRO(x) g_cells[x].macro #define MACRO(x) g_cells[x].macro
@ -778,9 +775,9 @@ make_closure_ (SCM args, SCM body, SCM a) ///((internal))
} }
SCM SCM
make_variable_ (SCM var, SCM global_p) ///((internal)) make_variable_ (SCM var) ///((internal))
{ {
return make_cell__ (TVARIABLE, var, global_p); return make_cell__ (TVARIABLE, var, 0);
} }
SCM SCM
@ -907,7 +904,7 @@ expand_variable_ (SCM x, SCM formals, int top_p) ///((internal))
{ {
SCM v = assq (CAR (x), r0); SCM v = assq (CAR (x), r0);
if (v != cell_f) if (v != cell_f)
CAR (x) = make_variable_ (v, cell_t); CAR (x) = make_variable_ (v);
} }
} }
x = CDR (x); x = CDR (x);