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))
((variable? x)
(display "#<variable " port)
(if (variable-global? x)
(display "*global* " port))
(display (car (core:car x)) port)
(display ">" port))
((number? x)

View File

@ -116,8 +116,7 @@ gc_loop (SCM scan) ///((internal))
|| NTYPE (scan) == TCONTINUATION
|| NTYPE (scan) == TMACRO
|| NTYPE (scan) == TPAIR
|| NTYPE (scan) == TVALUES
|| NTYPE (scan) == TVARIABLE)
|| NTYPE (scan) == TVALUES)
&& g_news[scan].cdr) // allow for 0 terminated list of symbols
{
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:
{
fputs ("#<variable ", fd);
if (VARIABLE_GLOBAL_P (x) == cell_t)
fputs ("*global* ", fd);
display_helper (CAR (VARIABLE (x)), cont, "", fd, 0);
fputs (">", fd);
break;

View File

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