Handle new naming of globals

This commit is contained in:
Justin Ethier 2016-03-31 22:06:56 -04:00
parent 9a0a0dc5ec
commit e0f6f917a8
2 changed files with 9 additions and 13 deletions

View file

@ -403,26 +403,23 @@ extern const object primitive_call_95cc;
/** Globals that are needed by the runtime /** Globals that are needed by the runtime
* What's going on here is the globals are defined by a module, but * What's going on here is the globals are defined by a module, but
* are also used by the runtime. At least for now, these macros are * are also used by the runtime. At least for now, macros below are
* used to point everybody to the objects, which are used by both * used to point everybody to the objects.
* those libraries and this module.
* *
* The assumption for now is that a program that does not include * The assumption for now is that a program that does not include
* the necessary libray would never use the corresponding function. * the necessary libray would never use the corresponding function.
*/ */
extern object Cyc_glo_eval;
extern object Cyc_glo_eval_from_c; extern object Cyc_glo_eval_from_c;
extern object Cyc_glo_call_cc; extern object Cyc_glo_call_cc;
#define __glo_eval Cyc_glo_eval #define __glo_eval_91from_91c_scheme_eval Cyc_glo_eval_from_c
#define __glo_eval_91from_91c Cyc_glo_eval_from_c #define __glo_call_95cc_scheme_base Cyc_glo_call_cc
#define __glo_call_95cc Cyc_glo_call_cc
/* Exception handling */
object Cyc_default_exception_handler(void *data, int argc, closure _, object err); object Cyc_default_exception_handler(void *data, int argc, closure _, object err);
object Cyc_current_exception_handler(void *data); object Cyc_current_exception_handler(void *data);
void Cyc_rt_raise(void *data, object err); void Cyc_rt_raise(void *data, object err);
void Cyc_rt_raise2(void *data, const char *msg, object err); void Cyc_rt_raise2(void *data, const char *msg, object err);
void Cyc_rt_raise_msg(void *data, const char *err); void Cyc_rt_raise_msg(void *data, const char *err);
/* END exception handler */
#endif /* CYCLONE_RUNTIME_H */ #endif /* CYCLONE_RUNTIME_H */

View file

@ -348,7 +348,6 @@ void clear_mutations(void *data) {
/* Runtime globals */ /* Runtime globals */
object Cyc_glo_call_cc = nil; object Cyc_glo_call_cc = nil;
object Cyc_glo_eval = nil;
object Cyc_glo_eval_from_c = nil; object Cyc_glo_eval_from_c = nil;
/* Exception handler */ /* Exception handler */
@ -2367,7 +2366,7 @@ void _call_95cc(void *data, object cont, object args){
if (eq(boolean_f, Cyc_is_procedure(data, car(args)))) { if (eq(boolean_f, Cyc_is_procedure(data, car(args)))) {
Cyc_invalid_type_error(data, closure1_tag, car(args)); Cyc_invalid_type_error(data, closure1_tag, car(args));
} }
return_closcall2(data, __glo_call_95cc, cont, car(args)); return_closcall2(data, __glo_call_95cc_scheme_base, cont, car(args));
} }
/* /*
@ -2423,17 +2422,17 @@ object apply(void *data, object cont, object func, object args){
make_cons(c, func, args); make_cons(c, func, args);
//printf("JAE DEBUG, sending to eval: "); //printf("JAE DEBUG, sending to eval: ");
//Cyc_display(&c, stderr); //Cyc_display(&c, stderr);
((closure)__glo_eval_91from_91c)->fn(data, 2, __glo_eval_91from_91c, cont, &c, nil); ((closure)Cyc_glo_eval_from_c)->fn(data, 2, Cyc_glo_eval_from_c, cont, &c, nil);
// TODO: would be better to compare directly against symbols here, // TODO: would be better to compare directly against symbols here,
// but need a way of looking them up ahead of time. // but need a way of looking them up ahead of time.
// maybe a libinit() or such is required. // maybe a libinit() or such is required.
} else if (strncmp(((symbol)fobj)->pname, "primitive", 10) == 0) { } else if (strncmp(((symbol)fobj)->pname, "primitive", 10) == 0) {
make_cons(c, cadr(func), args); make_cons(c, cadr(func), args);
((closure)__glo_eval_91from_91c)->fn(data, 3, __glo_eval_91from_91c, cont, &c, nil); ((closure)Cyc_glo_eval_from_c)->fn(data, 3, Cyc_glo_eval_from_c, cont, &c, nil);
} else if (strncmp(((symbol)fobj)->pname, "procedure", 10) == 0) { } else if (strncmp(((symbol)fobj)->pname, "procedure", 10) == 0) {
make_cons(c, func, args); make_cons(c, func, args);
((closure)__glo_eval_91from_91c)->fn(data, 3, __glo_eval_91from_91c, cont, &c, nil); ((closure)Cyc_glo_eval_from_c)->fn(data, 3, Cyc_glo_eval_from_c, cont, &c, nil);
} else { } else {
make_cons(c, func, args); make_cons(c, func, args);
Cyc_rt_raise2(data, "Unable to evaluate: ", &c); Cyc_rt_raise2(data, "Unable to evaluate: ", &c);