Macro for self-explanatory references to symbols in the core.

This commit is contained in:
jjgarcia 2006-03-06 09:31:03 +00:00
parent eeb4b234ca
commit 45a8e4cb69
4 changed files with 12 additions and 4 deletions

View file

@ -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

View file

@ -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 {

View file

@ -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)

View file

@ -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);