diff --git a/src/CHANGELOG b/src/CHANGELOG index 9bac6d433..bb6c35e35 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -66,6 +66,10 @@ ECL 0.9i - The function SI:PROCESS-COMMAND-ARGS has now a more flexible interface and can be used by standalone programs with user supplied rules. + - Symbols in the core library are now referenced with a self-explanatory + macro, as in ECL_SYM("SI::*EXIT-HOOKS*",1379) (Thanks to Douglas R. Miles + for the idea). + * Errors fixed: - The intermediate output of the compiler is written in the directory in which diff --git a/src/c/all_symbols.d b/src/c/all_symbols.d index 48fe59ab8..1dc161686 100644 --- a/src/c/all_symbols.d +++ b/src/c/all_symbols.d @@ -94,9 +94,9 @@ mangle_name(cl_object output, char *source, int l) p = (cl_symbol_initializer*)symbol - cl_symbols; if (p >= 0 && p <= cl_num_symbols_in_core) { found = Ct; - output = cl_format(3, Cnil, - make_constant_string("((cl_object)(cl_symbols+~A))"), - MAKE_FIXNUM(p)); + output = cl_format(4, Cnil, + make_constant_string("ECL_SYM(~S,~D)"), + symbol->symbol.name, MAKE_FIXNUM(p)); @(return found output maxarg) } } else { diff --git a/src/c/dpp.c b/src/c/dpp.c index b57c99388..4646ce25c 100644 --- a/src/c/dpp.c +++ b/src/c/dpp.c @@ -245,7 +245,9 @@ search_symbol(char *name) for (i = 0; cl_symbols[i].name != NULL; i++) { if (!strcasecmp(name, cl_symbols[i].name)) { name = poolp; - pushstr("(cl_object)(cl_symbols+"); + pushstr("ECL_SYM(\""); + pushstr(cl_symbols[i].name); + pushstr("\","); if (i >= 1000) pushc((i / 1000) % 10 + '0'); if (i >= 100) diff --git a/src/h/external.h b/src/h/external.h index 3aff6cd1d..c9614f930 100644 --- a/src/h/external.h +++ b/src/h/external.h @@ -235,6 +235,8 @@ __declspec(dllimport) extern cl_symbol_initializer cl_symbols[]; extern cl_index cl_num_symbols_in_core; +#define ECL_SYM(name,code) ((cl_object)(cl_symbols+(code))) + /* apply.c */ extern cl_object APPLY_fixed(cl_narg n, cl_object (*f)(), cl_object *x);