diff --git a/contrib/sockets/sockets.lisp b/contrib/sockets/sockets.lisp index 56e56efaf..2493d6e7b 100755 --- a/contrib/sockets/sockets.lisp +++ b/contrib/sockets/sockets.lisp @@ -76,9 +76,9 @@ cl_object output; ecl_disable_interrupts(); if (WSAStartup(MAKEWORD(2,2), &wsadata) == NO_ERROR) - output = Ct; + output = ECL_T; else - output = Cnil; + output = ECL_NIL; ecl_enable_interrupts(); @(return) = output; }") @@ -176,8 +176,8 @@ weird stuff - see gethostbyname(3) for grisly details." if (hostent != NULL) { char **aliases; char **addrs; - cl_object aliases_list = Cnil; - cl_object addr_list = Cnil; + cl_object aliases_list = ECL_NIL; + cl_object addr_list = ECL_NIL; int length = hostent->h_length; funcall(3,#2,make_simple_base_string(hostent->h_name),#1); @@ -201,7 +201,7 @@ weird stuff - see gethostbyname(3) for grisly details." @(return) = #1; } else { - @(return) = Cnil; + @(return) = ECL_NIL; } }" :side-effects t) @@ -234,8 +234,8 @@ weird stuff - see gethostbyname(3) for grisly details." if (hostent != NULL) { char **aliases; char **addrs; - cl_object aliases_list = Cnil; - cl_object addr_list = Cnil; + cl_object aliases_list = ECL_NIL; + cl_object addr_list = ECL_NIL; int length = hostent->h_length; funcall(3,#2,make_simple_base_string(hostent->h_name),#1); @@ -259,7 +259,7 @@ weird stuff - see gethostbyname(3) for grisly details." @(return) = #1; } else { - @(return) = Cnil; + @(return) = ECL_NIL; } }" :side-effects t) @@ -594,7 +594,7 @@ static void fill_inet_sockaddr(struct sockaddr_in *sockaddr, int port, ecl_enable_interrupts(); @(return 0) = new_fd; - @(return 1) = Cnil; + @(return 1) = ECL_NIL; @(return 2) = 0; if (new_fd != -1) { uint32_t ip = ntohl(sockaddr.sin_addr.s_addr); @@ -852,7 +852,7 @@ also known as unix-domain sockets.")) new_fd = accept(#0, (struct sockaddr *)&sockaddr, &addr_len); ecl_enable_interrupts(); @(return 0) = new_fd; - @(return 1) = (new_fd == -1) ? Cnil : make_base_string_copy(sockaddr.sun_path); + @(return 1) = (new_fd == -1) ? ECL_NIL : make_base_string_copy(sockaddr.sun_path); }") (cond ((= fd -1) @@ -907,7 +907,7 @@ also known as unix-domain sockets.")) if (ret == 0) { @(return) = make_base_string_copy(name.sun_path); } else { - @(return) = Cnil; + @(return) = ECL_NIL; } }"))) (if peer @@ -1100,7 +1100,7 @@ also known as unix-domain sockets.")) (c-inline (fd non-blocking-p) (:int t) :int " { - DWORD mode = PIPE_READMODE_BYTE | (#1 == Ct ? PIPE_NOWAIT : PIPE_WAIT); + DWORD mode = PIPE_READMODE_BYTE | (#1 == ECL_T ? PIPE_NOWAIT : PIPE_WAIT); ecl_disable_interrupts(); @(return) = SetNamedPipeHandleState(_get_osfhandle(#0), &mode, NULL, NULL); ecl_enable_interrupts(); @@ -1117,11 +1117,11 @@ also known as unix-domain sockets.")) DWORD flags; ecl_disable_interrupts(); if (!GetNamedPipeInfo(_get_osfhandle(#0), &flags, NULL, NULL, NULL)) - @(return) = Cnil; + @(return) = ECL_NIL; if (flags == PIPE_CLIENT_END || DisconnectNamedPipe(_get_osfhandle(#0))) - @(return) = Ct; + @(return) = ECL_T; else - @(return) = Cnil; + @(return) = ECL_NIL; ecl_enable_interrupts(); }" :one-liner nil) @@ -1473,7 +1473,7 @@ GET-NAME-SERVICE-ERRNO") ret = getsockopt(#0,#1,#2,&sockopt,&socklen); ecl_enable_interrupts(); - @(return) = (ret == 0) ? ecl_make_integer(sockopt) : Cnil; + @(return) = (ret == 0) ? ecl_make_integer(sockopt) : ECL_NIL; }"))) (if ret ret @@ -1489,7 +1489,7 @@ GET-NAME-SERVICE-ERRNO") ret = getsockopt(#0,#1,#2,&sockopt,&socklen); ecl_enable_interrupts(); - @(return) = (ret == 0) ? ecl_make_integer(sockopt) : Cnil; + @(return) = (ret == 0) ? ecl_make_integer(sockopt) : ECL_NIL; }"))) (if ret (/= ret 0) @@ -1512,7 +1512,7 @@ GET-NAME-SERVICE-ERRNO") ecl_enable_interrupts(); @(return) = (ret == 0) ? ecl_make_doublefloat((double)tv.tv_sec - + ((double)tv.tv_usec) / 1000000.0) : Cnil; + + ((double)tv.tv_usec) / 1000000.0) : ECL_NIL; }"))) (if ret ret @@ -1529,7 +1529,7 @@ GET-NAME-SERVICE-ERRNO") ret = getsockopt(#0,#1,#2,&sockopt,&socklen); ecl_enable_interrupts(); - @(return) = (ret == 0) ? ecl_make_integer((sockopt.l_onoff != 0) ? sockopt.l_linger : 0) : Cnil; + @(return) = (ret == 0) ? ecl_make_integer((sockopt.l_onoff != 0) ? sockopt.l_linger : 0) : ECL_NIL; }"))) (if ret ret @@ -1545,7 +1545,7 @@ GET-NAME-SERVICE-ERRNO") ret = setsockopt(#0,#1,#2,&sockopt,sizeof(int)); ecl_enable_interrupts(); - @(return) = (ret == 0) ? Ct : Cnil; + @(return) = (ret == 0) ? ECL_T : ECL_NIL; }"))) (if ret value @@ -1554,14 +1554,14 @@ GET-NAME-SERVICE-ERRNO") (defun set-sockopt-bool (fd level const value) (let ((ret (c-inline (fd level const value) (:int :int :int :object) t "{ - int sockopt = (#3 == Cnil) ? 0 : 1; + int sockopt = (#3 == ECL_NIL) ? 0 : 1; int ret; ecl_disable_interrupts(); ret = setsockopt(#0,#1,#2,&sockopt,sizeof(int)); ecl_enable_interrupts(); - @(return) = (ret == 0) ? Ct : Cnil; + @(return) = (ret == 0) ? ECL_T : ECL_NIL; }"))) (if ret value @@ -1581,7 +1581,7 @@ GET-NAME-SERVICE-ERRNO") ret = setsockopt(#0,#1,#2,&tv,sizeof(struct timeval)); ecl_enable_interrupts(); - @(return) = (ret == 0) ? Ct : Cnil; + @(return) = (ret == 0) ? ECL_T : ECL_NIL; }"))) (if ret value @@ -1607,7 +1607,7 @@ GET-NAME-SERVICE-ERRNO") ret = setsockopt(#0,#1,#2,&sockopt,sizeof(struct linger)); ecl_enable_interrupts(); - @(return) = (ret == 0) ? Ct : Cnil; + @(return) = (ret == 0) ? ECL_T : ECL_NIL; }"))) (if ret value diff --git a/src/c/all_symbols.d b/src/c/all_symbols.d index 7f7a5c786..50d6615e6 100644 --- a/src/c/all_symbols.d +++ b/src/c/all_symbols.d @@ -82,7 +82,7 @@ mangle_name(cl_object output, unsigned char *source, int l) unsigned char c, *source, *dest; cl_object output; cl_object package; - cl_object found = Cnil; + cl_object found = ECL_NIL; cl_object maxarg = ecl_make_fixnum(ECL_CALL_ARGUMENTS_LIMIT); cl_object minarg = ecl_make_fixnum(0); bool is_symbol; @@ -92,14 +92,14 @@ mangle_name(cl_object output, unsigned char *source, int l) is_symbol = Null(as_function); if (is_symbol) { cl_fixnum p; - if (symbol == Cnil) - @(return Ct make_constant_base_string("Cnil")) - else if (symbol == Ct) - @(return Ct make_constant_base_string("Ct")) + if (symbol == ECL_NIL) + @(return ECL_T make_constant_base_string("ECL_NIL")) + else if (symbol == ECL_T) + @(return ECL_T make_constant_base_string("ECL_T")) p = (cl_symbol_initializer*)symbol - cl_symbols; if (p >= 0 && p <= cl_num_symbols_in_core) { - found = Ct; - output = cl_format(4, Cnil, + found = ECL_T; + output = cl_format(4, ECL_NIL, make_constant_base_string("ECL_SYM(~S,~D)"), name, ecl_make_fixnum(p)); @(return found output maxarg) @@ -112,7 +112,7 @@ mangle_name(cl_object output, unsigned char *source, int l) cl_object s = (cl_object)(cl_symbols + l); if (fun == SYM_FUN(s)) { symbol = s; - found = Ct; + found = ECL_T; if (fun->cfun.narg >= 0) { minarg = maxarg = ecl_make_fixnum(fun->cfun.narg); @@ -132,7 +132,7 @@ mangle_name(cl_object output, unsigned char *source, int l) else if (package == cl_core.ext_package) package = make_constant_base_string("si"); else if (package == cl_core.keyword_package) - package = Cnil; + package = ECL_NIL; else package = package->pack.name; symbol = ecl_symbol_name(symbol); @@ -158,10 +158,10 @@ mangle_name(cl_object output, unsigned char *source, int l) output->base_string.fillp = 0; if (!Null(package)) if (!mangle_name(output, package->base_string.self, package->base_string.fillp)) - @(return Cnil Cnil maxarg) + @(return ECL_NIL ECL_NIL maxarg) output->base_string.self[output->base_string.fillp++] = c; if (!(dest = mangle_name(output, source, l))) - @(return Cnil Cnil maxarg) + @(return ECL_NIL ECL_NIL maxarg) if (dest[-1] == '_') dest[-1] = 'M'; *(dest++) = '\0'; @@ -203,9 +203,9 @@ make_this_symbol(int i, cl_object s, int code, const char *name, s->symbol.binding = ECL_MISSING_SPECIAL_BINDING; #endif ECL_SET(s, OBJNULL); - SYM_FUN(s) = Cnil; - s->symbol.plist = Cnil; - s->symbol.hpack = Cnil; + SYM_FUN(s) = ECL_NIL; + s->symbol.plist = ECL_NIL; + s->symbol.hpack = ECL_NIL; s->symbol.stype = stp; s->symbol.hpack = package; s->symbol.name = make_constant_base_string(name); @@ -216,7 +216,7 @@ make_this_symbol(int i, cl_object s, int code, const char *name, } else { int intern_flag; ECL_SET(s, value); - if (ecl_find_symbol(s->symbol.name, package, &intern_flag) != Cnil + if (ecl_find_symbol(s->symbol.name, package, &intern_flag) != ECL_NIL && intern_flag == ECL_INHERITED) { ecl_shadowing_import(s, package); } else { diff --git a/src/c/alloc.d b/src/c/alloc.d index ce7e44d7b..ad313e249 100644 --- a/src/c/alloc.d +++ b/src/c/alloc.d @@ -315,7 +315,7 @@ ONCE_MORE: break; case t_array: obj->array.dims = NULL; - obj->array.displaced = Cnil; + obj->array.displaced = ECL_NIL; obj->array.elttype = (short)ecl_aet_object; obj->array.self.t = NULL; break; @@ -323,16 +323,16 @@ ONCE_MORE: case t_string: #endif case t_vector: - obj->array.displaced = Cnil; + obj->array.displaced = ECL_NIL; obj->array.elttype = (short)ecl_aet_object; obj->array.self.t = NULL; break; case t_base_string: - obj->base_string.displaced = Cnil; + obj->base_string.displaced = ECL_NIL; obj->base_string.self = NULL; break; case t_bitvector: - obj->vector.displaced = Cnil; + obj->vector.displaced = ECL_NIL; obj->vector.self.bit = NULL; break; #ifndef CLOS @@ -362,17 +362,17 @@ ONCE_MORE: obj->pathname.version = OBJNULL; break; case t_bytecodes: - obj->bytecodes.lex = Cnil; - obj->bytecodes.name = Cnil; - obj->bytecodes.definition = Cnil; - obj->bytecodes.specials = Cnil; + obj->bytecodes.lex = ECL_NIL; + obj->bytecodes.name = ECL_NIL; + obj->bytecodes.definition = ECL_NIL; + obj->bytecodes.specials = ECL_NIL; obj->bytecodes.code_size = 0; obj->bytecodes.code = NULL; obj->bytecodes.data = NULL; break; case t_bclosure: obj->bclosure.code = - obj->bclosure.lex = Cnil; + obj->bclosure.lex = ECL_NIL; break; case t_cfun: case t_cfunfixed: @@ -410,25 +410,25 @@ ONCE_MORE: case t_instance: obj->instance.length = 0; CLASS_OF(obj) = OBJNULL; - obj->instance.sig = Cnil; + obj->instance.sig = ECL_NIL; obj->instance.isgf = 0; obj->instance.slots = NULL; break; #endif /* CLOS */ case t_codeblock: obj->cblock.locked = 0; - obj->cblock.name = Cnil; + obj->cblock.name = ECL_NIL; obj->cblock.handle = NULL; obj->cblock.entry = NULL; obj->cblock.data = NULL; obj->cblock.data_size = 0; obj->cblock.data_text = NULL; obj->cblock.data_text_size = 0; - obj->cblock.links = Cnil; - obj->cblock.next = Cnil; + obj->cblock.links = ECL_NIL; + obj->cblock.next = ECL_NIL; break; case t_foreign: - obj->foreign.tag = Cnil; + obj->foreign.tag = ECL_NIL; obj->foreign.size = 0; obj->foreign.data = NULL; break; @@ -455,7 +455,7 @@ CALL_GC: GC_disable(); { cl_object s = ecl_make_simple_base_string(tm_table[(int)t].tm_name+1, -1); GC_enable(); - CEerror(Ct, "The storage for ~A is exhausted.~%\ + CEerror(ECL_T, "The storage for ~A is exhausted.~%\ Currently, ~D pages are allocated.~%\ Use ALLOCATE to expand the space.", 2, s, MAKE_FIXNUM(tm->tm_npage)); @@ -511,7 +511,7 @@ CALL_GC: tm->tm_maxpage += tm->tm_maxpage/2; goto ONCE_MORE; } - CEerror(Ct, "The storage for CONS is exhausted.~%\ + CEerror(ECL_T, "The storage for CONS is exhausted.~%\ Currently, ~D pages are allocated.~%\ Use ALLOCATE to expand the space.", 1, MAKE_FIXNUM(tm->tm_npage)); @@ -574,7 +574,7 @@ ONCE_MORE: g = FALSE; goto ONCE_MORE; } - CEerror(Ct, "Contiguous blocks exhausted.~%\ + CEerror(ECL_T, "Contiguous blocks exhausted.~%\ Currently, ~D pages are allocated.~%\ Use ALLOCATE-CONTIGUOUS-PAGES to expand the space.", 1, MAKE_FIXNUM(ncbpage)); @@ -772,7 +772,7 @@ init_alloc(void) maxcbpage = 2048; #ifdef NEED_MALLOC - malloc_list = Cnil; + malloc_list = ECL_NIL; ecl_register_static_root(&malloc_list); #endif } @@ -791,7 +791,7 @@ t_from_type(cl_object type) FEerror("Unrecognized type", 0); } -@(defun si::allocate (type qty &optional (now Cnil)) +@(defun si::allocate (type qty &optional (now ECL_NIL)) struct typemanager *tm; cl_ptr pp; cl_index i; @@ -800,15 +800,15 @@ t_from_type(cl_object type) i = ecl_to_size(qty); if (tm->tm_npage > i) i = tm->tm_npage; tm->tm_maxpage = i; - if (now == Cnil || tm->tm_maxpage <= tm->tm_npage) - @(return Ct) + if (now == ECL_NIL || tm->tm_maxpage <= tm->tm_npage) + @(return ECL_T) if (available_pages() < tm->tm_maxpage - tm->tm_npage || (pp = alloc_page(tm->tm_maxpage - tm->tm_npage)) == NULL) FEerror("Can't allocate ~D pages for ~A.", 2, type, make_constant_base_string(tm->tm_name+1)); for (; tm->tm_npage < tm->tm_maxpage; pp += LISP_PAGESIZE) add_page_to_freelist(pp, tm); - @(return Ct) + @(return ECL_T) @) @(defun si::maximum-allocatable-pages (type) @@ -821,7 +821,7 @@ t_from_type(cl_object type) @(return MAKE_FIXNUM(tm_of(t_from_type(type))->tm_npage)) @) -@(defun si::allocate-contiguous-pages (qty &optional (now Cnil)) +@(defun si::allocate-contiguous-pages (qty &optional (now ECL_NIL)) cl_index i, m; cl_ptr p; @ @@ -832,7 +832,7 @@ since ~D pages are already allocated.", 2, qty, MAKE_FIXNUM(ncbpage)); maxcbpage = i; if (Null(now)) - @(return Ct) + @(return ECL_T) m = maxcbpage - ncbpage; if (available_pages() < m || (p = alloc_page(m)) == NULL) FEerror("Can't allocate ~D pages for contiguous blocks.", @@ -841,7 +841,7 @@ since ~D pages are already allocated.", type_map[page(p + LISP_PAGESIZE*i)] = (char)t_contiguous; ncbpage += m; cl_dealloc(p, LISP_PAGESIZE*m); - @(return Ct) + @(return ECL_T) @) @(defun si::allocated-contiguous-pages () @@ -872,7 +872,7 @@ since ~D pages are already allocated.", @(defun si::ignore-maximum-pages (&optional (flag OBJNULL)) @ if (flag == OBJNULL) - @(return (ignore_maximum_pages? Ct : Cnil)) + @(return (ignore_maximum_pages? ECL_T : ECL_NIL)) ignore_maximum_pages = Null(flag); @(return flag) @) diff --git a/src/c/alloc_2.d b/src/c/alloc_2.d index 59fb0ca73..85acd1a8d 100644 --- a/src/c/alloc_2.d +++ b/src/c/alloc_2.d @@ -95,7 +95,7 @@ out_of_memory(size_t requested_bytes) if (!interrupts) ecl_disable_interrupts_env(the_env); /* Free the input / output buffers */ - the_env->string_pool = Cnil; + the_env->string_pool = ECL_NIL; /* The out of memory condition may happen in more than one thread */ /* But then we have to ensure the error has not been solved */ @@ -122,7 +122,7 @@ out_of_memory(size_t requested_bytes) if (cl_core.safety_region) { /* We can free some memory and try handling the error */ GC_FREE(cl_core.safety_region); - the_env->string_pool = Cnil; + the_env->string_pool = ECL_NIL; cl_core.safety_region = 0; method = 0; } else { @@ -449,7 +449,7 @@ cl_object_mark_proc(void *addr, struct GC_ms_entry *msp, struct GC_ms_entry *msl MAYBE_MARK(o->process.args); MAYBE_MARK(o->process.function); MAYBE_MARK(o->process.name); - if (o->process.env && o->process.env != Cnil) + if (o->process.env && o->process.env != ECL_NIL) ecl_mark_env(o->process.env); break; case t_lock: @@ -654,12 +654,12 @@ ecl_list1(cl_object a) ecl_enable_interrupts_env(the_env); #ifdef ECL_SMALL_CONS obj->car = a; - obj->cdr = Cnil; + obj->cdr = ECL_NIL; return ECL_PTR_CONS(obj); #else obj->t = t_list; obj->car = a; - obj->cdr = Cnil; + obj->cdr = ECL_NIL; return (cl_object)obj; #endif } @@ -1123,9 +1123,9 @@ standard_finalizer(cl_object o) static void wrapped_finalizer(cl_object o, cl_object finalizer) { - if (finalizer != Cnil && finalizer != NULL) { + if (finalizer != ECL_NIL && finalizer != NULL) { CL_NEWENV_BEGIN { - if (finalizer != Ct) { + if (finalizer != ECL_T) { funcall(2, finalizer, o); } standard_finalizer(o); @@ -1143,11 +1143,11 @@ si_get_finalizer(cl_object o) ecl_disable_interrupts_env(the_env); GC_register_finalizer_no_order(o, (GC_finalization_proc)0, 0, &ofn, &odata); if (ofn == 0) { - output = Cnil; + output = ECL_NIL; } else if (ofn == (GC_finalization_proc)wrapped_finalizer) { output = (cl_object)odata; } else { - output = Cnil; + output = ECL_NIL; } GC_register_finalizer_no_order(o, ofn, odata, &ofn, &odata); ecl_enable_interrupts_env(the_env); @@ -1159,7 +1159,7 @@ ecl_set_finalizer_unprotected(cl_object o, cl_object finalizer) { GC_finalization_proc ofn; void *odata; - if (finalizer == Cnil) { + if (finalizer == ECL_NIL) { GC_register_finalizer_no_order(o, (GC_finalization_proc)0, 0, &ofn, &odata); } else { @@ -1196,13 +1196,13 @@ si_gc_stats(cl_object enable) cl_object size1 = ecl_make_fixnum(0); cl_object size2 = ecl_make_fixnum(0); if (cl_core.gc_stats == 0) { - old_status = Cnil; + old_status = ECL_NIL; } else if (GC_print_stats) { old_status = @':full'; } else { - old_status = Ct; + old_status = ECL_T; } - if (cl_core.bytes_consed == Cnil) { + if (cl_core.bytes_consed == ECL_NIL) { cl_core.bytes_consed = ecl_alloc_object(t_bignum); mpz_init2(cl_core.bytes_consed->big.big_num, 128); cl_core.gc_counter = ecl_alloc_object(t_bignum); @@ -1212,7 +1212,7 @@ si_gc_stats(cl_object enable) size1 = _ecl_big_plus_fix(cl_core.bytes_consed, 1); size2 = _ecl_big_plus_fix(cl_core.gc_counter, 1); } - if (enable == Cnil) { + if (enable == ECL_NIL) { GC_print_stats = 0; cl_core.gc_stats = 0; } else if (enable == ecl_make_fixnum(0)) { @@ -1304,7 +1304,7 @@ stacks_scanner() cl_object l; l = cl_core.libraries; if (l) { - for (; l != Cnil; l = ECL_CONS_CDR(l)) { + for (; l != ECL_NIL; l = ECL_CONS_CDR(l)) { cl_object dll = ECL_CONS_CAR(l); if (dll->cblock.locked) { GC_push_conditional((void *)dll, (void *)(&dll->cblock + 1), 1); @@ -1382,7 +1382,7 @@ ecl_alloc_weak_pointer(cl_object o) obj->value = o; if (!ECL_FIXNUMP(o) && !ECL_CHARACTERP(o) && !Null(o)) { GC_general_register_disappearing_link((void**)&(obj->value), (void*)o); - si_set_finalizer((cl_object)obj, Ct); + si_set_finalizer((cl_object)obj, ECL_T); } return (cl_object)obj; } @@ -1408,7 +1408,7 @@ si_weak_pointer_value(cl_object o) FEwrong_type_only_arg(@[ext::weak-pointer-value], o, @[ext::weak-pointer]); value = (cl_object)GC_call_with_alloc_lock((GC_fn_type)ecl_weak_pointer_value, o); - @(return (value? value : Cnil)); + @(return (value? value : ECL_NIL)); } #endif /* GBC_BOEHM */ diff --git a/src/c/array.d b/src/c/array.d index c3e9f23e3..143b93f3f 100644 --- a/src/c/array.d +++ b/src/c/array.d @@ -22,7 +22,7 @@ #include static const cl_object ecl_aet_name[] = { - Ct, /* ecl_aet_object */ + ECL_T, /* ecl_aet_object */ @'single-float', /* ecl_aet_sf */ @'double-float', /* ecl_aet_df */ @'bit', /* ecl_aet_bit: cannot be handled with this code */ @@ -97,7 +97,7 @@ ecl_to_index(cl_object n) case t_fixnum: { cl_fixnum out = ecl_fixnum(n); if (out < 0 || out >= ECL_ARRAY_DIMENSION_LIMIT) - FEtype_error_index(Cnil, out); + FEtype_error_index(ECL_NIL, out); return out; } default: @@ -419,7 +419,7 @@ si_make_pure_array(cl_object etype, cl_object dims, cl_object adj, 1, ecl_make_fixnum(r)); } x = ecl_alloc_object(t_array); - x->array.displaced = Cnil; + x->array.displaced = ECL_NIL; x->array.self.t = NULL; /* for GC sake */ x->array.rank = r; x->array.elttype = (short)ecl_symbol_to_elttype(etype); @@ -445,7 +445,7 @@ si_make_pure_array(cl_object etype, cl_object dims, cl_object adj, } } x->array.dim = s; - if (adj != Cnil) { + if (adj != ECL_NIL) { x->array.flags |= ECL_FLAG_ADJUSTABLE; } if (Null(displ)) @@ -493,15 +493,15 @@ si_make_vector(cl_object etype, cl_object dim, cl_object adj, x->vector.elttype = (short)aet; } x->vector.self.t = NULL; /* for GC sake */ - x->vector.displaced = Cnil; + x->vector.displaced = ECL_NIL; x->vector.dim = d; x->vector.flags = 0; - if (adj != Cnil) { + if (adj != ECL_NIL) { x->vector.flags |= ECL_FLAG_ADJUSTABLE; } if (Null(fillp)) { f = d; - } else if (fillp == Ct) { + } else if (fillp == ECL_T) { x->vector.flags |= ECL_FLAG_HAS_FILL_POINTER; f = d; } else if (ECL_FIXNUMP(fillp) && ecl_fixnum_geq(fillp,ecl_make_fixnum(0)) && @@ -509,7 +509,7 @@ si_make_vector(cl_object etype, cl_object dim, cl_object adj, x->vector.flags |= ECL_FLAG_HAS_FILL_POINTER; } else { fillp = ecl_type_error(@'make-array',"fill pointer",fillp, - cl_list(3,@'or',cl_list(3,@'member',Cnil,Ct), + cl_list(3,@'or',cl_list(3,@'member',ECL_NIL,ECL_T), cl_list(3,@'integer',ecl_make_fixnum(0), dim))); goto AGAIN; @@ -529,7 +529,7 @@ alloc_pointerfull_memory(cl_index l) cl_object *p = ecl_alloc_align(sizeof(cl_object) * l, sizeof(cl_object)); cl_index i; for (i = 0; l--;) - p[i++] = Cnil; + p[i++] = ECL_NIL; return p; } @@ -605,7 +605,7 @@ ecl_alloc_simple_vector(cl_index l, cl_elttype aet) } x->base_string.elttype = aet; x->base_string.flags = 0; /* no fill pointer, not adjustable */ - x->base_string.displaced = Cnil; + x->base_string.displaced = ECL_NIL; x->base_string.dim = x->base_string.fillp = l; return x; } @@ -660,7 +660,7 @@ ecl_symbol_to_elttype(cl_object x) #endif else if (x == @'t') return(ecl_aet_object); - else if (x == Cnil) { + else if (x == ECL_NIL) { FEerror("ECL does not support arrays with element type NIL", 0); } x = cl_upgraded_array_element_type(1, x); @@ -780,7 +780,7 @@ ecl_displace(cl_object from, cl_object to, cl_object offset) } from->array.displaced = ecl_list1(to); if (Null(to->array.displaced)) - to->array.displaced = ecl_list1(Cnil); + to->array.displaced = ecl_list1(ECL_NIL); ECL_RPLACD(to->array.displaced, CONS(from, CDR(to->array.displaced))); if (fromtype == ecl_aet_bit) { j += to->vector.offset; @@ -806,7 +806,7 @@ si_array_raw_data(cl_object x) } data = x->vector.self.b8; to_array = x->array.displaced; - if (to_array == Cnil || ((to_array = ECL_CONS_CAR(to_array)) == Cnil)) { + if (to_array == ECL_NIL || ((to_array = ECL_CONS_CAR(to_array)) == ECL_NIL)) { cl_index used_size = total_size; int flags = 0; if (ECL_ARRAY_HAS_FILL_POINTER_P(x)) { @@ -819,16 +819,16 @@ si_array_raw_data(cl_object x) output->vector.dim = total_size; output->vector.fillp = used_size; output->vector.flags = flags; - output->vector.displaced = Cnil; + output->vector.displaced = ECL_NIL; } else { cl_index displ = data - to_array->vector.self.b8; - cl_object fillp = Cnil; + cl_object fillp = ECL_NIL; if (ECL_ARRAY_HAS_FILL_POINTER_P(x)) { fillp = ecl_make_fixnum(x->vector.fillp * ecl_aet_size[et]); } output = si_make_vector(@'ext::byte8', ecl_make_fixnum(total_size), - Cnil, + ECL_NIL, fillp, si_array_raw_data(to_array), ecl_make_fixnum(displ)); @@ -910,7 +910,7 @@ cl_adjustable_array_p(cl_object a) { if (ecl_unlikely(!ECL_ARRAYP(a))) FEwrong_type_only_arg(@[adjustable-array-p], a, @[array]); - @(return (ECL_ADJUSTABLE_ARRAY_P(a) ? Ct : Cnil)) + @(return (ECL_ADJUSTABLE_ARRAY_P(a) ? ECL_T : ECL_NIL)) } /* @@ -997,7 +997,7 @@ cl_svref(cl_object x, cl_object index) if (ecl_unlikely(type_of(x) != t_vector || (x->vector.flags & (ECL_FLAG_ADJUSTABLE | ECL_FLAG_HAS_FILL_POINTER)) || - CAR(x->vector.displaced) != Cnil || + CAR(x->vector.displaced) != ECL_NIL || (cl_elttype)x->vector.elttype != ecl_aet_object)) { FEwrong_type_nth_arg(@[svref],1,x,@[simple-vector]); @@ -1014,7 +1014,7 @@ si_svset(cl_object x, cl_object index, cl_object v) if (ecl_unlikely(type_of(x) != t_vector || (x->vector.flags & (ECL_FLAG_ADJUSTABLE | ECL_FLAG_HAS_FILL_POINTER)) || - CAR(x->vector.displaced) != Cnil || + CAR(x->vector.displaced) != ECL_NIL || (cl_elttype)x->vector.elttype != ecl_aet_object)) { FEwrong_type_nth_arg(@[si::svset],1,x,@[simple-vector]); @@ -1030,14 +1030,14 @@ cl_array_has_fill_pointer_p(cl_object a) cl_object r; switch (type_of(a)) { case t_array: - r = Cnil; break; + r = ECL_NIL; break; case t_vector: case t_bitvector: #ifdef ECL_UNICODE case t_string: #endif case t_base_string: - r = ECL_ARRAY_HAS_FILL_POINTER_P(a)? Ct : Cnil; + r = ECL_ARRAY_HAS_FILL_POINTER_P(a)? ECL_T : ECL_NIL; break; default: FEwrong_type_nth_arg(@[array-has-fill-pointer-p],1,a,@[array]); @@ -1101,7 +1101,7 @@ si_replace_array(cl_object olda, cl_object newa) olda = newa; goto OUTPUT; } - for (dlist = CDR(olda->array.displaced); dlist != Cnil; dlist = CDR(dlist)) { + for (dlist = CDR(olda->array.displaced); dlist != ECL_NIL; dlist = CDR(dlist)) { cl_object other_array = CAR(dlist); cl_object offset; cl_array_displacement(other_array); diff --git a/src/c/assignment.d b/src/c/assignment.d index 56d630a74..22685c7e5 100644 --- a/src/c/assignment.d +++ b/src/c/assignment.d @@ -40,7 +40,7 @@ static cl_object make_setf_function_error(cl_object name) { return ecl_make_cclosure_va((cl_objectfn)unbound_setf_function_error, - name, Cnil); + name, ECL_NIL); } cl_object @@ -49,10 +49,10 @@ ecl_setf_definition(cl_object sym, cl_object createp) cl_env_ptr the_env = ecl_process_env(); cl_object pair; ECL_WITH_GLOBAL_ENV_RDLOCK_BEGIN(the_env) { - pair = ecl_gethash_safe(sym, cl_core.setf_definitions, Cnil); + pair = ecl_gethash_safe(sym, cl_core.setf_definitions, ECL_NIL); if (Null(pair) && !Null(createp)) { createp = make_setf_function_error(sym); - pair = ecl_cons(createp, Cnil); + pair = ecl_cons(createp, ECL_NIL); ecl_sethash(sym, cl_core.setf_definitions, pair); } } ECL_WITH_GLOBAL_ENV_RDLOCK_END; @@ -70,9 +70,9 @@ ecl_rem_setf_definition(cl_object sym) { cl_env_ptr the_env = ecl_process_env(); ECL_WITH_GLOBAL_ENV_WRLOCK_BEGIN(the_env) { - cl_object pair = ecl_gethash_safe(sym, cl_core.setf_definitions, Cnil); + cl_object pair = ecl_gethash_safe(sym, cl_core.setf_definitions, ECL_NIL); if (!Null(pair)) { - ECL_RPLACA(pair, Cnil); + ECL_RPLACA(pair, ECL_NIL); ecl_remhash(sym, cl_core.setf_definitions); } } ECL_WITH_GLOBAL_ENV_WRLOCK_END; @@ -87,7 +87,7 @@ ecl_rem_setf_definition(cl_object sym) if (Null(cl_functionp(def))) FEinvalid_function(def); pack = ecl_symbol_package(sym); - if (pack != Cnil && pack->pack.locked) { + if (pack != ECL_NIL && pack->pack.locked) { CEpackage_error("Attempt to redefine function ~S in locked package.", "Ignore lock and proceed", pack, 1, fname); } @@ -107,7 +107,7 @@ ecl_rem_setf_definition(cl_object sym) SYM_FUN(sym) = def; ecl_clear_compiler_properties(sym); #ifndef ECL_CMU_FORMAT - if (pprint == Cnil) + if (pprint == ECL_NIL) si_rem_sysprop(sym, @'si::pretty-print-format'); else si_put_sysprop(sym, @'si::pretty-print-format', pprint); @@ -138,13 +138,13 @@ cl_fmakunbound(cl_object fname) { cl_object sym = si_function_block_name(fname); cl_object pack = ecl_symbol_package(sym); - if (pack != Cnil && pack->pack.locked) { + if (pack != ECL_NIL && pack->pack.locked) { CEpackage_error("Attempt to redefine function ~S in locked package.", "Ignore lock and proceed", pack, 1, fname); } if (ECL_SYMBOLP(fname)) { ecl_clear_compiler_properties(sym); - SYM_FUN(sym) = Cnil; + SYM_FUN(sym) = ECL_NIL; ecl_symbol_type_set(sym, ecl_symbol_type(sym) & ~ecl_stp_macro); } else { ecl_rem_setf_definition(sym); @@ -166,13 +166,13 @@ si_get_sysprop(cl_object sym, cl_object prop) { cl_env_ptr the_env = ecl_process_env(); ECL_WITH_GLOBAL_ENV_RDLOCK_BEGIN(the_env) { - cl_object plist = ecl_gethash_safe(sym, cl_core.system_properties, Cnil); + cl_object plist = ecl_gethash_safe(sym, cl_core.system_properties, ECL_NIL); prop = ecl_getf(plist, prop, OBJNULL); } ECL_WITH_GLOBAL_ENV_RDLOCK_END; if (prop == OBJNULL) { - @(return Cnil Cnil); + @(return ECL_NIL ECL_NIL); } else { - @(return prop Ct); + @(return prop ECL_T); } } @@ -181,7 +181,7 @@ si_put_sysprop(cl_object sym, cl_object prop, cl_object value) { cl_env_ptr the_env = ecl_process_env(); ECL_WITH_GLOBAL_ENV_WRLOCK_BEGIN(the_env) { - cl_object plist = ecl_gethash_safe(sym, cl_core.system_properties, Cnil); + cl_object plist = ecl_gethash_safe(sym, cl_core.system_properties, ECL_NIL); ecl_sethash(sym, cl_core.system_properties, si_put_f(plist, value, prop)); } ECL_WITH_GLOBAL_ENV_WRLOCK_END; @(return value); @@ -192,7 +192,7 @@ si_rem_sysprop(cl_object sym, cl_object prop) { const cl_env_ptr the_env = ecl_process_env(); cl_object plist, found; - plist = ecl_gethash_safe(sym, cl_core.system_properties, Cnil); + plist = ecl_gethash_safe(sym, cl_core.system_properties, ECL_NIL); plist = si_rem_f(plist, prop); found = ecl_nth_value(the_env, 1); ecl_sethash(sym, cl_core.system_properties, plist); diff --git a/src/c/cfun.d b/src/c/cfun.d index 2a4c101d5..f546a24e1 100644 --- a/src/c/cfun.d +++ b/src/c/cfun.d @@ -30,7 +30,7 @@ ecl_make_cfun(cl_objectfn_fixed c_function, cl_object name, cl_object cblock, in cf->cfunfixed.entry_fixed = c_function; cf->cfunfixed.name = name; cf->cfunfixed.block = cblock; - cf->cfunfixed.file = Cnil; + cf->cfunfixed.file = ECL_NIL; cf->cfunfixed.file_position = ecl_make_fixnum(-1); cf->cfunfixed.narg = narg; if (ecl_unlikely(narg < 0 || narg > ECL_C_ARGUMENTS_LIMIT)) @@ -49,7 +49,7 @@ ecl_make_cfun_va(cl_objectfn c_function, cl_object name, cl_object cblock) cf->cfun.name = name; cf->cfun.block = cblock; cf->cfun.narg = -1; - cf->cfun.file = Cnil; + cf->cfun.file = ECL_NIL; cf->cfun.file_position = ecl_make_fixnum(-1); return cf; } @@ -63,7 +63,7 @@ ecl_make_cclosure_va(cl_objectfn c_function, cl_object env, cl_object block) cc->cclosure.entry = c_function; cc->cclosure.env = env; cc->cclosure.block = block; - cc->cclosure.file = Cnil; + cc->cclosure.file = ECL_NIL; cc->cclosure.file_position = ecl_make_fixnum(-1); return cc; } @@ -80,7 +80,7 @@ ecl_def_c_macro(cl_object sym, cl_objectfn_fixed c_function, int narg) { si_fset(3, sym, ecl_make_cfun(c_function, sym, ecl_symbol_value(@'si::*cblock*'), 2), - Ct); + ECL_T); } void @@ -88,7 +88,7 @@ ecl_def_c_macro_va(cl_object sym, cl_objectfn c_function) { si_fset(3, sym, ecl_make_cfun_va(c_function, sym, ecl_symbol_value(@'si::*cblock*')), - Ct); + ECL_T); } void @@ -113,7 +113,7 @@ si_compiled_function_name(cl_object fun) case t_cfunfixed: output = fun->cfun.name; break; case t_cclosure: - output = Cnil; break; + output = ECL_NIL; break; default: FEinvalid_function(fun); } @@ -124,7 +124,7 @@ cl_object cl_function_lambda_expression(cl_object fun) { cl_env_ptr the_env = ecl_process_env(); - cl_object output, name = Cnil, lex = Cnil; + cl_object output, name = ECL_NIL, lex = ECL_NIL; switch(type_of(fun)) { case t_bclosure: @@ -133,7 +133,7 @@ cl_function_lambda_expression(cl_object fun) case t_bytecodes: name = fun->bytecodes.name; output = fun->bytecodes.definition; - if (name == Cnil) + if (name == ECL_NIL) output = cl_cons(@'lambda', output); else if (name != @'si::bytecodes') output = @list*(3, @'ext::lambda-block', name, output); @@ -141,20 +141,20 @@ cl_function_lambda_expression(cl_object fun) case t_cfun: case t_cfunfixed: name = fun->cfun.name; - lex = Cnil; - output = Cnil; + lex = ECL_NIL; + output = ECL_NIL; break; case t_cclosure: - name = Cnil; - lex = Ct; - output = Cnil; + name = ECL_NIL; + lex = ECL_T; + output = ECL_NIL; break; #ifdef CLOS case t_instance: if (fun->instance.isgf) { - name = Cnil; - lex = Cnil; - output = Cnil; + name = ECL_NIL; + lex = ECL_NIL; + output = ECL_NIL; break; } #endif @@ -200,7 +200,7 @@ si_compiled_function_file(cl_object b) case t_cclosure: ecl_return2(the_env, b->cclosure.file, b->cclosure.file_position); default: - ecl_return2(the_env, Cnil, Cnil); + ecl_return2(the_env, ECL_NIL, ECL_NIL); } } @@ -236,7 +236,7 @@ ecl_set_function_source_file_info(cl_object b, cl_object source, cl_object posit void ecl_cmp_defmacro(cl_object fun) { - si_fset(3, fun->cfun.name, fun, Ct); + si_fset(3, fun->cfun.name, fun, ECL_T); } void diff --git a/src/c/character.d b/src/c/character.d index 29206dea6..c10d48b7f 100644 --- a/src/c/character.d +++ b/src/c/character.d @@ -48,7 +48,7 @@ cl_standard_char_p(cl_object c) { /* INV: ecl_char_code() checks the type */ cl_fixnum i = ecl_char_code(c); - @(return (ecl_standard_char_p(i)? Ct : Cnil)) + @(return (ecl_standard_char_p(i)? ECL_T : ECL_NIL)) } bool @@ -67,35 +67,35 @@ cl_object cl_graphic_char_p(cl_object c) { /* INV: ecl_char_code() checks the type */ - @(return (ecl_graphic_char_p(ecl_char_code(c))? Ct : Cnil)) + @(return (ecl_graphic_char_p(ecl_char_code(c))? ECL_T : ECL_NIL)) } cl_object cl_alpha_char_p(cl_object c) { /* INV: ecl_char_code() checks the type */ - @(return (ecl_alpha_char_p(ecl_char_code(c))? Ct : Cnil)) + @(return (ecl_alpha_char_p(ecl_char_code(c))? ECL_T : ECL_NIL)) } cl_object cl_upper_case_p(cl_object c) { /* INV: ecl_char_code() checks the type */ - @(return (ecl_upper_case_p(ecl_char_code(c))? Ct : Cnil)) + @(return (ecl_upper_case_p(ecl_char_code(c))? ECL_T : ECL_NIL)) } cl_object cl_lower_case_p(cl_object c) { /* INV: ecl_char_code() checks the type */ - @(return (ecl_lower_case_p(ecl_char_code(c))? Ct : Cnil)) + @(return (ecl_lower_case_p(ecl_char_code(c))? ECL_T : ECL_NIL)) } cl_object cl_both_case_p(cl_object c) { /* INV: ecl_char_code() checks the type */ - @(return (ecl_both_case_p(ecl_char_code(c))? Ct : Cnil)) + @(return (ecl_both_case_p(ecl_char_code(c))? ECL_T : ECL_NIL)) } int @@ -130,7 +130,7 @@ ecl_string_case(cl_object s) } basis = ecl_fixnum(radix); value = ecl_digitp(ecl_char_code(c), basis); - @(return ((value < 0)? Cnil: ecl_make_fixnum(value))); + @(return ((value < 0)? ECL_NIL: ecl_make_fixnum(value))); } @) /* @@ -162,7 +162,7 @@ cl_alphanumericp(cl_object c) { /* INV: ecl_char_code() checks type of `c' */ cl_fixnum i = ecl_char_code(c); - @(return (ecl_alphanumericp(i)? Ct : Cnil)) + @(return (ecl_alphanumericp(i)? ECL_T : ECL_NIL)) } @(defun char= (c &rest cs) @@ -170,8 +170,8 @@ cl_alphanumericp(cl_object c) /* INV: ecl_char_eq() checks types of `c' and `cs' */ while (--narg) if (!ecl_char_eq(c, ecl_va_arg(cs))) - @(return Cnil) - @(return Ct) + @(return ECL_NIL) + @(return ECL_T) @) bool @@ -194,9 +194,9 @@ ecl_char_eq(cl_object x, cl_object y) c = ecl_va_arg(cs); for (j = 1; jbase_string.fillp; @@ -510,7 +510,7 @@ cl_name_char(cl_object name) c = ecl_parse_integer(name, 1, end, &real_end, 16); used_l = real_end; if (!ECL_FIXNUMP(c) || (used_l == (l - 1))) { - c = Cnil; + c = ECL_NIL; } else { c = ECL_CODE_CHAR(ecl_fixnum(c)); } diff --git a/src/c/cinit.d b/src/c/cinit.d index c9f5e97eb..9bff7a107 100644 --- a/src/c/cinit.d +++ b/src/c/cinit.d @@ -99,7 +99,7 @@ cl_array_dimensions(cl_object array) extern cl_object si_find_relative_package(cl_narg narg, cl_object package, ...) { - @(return Cnil); + @(return ECL_NIL); } static cl_object si_simple_toplevel () @@ -121,7 +121,7 @@ static cl_object si_simple_toplevel () } while (1) { writestr_stream("\n> ", output); - sentence = @read(3, Cnil, Cnil, OBJNULL); + sentence = @read(3, ECL_NIL, ECL_NIL, OBJNULL); if (sentence == OBJNULL) @(return); sentence = si_eval_with_env(1, sentence); @@ -139,10 +139,10 @@ main(int argc, char **args) cl_boot(argc, args); /* We are computing unnormalized numbers at some point */ - si_trap_fpe(Ct, Cnil); + si_trap_fpe(ECL_T, ECL_NIL); #ifdef ECL_CMU_FORMAT - ECL_SET(@'*load-verbose*', Cnil); + ECL_SET(@'*load-verbose*', ECL_NIL); #endif ECL_SET(@'*package*', cl_core.system_package); diff --git a/src/c/clos/cache.d b/src/c/clos/cache.d index 36c30c541..c6201d24f 100644 --- a/src/c/clos/cache.d +++ b/src/c/clos/cache.d @@ -35,7 +35,7 @@ empty_cache(ecl_cache_ptr cache) table->vector.self.fix[i+2] = 0; } #ifdef ECL_THREADS - cache->clear_list = Cnil; + cache->clear_list = ECL_NIL; #endif } @@ -79,19 +79,19 @@ ecl_make_cache(cl_index key_size, cl_index cache_size) { ecl_cache_ptr cache = ecl_alloc(sizeof(struct ecl_cache)); cache->keys = - si_make_vector(Ct, /* element type */ + si_make_vector(ECL_T, /* element type */ ecl_make_fixnum(key_size), /* Maximum size */ - Ct, /* adjustable */ + ECL_T, /* adjustable */ ecl_make_fixnum(0), /* fill pointer */ - Cnil, /* displaced */ - Cnil); + ECL_NIL, /* displaced */ + ECL_NIL); cache->table = - si_make_vector(Ct, /* element type */ + si_make_vector(ECL_T, /* element type */ ecl_make_fixnum(3*cache_size), /* Maximum size */ - Cnil, /* adjustable */ - Cnil, /* fill pointer */ - Cnil, /* displaced */ - Cnil); + ECL_NIL, /* adjustable */ + ECL_NIL, /* fill pointer */ + ECL_NIL, /* displaced */ + ECL_NIL); empty_cache(cache); return cache; } @@ -210,7 +210,7 @@ ecl_search_cache(ecl_cache_ptr cache) cl_fixnum g = RECORD_GEN(e) - gen; if (g <= 0) { RECORD_KEY(e) = OBJNULL; - RECORD_VALUE(e) = Cnil; + RECORD_VALUE(e) = ECL_NIL; g = 0; } RECORD_GEN_SET(e, g); diff --git a/src/c/cmpaux.d b/src/c/cmpaux.d index 4c98347bc..36d9bba9e 100644 --- a/src/c/cmpaux.d +++ b/src/c/cmpaux.d @@ -22,7 +22,7 @@ cl_object si_specialp(cl_object sym) { - @(return ((ecl_symbol_type(sym) & ecl_stp_special)? Ct : Cnil)) + @(return ((ecl_symbol_type(sym) & ecl_stp_special)? ECL_T : ECL_NIL)) } cl_fixnum @@ -164,7 +164,7 @@ cl_go(cl_object tag_id, cl_object label) cl_object cl_grab_rest_args(ecl_va_list args) { - cl_object rest = Cnil; + cl_object rest = ECL_NIL; cl_object *r = &rest; while (args[0].narg) { *r = ecl_list1(ecl_va_arg(args)); @@ -187,10 +187,10 @@ cl_parse_key( cl_object supplied_allow_other_keys = OBJNULL; cl_object unknown_keyword = OBJNULL; - if (rest != NULL) *rest = Cnil; + if (rest != NULL) *rest = ECL_NIL; for (i = 0; i < 2*nkey; i++) - vars[i] = Cnil; /* default values: NIL, supplied: NIL */ + vars[i] = ECL_NIL; /* default values: NIL, supplied: NIL */ if (args[0].narg <= 0) return; for (; args[0].narg > 1; ) { @@ -205,9 +205,9 @@ cl_parse_key( } for (i = 0; i < nkey; i++) { if (keys[i] == keyword) { - if (vars[nkey+i] == Cnil) { + if (vars[nkey+i] == ECL_NIL) { vars[i] = value; - vars[nkey+i] = Ct; + vars[nkey+i] = ECL_T; } goto goon; } @@ -223,7 +223,7 @@ cl_parse_key( if (ecl_unlikely(args[0].narg != 0)) FEprogram_error_noreturn("Odd number of keys", 0); if (ecl_unlikely(unknown_keyword != OBJNULL && !allow_other_keys && - (supplied_allow_other_keys == Cnil || + (supplied_allow_other_keys == ECL_NIL || supplied_allow_other_keys == OBJNULL))) FEprogram_error("Unknown keyword ~S", 1, unknown_keyword); } diff --git a/src/c/compiler.d b/src/c/compiler.d index 8b32749c1..57da74fb3 100644 --- a/src/c/compiler.d +++ b/src/c/compiler.d @@ -151,8 +151,8 @@ pop(cl_object *l) { static cl_object pop_maybe_nil(cl_object *l) { cl_object head, list = *l; - if (list == Cnil) - return Cnil; + if (list == ECL_NIL) + return ECL_NIL; unlikely_if (!ECL_LISTP(list)) FEill_formed_input(); head = ECL_CONS_CAR(list); @@ -189,8 +189,8 @@ asm_end(cl_env_ptr env, cl_index beginning, cl_object definition) { code[i] = (cl_opcode)(cl_fixnum)(env->stack[beginning+i]); } bytecodes->bytecodes.entry = _ecl_bytecodes_dispatch_vararg; - ecl_set_function_source_file_info(bytecodes, (file == OBJNULL)? Cnil : file, - (file == OBJNULL)? Cnil : position); + ecl_set_function_source_file_info(bytecodes, (file == OBJNULL)? ECL_NIL : file, + (file == OBJNULL)? ECL_NIL : position); asm_clear(env, beginning); return bytecodes; } @@ -454,7 +454,7 @@ c_register_block(cl_env_ptr env, cl_object name) { const cl_compiler_ptr c_env = env->c_env; cl_object loc = new_location(c_env); - c_env->variables = CONS(cl_list(4, @':block', name, Cnil, loc), + c_env->variables = CONS(cl_list(4, @':block', name, ECL_NIL, loc), c_env->variables); return ecl_fixnum(ECL_CONS_CDR(loc)); } @@ -464,7 +464,7 @@ c_register_tags(cl_env_ptr env, cl_object all_tags) { const cl_compiler_ptr c_env = env->c_env; cl_object loc = new_location(c_env); - c_env->variables = CONS(cl_list(4, @':tag', all_tags, Cnil, loc), + c_env->variables = CONS(cl_list(4, @':tag', all_tags, ECL_NIL, loc), c_env->variables); return ecl_fixnum(ECL_CONS_CDR(loc)); } @@ -473,7 +473,7 @@ static void c_register_function(cl_env_ptr env, cl_object name) { const cl_compiler_ptr c_env = env->c_env; - c_env->variables = CONS(cl_list(4, @':function', name, Cnil, + c_env->variables = CONS(cl_list(4, @':function', name, ECL_NIL, new_location(c_env)), c_env->variables); c_env->macros = CONS(cl_list(2, name, @'function'), c_env->macros); @@ -508,8 +508,8 @@ c_register_var(cl_env_ptr env, cl_object var, bool special, bool bound) { const cl_compiler_ptr c_env = env->c_env; c_env->variables = CONS(cl_list(4, var, - special? @'special' : Cnil, - bound? Ct : Cnil, + special? @'special' : ECL_NIL, + bound? ECL_T : ECL_NIL, new_location(c_env)), c_env->variables); } @@ -524,7 +524,7 @@ guess_environment(cl_env_ptr env, cl_object interpreter_env) * suitable compiler enviroment to compile forms that access the * variables and local functions of this interpreted code. */ - for (interpreter_env = @revappend(interpreter_env, Cnil); + for (interpreter_env = @revappend(interpreter_env, ECL_NIL); !Null(interpreter_env); interpreter_env = ECL_CONS_CDR(interpreter_env)) { @@ -537,7 +537,7 @@ guess_environment(cl_env_ptr env, cl_object interpreter_env) if (ECL_SYMBOLP(record0)) { c_register_var(env, record0, FALSE, TRUE); } else if (record1 == ecl_make_fixnum(0)) { - c_register_tags(env, Cnil); + c_register_tags(env, ECL_NIL); } else { c_register_block(env, record1); } @@ -555,14 +555,14 @@ c_new_env(cl_env_ptr the_env, cl_compiler_env_ptr new, cl_object env, new->env_depth = old->env_depth + 1; } else { new->code_walker = ECL_SYM_VAL(the_env, @'si::*code-walker*'); - new->constants = si_make_vector(Ct, ecl_make_fixnum(16), - Ct, /* Adjustable */ + new->constants = si_make_vector(ECL_T, ecl_make_fixnum(16), + ECL_T, /* Adjustable */ ecl_make_fixnum(0), /* Fillp */ - Cnil, /* displacement */ - Cnil); + ECL_NIL, /* displacement */ + ECL_NIL); new->stepping = 0; new->lexical_level = 0; - new->load_time_forms = Cnil; + new->load_time_forms = ECL_NIL; new->env_depth = 0; new->macros = CDR(env); new->variables = CAR(env); @@ -608,7 +608,7 @@ c_tag_ref(cl_env_ptr env, cl_object the_tag, cl_object the_type) if (type == the_type && ecl_equal(name, the_tag)) { /* Mark as used */ record = ECL_CONS_CDR(record); - ECL_RPLACA(record, Ct); + ECL_RPLACA(record, ECL_T); return ecl_make_fixnum(n); } n++; @@ -619,7 +619,7 @@ c_tag_ref(cl_env_ptr env, cl_object the_tag, cl_object the_type) * and other declarations */ } } - return Cnil; + return ECL_NIL; } ecl_def_ct_base_string(undefined_variable, @@ -662,7 +662,7 @@ c_var_ref(cl_env_ptr env, cl_object var, int allow_symbol_macro, bool ensure_def } if (ensure_defined) { l = ecl_symbol_value(@'ext::*action-on-undefined-variable*'); - if (l != Cnil) { + if (l != ECL_NIL) { funcall(3, l, undefined_variable, var); } } @@ -880,7 +880,7 @@ c_block(cl_env_ptr env, cl_object body, int old_flags) { } labelz = asm_jmp(env, OP_FRAME); compile_body(env, body, flags); - if (CADDR(block_record) == Cnil) { + if (CADDR(block_record) == ECL_NIL) { /* Block unused. We remove the enclosing OP_BLOCK/OP_DO */ /* We also have to remove the constants we compiled, because */ /* some of them might be from load-time-value */ @@ -1012,15 +1012,15 @@ perform_c_case(cl_env_ptr env, cl_object args, int flags) { do { if (Null(args)) - return compile_body(env, Cnil, flags); + return compile_body(env, ECL_NIL, flags); clause = pop(&args); if (ECL_ATOM(clause)) FEprogram_error_noreturn("CASE: Illegal clause ~S.",1,clause); test = pop(&clause); - } while (test == Cnil); + } while (test == ECL_NIL); - if (@'otherwise' == test || test == Ct) { - unlikely_if (args != Cnil) { + if (@'otherwise' == test || test == ECL_T) { + unlikely_if (args != ECL_NIL) { FEprogram_error_noreturn("CASE: The selector ~A can only appear at the last position.", 1, test); } @@ -1130,8 +1130,8 @@ c_compiler_let(cl_env_ptr env, cl_object args, int flags) { 2) The three jump forms are [OP_JMP + label] ; Unconditional jump - [OP_JNIL + label] ; Jump if VALUES(0) == Cnil - [OP_JT + label] ; Jump if VALUES(0) != Cnil + [OP_JNIL + label] ; Jump if VALUES(0) == ECL_NIL + [OP_JT + label] ; Jump if VALUES(0) != ECL_NIL It is important to remark that both OP_JNIL and OP_JT truncate the values stack, so that always NVALUES = 1 after performing @@ -1143,16 +1143,16 @@ c_cond(cl_env_ptr env, cl_object args, int flags) { cl_index label_nil, label_exit; if (Null(args)) - return compile_form(env, Cnil, flags); + return compile_form(env, ECL_NIL, flags); clause = pop(&args); if (ECL_ATOM(clause)) FEprogram_error_noreturn("COND: Illegal clause ~S.",1,clause); test = pop(&clause); flags = maybe_values_or_reg0(flags); - if (Ct == test) { + if (ECL_T == test) { /* Default sentence. If no forms, just output T. */ if (Null(clause)) - compile_form(env, Ct, flags); + compile_form(env, ECL_T, flags); else compile_body(env, clause, flags); } else { @@ -1242,7 +1242,7 @@ c_until(cl_env_ptr env, cl_object body, int flags) { static int c_with_backend(cl_env_ptr env, cl_object args, int flags) { - cl_object forms = Cnil; + cl_object forms = ECL_NIL; while (!Null(args)) { cl_object tag = pop(&args); cl_object form = pop(&args); @@ -1257,7 +1257,7 @@ eval_when_flags(cl_object situation) { int code = 0; cl_object p; - for (p = situation; p != Cnil; p = ECL_CONS_CDR(p)) { + for (p = situation; p != ECL_NIL; p = ECL_CONS_CDR(p)) { cl_object keyword; unlikely_if (!ECL_LISTP(p)) FEtype_error_proper_list(situation); @@ -1290,33 +1290,33 @@ c_eval_when(cl_env_ptr env, cl_object args, int flags) { int mode = c_env->mode; if (mode == FLAG_EXECUTE) { if (!when_execute_p(situation)) - args = Cnil; + args = ECL_NIL; } else if (c_env->lexical_level) { if (!when_execute_p(situation)) - args = Cnil; + args = ECL_NIL; } else if (mode == FLAG_LOAD) { if (when_compile_p(situation)) { env->c_env->mode = FLAG_COMPILE; execute_each_form(env, args); env->c_env->mode = FLAG_LOAD; if (!when_load_p(situation)) - args = Cnil; + args = ECL_NIL; } else if (when_load_p(situation)) { env->c_env->mode = FLAG_ONLY_LOAD; flags = compile_toplevel_body(env, args, flags); env->c_env->mode = FLAG_LOAD; return flags; } else { - args = Cnil; + args = ECL_NIL; } } else if (mode == FLAG_ONLY_LOAD) { if (!when_load_p(situation)) - args = Cnil; + args = ECL_NIL; } else { /* FLAG_COMPILE */ if (when_execute_p(situation) || when_compile_p(situation)) { execute_each_form(env, args); } - args = Cnil; + args = ECL_NIL; } return compile_toplevel_body(env, args, flags); } @@ -1433,7 +1433,7 @@ asm_function(cl_env_ptr env, cl_object function, int flags) { cl_object body = ECL_CONS_CDR(function); cl_object name; if (kind == @'lambda') { - name = Cnil; + name = ECL_NIL; } else if (kind == @'ext::lambda-block') { name = ECL_CONS_CAR(body); body = ECL_CONS_CDR(body); @@ -1482,7 +1482,7 @@ c_if(cl_env_ptr env, cl_object form, int flags) { if (Null(form)) { return c_cond(env, ecl_list1(then), flags); } else { - return c_cond(env, cl_list(2, then, CONS(Ct, form)), flags); + return c_cond(env, cl_list(2, then, CONS(ECL_T, form)), flags); } } @@ -1544,12 +1544,12 @@ c_let_leta(cl_env_ptr env, int op, cl_object args, int flags) { case 1: op = OP_BIND; break; } - for (vars=Cnil, l=bindings; !Null(l); ) { + for (vars=ECL_NIL, l=bindings; !Null(l); ) { cl_object aux = pop(&l); cl_object var, value; if (ECL_ATOM(aux)) { var = aux; - value = Cnil; + value = ECL_NIL; } else { var = pop(&aux); value = pop_maybe_nil(&aux); @@ -1595,7 +1595,7 @@ c_load_time_value(cl_env_ptr env, cl_object args, int flags) { const cl_compiler_ptr c_env = env->c_env; cl_object value; - unlikely_if (Null(args) || cl_cddr(args) != Cnil) + unlikely_if (Null(args) || cl_cddr(args) != ECL_NIL) FEprogram_error_noreturn("LOAD-TIME-VALUE: Wrong number of arguments.", 0); value = ECL_CONS_CAR(args); if (c_env->mode != FLAG_LOAD && c_env->mode != FLAG_ONLY_LOAD) { @@ -1604,7 +1604,7 @@ c_load_time_value(cl_env_ptr env, cl_object args, int flags) /* Using the form as constant, we force the system to coalesce multiple * copies of the same load-time-value form */ c_env->load_time_forms = - ecl_cons(cl_list(3, args, value, Cnil), + ecl_cons(cl_list(3, args, value, ECL_NIL), c_env->load_time_forms); value = args; } @@ -1738,7 +1738,7 @@ static int c_multiple_value_setq(cl_env_ptr env, cl_object orig_args, int flags) { cl_object args = orig_args; cl_object orig_vars; - cl_object vars = Cnil, values; + cl_object vars = ECL_NIL, values; cl_object old_variables = env->c_env->variables; cl_index nvars = 0; @@ -1765,7 +1765,7 @@ c_multiple_value_setq(cl_env_ptr env, cl_object orig_args, int flags) { /* Compile values */ values = pop(&args); - if (args != Cnil) + if (args != ECL_NIL) FEprogram_error_noreturn("MULTIPLE-VALUE-SETQ: Too many arguments.", 0); if (nvars == 0) { /* No variables */ @@ -1774,7 +1774,7 @@ c_multiple_value_setq(cl_env_ptr env, cl_object orig_args, int flags) { compile_form(env, values, FLAG_VALUES); /* Compile variables */ - for (nvars = 0, vars = cl_nreverse(vars); vars != Cnil; nvars++, vars = ECL_CONS_CDR(vars)) { + for (nvars = 0, vars = cl_nreverse(vars); vars != ECL_NIL; nvars++, vars = ECL_CONS_CDR(vars)) { if (nvars) { compile_setq(env, OP_VSETQ, ECL_CONS_CAR(vars)); asm_arg(env, nvars); @@ -1817,7 +1817,7 @@ static int c_nth_value(cl_env_ptr env, cl_object args, int flags) { compile_form(env, pop(&args), FLAG_PUSH); /* INDEX */ compile_form(env, pop(&args), FLAG_VALUES); /* VALUES */ - if (args != Cnil) + if (args != ECL_NIL) FEprogram_error_noreturn("NTH-VALUE: Too many arguments.",0); asm_op(env, OP_NTHVAL); return FLAG_REG0; @@ -1896,12 +1896,12 @@ c_progv(cl_env_ptr env, cl_object args, int flags) { */ static int c_psetq(cl_env_ptr env, cl_object old_args, int flags) { - cl_object args = Cnil, vars = Cnil; + cl_object args = ECL_NIL, vars = ECL_NIL; bool use_psetf = FALSE; cl_index nvars = 0; if (Null(old_args)) - return compile_body(env, Cnil, flags); + return compile_body(env, ECL_NIL, flags); /* We have to make sure that non of the variables which are to be assigned is actually a symbol macro. If that is the case, we invoke (PSETF ...) to handle the @@ -1930,7 +1930,7 @@ c_psetq(cl_env_ptr env, cl_object old_args, int flags) { do { compile_setq(env, OP_PSETQ, pop(&vars)); } while (!Null(vars)); - return compile_form(env, Cnil, flags); + return compile_form(env, ECL_NIL, flags); } @@ -1950,7 +1950,7 @@ c_return_aux(cl_env_ptr env, cl_object name, cl_object stmt, int flags) if (!ECL_SYMBOLP(name) || Null(ndx)) FEprogram_error_noreturn("RETURN-FROM: Unknown block name ~S.", 1, name); - if (stmt != Cnil) + if (stmt != ECL_NIL) FEprogram_error_noreturn("RETURN-FROM: Too many arguments.", 0); compile_form(env, output, FLAG_VALUES); asm_op2(env, OP_RETURN, ecl_fixnum(ndx)); @@ -1959,7 +1959,7 @@ c_return_aux(cl_env_ptr env, cl_object name, cl_object stmt, int flags) static int c_return(cl_env_ptr env, cl_object stmt, int flags) { - return c_return_aux(env, Cnil, stmt, flags); + return c_return_aux(env, ECL_NIL, stmt, flags); } @@ -1973,7 +1973,7 @@ c_return_from(cl_env_ptr env, cl_object stmt, int flags) { static int c_setq(cl_env_ptr env, cl_object args, int flags) { if (Null(args)) - return compile_form(env, Cnil, flags); + return compile_form(env, ECL_NIL, flags); do { cl_object var = pop(&args); cl_object value = pop(&args); @@ -2031,7 +2031,7 @@ c_tagbody(cl_env_ptr env, cl_object args, int flags) { cl_object old_env = env->c_env->variables; cl_index tag_base; - cl_object labels = Cnil, label, body; + cl_object labels = ECL_NIL, label, body; cl_type item_type; int nt, i; @@ -2047,7 +2047,7 @@ c_tagbody(cl_env_ptr env, cl_object args, int flags) } if (nt == 0) { compile_body(env, args, 0); - return compile_form(env, Cnil, flags); + return compile_form(env, ECL_NIL, flags); } asm_op2c(env, OP_BLOCK, ecl_make_fixnum(0)); c_register_tags(env, labels); @@ -2076,7 +2076,7 @@ static int c_the(cl_env_ptr env, cl_object stmt, int flags) { cl_object type = pop(&stmt); cl_object value = pop(&stmt); - if (stmt != Cnil) { + if (stmt != ECL_NIL) { FEprogram_error_noreturn("THE: Too many arguments",0); } return compile_form(env, value, flags); @@ -2091,7 +2091,7 @@ static int c_throw(cl_env_ptr env, cl_object stmt, int flags) { cl_object tag = pop(&stmt); cl_object form = pop(&stmt); - if (stmt != Cnil) + if (stmt != ECL_NIL) FEprogram_error_noreturn("THROW: Too many arguments.",0); compile_form(env, tag, FLAG_PUSH); compile_form(env, form, FLAG_VALUES); @@ -2136,7 +2136,7 @@ c_values(cl_env_ptr env, cl_object args, int flags) { /* We only need the first value. However, the rest of arguments HAVE to be be evaluated */ if (Null(args)) - return compile_form(env, Cnil, flags); + return compile_form(env, ECL_NIL, flags); flags = compile_form(env, pop(&args), FLAG_PUSH); compile_body(env, args, FLAG_IGNORE); return flags; @@ -2178,8 +2178,8 @@ need_to_make_load_form_p(cl_object o) case t_list: if (Null(o)) return 0; default: - return _ecl_funcall3(@'clos::need-to-make-load-form-p', o, Cnil) - != Cnil; + return _ecl_funcall3(@'clos::need-to-make-load-form-p', o, ECL_NIL) + != ECL_NIL; } } @@ -2207,7 +2207,7 @@ compile_constant(cl_env_ptr env, cl_object stmt, int flags) bool push = flags & FLAG_PUSH; cl_fixnum n; maybe_make_load_forms(env, stmt); - if (stmt == Cnil) { + if (stmt == ECL_NIL) { asm_op(env, push? OP_PUSHNIL : OP_NIL); } else if (ECL_FIXNUMP(stmt) && (n = ecl_fixnum(stmt)) <= MAX_OPARG && n >= -MAX_OPARG) { @@ -2224,7 +2224,7 @@ compile_constant(cl_env_ptr env, cl_object stmt, int flags) static int c_quote(cl_env_ptr env, cl_object args, int flags) { - if (ECL_ATOM(args) || ECL_CONS_CDR(args) != Cnil) + if (ECL_ATOM(args) || ECL_CONS_CDR(args) != ECL_NIL) FEill_formed_input(); return compile_constant(env, ECL_CONS_CAR(args), flags); } @@ -2356,13 +2356,13 @@ eval_nontrivial_form(cl_env_ptr env, cl_object form) { frame.size = 0; frame.env = env; env->nvalues = 0; - env->values[0] = Cnil; - new_c_env.constants = si_make_vector(Ct, ecl_make_fixnum(16), - Ct, /* Adjustable */ + env->values[0] = ECL_NIL; + new_c_env.constants = si_make_vector(ECL_T, ecl_make_fixnum(16), + ECL_T, /* Adjustable */ ecl_make_fixnum(0), /* Fillp */ - Cnil, /* displacement */ - Cnil); - new_c_env.load_time_forms = Cnil; + ECL_NIL, /* displacement */ + ECL_NIL); + new_c_env.load_time_forms = ECL_NIL; new_c_env.env_depth = 0; new_c_env.env_size = 0; env->c_env = &new_c_env; @@ -2395,8 +2395,8 @@ eval_form(cl_env_ptr env, cl_object form) { static int execute_each_form(cl_env_ptr env, cl_object body) { - cl_object form = Cnil, next_form; - for (form = Cnil; !Null(body); form = next_form) { + cl_object form = ECL_NIL, next_form; + for (form = ECL_NIL; !Null(body); form = next_form) { unlikely_if (!ECL_LISTP(body)) FEtype_error_proper_list(body); next_form = ECL_CONS_CAR(body); @@ -2447,10 +2447,10 @@ compile_with_load_time_forms(cl_env_ptr env, cl_object form, int flags) * If some constants need to be built, we insert the * code _before_ the actual forms; */ - if (c_env->load_time_forms != Cnil) { + if (c_env->load_time_forms != ECL_NIL) { cl_index *bytecodes = save_bytecodes(env, handle, current_pc(env)); cl_object p, forms_list = c_env->load_time_forms; - c_env->load_time_forms = Cnil; + c_env->load_time_forms = ECL_NIL; p = forms_list; do { cl_object r = ECL_CONS_CAR(p); @@ -2463,14 +2463,14 @@ compile_with_load_time_forms(cl_env_ptr env, cl_object form, int flags) compile_with_load_time_forms(env, init_form, FLAG_IGNORE); ECL_RPLACA(p, ecl_make_fixnum(loc)); p = ECL_CONS_CDR(p); - } while (p != Cnil); + } while (p != ECL_NIL); p = forms_list; do { cl_index loc = ecl_fixnum(ECL_CONS_CAR(p)); /* Clear created constants (they cannot be printed) */ c_env->constants->vector.self.t[loc] = ecl_make_fixnum(0); p = ECL_CONS_CDR(p); - } while (p != Cnil); + } while (p != ECL_NIL); restore_bytecodes(env, bytecodes); } return output_flags; @@ -2479,8 +2479,8 @@ compile_with_load_time_forms(cl_env_ptr env, cl_object form, int flags) static int compile_each_form(cl_env_ptr env, cl_object body, int flags) { - cl_object form = Cnil, next_form; - for (form = Cnil; !Null(body); form = next_form) { + cl_object form = ECL_NIL, next_form; + for (form = ECL_NIL; !Null(body); form = next_form) { unlikely_if (!ECL_LISTP(body)) FEtype_error_proper_list(body); next_form = ECL_CONS_CAR(body); @@ -2507,8 +2507,8 @@ compile_toplevel_body(cl_env_ptr env, cl_object body, int flags) static int compile_body(cl_env_ptr env, cl_object body, int flags) { - cl_object form = Cnil, next_form; - for (form = Cnil; !Null(body); form = next_form) { + cl_object form = ECL_NIL, next_form; + for (form = ECL_NIL; !Null(body); form = next_form) { unlikely_if (!ECL_LISTP(body)) FEtype_error_proper_list(body); next_form = ECL_CONS_CAR(body); @@ -2536,7 +2536,7 @@ static int c_endp(cl_env_ptr env, cl_object args, int flags) { cl_object list = pop(&args); - if (args != Cnil) { + if (args != ECL_NIL) { FEprogram_error_noreturn("ENDP: Too many arguments", 0); } compile_form(env, list, FLAG_REG0); @@ -2548,7 +2548,7 @@ static int c_car(cl_env_ptr env, cl_object args, int flags) { cl_object list = pop(&args); - if (args != Cnil) { + if (args != ECL_NIL) { FEprogram_error_noreturn("CAR: Too many arguments", 0); } compile_form(env, list, FLAG_REG0); @@ -2560,7 +2560,7 @@ static int c_cdr(cl_env_ptr env, cl_object args, int flags) { cl_object list = pop(&args); - if (args != Cnil) { + if (args != ECL_NIL) { FEprogram_error_noreturn("CDR: Too many arguments", 0); } compile_form(env, list, FLAG_REG0); @@ -2573,9 +2573,9 @@ c_list_listA(cl_env_ptr env, cl_object args, int flags, int op) { cl_index n = ecl_length(args); if (n == 0) { - return compile_form(env, Cnil, flags); + return compile_form(env, ECL_NIL, flags); } else { - while (ECL_CONS_CDR(args) != Cnil) { + while (ECL_CONS_CDR(args) != ECL_NIL) { compile_form(env, ECL_CONS_CAR(args), FLAG_PUSH); args = ECL_CONS_CDR(args); } @@ -2626,7 +2626,7 @@ c_listA(cl_env_ptr env, cl_object args, int flags) Handles special declarations, removes declarations from body */ @(defun si::process-declarations (body &optional doc) - cl_object documentation = Cnil, declarations = Cnil, specials = Cnil; + cl_object documentation = ECL_NIL, declarations = ECL_NIL, specials = ECL_NIL; @ for (; !Null(body); body = ECL_CONS_CDR(body)) { cl_object form; @@ -2634,7 +2634,7 @@ c_listA(cl_env_ptr env, cl_object args, int flags) FEill_formed_input(); form = ECL_CONS_CAR(body); if (!Null(doc) && ecl_stringp(form) && !Null(ECL_CONS_CDR(body))) { - if (documentation != Cnil) + if (documentation != ECL_NIL) break; documentation = form; continue; @@ -2668,7 +2668,7 @@ si_process_lambda(cl_object lambda) lambda_list = ECL_CONS_CAR(lambda); body = ECL_CONS_CDR(lambda); - declarations = @si::process-declarations(2, body, Ct); + declarations = @si::process-declarations(2, body, ECL_T); body = env->values[1]; documentation = env->values[2]; specials = env->values[3]; @@ -2721,12 +2721,12 @@ si_process_lambda_list(cl_object org_lambda_list, cl_object context) if (context == @'function') { \ unlikely_if (ecl_symbol_type(v) & ecl_stp_constant) \ FEillegal_variable_name(v); } - cl_object lists[4] = {Cnil, Cnil, Cnil, Cnil}; + cl_object lists[4] = {ECL_NIL, ECL_NIL, ECL_NIL, ECL_NIL}; cl_object *reqs = lists, *opts = lists+1, *keys = lists+2, *auxs = lists+3; - cl_object v, rest = Cnil, lambda_list = org_lambda_list; + cl_object v, rest = ECL_NIL, lambda_list = org_lambda_list; int nreq = 0, nopt = 0, nkey = 0, naux = 0; - cl_object allow_other_keys = Cnil; - cl_object key_flag = Cnil; + cl_object allow_other_keys = ECL_NIL; + cl_object key_flag = ECL_NIL; enum { AT_REQUIREDS, AT_OPTIONALS, AT_REST, @@ -2744,7 +2744,7 @@ LOOP: unlikely_if (context == @'function' || context == @'ftype') goto ILLEGAL_LAMBDA; v = lambda_list; - lambda_list = Cnil; + lambda_list = ECL_NIL; goto REST; } v = ECL_CONS_CAR(lambda_list); @@ -2769,7 +2769,7 @@ REST: unlikely_if (stage >= AT_REST) if (v == @'&key') { unlikely_if (stage >= AT_KEYS) goto ILLEGAL_LAMBDA; - key_flag = Ct; + key_flag = ECL_T; stage = AT_KEYS; goto LOOP; } @@ -2780,7 +2780,7 @@ REST: unlikely_if (stage >= AT_REST) goto LOOP; } if (v == @'&allow-other-keys') { - allow_other_keys = Ct; + allow_other_keys = ECL_T; unlikely_if (stage != AT_KEYS) goto ILLEGAL_LAMBDA; stage = AT_OTHER_KEYS; @@ -2793,8 +2793,8 @@ REST: unlikely_if (stage >= AT_REST) push(v, reqs); break; case AT_OPTIONALS: { - cl_object spp = Cnil; - cl_object init = Cnil; + cl_object spp = ECL_NIL; + cl_object init = ECL_NIL; if (!ECL_ATOM(v) && (context != @'ftype')) { cl_object x = v; unlikely_if (!ECL_LISTP(x)) goto ILLEGAL_LAMBDA; @@ -2808,7 +2808,7 @@ REST: unlikely_if (stage >= AT_REST) unlikely_if (!ECL_LISTP(x)) goto ILLEGAL_LAMBDA; spp = ECL_CONS_CAR(x); x = ECL_CONS_CDR(x); - if (spp != Cnil) assert_var_name(spp); + if (spp != ECL_NIL) assert_var_name(spp); unlikely_if (!Null(x)) goto ILLEGAL_LAMBDA; } @@ -2826,8 +2826,8 @@ REST: unlikely_if (stage >= AT_REST) * &rest variable, as in (lambda (&rest x y) ...) */ goto ILLEGAL_LAMBDA; case AT_KEYS: { - cl_object init = Cnil; - cl_object spp = Cnil; + cl_object init = ECL_NIL; + cl_object spp = ECL_NIL; cl_object key; if (context == @'ftype') { unlikely_if (ECL_ATOM(v)) @@ -2850,7 +2850,7 @@ REST: unlikely_if (stage >= AT_REST) x = ECL_CONS_CDR(x); unlikely_if (!Null(x)) goto ILLEGAL_LAMBDA; - if (spp != Cnil) assert_var_name(spp); + if (spp != ECL_NIL) assert_var_name(spp); } } } @@ -2880,7 +2880,7 @@ REST: unlikely_if (stage >= AT_REST) default: { cl_object init; if (ECL_ATOM(v)) { - init = Cnil; + init = ECL_NIL; } else if (Null(CDDR(v))) { cl_object x = v; v = ECL_CONS_CAR(x); @@ -2924,7 +2924,7 @@ c_default(cl_env_ptr env, cl_object var, cl_object stmt, cl_object flag, cl_obje if (Null(flag)) { asm_complete(env, OP_JT, label); } else { - compile_form(env, Cnil, FLAG_REG0); + compile_form(env, ECL_NIL, FLAG_REG0); asm_complete(env, OP_JT, label); c_bind(env, flag, specials); } @@ -2942,7 +2942,7 @@ ecl_make_lambda(cl_env_ptr env, cl_object name, cl_object lambda) { @list*(3, @'ext::lambda-block', name, lambda)); old_c_env = env->c_env; - c_new_env(env, &new_c_env, Cnil, old_c_env); + c_new_env(env, &new_c_env, ECL_NIL, old_c_env); new_c_env.lexical_level++; reqs = si_process_lambda(lambda); @@ -2990,8 +2990,8 @@ ecl_make_lambda(cl_env_ptr env, cl_object name, cl_object lambda) { c_bind(env, rest, specials); } if (!Null(key)) { - cl_object aux = CONS(allow_other_keys,Cnil); - cl_object names = Cnil; + cl_object aux = CONS(allow_other_keys,ECL_NIL); + cl_object names = ECL_NIL; asm_op2c(env, OP_PUSHKEYS, aux); keys = ECL_CONS_CDR(keys); while (!Null(keys)) { @@ -3026,7 +3026,7 @@ ecl_make_lambda(cl_env_ptr env, cl_object name, cl_object lambda) { asm_op(env, OP_EXIT); if (Null(ecl_symbol_value(@'si::*keep-definitions*'))) - lambda = Cnil; + lambda = ECL_NIL; output = asm_end(env, handle, lambda); output->bytecodes.name = name; @@ -3067,7 +3067,7 @@ cl_object si_valid_function_name_p(cl_object name) { name = ecl_function_block_name(name); - @(return (name? Ct : Cnil)) + @(return (name? ECL_T : ECL_NIL)) } cl_object @@ -3078,7 +3078,7 @@ si_make_lambda(cl_object name, cl_object rest) volatile cl_compiler_env_ptr old_c_env = the_env->c_env; struct cl_compiler_env new_c_env; - c_new_env(the_env, &new_c_env, Cnil, 0); + c_new_env(the_env, &new_c_env, ECL_NIL, 0); ECL_UNWIND_PROTECT_BEGIN(the_env) { lambda = ecl_make_lambda(the_env, name, rest); } ECL_UNWIND_PROTECT_EXIT { @@ -3087,8 +3087,8 @@ si_make_lambda(cl_object name, cl_object rest) @(return lambda) } -@(defun si::eval-with-env (form &optional (env Cnil) (stepping Cnil) - (compiler_env_p Cnil) (execute Ct)) +@(defun si::eval-with-env (form &optional (env ECL_NIL) (stepping ECL_NIL) + (compiler_env_p ECL_NIL) (execute ECL_T)) volatile cl_compiler_env_ptr old_c_env; struct cl_compiler_env new_c_env; cl_object interpreter_env, compiler_env; @@ -3096,18 +3096,18 @@ si_make_lambda(cl_object name, cl_object rest) /* * Compile to bytecodes. */ - if (compiler_env_p == Cnil) { + if (compiler_env_p == ECL_NIL) { interpreter_env = env; - compiler_env = Cnil; + compiler_env = ECL_NIL; } else { - interpreter_env = Cnil; + interpreter_env = ECL_NIL; compiler_env = env; } old_c_env = the_env->c_env; c_new_env(the_env, &new_c_env, compiler_env, 0); guess_environment(the_env, interpreter_env); new_c_env.lex_env = env; - new_c_env.stepping = stepping != Cnil; + new_c_env.stepping = stepping != ECL_NIL; ECL_UNWIND_PROTECT_BEGIN(the_env) { if (Null(execute)) { cl_index handle = asm_begin(the_env); diff --git a/src/c/disassembler.d b/src/c/disassembler.d index 6fc36bd7c..9262b8d26 100644 --- a/src/c/disassembler.d +++ b/src/c/disassembler.d @@ -24,27 +24,27 @@ static cl_opcode *base = NULL; static void print_noarg(const char *s) { - ecl_princ_str(s, Cnil); + ecl_princ_str(s, ECL_NIL); } static void print_oparg(const char *s, cl_fixnum n) { - ecl_princ_str(s, Cnil); - ecl_princ(ecl_make_fixnum(n), Cnil); + ecl_princ_str(s, ECL_NIL); + ecl_princ(ecl_make_fixnum(n), ECL_NIL); } static void print_arg(const char *s, cl_object x) { - ecl_princ_str(s, Cnil); - ecl_princ(x, Cnil); + ecl_princ_str(s, ECL_NIL); + ecl_princ(x, ECL_NIL); } static void print_oparg_arg(const char *s, cl_fixnum n, cl_object x) { - ecl_princ_str(s, Cnil); - ecl_princ(ecl_make_fixnum(n), Cnil); - ecl_princ_str(",", Cnil); - ecl_princ(x, Cnil); + ecl_princ_str(s, ECL_NIL); + ecl_princ(ecl_make_fixnum(n), ECL_NIL); + ecl_princ_str(",", ECL_NIL); + ecl_princ(x, ECL_NIL); } #define GET_DATA(r,v,data) { \ @@ -59,7 +59,7 @@ disassemble_lambda(cl_object bytecodes) { cl_object *data; cl_opcode *vector; - ecl_bds_bind(env, @'*print-pretty*', Cnil); + ecl_bds_bind(env, @'*print-pretty*', ECL_NIL); /* Print required arguments */ data = bytecodes->bytecodes.data->vector.self.t; @@ -156,10 +156,10 @@ disassemble_tagbody(cl_object bytecodes, cl_opcode *vector) { print_noarg("TAGBODY"); for (i=0; ibytecodes.data->vector.self.t; cl_object line_no; - if (cl_fboundp(@'si::formatter-aux') != Cnil) + if (cl_fboundp(@'si::formatter-aux') != ECL_NIL) line_format = make_constant_base_string("~%~4d\t"); else - line_format = Cnil; + line_format = ECL_NIL; BEGIN: if (1) { line_no = ecl_make_fixnum(vector-base); } else { line_no = @'*'; } - if (line_format != Cnil) { - cl_format(3, Ct, line_format, line_no); + if (line_format != ECL_NIL) { + cl_format(3, ECL_T, line_format, line_no); } else { - ecl_princ_char('\n', Ct); - ecl_princ(line_no, Ct); - ecl_princ_char('\t', Ct); + ecl_princ_char('\n', ECL_T); + ecl_princ(line_no, ECL_T); + ecl_princ_char('\t', ECL_T); } switch (GET_OPCODE(vector)) { @@ -301,7 +301,7 @@ disassemble(cl_object bytecodes, cl_opcode *vector) { case OP_CATCH: string = "CATCH\tREG0"; goto NOARG; case OP_DO: string = "BLOCK\t"; - o = Cnil; + o = ECL_NIL; goto ARG; case OP_FRAME: string = "FRAME\t"; goto JMP; @@ -619,22 +619,22 @@ si_bc_disassemble(cl_object v) disassemble_lambda(v); @(return v) } - @(return Cnil) + @(return ECL_NIL) } cl_object si_bc_split(cl_object b) { - cl_object vector, data, name, lex = Cnil; + cl_object vector, data, name, lex = ECL_NIL; if (type_of(b) == t_bclosure) { b = b->bclosure.code; lex = b->bclosure.lex; } if (type_of(b) != t_bytecodes) { - vector = Cnil; - data = Cnil; - name = Cnil; + vector = ECL_NIL; + data = ECL_NIL; + name = ECL_NIL; } else { vector = ecl_alloc_simple_vector(b->bytecodes.code_size * sizeof(cl_opcode), ecl_aet_b8); @@ -649,9 +649,9 @@ cl_object si_bc_join(cl_object lex, cl_object code, cl_object data, cl_object name) { cl_object output; - if (lex != Cnil) { + if (lex != ECL_NIL) { output = ecl_alloc_object(t_bclosure); - output->bclosure.code = si_bc_join(Cnil, code, data, name); + output->bclosure.code = si_bc_join(ECL_NIL, code, data, name); output->bclosure.lex = lex; output->bclosure.entry = _ecl_bclosure_dispatch_vararg; } else { @@ -670,20 +670,20 @@ si_bc_join(cl_object lex, cl_object code, cl_object data, cl_object name) 0, code, cl_list(2, @'simple-array', - Ct)); + ECL_T)); } /* Duplicate the vectors and steal their data pointers */ code = cl_copy_seq(code); data = cl_copy_seq(data); output = ecl_alloc_object(t_bytecodes); - output->bytecodes.name = Cnil; - output->bytecodes.definition = Cnil; + output->bytecodes.name = ECL_NIL; + output->bytecodes.definition = ECL_NIL; output->bytecodes.entry = _ecl_bytecodes_dispatch_vararg; output->bytecodes.code_size = code->vector.fillp / sizeof(cl_opcode); output->bytecodes.code = (void*)code->vector.self.b8; output->bytecodes.data = data; - output->bytecodes.file = Cnil; - output->bytecodes.file_position = Cnil; + output->bytecodes.file = ECL_NIL; + output->bytecodes.file_position = ECL_NIL; } @(return output) } diff --git a/src/c/dpp.c b/src/c/dpp.c index cdbde6dd6..c38a7acc0 100755 --- a/src/c/dpp.c +++ b/src/c/dpp.c @@ -273,7 +273,7 @@ search_symbol(char *name, int *symbol_code, int code) pushstr(")"); pushc(0); } else if (i == 0) { - pushstr("Cnil"); + pushstr("ECL_NIL"); pushc(0); } else { pushstr("ECL_SYM(\""); @@ -470,7 +470,7 @@ get_function(void) function_symbol = search_symbol(function, &function_code, 0); if (function_symbol == NULL) { function_symbol = poolp; - pushstr("Cnil"); + pushstr("ECL_NIL"); pushc('\0'); } function_c_name = translate_function(function); @@ -739,7 +739,7 @@ put_declaration(void) put_lineno(); fprintf(out, "\t\t%s = %s;\n", optional[i].o_var, - optional[i].o_init == NULL ? "Cnil" : optional[i].o_init); + optional[i].o_init == NULL ? "ECL_NIL" : optional[i].o_init); if (optional[i].o_svar) { put_lineno(); fprintf(out, "\t\t%s = FALSE;\n", optional[i].o_svar); @@ -753,13 +753,13 @@ put_declaration(void) nkey, allow_other_keys_flag); for (i = 0; i < nkey; i++) { put_lineno(); - fprintf(out, "\tif (KEY_VARS[%d]==Cnil) {\n", nkey+i); + fprintf(out, "\tif (KEY_VARS[%d]==ECL_NIL) {\n", nkey+i); if (keyword[i].k_init != NULL) { put_lineno(); fprintf(out, "\t %s = %s;\n", keyword[i].k_var, keyword[i].k_init); } else { put_lineno(); - fprintf(out, "\t %s = Cnil;\n", keyword[i].k_var); + fprintf(out, "\t %s = ECL_NIL;\n", keyword[i].k_var); } if (keyword[i].k_svar != NULL) { put_lineno(); @@ -778,7 +778,7 @@ put_declaration(void) for (i = 0; i < naux; i++) { put_lineno(); fprintf(out, "\t%s = %s;\n", aux[i].a_var, - aux[i].a_init == NULL ? "Cnil" : aux[i].a_init); + aux[i].a_init == NULL ? "ECL_NIL" : aux[i].a_init); } } @@ -795,7 +795,7 @@ put_return(void) fprintf(out, "const cl_env_ptr the_env = ecl_process_env();\n"); } if (nres == 0) { - fprintf(out, "the_env->nvalues = 0; return Cnil;\n"); + fprintf(out, "the_env->nvalues = 0; return ECL_NIL;\n"); } else { put_tabs(t); for (i = 0; i < nres; i++) { diff --git a/src/c/error.d b/src/c/error.d index f065ef694..2e4321161 100644 --- a/src/c/error.d +++ b/src/c/error.d @@ -110,7 +110,7 @@ FEerror(const char *s, int narg, ...) ecl_va_start(args, narg, narg, 0); ecl_enable_interrupts(); funcall(4, @'si::universal-error-handler', - Cnil, /* not correctable */ + ECL_NIL, /* not correctable */ make_constant_base_string(s), /* condition text */ cl_grab_rest_args(args)); _ecl_unexpected_return(); @@ -140,19 +140,19 @@ FEprogram_error(const char *s, int narg, ...) ecl_va_start(args, narg, narg, 0); text = make_constant_base_string(s); real_args = cl_grab_rest_args(args); - if (cl_boundp(@'si::*current-form*') != Cnil) { + if (cl_boundp(@'si::*current-form*') != ECL_NIL) { /* When FEprogram_error is invoked from the compiler, we can * provide information about the offending form. */ cl_object stmt = ecl_symbol_value(@'si::*current-form*'); - if (stmt != Cnil) { + if (stmt != ECL_NIL) { real_args = @list(3, stmt, text, real_args); text = make_constant_base_string("In form~%~S~%~?"); } } si_signal_simple_error(4, @'program-error', /* condition name */ - Cnil, /* not correctable */ + ECL_NIL, /* not correctable */ text, real_args); } @@ -165,19 +165,19 @@ FEprogram_error_noreturn(const char *s, int narg, ...) ecl_va_start(args, narg, narg, 0); text = make_constant_base_string(s); real_args = cl_grab_rest_args(args); - if (cl_boundp(@'si::*current-form*') != Cnil) { + if (cl_boundp(@'si::*current-form*') != ECL_NIL) { /* When FEprogram_error is invoked from the compiler, we can * provide information about the offending form. */ cl_object stmt = ecl_symbol_value(@'si::*current-form*'); - if (stmt != Cnil) { + if (stmt != ECL_NIL) { real_args = @list(3, stmt, text, real_args); text = make_constant_base_string("In form~%~S~%~?"); } } si_signal_simple_error(4, @'program-error', /* condition name */ - Cnil, /* not correctable */ + ECL_NIL, /* not correctable */ text, real_args); } @@ -189,7 +189,7 @@ FEcontrol_error(const char *s, int narg, ...) ecl_va_start(args, narg, narg, 0); si_signal_simple_error(4, @'control-error', /* condition name */ - Cnil, /* not correctable */ + ECL_NIL, /* not correctable */ make_constant_base_string(s), /* format control */ cl_grab_rest_args(args)); /* format args */ } @@ -206,7 +206,7 @@ FEreader_error(const char *s, cl_object stream, int narg, ...) /* Parser error */ si_signal_simple_error(4, @'parse-error', /* condition name */ - Cnil, /* not correctable */ + ECL_NIL, /* not correctable */ message, /* format control */ args_list); } else { @@ -218,7 +218,7 @@ FEreader_error(const char *s, cl_object stream, int narg, ...) args_list = cl_listX(3, stream, position, args_list); si_signal_simple_error(6, @'reader-error', /* condition name */ - Cnil, /* not correctable */ + ECL_NIL, /* not correctable */ message, /* format control */ args_list, /* format args */ @':stream', stream); @@ -269,11 +269,11 @@ FEwrong_type_only_arg(cl_object function, cl_object value, cl_object type) function = cl_symbol_or_object(function); type = cl_symbol_or_object(type); if (!Null(function) && env->ihs_top && env->ihs_top->function != function) { - ecl_ihs_push(env,&tmp_ihs,function,Cnil); + ecl_ihs_push(env,&tmp_ihs,function,ECL_NIL); } si_signal_simple_error(8, @'type-error', /* condition name */ - Cnil, /* not correctable */ + ECL_NIL, /* not correctable */ make_constant_base_string(message), /* format control */ cl_list(3, function, value, type), @':expected-type', type, @@ -292,11 +292,11 @@ FEwrong_type_nth_arg(cl_object function, cl_narg narg, cl_object value, cl_objec function = cl_symbol_or_object(function); type = cl_symbol_or_object(type); if (!Null(function) && env->ihs_top && env->ihs_top->function != function) { - ecl_ihs_push(env,&tmp_ihs,function,Cnil); + ecl_ihs_push(env,&tmp_ihs,function,ECL_NIL); } si_signal_simple_error(8, @'type-error', /* condition name */ - Cnil, /* not correctable */ + ECL_NIL, /* not correctable */ make_constant_base_string(message), /* format control */ cl_list(4, function, ecl_make_fixnum(narg), value, type), @@ -317,11 +317,11 @@ FEwrong_type_key_arg(cl_object function, cl_object key, cl_object value, cl_obje type = cl_symbol_or_object(type); key = cl_symbol_or_object(key); if (!Null(function) && env->ihs_top && env->ihs_top->function != function) { - ecl_ihs_push(env,&tmp_ihs,function,Cnil); + ecl_ihs_push(env,&tmp_ihs,function,ECL_NIL); } si_signal_simple_error(8, @'type-error', /* condition name */ - Cnil, /* not correctable */ + ECL_NIL, /* not correctable */ make_constant_base_string(message), /* format control */ cl_list(4, function, key, value, type), @':expected-type', type, @@ -347,7 +347,7 @@ FEwrong_index(cl_object function, cl_object a, int which, cl_object ndx, struct ecl_ihs_frame tmp_ihs; function = cl_symbol_or_object(function); if (!Null(function) && env->ihs_top && env->ihs_top->function != function) { - ecl_ihs_push(env,&tmp_ihs,function,Cnil); + ecl_ihs_push(env,&tmp_ihs,function,ECL_NIL); } cl_error(9, @'simple-type-error', /* condition name */ @@ -444,10 +444,10 @@ universal_error_handler(cl_object continue_string, cl_object datum, recursive_error = 1; stream = cl_core.error_output; if (!Null(stream)) { - ecl_bds_bind(the_env, @'*print-readably*', Cnil); + ecl_bds_bind(the_env, @'*print-readably*', ECL_NIL); ecl_bds_bind(the_env, @'*print-level*', ecl_make_fixnum(3)); ecl_bds_bind(the_env, @'*print-length*', ecl_make_fixnum(3)); - ecl_bds_bind(the_env, @'*print-circle*', Cnil); + ecl_bds_bind(the_env, @'*print-circle*', ECL_NIL); ecl_bds_bind(the_env, @'*print-base*', ecl_make_fixnum(10)); writestr_stream("\n;;; Unhandled lisp initialization error", stream); @@ -523,7 +523,7 @@ FEwin32_error(const char *msg, int narg, ...) @(defun error (eformat &rest args) @ ecl_enable_interrupts(); - funcall(4, @'si::universal-error-handler', Cnil, eformat, + funcall(4, @'si::universal-error-handler', ECL_NIL, eformat, cl_grab_rest_args(args)); _ecl_unexpected_return(); @(return); diff --git a/src/c/eval.d b/src/c/eval.d index d87e81aa9..4982bd97b 100644 --- a/src/c/eval.d +++ b/src/c/eval.d @@ -43,7 +43,7 @@ ecl_apply_from_stack_frame(cl_object frame, cl_object x) cl_object fun = x; AGAIN: frame->frame.env->function = fun; - if (ecl_unlikely(fun == OBJNULL || fun == Cnil)) + if (ecl_unlikely(fun == OBJNULL || fun == ECL_NIL)) FEundefined_function(x); switch (type_of(fun)) { case t_cfunfixed: @@ -76,7 +76,7 @@ ecl_apply_from_stack_frame(cl_object frame, cl_object x) fun = SYM_FUN(fun); goto AGAIN; case t_bytecodes: - return ecl_interpret(frame, Cnil, fun); + return ecl_interpret(frame, ECL_NIL, fun); case t_bclosure: return ecl_interpret(frame, fun->bclosure.lex, fun->bclosure.code); default: @@ -89,7 +89,7 @@ ecl_function_dispatch(cl_env_ptr env, cl_object x) { cl_object fun = x; AGAIN: - if (ecl_unlikely(fun == OBJNULL || fun == Cnil)) + if (ecl_unlikely(fun == OBJNULL || fun == ECL_NIL)) FEundefined_function(x); switch (type_of(fun)) { case t_cfunfixed: @@ -181,18 +181,18 @@ cl_eval(cl_object form) switch (type_of(arg)) { case t_list: if (Null(arg)) { - flag = Ct; + flag = ECL_T; } else if (CAR(arg) == @'quote') { - flag = Ct; + flag = ECL_T; } else { - flag = Cnil; + flag = ECL_NIL; } break; case t_symbol: - flag = (arg->symbol.stype & ecl_stp_constant) ? Ct : Cnil; + flag = (arg->symbol.stype & ecl_stp_constant) ? ECL_T : ECL_NIL; break; default: - flag = Ct; + flag = ECL_T; } @(return flag) @) diff --git a/src/c/ffi.d b/src/c/ffi.d index d85c1b4ce..bba921a86 100644 --- a/src/c/ffi.d +++ b/src/c/ffi.d @@ -193,7 +193,7 @@ cl_object ecl_make_foreign_data(cl_object tag, cl_index size, void *data) { cl_object output = ecl_alloc_object(t_foreign); - output->foreign.tag = tag == Cnil ? @':void' : tag; + output->foreign.tag = tag == ECL_NIL ? @':void' : tag; output->foreign.size = size; output->foreign.data = (char*)data; return output; @@ -296,7 +296,7 @@ si_make_foreign_data_from_array(cl_object array) cl_object si_foreign_data_p(cl_object f) { - @(return (ECL_FOREIGN_DATA_P(f)? Ct : Cnil)) + @(return (ECL_FOREIGN_DATA_P(f)? ECL_T : ECL_NIL)) } cl_object @@ -330,7 +330,7 @@ si_foreign_data_equal(cl_object f1, cl_object f2) FEwrong_type_only_arg(@[si::foreign-data-address], f2, @[si::foreign-data]); } - @(return ((f1->foreign.data == f2->foreign.data)? Ct : Cnil)) + @(return ((f1->foreign.data == f2->foreign.data)? ECL_T : ECL_NIL)) } cl_object @@ -512,7 +512,7 @@ ecl_foreign_data_ref_elt(void *p, enum ecl_ffi_tag tag) return ecl_make_foreign_data(@':pointer-void', 0, *(void **)p); case ECL_FFI_CSTRING: return *(char **)p ? - ecl_make_simple_base_string(*(char **)p, -1) : Cnil; + ecl_make_simple_base_string(*(char **)p, -1) : ECL_NIL; case ECL_FFI_OBJECT: return *(cl_object *)p; case ECL_FFI_FLOAT: @@ -520,7 +520,7 @@ ecl_foreign_data_ref_elt(void *p, enum ecl_ffi_tag tag) case ECL_FFI_DOUBLE: return ecl_make_double_float(*(double *)p); case ECL_FFI_VOID: - return Cnil; + return ECL_NIL; default: wrong_ffi_tag(tag); } @@ -602,7 +602,7 @@ ecl_foreign_data_set_elt(void *p, enum ecl_ffi_tag tag, cl_object value) *(void **)p = ecl_foreign_data_pointer_safe(value); break; case ECL_FFI_CSTRING: - *(char **)p = value == Cnil ? NULL : (char*)value->base_string.self; + *(char **)p = value == ECL_NIL ? NULL : (char*)value->base_string.self; break; case ECL_FFI_OBJECT: *(cl_object *)p = value; @@ -672,7 +672,7 @@ si_alignment_of_foreign_elt_type(cl_object type) cl_object si_foreign_elt_type_p(cl_object type) { - @(return ((foreign_type_code(type) < 0)? Cnil : Ct)) + @(return ((foreign_type_code(type) < 0)? ECL_NIL : ECL_T)) } cl_object @@ -681,7 +681,7 @@ si_null_pointer_p(cl_object f) if (ecl_unlikely(type_of(f) != t_foreign)) FEwrong_type_only_arg(@[si::null-pointer-p], f, @[si::foreign-data]); - @(return ((f->foreign.data == NULL)? Ct : Cnil)) + @(return ((f->foreign.data == NULL)? ECL_T : ECL_NIL)) } cl_object @@ -734,7 +734,7 @@ si_find_foreign_symbol(cl_object var, cl_object module, cl_object type, cl_objec FEerror("SI:FIND-FOREIGN-SYMBOL does not work when ECL is statically linked", 0); #else cl_object block; - cl_object output = Cnil; + cl_object output = ECL_NIL; void *sym; block = (module == @':default' ? module : si_load_foreign_module(module)); @@ -768,7 +768,7 @@ ecl_fficall_prepare(cl_object return_type, cl_object arg_type, cl_object cc_type struct ecl_fficall *fficall = cl_env.fficall; fficall->buffer_sp = fficall->buffer; fficall->buffer_size = 0; - fficall->cstring = Cnil; + fficall->cstring = ECL_NIL; fficall->cc = ecl_foreign_cc_code(cc_type); fficall->registers = ecl_fficall_prepare_extra(fficall->registers); } @@ -839,7 +839,7 @@ ecl_fficall_align(int data) fficall->buffer_size = 0; fficall->buffer_sp = fficall->buffer; - fficall->cstring = Cnil; + fficall->cstring = ECL_NIL; @(return object) @) @@ -964,7 +964,7 @@ callback_executor(ffi_cif *cif, void *result, void **args, void *userdata) struct ecl_stack_frame frame_aux; const cl_object frame = ecl_stack_frame_open(the_env, (cl_object)&frame_aux, 0); cl_object x; - while (arg_types != Cnil) { + while (arg_types != ECL_NIL) { cl_object type = ECL_CONS_CAR(arg_types); enum ecl_ffi_tag tag = ecl_foreign_type_code(type); x = ecl_foreign_data_ref_elt(*args, tag); @@ -990,7 +990,7 @@ si_free_ffi_closure(cl_object closure) { ffi_cif *cif = ecl_alloc(sizeof(ffi_cif)); ffi_type **types; - int n = prepare_cif(the_env, cif, return_type, arg_types, Cnil, cc_type, + int n = prepare_cif(the_env, cif, return_type, arg_types, ECL_NIL, cc_type, &types); /* libffi allocates executable memory for us. ffi_closure_alloc() diff --git a/src/c/ffi/backtrace.d b/src/c/ffi/backtrace.d index 7c84a48b9..cbdb738bb 100644 --- a/src/c/ffi/backtrace.d +++ b/src/c/ffi/backtrace.d @@ -115,14 +115,14 @@ si_dump_c_backtrace(cl_object size) fflush(stderr); free(names); } - ecl_return1(the_env, Ct); + ecl_return1(the_env, ECL_T); #else - ecl_return1(the_env, Cnil); + ecl_return1(the_env, ECL_NIL); #endif } cl_object si_backtrace(cl_object start, cl_object end) { - @(return Cnil) + @(return ECL_NIL) } diff --git a/src/c/ffi/libraries.d b/src/c/ffi/libraries.d index 6ea0ea950..01c298c71 100644 --- a/src/c/ffi/libraries.d +++ b/src/c/ffi/libraries.d @@ -85,14 +85,14 @@ ecl_make_codeblock() block->cblock.temp_data_size = 0; block->cblock.data_text = NULL; block->cblock.data_text_size = 0; - block->cblock.next = Cnil; - block->cblock.name = Cnil; - block->cblock.links = Cnil; + block->cblock.next = ECL_NIL; + block->cblock.name = ECL_NIL; + block->cblock.links = ECL_NIL; block->cblock.cfuns_size = 0; block->cblock.cfuns = NULL; - block->cblock.source = Cnil; + block->cblock.source = ECL_NIL; block->cblock.refs = ecl_make_fixnum(0); - si_set_finalizer(block, Ct); + si_set_finalizer(block, ECL_T); return block; } @@ -190,27 +190,27 @@ static cl_object ecl_library_find_by_name(cl_object filename) { cl_object l; - for (l = cl_core.libraries; l != Cnil; l = ECL_CONS_CDR(l)) { + for (l = cl_core.libraries; l != ECL_NIL; l = ECL_CONS_CDR(l)) { cl_object other = ECL_CONS_CAR(l); cl_object name = other->cblock.name; if (!Null(name) && ecl_string_eq(name, filename)) { return other; } } - return Cnil; + return ECL_NIL; } static cl_object ecl_library_find_by_handle(void *handle) { cl_object l; - for (l = cl_core.libraries; l != Cnil; l = ECL_CONS_CDR(l)) { + for (l = cl_core.libraries; l != ECL_NIL; l = ECL_CONS_CDR(l)) { cl_object other = ECL_CONS_CAR(l); if (handle == other->cblock.handle) { return other; } } - return Cnil; + return ECL_NIL; } static cl_object @@ -229,11 +229,11 @@ ecl_library_open_inner(cl_object filename, bool self_destruct) block->cblock.data_text = NULL; block->cblock.data_text_size = 0; block->cblock.name = filename; - block->cblock.next = Cnil; - block->cblock.links = Cnil; + block->cblock.next = ECL_NIL; + block->cblock.links = ECL_NIL; block->cblock.cfuns_size = 0; block->cblock.cfuns = NULL; - block->cblock.source = Cnil; + block->cblock.source = ECL_NIL; block->cblock.refs = ecl_make_fixnum(1); ECL_WITH_GLOBAL_LOCK_BEGIN(the_env) { @@ -245,12 +245,12 @@ ecl_library_open_inner(cl_object filename, bool self_destruct) * track (in lisp) of how many copies we use. */ cl_object other = ecl_library_find_by_handle(block->cblock.handle); - if (other != Cnil) { + if (other != ECL_NIL) { dlclose_wrapper(block); block = other; block->cblock.refs = ecl_one_plus(block->cblock.refs); } else { - si_set_finalizer(block, Ct); + si_set_finalizer(block, ECL_T); cl_core.libraries = CONS(block, cl_core.libraries); } } @@ -325,7 +325,7 @@ ecl_library_symbol(cl_object block, const char *symbol, bool lock) { void *p; if (block == @':default') { cl_object l; - for (l = cl_core.libraries; l != Cnil; l = ECL_CONS_CDR(l)) { + for (l = cl_core.libraries; l != ECL_NIL; l = ECL_CONS_CDR(l)) { cl_object block = ECL_CONS_CAR(l); p = ecl_library_symbol(block, symbol, lock); if (p) return p; @@ -427,14 +427,14 @@ ecl_library_close(cl_object block) { ecl_disable_interrupts(); if (block->cblock.refs != ecl_make_fixnum(1)) { block->cblock.refs = ecl_one_minus(block->cblock.refs); - block = Cnil; + block = ECL_NIL; } else if (block->cblock.handle != NULL) { dlclose_wrapper(block); cl_core.libraries = ecl_remove_eq(block, cl_core.libraries); } ecl_enable_interrupts(); } ECL_WITH_GLOBAL_LOCK_END; - if (block != Cnil && block->cblock.self_destruct) { + if (block != ECL_NIL && block->cblock.self_destruct) { if (!Null(block->cblock.name)) { unlink((char*)block->cblock.name->base_string.self); } @@ -444,7 +444,7 @@ ecl_library_close(cl_object block) { void ecl_library_close_all(void) { - while (cl_core.libraries != Cnil) { + while (cl_core.libraries != ECL_NIL) { ecl_library_close(ECL_CONS_CAR(cl_core.libraries)); } } diff --git a/src/c/ffi/mmap.d b/src/c/ffi/mmap.d index 1e1962bdf..3ebddf91d 100644 --- a/src/c/ffi/mmap.d +++ b/src/c/ffi/mmap.d @@ -22,7 +22,7 @@ @(defun ext::mmap (filename &key - (length Cnil) + (length ECL_NIL) (offset ecl_make_fixnum(0)) (direction @':input') (element_type @'base-char') @@ -48,7 +48,7 @@ c_flags = MAP_ANON | MAP_PRIVATE; fd = -1; len = ecl_to_unsigned_integer(length); - stream = Cnil; + stream = ECL_NIL; } else { c_flags = MAP_SHARED; stream = cl_open(13, filename, @@ -57,15 +57,15 @@ @':if-exists', if_exists, @':if-does-not-exist', if_does_not_exist, @':external-format', @':default', - @':cstream', Cnil); + @':cstream', ECL_NIL); fd = ecl_to_int(si_file_stream_fd(stream)); if (Null(length)) len = ecl_to_unsigned_integer(ecl_file_length(stream)); else len = ecl_to_unsigned_integer(length); } - output = si_make_vector(element_type, ecl_make_fixnum(0), Cnil, - Cnil, Cnil, Cnil); + output = si_make_vector(element_type, ecl_make_fixnum(0), ECL_NIL, + ECL_NIL, ECL_NIL, ECL_NIL); pa = mmap(0, len, c_prot, c_flags, fd, ecl_integer_to_off_t(offset)); if (pa == MAP_FAILED) { @@ -81,8 +81,8 @@ { cl_object output, vector; if (Null(filename)) { - output = si_make_vector(element_type, length, Cnil, - Cnil, Cnil, Cnil); + output = si_make_vector(element_type, length, ECL_NIL, + ECL_NIL, ECL_NIL, ECL_NIL); } else { cl_object stream = cl_open(13, filename, @':direction', direction, @@ -90,13 +90,13 @@ @':if-exists', if_exists, @':if-does-not-exist', if_does_not_exist, @':external-format', @':pass-through', - @':cstream', Ct); + @':cstream', ECL_T); if (Null(length)) length = ecl_file_length(stream); else length = ecl_to_unsigned_integer(length); - output = si_make_vector(element_type, length, Cnil, - Cnil, Cnil, Cnil); + output = si_make_vector(element_type, length, ECL_NIL, + ECL_NIL, ECL_NIL, ECL_NIL); cl_read_sequence(2, output, stream); cl_close(1, stream); } @@ -127,5 +127,5 @@ si_munmap(cl_object map) } cl_close(1, stream); #endif - @(return Cnil) + @(return ECL_NIL) } diff --git a/src/c/file.d b/src/c/file.d index ac90e1d5e..7eafccd30 100755 --- a/src/c/file.d +++ b/src/c/file.d @@ -215,14 +215,14 @@ static cl_object not_implemented_get_position(cl_object strm) { FEerror("file-position not implemented for stream ~S", 1, strm); - return Cnil; + return ECL_NIL; } static cl_object not_implemented_set_position(cl_object strm, cl_object pos) { FEerror("file-position not implemented for stream ~S", 1, strm); - return Cnil; + return ECL_NIL; } #endif @@ -308,7 +308,7 @@ generic_read_byte_unsigned8(cl_object strm) { unsigned char c; if (strm->stream.ops->read_byte8(strm, &c, 1) < 1) { - return Cnil; + return ECL_NIL; } return ecl_make_fixnum(c); } @@ -325,7 +325,7 @@ generic_read_byte_signed8(cl_object strm) { signed char c; if (strm->stream.ops->read_byte8(strm, (unsigned char *)&c, 1) < 1) - return Cnil; + return ECL_NIL; return ecl_make_fixnum(c); } @@ -348,7 +348,7 @@ generic_read_byte_le(cl_object strm) for (nb = 0; bs >= 8; bs -= 8, nb += 8) { cl_object aux; if (read_byte8(strm, &c, 1) < 1) - return Cnil; + return ECL_NIL; if (bs <= 8 && (strm->stream.flags & ECL_STREAM_SIGNED_BYTES)) aux = ecl_make_fixnum((signed char)c); else @@ -386,7 +386,7 @@ generic_read_byte(cl_object strm) bs = strm->stream.byte_size; for (; bs >= 8; bs -= 8) { if (read_byte8(strm, &c, 1) < 1) - return Cnil; + return ECL_NIL; if (output) { output = cl_logior(2, ecl_make_fixnum(c), cl_ash(output, ecl_make_fixnum(8))); @@ -445,7 +445,7 @@ generic_always_false(cl_object strm) static cl_object generic_always_nil(cl_object strm) { - return Cnil; + return ECL_NIL; } static int @@ -457,7 +457,7 @@ generic_column(cl_object strm) static cl_object generic_set_position(cl_object strm, cl_object pos) { - return Cnil; + return ECL_NIL; } static cl_object @@ -483,7 +483,7 @@ generic_close(cl_object strm) ops->length = closed_stream_length; ops->close = generic_close; strm->stream.closed = 1; - return Ct; + return ECL_T; } static cl_index @@ -926,16 +926,16 @@ user_decoder(cl_object stream) if (ecl_read_byte8(stream, buffer, 1) < 1) { return EOF; } - character = ecl_gethash_safe(ecl_make_fixnum(buffer[0]), table, Cnil); + character = ecl_gethash_safe(ecl_make_fixnum(buffer[0]), table, ECL_NIL); unlikely_if (Null(character)) { return decoding_error(stream, buffer, 1); } - if (character == Ct) { + if (character == ECL_T) { if (ecl_read_byte8(stream, buffer+1, 1) < 1) { return EOF; } else { cl_fixnum byte = (buffer[0]<<8) + buffer[1]; - character = ecl_gethash_safe(ecl_make_fixnum(byte), table, Cnil); + character = ecl_gethash_safe(ecl_make_fixnum(byte), table, ECL_NIL); unlikely_if (Null(character)) { return decoding_error(stream, buffer, 2); } @@ -947,7 +947,7 @@ user_decoder(cl_object stream) static int user_encoder(cl_object stream, unsigned char *buffer, ecl_character c) { - cl_object byte = ecl_gethash_safe(ECL_CODE_CHAR(c), stream->stream.format_table, Cnil); + cl_object byte = ecl_gethash_safe(ECL_CODE_CHAR(c), stream->stream.format_table, ECL_NIL); if (Null(byte)) { return encoding_error(stream, buffer, c); } else { @@ -980,14 +980,14 @@ user_multistate_decoder(cl_object stream) return EOF; } j = (j << 8) | buffer[i]; - character = ecl_gethash_safe(ecl_make_fixnum(j), table, Cnil); + character = ecl_gethash_safe(ecl_make_fixnum(j), table, ECL_NIL); if (ECL_CHARACTERP(character)) { return ECL_CHAR_CODE(character); } unlikely_if (Null(character)) { return decoding_error(stream, buffer, i); } - if (character == Ct) { + if (character == ECL_T) { /* Need more characters */ continue; } @@ -1010,13 +1010,13 @@ user_multistate_encoder(cl_object stream, unsigned char *buffer, ecl_character c cl_object p = table_list; do { cl_object table = ECL_CONS_CAR(p); - cl_object byte = ecl_gethash_safe(ECL_CODE_CHAR(c), table, Cnil); + cl_object byte = ecl_gethash_safe(ECL_CODE_CHAR(c), table, ECL_NIL); if (!Null(byte)) { cl_fixnum code = ecl_fixnum(byte); ecl_character n = 0; if (p != table_list) { /* Must output a escape sequence */ - cl_object x = ecl_gethash_safe(Ct, table, Cnil); + cl_object x = ecl_gethash_safe(ECL_T, table, ECL_NIL); while (!Null(x)) { buffer[0] = ecl_fixnum(ECL_CONS_CAR(x)); buffer++; @@ -1159,7 +1159,7 @@ static cl_object clos_stream_read_byte(cl_object strm) { cl_object b = _ecl_funcall2(@'gray::stream-read-byte', strm); - if (b == @':eof') b = Cnil; + if (b == @':eof') b = ECL_NIL; return b; } @@ -1178,7 +1178,7 @@ clos_stream_read_char(cl_object strm) value = ECL_CHAR_CODE(output); else if (ECL_FIXNUMP(output)) value = ecl_fixnum(output); - else if (output == Cnil || output == @':eof') + else if (output == ECL_NIL || output == @':eof') return EOF; else value = -1; @@ -1378,7 +1378,7 @@ str_out_set_position(cl_object strm, cl_object pos) while (disp-- > 0) ecl_write_char(' ', strm); } - return Ct; + return ECL_T; } static int @@ -1572,7 +1572,7 @@ str_in_set_position(cl_object strm, cl_object pos) } } STRING_INPUT_POSITION(strm) = disp; - return Ct; + return ECL_T; } const struct ecl_file_ops str_in_ops = { @@ -1906,7 +1906,7 @@ broadcast_element_type(cl_object strm) { cl_object l = BROADCAST_STREAM_LIST(strm); if (Null(l)) - return Ct; + return ECL_T; return ecl_stream_element_type(ECL_CONS_CAR(l)); } @@ -1933,7 +1933,7 @@ broadcast_set_position(cl_object strm, cl_object pos) { cl_object l = BROADCAST_STREAM_LIST(strm); if (Null(l)) - return Cnil; + return ECL_NIL; return ecl_file_position_set(ECL_CONS_CAR(l), pos); } @@ -1992,7 +1992,7 @@ const struct ecl_file_ops broadcast_ops = { cl_object x, streams; int i; @ - streams = Cnil; + streams = ECL_NIL; for (i = 0; i < narg; i++) { x = ecl_va_arg(ap); unlikely_if (!ecl_output_stream_p(x)) @@ -2230,10 +2230,10 @@ static cl_object concatenated_read_byte(cl_object strm) { cl_object l = CONCATENATED_STREAM_LIST(strm); - cl_object c = Cnil; + cl_object c = ECL_NIL; while (!Null(l)) { c = ecl_read_byte(ECL_CONS_CAR(l)); - if (c != Cnil) break; + if (c != ECL_NIL) break; CONCATENATED_STREAM_LIST(strm) = l = ECL_CONS_CDR(l); } return c; @@ -2323,7 +2323,7 @@ const struct ecl_file_ops concatenated_ops = { cl_object x, streams; int i; @ - streams = Cnil; + streams = ECL_NIL; for (i = 0; i < narg; i++) { x = ecl_va_arg(ap); unlikely_if (!ecl_input_stream_p(x)) @@ -2625,7 +2625,7 @@ consume_byte_stack(cl_object strm, unsigned char *c, cl_index n) cl_index out = 0; while (n) { cl_object l = strm->stream.byte_stack; - if (l == Cnil) + if (l == ECL_NIL) return out + strm->stream.ops->read_byte8(strm, c, n); *(c++) = ecl_fixnum(ECL_CONS_CAR(l)); out++; @@ -2638,7 +2638,7 @@ consume_byte_stack(cl_object strm, unsigned char *c, cl_index n) static cl_index io_file_read_byte8(cl_object strm, unsigned char *c, cl_index n) { - unlikely_if (strm->stream.byte_stack != Cnil) { + unlikely_if (strm->stream.byte_stack != ECL_NIL) { return consume_byte_stack(strm, c, n); } else { int f = IO_FILE_DESCRIPTOR(strm); @@ -2668,12 +2668,12 @@ output_file_write_byte8(cl_object strm, unsigned char *c, cl_index n) static cl_index io_file_write_byte8(cl_object strm, unsigned char *c, cl_index n) { - unlikely_if (strm->stream.byte_stack != Cnil) { + unlikely_if (strm->stream.byte_stack != ECL_NIL) { /* Try to move to the beginning of the unread characters */ cl_object aux = ecl_file_position(strm); if (!Null(aux)) ecl_file_position_set(strm, aux); - strm->stream.byte_stack = Cnil; + strm->stream.byte_stack = ECL_NIL; } return output_file_write_byte8(strm, c, n); } @@ -2681,7 +2681,7 @@ io_file_write_byte8(cl_object strm, unsigned char *c, cl_index n) static int io_file_listen(cl_object strm) { - if (strm->stream.byte_stack != Cnil) + if (strm->stream.byte_stack != ECL_NIL) return ECL_LISTEN_AVAILABLE; if (strm->stream.flags & ECL_STREAM_MIGHT_SEEK) { cl_env_ptr the_env = ecl_process_env(); @@ -2817,7 +2817,7 @@ io_file_set_position(cl_object strm, cl_object large_disp) mode = SEEK_SET; } disp = lseek(f, disp, mode); - return (disp == (ecl_off_t)-1)? Cnil : Ct; + return (disp == (ecl_off_t)-1)? ECL_NIL : ECL_T; } static int @@ -2996,14 +2996,14 @@ parse_external_format(cl_object stream, cl_object format, int flags) flags = parse_external_format(stream, ECL_CONS_CDR(format), flags); format = ECL_CONS_CAR(format); } - if (format == Ct) { + if (format == ECL_T) { #ifdef ECL_UNICODE return (flags & ~ECL_STREAM_FORMAT) | ECL_STREAM_UTF_8; #else return (flags & ~ECL_STREAM_FORMAT) | ECL_STREAM_DEFAULT_FORMAT; #endif } - if (format == Cnil) { + if (format == ECL_NIL) { return flags; } if (format == @':CR') { @@ -3300,7 +3300,7 @@ ecl_make_file_stream_from_fd(cl_object fname, int fd, enum ecl_smmode smm, IO_FILE_COLUMN(stream) = 0; IO_FILE_DESCRIPTOR(stream) = fd; stream->stream.last_op = 0; - si_set_finalizer(stream, Ct); + si_set_finalizer(stream, ECL_T); return stream; } @@ -3311,7 +3311,7 @@ ecl_make_file_stream_from_fd(cl_object fname, int fd, enum ecl_smmode smm, static cl_index input_stream_read_byte8(cl_object strm, unsigned char *c, cl_index n) { - unlikely_if (strm->stream.byte_stack != Cnil) { + unlikely_if (strm->stream.byte_stack != ECL_NIL) { return consume_byte_stack(strm, c, n); } else { FILE *f = IO_STREAM_FILE(strm); @@ -3345,7 +3345,7 @@ io_stream_write_byte8(cl_object strm, unsigned char *c, cl_index n) * there were unread octets, we have to move to the position at the * begining of them. */ - if (strm->stream.byte_stack != Cnil) { + if (strm->stream.byte_stack != ECL_NIL) { cl_object aux = ecl_file_position(strm); if (!Null(aux)) ecl_file_position_set(strm, aux); @@ -3374,7 +3374,7 @@ io_stream_read_byte8(cl_object strm, unsigned char *c, cl_index n) static int io_stream_listen(cl_object strm) { - if (strm->stream.byte_stack != Cnil) + if (strm->stream.byte_stack != ECL_NIL) return ECL_LISTEN_AVAILABLE; return flisten(IO_STREAM_FILE(strm)); } @@ -3488,7 +3488,7 @@ io_stream_set_position(cl_object strm, cl_object large_disp) ecl_disable_interrupts(); mode = ecl_fseeko(f, disp, mode); ecl_enable_interrupts(); - return mode? Cnil : Ct; + return mode? ECL_NIL : ECL_T; } static int @@ -3640,7 +3640,7 @@ winsock_stream_read_byte8(cl_object strm, unsigned char *c, cl_index n) { cl_index len = 0; - unlikely_if (strm->stream.byte_stack != Cnil) { + unlikely_if (strm->stream.byte_stack != ECL_NIL) { return consume_byte_stack(strm, c, n); } if(n > 0) { @@ -3855,7 +3855,7 @@ const struct ecl_file_ops winsock_stream_input_ops = { static cl_index wcon_stream_read_byte8(cl_object strm, unsigned char *c, cl_index n) { - unlikely_if (strm->stream.byte_stack != Cnil) { + unlikely_if (strm->stream.byte_stack != ECL_NIL) { return consume_byte_stack(strm, c, n); } else { cl_index len = 0; @@ -4094,7 +4094,7 @@ ecl_make_stream_from_FILE(cl_object fname, void *f, enum ecl_smmode smm, IO_STREAM_COLUMN(stream) = 0; IO_STREAM_FILE(stream) = f; stream->stream.last_op = 0; - si_set_finalizer(stream, Ct); + si_set_finalizer(stream, ECL_T); return stream; } @@ -4233,7 +4233,7 @@ seq_in_unread_char(cl_object strm, ecl_character c) { eformat_unread_char(strm, c); SEQ_INPUT_POSITION(strm) -= ecl_length(strm->stream.byte_stack); - strm->stream.byte_stack = Cnil; + strm->stream.byte_stack = ECL_NIL; } static int @@ -4264,7 +4264,7 @@ seq_in_set_position(cl_object strm, cl_object pos) } } SEQ_INPUT_POSITION(strm) = disp; - return Ct; + return ECL_T; } const struct ecl_file_ops seq_in_ops = { @@ -4354,8 +4354,8 @@ make_sequence_input_stream(cl_object vector, cl_index istart, cl_index iend, @(defun ext::make_sequence_input_stream (vector &key (start ecl_make_fixnum(0)) - (end Cnil) - (external_format Cnil)) + (end ECL_NIL) + (external_format ECL_NIL)) cl_index_pair p; @ p = ecl_vector_start_end(@[ext::make-sequence-input-stream], @@ -4412,7 +4412,7 @@ seq_out_set_position(cl_object strm, cl_object pos) } } SEQ_OUTPUT_POSITION(strm) = disp; - return Ct; + return ECL_T; } const struct ecl_file_ops seq_out_ops = { @@ -4498,7 +4498,7 @@ make_sequence_output_stream(cl_object vector, cl_object external_format) return strm; } -@(defun ext::make_sequence_output_stream (vector &key (external_format Cnil)) +@(defun ext::make_sequence_output_stream (vector &key (external_format ECL_NIL)) @ @(return make_sequence_output_stream(vector, external_format)) @) @@ -4715,7 +4715,7 @@ cl_file_string_length(cl_object stream, cl_object string) BEGIN: #ifdef ECL_CLOS_STREAMS if (ECL_INSTANCEP(stream)) { - @(return Cnil) + @(return ECL_NIL) } #endif unlikely_if (!ECL_ANSI_STREAM_P(stream)) { @@ -4760,7 +4760,7 @@ si_do_write_sequence(cl_object seq, cl_object stream, cl_object s, cl_object e) /* Since we have called ecl_length(), we know that SEQ is a valid sequence. Therefore, we only need to check the type of the - object, and seq == Cnil i.f.f. t = t_symbol */ + object, and seq == ECL_NIL i.f.f. t = t_symbol */ limit = ecl_length(seq); if (ecl_unlikely(!ECL_FIXNUMP(s) || ((start = ecl_fixnum(s)) < 0) || @@ -4769,7 +4769,7 @@ si_do_write_sequence(cl_object seq, cl_object stream, cl_object s, cl_object e) ecl_make_integer_type(ecl_make_fixnum(0), ecl_make_fixnum(limit-1))); } - if (e == Cnil) { + if (e == ECL_NIL) { end = limit; } else if (ecl_unlikely(!ECL_FIXNUMP(e) || ((end = ecl_fixnum(e)) < 0) || @@ -4813,7 +4813,7 @@ si_do_read_sequence(cl_object seq, cl_object stream, cl_object s, cl_object e) /* Since we have called ecl_length(), we know that SEQ is a valid sequence. Therefore, we only need to check the type of the - object, and seq == Cnil i.f.f. t = t_symbol */ + object, and seq == ECL_NIL i.f.f. t = t_symbol */ limit = ecl_length(seq); if (ecl_unlikely(!ECL_FIXNUMP(s) || ((start = ecl_fixnum(s)) < 0) || @@ -4822,7 +4822,7 @@ si_do_read_sequence(cl_object seq, cl_object stream, cl_object s, cl_object e) ecl_make_integer_type(ecl_make_fixnum(0), ecl_make_fixnum(limit-1))); } - if (e == Cnil) { + if (e == ECL_NIL) { end = limit; } else if (ecl_unlikely(!ECL_FIXNUMP(e) || ((end = ecl_fixnum(e)) < 0) || @@ -4850,7 +4850,7 @@ si_do_read_sequence(cl_object seq, cl_object stream, cl_object s, cl_object e) c = ECL_CODE_CHAR(i); } else { c = ops->read_byte(stream); - if (c == Cnil) goto OUTPUT; + if (c == ECL_NIL) goto OUTPUT; } ECL_RPLACA(seq, c); start++; @@ -4888,7 +4888,7 @@ cl_file_length(cl_object strm) if (position == @':start') { position = ecl_make_fixnum(0); } else if (position == @':end') { - position = Cnil; + position = ECL_NIL; } output = ecl_file_position_set(file_stream, position); } @@ -4898,19 +4898,19 @@ cl_file_length(cl_object strm) cl_object cl_input_stream_p(cl_object strm) { - @(return (ecl_input_stream_p(strm) ? Ct : Cnil)) + @(return (ecl_input_stream_p(strm) ? ECL_T : ECL_NIL)) } cl_object cl_output_stream_p(cl_object strm) { - @(return (ecl_output_stream_p(strm) ? Ct : Cnil)) + @(return (ecl_output_stream_p(strm) ? ECL_T : ECL_NIL)) } cl_object cl_interactive_stream_p(cl_object strm) { - @(return (stream_dispatch_table(strm)->interactive_p(strm)? Ct : Cnil)) + @(return (stream_dispatch_table(strm)->interactive_p(strm)? ECL_T : ECL_NIL)) } cl_object @@ -4926,7 +4926,7 @@ cl_open_stream_p(cl_object strm) #endif unlikely_if (!ECL_ANSI_STREAM_P(strm)) FEwrong_type_only_arg(@'open-stream-p', strm, @'stream'); - @(return (strm->stream.closed ? Cnil : Ct)) + @(return (strm->stream.closed ? ECL_NIL : ECL_T)) } cl_object @@ -4965,7 +4965,7 @@ cl_streamp(cl_object strm) return _ecl_funcall2(@'gray::streamp', strm); } #endif - @(return (ECL_ANSI_STREAM_P(strm) ? Ct : Cnil)) + @(return (ECL_ANSI_STREAM_P(strm) ? ECL_T : ECL_NIL)) } /********************************************************************** @@ -4980,7 +4980,7 @@ si_copy_stream(cl_object in, cl_object out) ecl_write_char(c, out); } ecl_force_output(out); - @(return Ct) + @(return ECL_T) } @@ -5001,11 +5001,11 @@ ecl_normalize_stream_element_type(cl_object element_type) return 0; } else if (element_type == @'base-char' || element_type == @'character') { return 0; - } else if (_ecl_funcall3(@'subtypep', element_type, @'character') != Cnil) { + } else if (_ecl_funcall3(@'subtypep', element_type, @'character') != ECL_NIL) { return 0; - } else if (_ecl_funcall3(@'subtypep', element_type, @'unsigned-byte') != Cnil) { + } else if (_ecl_funcall3(@'subtypep', element_type, @'unsigned-byte') != ECL_NIL) { sign = +1; - } else if (_ecl_funcall3(@'subtypep', element_type, @'signed-byte') != Cnil) { + } else if (_ecl_funcall3(@'subtypep', element_type, @'signed-byte') != ECL_NIL) { sign = -1; } else { FEerror("Not a valid stream element type: ~A", 1, element_type); @@ -5020,7 +5020,7 @@ ecl_normalize_stream_element_type(cl_object element_type) cl_object type; type = cl_list(2, sign>0? @'unsigned-byte' : @'signed-byte', ecl_make_fixnum(size)); - if (_ecl_funcall3(@'subtypep', element_type, type) != Cnil) { + if (_ecl_funcall3(@'subtypep', element_type, type) != ECL_NIL) { return size * sign; } } @@ -5048,7 +5048,7 @@ ecl_open_stream(cl_object fn, enum ecl_smmode smm, cl_object if_exists, cl_object filename = si_coerce_to_filename(fn); char *fname = (char*)filename->base_string.self; bool appending = 0; - bool exists = si_file_kind(filename, Ct) != Cnil; + bool exists = si_file_kind(filename, ECL_T) != ECL_NIL; if (smm == ecl_smm_input || smm == ecl_smm_probe) { if (!exists) { if (if_does_not_exist == @':error') { @@ -5058,7 +5058,7 @@ ecl_open_stream(cl_object fn, enum ecl_smmode smm, cl_object if_exists, unlikely_if (f < 0) FEcannot_open(fn); safe_close(f); } else if (Null(if_does_not_exist)) { - return Cnil; + return ECL_NIL; } else { FEinvalid_option(@':if-does-not-exist', if_does_not_exist); @@ -5089,7 +5089,7 @@ ecl_open_stream(cl_object fn, enum ecl_smmode smm, cl_object if_exists, unlikely_if (f < 0) FEcannot_open(fn); appending = (if_exists == @':append'); } else if (Null(if_exists)) { - return Cnil; + return ECL_NIL; } else { FEinvalid_option(@':if-exists', if_exists); } @@ -5100,7 +5100,7 @@ ecl_open_stream(cl_object fn, enum ecl_smmode smm, cl_object if_exists, f = safe_open(fname, base | O_CREAT | O_TRUNC, mode); unlikely_if (f < 0) FEcannot_open(fn); } else if (Null(if_does_not_exist)) { - return Cnil; + return ECL_NIL; } else { FEinvalid_option(@':if-does-not-exist', if_does_not_exist); @@ -5134,9 +5134,9 @@ ecl_open_stream(cl_object fn, enum ecl_smmode smm, cl_object if_exists, cl_close(1, output); } else { output->stream.flags |= ECL_STREAM_MIGHT_SEEK; - si_set_finalizer(output, Ct); + si_set_finalizer(output, ECL_T); /* Set file pointer to the correct position */ - ecl_file_position_set(output, appending? Cnil : ecl_make_fixnum(0)); + ecl_file_position_set(output, appending? ECL_NIL : ecl_make_fixnum(0)); } return output; } @@ -5144,10 +5144,10 @@ ecl_open_stream(cl_object fn, enum ecl_smmode smm, cl_object if_exists, @(defun open (filename &key (direction @':input') (element_type @'character') - (if_exists Cnil iesp) - (if_does_not_exist Cnil idnesp) + (if_exists ECL_NIL iesp) + (if_does_not_exist ECL_NIL idnesp) (external_format @':default') - (cstream Ct) + (cstream ECL_T) &aux strm) enum ecl_smmode smm; int flags = 0; @@ -5183,14 +5183,14 @@ ecl_open_stream(cl_object fn, enum ecl_smmode smm, cl_object if_exists, } else if (direction == @':probe') { smm = ecl_smm_probe; if (!idnesp) - if_does_not_exist = Cnil; + if_does_not_exist = ECL_NIL; } else { FEerror("~S is an illegal DIRECTION for OPEN.", 1, direction); } byte_size = ecl_normalize_stream_element_type(element_type); if (byte_size != 0) { - external_format = Cnil; + external_format = ECL_NIL; } if (!Null(cstream)) { flags |= ECL_STREAM_C_STREAM; @@ -5386,14 +5386,14 @@ alloc_stream() x->stream.object0 = x->stream.object1 = OBJNULL; x->stream.int0 = x->stream.int1 = 0; - x->stream.format = Cnil; + x->stream.format = ECL_NIL; x->stream.flags = 0; x->stream.byte_size = 8; x->stream.buffer = NULL; x->stream.encoder = NULL; x->stream.decoder = NULL; x->stream.last_char = EOF; - x->stream.byte_stack = Cnil; + x->stream.byte_stack = ECL_NIL; x->stream.last_code[0] = x->stream.last_code[1] = EOF; x->stream.eof_char = EOF; return x; @@ -5457,13 +5457,13 @@ not_a_binary_stream(cl_object s) static void unread_error(cl_object s) { - CEerror(Ct, "Error when using UNREAD-CHAR on stream ~D", 1, s); + CEerror(ECL_T, "Error when using UNREAD-CHAR on stream ~D", 1, s); } static void unread_twice(cl_object s) { - CEerror(Ct, "Used UNREAD-CHAR twice on stream ~D", 1, s); + CEerror(ECL_T, "Used UNREAD-CHAR twice on stream ~D", 1, s); } static void @@ -5530,7 +5530,7 @@ encoding_error(cl_object stream, unsigned char *buffer, ecl_character c) static ecl_character decoding_error(cl_object stream, unsigned char *buffer, int length) { - cl_object octets = Cnil, code; + cl_object octets = ECL_NIL, code; while (length > 0) { octets = CONS(ecl_make_fixnum(buffer[--length]), octets); } @@ -5574,7 +5574,7 @@ init_file(void) cl_object error_output; cl_object aux; cl_object null_stream; - cl_object external_format = Cnil; + cl_object external_format = ECL_NIL; #if defined(ECL_MS_WINDOWS_HOST) # ifdef ECL_UNICODE external_format = cl_list(2, @':latin-1', @':crlf'); diff --git a/src/c/format.d b/src/c/format.d index dd4b2dfcb..1d4aae76d 100644 --- a/src/c/format.d +++ b/src/c/format.d @@ -102,11 +102,11 @@ get_aux_stream(void) cl_object stream; ecl_disable_interrupts_env(env); - if (env->fmt_aux_stream == Cnil) { + if (env->fmt_aux_stream == ECL_NIL) { stream = ecl_make_string_output_stream(64, 1); } else { stream = env->fmt_aux_stream; - env->fmt_aux_stream = Cnil; + env->fmt_aux_stream = ECL_NIL; } ecl_enable_interrupts_env(env); return stream; @@ -141,7 +141,7 @@ fmt_go(format_stack fmt, cl_fixnum n) cl_object p; if (n < 0) fmt_error(fmt, "can't goto"); - if ((p = ecl_nthcdr(n, fmt->args)) == Cnil) + if ((p = ecl_nthcdr(n, fmt->args)) == ECL_NIL) fmt_error(fmt, "can't goto"); fmt->current = p; } @@ -151,11 +151,11 @@ fmt_index(format_stack fmt) { cl_object p = fmt->args, target = fmt->current; cl_index n = 0; - if (target == Cnil) + if (target == ECL_NIL) return ecl_length(p); while (p != fmt->current) { p = CDR(p); - if (p == Cnil) + if (p == ECL_NIL) fmt_error(fmt, "Overflow"); n++; } @@ -171,7 +171,7 @@ fmt_back_up(format_stack fmt) static bool fmt_more_args_p(format_stack fmt) { - return fmt->current != Cnil; + return fmt->current != ECL_NIL; } static cl_index @@ -184,7 +184,7 @@ static cl_object fmt_advance(format_stack fmt) { cl_object output, l = fmt->current; - if (l == Cnil) + if (l == ECL_NIL) fmt_error(fmt, "arguments exhausted"); output = CAR(l); fmt->current = CDR(l); @@ -253,7 +253,7 @@ ensure_param(format_stack fmt, int n) if (fmt->nparam > n) fmt_error(fmt, "too many parameters"); while (n-- > fmt->nparam) - fmt->param[n] = Cnil; + fmt->param[n] = ECL_NIL; } static void @@ -280,7 +280,7 @@ fmt_not_colon_atsign(format_stack fmt, bool colon, bool atsign) static cl_object set_param(format_stack fmt, int i, int t, cl_object v) { - if (i >= fmt->nparam || fmt->param[i] == Cnil) + if (i >= fmt->nparam || fmt->param[i] == ECL_NIL) return v; else if ((t != INT && t != CHAR) || (t == INT && !cl_integerp(fmt->param[i])) || @@ -292,9 +292,9 @@ set_param(format_stack fmt, int i, int t, cl_object v) static int set_param_positive(format_stack fmt, int i, const char *message) { - if (i >= fmt->nparam || fmt->param[i] == Cnil) + if (i >= fmt->nparam || fmt->param[i] == ECL_NIL) return -1; - else if (cl_integerp(fmt->param[i]) == Cnil) + else if (cl_integerp(fmt->param[i]) == ECL_NIL) fmt_error(fmt, "illegal parameter type"); else { cl_object p = fmt->param[i]; @@ -414,7 +414,7 @@ fmt_integer(format_stack fmt, cl_object x, bool colon, bool atsign, if (!ECL_FIXNUMP(x) && type_of(x) != t_bignum) { fmt_prepare_aux_stream(fmt); - ecl_bds_bind(env, @'*print-escape*', Cnil); + ecl_bds_bind(env, @'*print-escape*', ECL_NIL); ecl_bds_bind(env, @'*print-base*', ecl_make_fixnum(radix)); si_write_object(x, fmt->aux_stream); ecl_bds_unwind_n(env, 2); @@ -426,7 +426,7 @@ fmt_integer(format_stack fmt, cl_object x, bool colon, bool atsign, return; } fmt_prepare_aux_stream(fmt); - ecl_bds_bind(env, @'*print-radix*', Cnil); + ecl_bds_bind(env, @'*print-radix*', ECL_NIL); ecl_bds_bind(env, @'*print-base*', ecl_make_fixnum(radix)); si_write_object(x, fmt->aux_stream); ecl_bds_unwind_n(env, 2); @@ -653,7 +653,7 @@ fmt_radix(format_stack fmt, bool colon, bool atsign) return; } fmt_prepare_aux_stream(fmt); - ecl_bds_bind(env, @'*print-radix*', Cnil); + ecl_bds_bind(env, @'*print-radix*', ECL_NIL); ecl_bds_bind(env, @'*print-base*', ecl_make_fixnum(10)); si_write_object(x, fmt->aux_stream); ecl_bds_unwind_n(env, 2); @@ -1255,7 +1255,7 @@ fmt_general_float(format_stack fmt, bool colon, bool atsign) fmt->nparam = 5; fmt->param[0] = ecl_make_fixnum(ww); fmt->param[1] = ecl_make_fixnum(dd); - fmt->param[2] = Cnil; + fmt->param[2] = ECL_NIL; fmt->param[3] = fmt->param[4]; fmt->param[4] = fmt->param[5]; fmt_back_up(fmt); @@ -1317,7 +1317,7 @@ fmt_dollars_float(format_stack fmt, bool colon, bool atsign) fmt->param[5] = fmt->param[3]; fmt->param[2] = fmt->param[3] = - fmt->param[4] = Cnil; + fmt->param[4] = ECL_NIL; fmt_back_up(fmt); fmt_exponential_float(fmt, colon, atsign); } @@ -1796,7 +1796,7 @@ fmt_justification(format_stack fmt, volatile bool colon, bool atsign) jmp_buf fmt_jmp_buf0; volatile int i, j, k, l, m, j0, l0; int up_colon; - volatile cl_object special = Cnil; + volatile cl_object special = ECL_NIL; volatile int spare_spaces, line_length; ensure_param(fmt, 4); @@ -1805,7 +1805,7 @@ fmt_justification(format_stack fmt, volatile bool colon, bool atsign) minpad = ecl_to_fix(set_param(fmt, 2, INT, ecl_make_fixnum(0))); padchar = ECL_CHAR_CODE(set_param(fmt, 3, CHAR, ECL_CODE_CHAR(' '))); - fields = Cnil; + fields = ECL_NIL; for (;;) { cl_object this_field = ecl_make_string_output_stream(64, 1); i = fmt->ctl_index; @@ -1856,7 +1856,7 @@ fmt_justification(format_stack fmt, volatile bool colon, bool atsign) * found, the first item is not included. */ fields = cl_nreverse(fields); - for (p = fields, l = 0; p != Cnil; p = CDR(p)) + for (p = fields, l = 0; p != ECL_NIL; p = CDR(p)) l += CAR(p)->base_string.fillp; /* * Count the number of segments that need padding, "M". If the colon @@ -1883,7 +1883,7 @@ fmt_justification(format_stack fmt, volatile bool colon, bool atsign) for (k = 0; mincol + k * colinc < l; k++) ; l = mincol + k * colinc; - if (special != Cnil && + if (special != ECL_NIL && ecl_file_column(fmt->stream) + l + spare_spaces > line_length) ecl_princ(special, fmt->stream); /* @@ -1891,7 +1891,7 @@ fmt_justification(format_stack fmt, volatile bool colon, bool atsign) * padchars is kept in "l", and it is shared equally among all segments. */ l -= l0; - for (p = fields; p != Cnil; p = CDR(p)) { + for (p = fields; p != ECL_NIL; p = CDR(p)) { if (p != fields || colon) for (j = l / m, l -= j, --m; j > 0; --j) ecl_write_char(padchar, fmt->stream); @@ -1963,7 +1963,7 @@ doformat(cl_narg narg, cl_object strm, cl_object string, ecl_va_list args, bool fmt.stream = strm; fmt_set_arg_list(&fmt, output); fmt.jmp_buf = &fmt_jmp_buf0; - if (ecl_symbol_value(@'si::*indent-formatted-output*') != Cnil) + if (ecl_symbol_value(@'si::*indent-formatted-output*') != ECL_NIL) fmt.indents = ecl_file_column(strm); else fmt.indents = 0; @@ -1979,7 +1979,7 @@ doformat(cl_narg narg, cl_object strm, cl_object string, ecl_va_list args, bool } ecl_process_env()->fmt_aux_stream = fmt.aux_stream; if (!in_formatter) - output = Cnil; + output = ECL_NIL; return output; } @@ -2005,7 +2005,7 @@ LOOP: for (;;) { switch (c = ctl_advance(fmt)) { case ',': - fmt->param[n] = Cnil; + fmt->param[n] = ECL_NIL; break; case '+': case '-': @@ -2198,7 +2198,7 @@ DIRECTIVE: #endif /* !ECL_CMU_FORMAT */ @(defun format (strm string &rest args) - cl_object output = Cnil; + cl_object output = ECL_NIL; int null_strm = 0; @ if (Null(strm)) { @@ -2208,7 +2208,7 @@ DIRECTIVE: strm = ecl_alloc_adjustable_base_string(64); #endif null_strm = 1; - } else if (strm == Ct) { + } else if (strm == ECL_T) { strm = ecl_symbol_value(@'*standard-output*'); } if (ecl_stringp(strm)) { @@ -2223,7 +2223,7 @@ DIRECTIVE: } strm = si_make_string_output_stream_from_string(strm); if (null_strm == 0) - output = Cnil; + output = ECL_NIL; } if (!Null(cl_functionp(string))) { cl_apply(3, string, strm, cl_grab_rest_args(args)); diff --git a/src/c/gbc-new.d b/src/c/gbc-new.d index dde6b13d2..63bbac7d9 100644 --- a/src/c/gbc-new.d +++ b/src/c/gbc-new.d @@ -208,7 +208,7 @@ BEGIN: case t_string: #endif case t_vector: - if ((y = x->array.displaced) != Cnil) + if ((y = x->array.displaced) != ECL_NIL) mark_displaced(y); cp = (char *)x->array.self.t; if (cp == NULL) @@ -218,7 +218,7 @@ BEGIN: case ecl_aet_ch: #endif case ecl_aet_object: - if (x->array.displaced == Cnil || CAR(x->array.displaced) == Cnil) { + if (x->array.displaced == ECL_NIL || CAR(x->array.displaced) == ECL_NIL) { cl_object *p = x->array.self.t; cl_index i; if (x->array.t == t_vector && x->vector.hasfillp) @@ -250,7 +250,7 @@ BEGIN: } goto COPY_ARRAY; case t_base_string: - if ((y = x->base_string.displaced) != Cnil) + if ((y = x->base_string.displaced) != ECL_NIL) mark_displaced(y); cp = x->base_string.self; if (cp == NULL) @@ -260,7 +260,7 @@ BEGIN: mark_contblock(cp, j); break; case t_bitvector: - if ((y = x->vector.displaced) != Cnil) + if ((y = x->vector.displaced) != ECL_NIL) mark_displaced(y); cp = x->vector.self.bit; if (cp == NULL) @@ -454,8 +454,8 @@ mark_phase(void) register ecl_frame_ptr frp; register ecl_ihs_ptr ihsp; - mark_object(Cnil); - mark_object(Ct); + mark_object(ECL_NIL); + mark_object(ECL_T); #ifdef THREADS { @@ -565,8 +565,8 @@ sweep_phase(void) register struct typemanager *tm; register cl_object f; - Cnil->symbol.m = FALSE; - Ct->symbol.m = FALSE; + ECL_NIL->symbol.m = FALSE; + ECL_T->symbol.m = FALSE; if (debug) printf("type map\n"); @@ -696,7 +696,7 @@ gc(enum type t) if (!GC_enabled()) return; - if (SYM_VAL(siVgc_verbose) != Cnil) { + if (SYM_VAL(siVgc_verbose) != ECL_NIL) { printf("\n[GC .."); /* To use this should add entries in tm_table for reloc and contig. fprintf(stdout, "\n[GC for %d %s pages ..", @@ -705,7 +705,7 @@ gc(enum type t) fflush(stdout); } - debug = symbol_value(siVgc_message) != Cnil; + debug = symbol_value(siVgc_message) != ECL_NIL; #ifdef THREADS if (clwp != &main_lpd) { @@ -856,7 +856,7 @@ gc(enum type t) gc_time += (gc_start = runtime() - gc_start); - if (SYM_VAL(siVgc_verbose) != Cnil) { + if (SYM_VAL(siVgc_verbose) != ECL_NIL) { /* Don't use fprintf since on Linux it calls malloc() */ printf(". finished in %.2f\"]", gc_start/60.0); fflush(stdout); @@ -953,21 +953,21 @@ _mark_contblock(void *x, size_t s) VALUES(4) = ecl_make_fixnum(ncb); VALUES(5) = ecl_make_fixnum(cbgccount); VALUES(6) = ecl_make_fixnum(holepage); - VALUES(7) = Cnil; + VALUES(7) = ECL_NIL; tl = &VALUES(7); for (i = 0; i < (int)t_end; i++) { if (tm_table[i].tm_type == (enum type)i) { - tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_nused), Cnil)); - tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_nfree), Cnil)); - tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_npage), Cnil)); - tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_maxpage), Cnil)); - tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_gccount), Cnil)); + tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_nused), ECL_NIL)); + tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_nfree), ECL_NIL)); + tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_npage), ECL_NIL)); + tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_maxpage), ECL_NIL)); + tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_gccount), ECL_NIL)); } else { - tl = &CDR(*tl = CONS(Cnil, Cnil)); - tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_type), Cnil)); - tl = &CDR(*tl = CONS(Cnil, Cnil)); - tl = &CDR(*tl = CONS(Cnil, Cnil)); - tl = &CDR(*tl = CONS(Cnil, Cnil)); + tl = &CDR(*tl = CONS(ECL_NIL, ECL_NIL)); + tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_type), ECL_NIL)); + tl = &CDR(*tl = CONS(ECL_NIL, ECL_NIL)); + tl = &CDR(*tl = CONS(ECL_NIL, ECL_NIL)); + tl = &CDR(*tl = CONS(ECL_NIL, ECL_NIL)); } } return VALUES(0); @@ -992,8 +992,8 @@ init_GC(void) { register_root(&siVgc_verbose); register_root(&siVgc_message); - siVgc_verbose = make_si_special("*GC-VERBOSE*", Cnil); - siVgc_message = make_si_special("*GC-MESSAGE*", Cnil); + siVgc_verbose = make_si_special("*GC-VERBOSE*", ECL_NIL); + siVgc_message = make_si_special("*GC-MESSAGE*", ECL_NIL); GC_enable(); gc_time = 0; } diff --git a/src/c/gbc.d b/src/c/gbc.d index 1ae852a9f..d7f5b98fa 100644 --- a/src/c/gbc.d +++ b/src/c/gbc.d @@ -210,7 +210,7 @@ BEGIN: case t_string: #endif case t_vector: - if ((y = x->array.displaced) != Cnil) + if ((y = x->array.displaced) != ECL_NIL) mark_displaced(y); cp = (cl_ptr)x->array.self.t; if (cp == NULL) @@ -220,7 +220,7 @@ BEGIN: case ecl_aet_ch: #endif case ecl_aet_object: - if (x->array.displaced == Cnil || CAR(x->array.displaced) == Cnil) { + if (x->array.displaced == ECL_NIL || CAR(x->array.displaced) == ECL_NIL) { i = x->vector.dim; p = x->array.self.t; goto MARK_DATA; @@ -256,7 +256,7 @@ BEGIN: } goto COPY_ARRAY; case t_base_string: - if ((y = x->base_string.displaced) != Cnil) + if ((y = x->base_string.displaced) != ECL_NIL) mark_displaced(y); cp = x->base_string.self; if (cp == NULL) @@ -266,7 +266,7 @@ BEGIN: mark_contblock(cp, j); break; case t_bitvector: - if ((y = x->vector.displaced) != Cnil) + if ((y = x->vector.displaced) != ECL_NIL) mark_displaced(y); cp = x->vector.self.bit; if (cp == NULL) @@ -609,8 +609,8 @@ sweep_phase(void) register struct typemanager *tm; register cl_object f; - Cnil->symbol.m = FALSE; - Ct->symbol.m = FALSE; + ECL_NIL->symbol.m = FALSE; + ECL_T->symbol.m = FALSE; if (debug) printf("type map\n"); @@ -754,7 +754,7 @@ ecl_gc(cl_type t) GC_disable(); CL_NEWENV_BEGIN { - if (SYM_VAL(@'si::*gc-verbose*') != Cnil) { + if (SYM_VAL(@'si::*gc-verbose*') != ECL_NIL) { printf("\n[GC .."); /* To use this should add entries in tm_table for reloc and contig. fprintf(stdout, "\n[GC for %d %s pages ..", @@ -763,7 +763,7 @@ ecl_gc(cl_type t) fflush(stdout); } - debug = ecl_symbol_value(@'si::*gc-message*') != Cnil; + debug = ecl_symbol_value(@'si::*gc-message*') != ECL_NIL; if (GC_enter_hook != NULL) (*GC_enter_hook)(); @@ -875,7 +875,7 @@ ecl_gc(cl_type t) gc_time += (gc_start = ecl_runtime() - gc_start); - if (SYM_VAL(@'si::*gc-verbose*') != Cnil) { + if (SYM_VAL(@'si::*gc-verbose*') != ECL_NIL) { /* Don't use fprintf since on Linux it calls malloc() */ printf(". finished in %.2f\"]", gc_start/60.0); fflush(stdout); @@ -933,21 +933,21 @@ _mark_contblock(void *x, cl_index s) the_env->values[4] = ecl_make_fixnum(ncb); the_env->values[5] = ecl_make_fixnum(cbgccount); the_env->values[6] = ecl_make_fixnum(holepage); - the_env->values[7] = Cnil; + the_env->values[7] = ECL_NIL; tl = &the_env->values[7]; for (i = 0; i < (int)t_end; i++) { if (tm_table[i].tm_type == (cl_type)i) { - tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_nused), Cnil)); - tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_nfree), Cnil)); - tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_npage), Cnil)); - tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_maxpage), Cnil)); - tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_gccount), Cnil)); + tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_nused), ECL_NIL)); + tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_nfree), ECL_NIL)); + tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_npage), ECL_NIL)); + tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_maxpage), ECL_NIL)); + tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_gccount), ECL_NIL)); } else { - tl = &CDR(*tl = CONS(Cnil, Cnil)); - tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_type), Cnil)); - tl = &CDR(*tl = CONS(Cnil, Cnil)); - tl = &CDR(*tl = CONS(Cnil, Cnil)); - tl = &CDR(*tl = CONS(Cnil, Cnil)); + tl = &CDR(*tl = CONS(ECL_NIL, ECL_NIL)); + tl = &CDR(*tl = CONS(ecl_make_fixnum(tm_table[i].tm_type), ECL_NIL)); + tl = &CDR(*tl = CONS(ECL_NIL, ECL_NIL)); + tl = &CDR(*tl = CONS(ECL_NIL, ECL_NIL)); + tl = &CDR(*tl = CONS(ECL_NIL, ECL_NIL)); } } return the_env->values[0]; @@ -970,7 +970,7 @@ _mark_contblock(void *x, cl_index s) cl_object si_get_finalizer(cl_object o) { - @(return Cnil) + @(return ECL_NIL) } cl_object diff --git a/src/c/gfun.d b/src/c/gfun.d index a1be74ff1..a75382bc1 100644 --- a/src/c/gfun.d +++ b/src/c/gfun.d @@ -78,13 +78,13 @@ clos_set_funcallable_instance_function(cl_object x, cl_object function_or_t) reshape_instance(x, -1); x->instance.isgf = ECL_NOT_FUNCALLABLE; } - if (function_or_t == Ct) { + if (function_or_t == ECL_T) { x->instance.isgf = ECL_STANDARD_DISPATCH; x->instance.entry = generic_function_dispatch_vararg; } else if (function_or_t == @'standard-generic-function') { x->instance.isgf = ECL_RESTRICTED_DISPATCH; x->instance.entry = generic_function_dispatch_vararg; - } else if (function_or_t == Cnil) { + } else if (function_or_t == ECL_NIL) { x->instance.isgf = ECL_NOT_FUNCALLABLE; x->instance.entry = FEnot_funcallable_vararg; } else if (function_or_t == @'clos::standard-reader-method') { @@ -109,7 +109,7 @@ clos_set_funcallable_instance_function(cl_object x, cl_object function_or_t) cl_object si_generic_function_p(cl_object x) { - @(return ((ECL_INSTANCEP(x) && (x->instance.isgf))? Ct : Cnil)) + @(return ((ECL_INSTANCEP(x) && (x->instance.isgf))? ECL_T : ECL_NIL)) } static cl_object @@ -143,7 +143,7 @@ static cl_object frame_to_list(cl_object frame) { cl_object arglist, *p; - for (p = frame->frame.base + frame->frame.size, arglist = Cnil; + for (p = frame->frame.base + frame->frame.size, arglist = ECL_NIL; p != frame->frame.base; ) { arglist = CONS(*(--p), arglist); } @@ -154,7 +154,7 @@ static cl_object frame_to_classes(cl_object frame) { cl_object arglist, *p; - for (p = frame->frame.base + frame->frame.size, arglist = Cnil; + for (p = frame->frame.base + frame->frame.size, arglist = ECL_NIL; p != frame->frame.base; ) { arglist = CONS(cl_class_of(*(--p)), arglist); } @@ -172,16 +172,16 @@ generic_compute_applicable_method(cl_env_ptr env, cl_object frame, cl_object gf) cl_object arglist = frame_to_list(frame); methods = _ecl_funcall3(@'compute-applicable-methods', gf, arglist); - unlikely_if (methods == Cnil) { + unlikely_if (methods == ECL_NIL) { cl_object func = _ecl_funcall3(@'no-applicable-method', gf, arglist); frame->frame.base[0] = OBJNULL; - env->values[1] = Cnil; + env->values[1] = ECL_NIL; return func; } } methods = clos_compute_effective_method_function(gf, GFUN_COMB(gf), methods); - env->values[1] = Ct; + env->values[1] = ECL_T; return methods; } @@ -191,14 +191,14 @@ restricted_compute_applicable_method(cl_env_ptr env, cl_object frame, cl_object /* method not cached */ cl_object arglist = frame_to_list(frame); cl_object methods = clos_std_compute_applicable_methods(gf, arglist); - unlikely_if (methods == Cnil) { + unlikely_if (methods == ECL_NIL) { cl_object func = _ecl_funcall3(@'no-applicable-method', gf, arglist); frame->frame.base[0] = OBJNULL; - env->values[1] = Cnil; + env->values[1] = ECL_NIL; return func; } methods = clos_std_compute_effective_method(gf, GFUN_COMB(gf), methods); - env->values[1] = Ct; + env->values[1] = ECL_T; return methods; } @@ -242,7 +242,7 @@ _ecl_standard_dispatch(cl_object frame, cl_object gf) * the keys and recompute the cache location if * it was filled. */ func = compute_applicable_method(env, frame, gf); - if (env->values[1] != Cnil) { + if (env->values[1] != ECL_NIL) { cl_object keys = cl_copy_seq(vector); if (e->key != OBJNULL) { e = ecl_search_cache(cache); @@ -251,7 +251,7 @@ _ecl_standard_dispatch(cl_object frame, cl_object gf) e->value = func; } } - func = _ecl_funcall3(func, frame, Cnil); + func = _ecl_funcall3(func, frame, ECL_NIL); /* Only need to close the copy */ #if !defined(ECL_USE_VARARG_AS_POINTER) if (frame == (cl_object)&frame_aux) @@ -276,7 +276,7 @@ si_clear_gfun_hash(cl_object what) { /* * This function clears the generic function call hashes selectively. - * what = Ct means clear the hash completely + * what = ECL_T means clear the hash completely * what = generic function, means cleans only these entries * If we work on a multithreaded environment, we simply enqueue these * operations and wait for the destination thread to update its own hash. diff --git a/src/c/hash.d b/src/c/hash.d index d80ed2f6e..5cba5da97 100644 --- a/src/c/hash.d +++ b/src/c/hash.d @@ -25,7 +25,7 @@ #include #include "newhash.h" -#define SYMBOL_NAME(x) (Null(x)? Cnil_symbol->symbol.name : (x)->symbol.name) +#define SYMBOL_NAME(x) (Null(x)? ECL_NIL_SYMBOL->symbol.name : (x)->symbol.name) static void ECL_INLINE assert_type_hash_table(cl_object function, cl_narg narg, cl_object p) @@ -80,7 +80,7 @@ _hash_equal(int depth, cl_hashkey h, cl_object x) switch (type_of(x)) { case t_list: if (Null(x)) { - return _hash_equal(depth, h, Cnil_symbol->symbol.name); + return _hash_equal(depth, h, ECL_NIL_SYMBOL->symbol.name); } if (--depth == 0) { return h; @@ -159,7 +159,7 @@ _hash_equalp(int depth, cl_hashkey h, cl_object x) return hash_word(h, ecl_char_upcase(ECL_CHAR_CODE(x))); case t_list: if (Null(x)) { - return _hash_equalp(depth, h, Cnil_symbol->symbol.name); + return _hash_equalp(depth, h, ECL_NIL_SYMBOL->symbol.name); } if (--depth == 0) { return h; @@ -288,7 +288,7 @@ _ecl_remhash_eq(cl_object key, cl_object hashtable) return 0; } else { e->key = OBJNULL; - e->value = Cnil; + e->value = ECL_NIL; hashtable->hash.entries--; return 1; } @@ -333,7 +333,7 @@ _ecl_remhash_eql(cl_object key, cl_object hashtable) return 0; } else { e->key = OBJNULL; - e->value = Cnil; + e->value = ECL_NIL; hashtable->hash.entries--; return 1; } @@ -372,7 +372,7 @@ _ecl_remhash_equal(cl_object key, cl_object hashtable) return 0; } else { e->key = OBJNULL; - e->value = Cnil; + e->value = ECL_NIL; hashtable->hash.entries--; return 1; } @@ -411,7 +411,7 @@ _ecl_remhash_equalp(cl_object key, cl_object hashtable) return 0; } else { e->key = OBJNULL; - e->value = Cnil; + e->value = ECL_NIL; hashtable->hash.entries--; return 1; } @@ -451,7 +451,7 @@ _ecl_remhash_pack(cl_object key, cl_object hashtable) return 0; } else { e->key = OBJNULL; - e->value = Cnil; + e->value = ECL_NIL; hashtable->hash.entries--; return 1; } @@ -526,7 +526,7 @@ copy_entry(struct ecl_hashtable_entry *e, cl_object h) } h->hash.entries--; output.key = OBJNULL; - output.value = Cnil; + output.value = ECL_NIL; h->hash.entries--; return *e = output; } @@ -631,7 +631,7 @@ _ecl_remhash_weak(cl_object key, cl_object hashtable) if (aux->key != OBJNULL) { hashtable->hash.entries--; e->key = OBJNULL; - e->value = Cnil; + e->value = ECL_NIL; return 1; } else { return 0; @@ -729,7 +729,7 @@ ecl_extend_hashtable(cl_object hashtable) } @(defun make_hash_table (&key (test @'eql') - (weakness Cnil) + (weakness ECL_NIL) (size ecl_make_fixnum(1024)) (rehash_size cl_core.rehash_size) (rehash_threshold cl_core.rehash_threshold)) @@ -748,7 +748,7 @@ ecl_extend_hashtable(cl_object hashtable) FEwrong_type_key_arg(@[make-hash-table], @[:weakness], cl_list(5, @'member', - Cnil, @':key', @':value', + ECL_NIL, @':key', @':value', @':key-and-value'), weakness); } @@ -885,34 +885,34 @@ cl__make_hash_table(cl_object test, cl_object size, cl_object rehash_size, cl_object cl_hash_table_p(cl_object ht) { - @(return (ECL_HASH_TABLE_P(ht) ? Ct : Cnil)) + @(return (ECL_HASH_TABLE_P(ht) ? ECL_T : ECL_NIL)) } cl_object si_hash_table_weakness(cl_object ht) { - cl_object output = Cnil; + cl_object output = ECL_NIL; #ifdef ECL_WEAK_HASH switch (ht->hash.weak) { case ecl_htt_weak_key: output = @':key'; break; case ecl_htt_weak_value: output = @':value'; break; case ecl_htt_weak_key_and_value: output = @':key-and-value'; break; - case ecl_htt_not_weak: default: output = Cnil; break; + case ecl_htt_not_weak: default: output = ECL_NIL; break; } #endif @(return output) } -@(defun gethash (key ht &optional (no_value Cnil)) +@(defun gethash (key ht &optional (no_value ECL_NIL)) @ { assert_type_hash_table(@[gethash], 2, ht); { cl_object v = ht->hash.get(key, ht, OBJNULL); if (v != OBJNULL) { - @(return v Ct); + @(return v ECL_T); } else { - @(return no_value Cnil); + @(return no_value ECL_NIL); } } } @@ -937,7 +937,7 @@ cl_object cl_remhash(cl_object key, cl_object ht) { /* INV: _ecl_remhash() checks the type of hashtable */ - @(return (ecl_remhash(key, ht)? Ct : Cnil)); + @(return (ecl_remhash(key, ht)? ECL_T : ECL_NIL)); } cl_object @@ -1001,9 +1001,9 @@ si_hash_table_iterate(cl_narg narg) @(return ndx e.key e.value) } } - ECL_RPLACA(env, Cnil); + ECL_RPLACA(env, ECL_NIL); } - @(return Cnil) + @(return ECL_NIL) } cl_object @@ -1078,14 +1078,14 @@ cl_maphash(cl_object fun, cl_object ht) if(e.key != OBJNULL) funcall(3, fun, e.key, e.value); } - @(return Cnil) + @(return ECL_NIL) } cl_object si_hash_table_content(cl_object ht) { cl_index i; - cl_object output = Cnil; + cl_object output = ECL_NIL; assert_type_hash_table(@[ext::hash-table-content], 2, ht); for (i = 0; i < ht->hash.size; i++) { struct ecl_hashtable_entry e = ht->hash.data[i]; diff --git a/src/c/instance.d b/src/c/instance.d index 206d3f029..3ed3b3267 100644 --- a/src/c/instance.d +++ b/src/c/instance.d @@ -33,7 +33,7 @@ cl_object si_allocate_raw_instance(cl_object orig, cl_object clas, cl_object size) { cl_object output = ecl_allocate_instance(clas, ecl_to_size(size)); - if (orig == Cnil) { + if (orig == ECL_NIL) { orig = output; } else { orig->instance.clas = clas; @@ -147,7 +147,7 @@ si_instance_set(cl_object x, cl_object index, cl_object value) cl_object si_instancep(cl_object x) { - @(return (ECL_INSTANCEP(x) ? ecl_make_fixnum(x->instance.length) : Cnil)) + @(return (ECL_INSTANCEP(x) ? ecl_make_fixnum(x->instance.length) : ECL_NIL)) } cl_object @@ -161,7 +161,7 @@ si_unbound() cl_object si_sl_boundp(cl_object x) { - @(return ((x == ECL_UNBOUND) ? Cnil : Ct)) + @(return ((x == ECL_UNBOUND) ? ECL_NIL : ECL_T)) } cl_object @@ -194,12 +194,12 @@ si_copy_instance(cl_object x) @(return y) } -@(defun find-class (name &optional (errorp Ct) env) +@(defun find-class (name &optional (errorp ECL_T) env) cl_object class, hash; @ hash = ECL_SYM_VAL(the_env, @'si::*class-name-hash-table*'); - class = ecl_gethash_safe(name, hash, Cnil); - if (class == Cnil) { + class = ecl_gethash_safe(name, hash, ECL_NIL); + if (class == ECL_NIL) { if (!Null(errorp)) FEerror("No class named ~S.", 1, name); } diff --git a/src/c/interpreter.d b/src/c/interpreter.d index b048b937f..ed2453cdc 100644 --- a/src/c/interpreter.d +++ b/src/c/interpreter.d @@ -148,7 +148,7 @@ ecl_stack_frame_pop_values(cl_object f) cl_index n = f->frame.size % ECL_MULTIPLE_VALUES_LIMIT; cl_object o; env->nvalues = n; - env->values[0] = o = Cnil; + env->values[0] = o = ECL_NIL; while (n--) { env->values[n] = o = f->frame.base[n]; } @@ -190,7 +190,7 @@ _ecl_bytecodes_dispatch_vararg(cl_narg narg, ...) { cl_object output; ECL_STACK_FRAME_VARARGS_BEGIN(narg, narg, frame) { - output = ecl_interpret(frame, Cnil, frame->frame.env->function); + output = ecl_interpret(frame, ECL_NIL, frame->frame.env->function); } ECL_STACK_FRAME_VARARGS_END(frame); return output; } @@ -289,7 +289,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) BEGIN: BEGIN_SWITCH { CASE(OP_NOP); { - reg0 = Cnil; + reg0 = ECL_NIL; the_env->nvalues = 0; THREAD_NEXT; } @@ -484,7 +484,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) frame_aux.base = the_env->stack_top - narg; SETUP_ENV(the_env); AGAIN: - if (ecl_unlikely(reg0 == OBJNULL || reg0 == Cnil)) + if (ecl_unlikely(reg0 == OBJNULL || reg0 == ECL_NIL)) FEundefined_function(x); switch (type_of(reg0)) { case t_cfunfixed: @@ -526,7 +526,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) reg0 = SYM_FUN(reg0); goto AGAIN; case t_bytecodes: - reg0 = ecl_interpret(frame, Cnil, reg0); + reg0 = ecl_interpret(frame, ECL_NIL, reg0); break; case t_bclosure: reg0 = ecl_interpret(frame, reg0->bclosure.lex, reg0->bclosure.code); @@ -569,10 +569,10 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) */ CASE(OP_POPOPT); { if (frame_index >= frame->frame.size) { - reg0 = Cnil; + reg0 = ECL_NIL; } else { ECL_STACK_PUSH(the_env,frame->frame.base[frame_index++]); - reg0 = Ct; + reg0 = ECL_T; } THREAD_NEXT; } @@ -590,7 +590,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) CASE(OP_POPREST); { cl_object *first = frame->frame.base + frame_index; cl_object *last = frame->frame.base + frame->frame.size; - for (reg0 = Cnil; last > first; ) { + for (reg0 = ECL_NIL; last > first; ) { reg0 = CONS(*(--last), reg0); } THREAD_NEXT; @@ -611,19 +611,19 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) aok = ECL_CONS_CAR(keys_list); for (; (keys_list = ECL_CONS_CDR(keys_list), !Null(keys_list)); ) { cl_object name = ECL_CONS_CAR(keys_list); - cl_object flag = Cnil; - cl_object value = Cnil; + cl_object flag = ECL_NIL; + cl_object value = ECL_NIL; cl_object *p = first; for (; p != last; ++p) { if (*(p++) == name) { count -= 2; - if (flag == Cnil) { - flag = Ct; + if (flag == ECL_NIL) { + flag = ECL_T; value = *p; } } } - if (flag != Cnil) ECL_STACK_PUSH(the_env, value); + if (flag != ECL_NIL) ECL_STACK_PUSH(the_env, value); ECL_STACK_PUSH(the_env, flag); } if (count) { @@ -829,7 +829,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) if (ecl_unlikely(!LISTP(reg0))) FEwrong_type_only_arg(@[endp], reg0, @[list]); CASE(OP_NOT); { - reg0 = (reg0 == Cnil)? Ct : Cnil; + reg0 = (reg0 == ECL_NIL)? ECL_T : ECL_NIL; THREAD_NEXT; } @@ -880,7 +880,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) GET_OPARG(n, vector); GET_DATA(var_name, vector, data); lex_env = bind_var(lex_env, var_name, - (n < the_env->nvalues) ? the_env->values[n] : Cnil); + (n < the_env->nvalues) ? the_env->values[n] : ECL_NIL); THREAD_NEXT; } CASE(OP_BINDS); { @@ -901,7 +901,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) GET_OPARG(n, vector); GET_DATA(var_name, vector, data); ecl_bds_bind(the_env, var_name, - (n < the_env->nvalues) ? the_env->values[n] : Cnil); + (n < the_env->nvalues) ? the_env->values[n] : ECL_NIL); THREAD_NEXT; } /* OP_SETQ n{arg} @@ -951,7 +951,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) GET_OPARG(lex_env_index, vector); GET_OPARG(index, vector); ecl_lex_env_set_var(lex_env, lex_env_index, - (index >= the_env->nvalues)? Cnil : the_env->values[index]); + (index >= the_env->nvalues)? ECL_NIL : the_env->values[index]); THREAD_NEXT; } CASE(OP_VSETQS); { @@ -959,7 +959,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) cl_oparg index; GET_DATA(var, vector, data); GET_OPARG(index, vector); - v = (index >= the_env->nvalues)? Cnil : the_env->values[index]; + v = (index >= the_env->nvalues)? ECL_NIL : the_env->values[index]; ECL_SETQ(the_env, var, v); THREAD_NEXT; } @@ -981,7 +981,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) THREAD_NEXT; } CASE(OP_DO); { - reg0 = Cnil; + reg0 = ECL_NIL; reg1 = ecl_make_fixnum(the_env->frame_id++); lex_env = bind_frame(lex_env, reg1, reg0); THREAD_NEXT; @@ -1038,7 +1038,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) THREAD_NEXT; } CASE(OP_EXIT_TAGBODY); { - reg0 = Cnil; + reg0 = ECL_NIL; } CASE(OP_EXIT_FRAME); { DO_EXIT_FRAME: @@ -1048,11 +1048,11 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) THREAD_NEXT; } CASE(OP_NIL); { - reg0 = Cnil; + reg0 = ECL_NIL; THREAD_NEXT; } CASE(OP_PUSHNIL); { - ECL_STACK_PUSH(the_env, Cnil); + ECL_STACK_PUSH(the_env, ECL_NIL); THREAD_NEXT; } CASE(OP_VALUEREG0); { @@ -1092,7 +1092,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) cl_object *dest = the_env->values; int n = the_env->nvalues = ecl_fixnum(ECL_STACK_POP_UNSAFE(the_env)); if (n == 0) { - *dest = reg0 = Cnil; + *dest = reg0 = ECL_NIL; THREAD_NEXT; } else if (n == 1) { *dest = reg0 = ECL_STACK_POP_UNSAFE(the_env); @@ -1126,7 +1126,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) if (ecl_unlikely(n < 0)) { FEerror("Wrong index passed to NTH-VAL", 1, ecl_make_fixnum(n)); } else if ((cl_index)n >= the_env->nvalues) { - reg0 = Cnil; + reg0 = ECL_NIL; } else if (n) { reg0 = the_env->values[n]; } @@ -1212,14 +1212,14 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) SETUP_ENV(the_env); the_env->values[0] = reg0; n = ecl_stack_push_values(the_env); - if (a == Ct) { + if (a == ECL_T) { /* We are stepping in, but must first ask the user * what to do. */ ECL_SETQ(the_env, @'si::*step-level*', cl_1P(ECL_SYM_VAL(the_env, @'si::*step-level*'))); ECL_STACK_PUSH(the_env, form); INTERPRET_FUNCALL(form, the_env, frame_aux, 1, @'si::stepper'); - } else if (a != Cnil) { + } else if (a != ECL_NIL) { /* The user told us to step over. *step-level* contains * an integer number that, when it becomes 0, means * that we have finished stepping over. */ @@ -1239,7 +1239,7 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) cl_fixnum n; GET_OPARG(n, vector); SETUP_ENV(the_env); - if (ECL_SYM_VAL(the_env, @'si::*step-action*') == Ct) { + if (ECL_SYM_VAL(the_env, @'si::*step-action*') == ECL_T) { ECL_STACK_PUSH(the_env, reg0); INTERPRET_FUNCALL(reg0, the_env, frame_aux, 1, @'si::stepper'); } @@ -1251,15 +1251,15 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) SETUP_ENV(the_env); the_env->values[0] = reg0; n = ecl_stack_push_values(the_env); - if (a == Ct) { + if (a == ECL_T) { /* We exit one stepping level */ ECL_SETQ(the_env, @'si::*step-level*', cl_1M(ECL_SYM_VAL(the_env, @'si::*step-level*'))); } else if (a == ecl_make_fixnum(0)) { /* We are back to the level in which the user * selected to step over. */ - ECL_SETQ(the_env, @'si::*step-action*', Ct); - } else if (a != Cnil) { + ECL_SETQ(the_env, @'si::*step-action*', ECL_T); + } else if (a != ECL_NIL) { ECL_SETQ(the_env, @'si::*step-action*', cl_1M(a)); } else { /* Not stepping, nothing to be done. */ @@ -1273,5 +1273,5 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes) @(defun si::interpreter-stack () @ - @(return Cnil) + @(return ECL_NIL) @) diff --git a/src/c/list.d b/src/c/list.d index 8d5bee778..4ff85009b 100644 --- a/src/c/list.d +++ b/src/c/list.d @@ -44,7 +44,7 @@ test_compare(struct cl_test *t, cl_object x) { x = KEY(t,x); t->env->function = t->test_function; - return t->test_fn(2, t->item_compared, x) != Cnil; + return t->test_fn(2, t->item_compared, x) != ECL_NIL; } static bool @@ -52,7 +52,7 @@ test_compare_not(struct cl_test *t, cl_object x) { x = KEY(t,x); t->env->function = t->test_function; - return t->test_fn(2, t->item_compared, x) == Cnil; + return t->test_fn(2, t->item_compared, x) == ECL_NIL; } static bool @@ -98,8 +98,8 @@ setup_test(struct cl_test *t, cl_object item, cl_object test, { cl_env_ptr env = t->env = ecl_process_env(); t->item_compared = item; - if (test != Cnil) { - if (test_not != Cnil) + if (test != ECL_NIL) { + if (test_not != ECL_NIL) FEerror("Both :TEST and :TEST-NOT are specified.", 0); t->test_function = test = si_coerce_to_function(test); if (test == SYM_FUN(@'eq')) { @@ -115,7 +115,7 @@ setup_test(struct cl_test *t, cl_object item, cl_object test, t->test_fn = ecl_function_dispatch(env, test); t->test_function = env->function; } - } else if (test_not != Cnil) { + } else if (test_not != ECL_NIL) { t->test_c_function = test_compare_not; test_not = si_coerce_to_function(test_not); t->test_fn = ecl_function_dispatch(env, test_not); @@ -123,7 +123,7 @@ setup_test(struct cl_test *t, cl_object item, cl_object test, } else { t->test_c_function = test_eql; } - if (key != Cnil) { + if (key != ECL_NIL) { key = si_coerce_to_function(key); t->key_fn = ecl_function_dispatch(env, key); t->key_function = env->function; @@ -134,7 +134,7 @@ setup_test(struct cl_test *t, cl_object item, cl_object test, } @(defun list (&rest args) - cl_object head = Cnil; + cl_object head = ECL_NIL; @ if (narg--) { cl_object tail = head = ecl_list1(ecl_va_arg(args)); @@ -183,7 +183,7 @@ append_into(cl_object head, cl_object *tail, cl_object l) } @(defun append (&rest rest) - cl_object head = Cnil, *tail = &head; + cl_object head = ECL_NIL, *tail = &head; @ for (; narg > 1; narg--) { cl_object other = ecl_va_arg(rest); @@ -202,7 +202,7 @@ append_into(cl_object head, cl_object *tail, cl_object l) cl_object ecl_append(cl_object x, cl_object y) { - cl_object head = Cnil; + cl_object head = ECL_NIL; cl_object *tail = &head; if (!Null(x)) { tail = append_into(head, tail, x); @@ -256,8 +256,8 @@ BEGIN: struct cl_test t; cl_object output; @ - setup_test(&t, Cnil, test, test_not, Cnil); - output = tree_equal(&t, x, y)? Ct : Cnil; + setup_test(&t, ECL_NIL, test, test_not, ECL_NIL); + output = tree_equal(&t, x, y)? ECL_T : ECL_NIL; close_test(&t); @(return output) @) @@ -265,9 +265,9 @@ BEGIN: cl_object cl_endp(cl_object x) { - cl_object output = Cnil; + cl_object output = ECL_NIL; if (Null(x)) { - output = Ct; + output = ECL_T; } else if (ecl_unlikely(!LISTP(x))) { FEwrong_type_only_arg(@[endp], x, @[list]); } @@ -298,7 +298,7 @@ cl_list_length(cl_object x) } if (n & 1) { /* Circular list? */ - if (slow == fast) @(return Cnil); + if (slow == fast) @(return ECL_NIL); slow = ECL_CONS_CDR(slow); } } @@ -309,18 +309,18 @@ cl_object si_proper_list_p(cl_object x) { cl_fixnum n; - cl_object fast, slow, test = Ct; + cl_object fast, slow, test = ECL_T; /* INV: A list's length always fits in a fixnum */ fast = slow = x; for (n = 0; !Null(fast); n++, fast = ECL_CONS_CDR(fast)) { if (!LISTP(fast)) { - test = Cnil; + test = ECL_NIL; break; } if (n & 1) { /* Circular list? */ if (slow == fast) { - test = Cnil; + test = ECL_NIL; break; } slow = ECL_CONS_CDR(slow); @@ -345,7 +345,7 @@ ecl_nth(cl_fixnum n, cl_object x) for (; n > 0 && CONSP(x); n--) x = ECL_CONS_CDR(x); if (Null(x)) - return Cnil; + return ECL_NIL; if (!LISTP(x)) FEtype_error_list(x); return ECL_CONS_CAR(x); @@ -424,7 +424,7 @@ cl_copy_list(cl_object x) if (ecl_unlikely(!LISTP(x))) { FEwrong_type_only_arg(@[copy-list], x, @[list]); } - copy = Cnil; + copy = ECL_NIL; if (!Null(x)) { cl_object tail = copy = ecl_list1(CAR(x)); while (x = ECL_CONS_CDR(x), CONSP(x)) { @@ -453,7 +453,7 @@ cl_copy_alist(cl_object x) if (ecl_unlikely(!LISTP(x))) { FEwrong_type_only_arg(@[copy-alist], x, @[list]); } - copy = Cnil; + copy = ECL_NIL; if (!Null(x)) { cl_object tail = copy = duplicate_pairs(x); while (x = ECL_CONS_CDR(x), !Null(x)) { @@ -495,7 +495,7 @@ cl_revappend(cl_object x, cl_object y) } @(defun nconc (&rest lists) - cl_object head = Cnil, tail = Cnil; + cl_object head = ECL_NIL, tail = ECL_NIL; @ while (narg--) { cl_object new_tail, other = ecl_va_arg(lists); @@ -554,12 +554,12 @@ ecl_butlast(cl_object l, cl_index n) for (r = l; n && CONSP(r); n--, r = ECL_CONS_CDR(r)) ; if (Null(r)) { - return Cnil; + return ECL_NIL; } else if (!LISTP(r)) { /* We reach here either because l is shorter than n conses, * or because it is not a list */ if (r == l) FEtype_error_list(r); - return Cnil; + return ECL_NIL; } else { /* We reach here because l has at least n conses and * thus we can take CAR(l) */ @@ -578,7 +578,7 @@ ecl_butlast(cl_object l, cl_index n) @ /* INV: No list has more than MOST_POSITIVE_FIXNUM elements */ if (type_of(nn) == t_bignum) - @(return Cnil); + @(return ECL_NIL); /* INV: ecl_to_size() signals a type-error if NN is not an integer >=0 */ @(return ecl_butlast(lis, ecl_to_size(nn))) @) @@ -597,17 +597,17 @@ ecl_nbutlast(cl_object l, cl_index n) tail = ECL_CONS_CDR(tail); r = ECL_CONS_CDR(r); } - ECL_RPLACD(tail, Cnil); + ECL_RPLACD(tail, ECL_NIL); return l; } - return Cnil; + return ECL_NIL; } @(defun nbutlast (lis &optional (nn ecl_make_fixnum(1))) @ /* INV: No list has more than MOST_POSITIVE_FIXNUM elements */ if (type_of(nn) == t_bignum) - @(return Cnil) + @(return ECL_NIL) /* INV: ecl_to_size() signas a type-error if NN is not an integer >=0 */ @(return ecl_nbutlast(lis, ecl_to_size(nn))) @) @@ -615,7 +615,7 @@ ecl_nbutlast(cl_object l, cl_index n) cl_object cl_ldiff(cl_object x, cl_object y) { - cl_object head = Cnil; + cl_object head = ECL_NIL; if (ecl_unlikely(!LISTP(x))) { FEwrong_type_only_arg(@[ldiff], x, @[list]); } @@ -679,7 +679,7 @@ subst(struct cl_test *t, cl_object new_obj, cl_object tree) } else if (ECL_ATOM(tree)) { return tree; } else { - cl_object head, tail = Cnil; + cl_object head, tail = ECL_NIL; do { cl_object cons = subst(t, new_obj, ECL_CONS_CAR(tree)); cons = ecl_cons(cons, tree = ECL_CONS_CDR(tree)); @@ -745,8 +745,8 @@ nsubst(struct cl_test *t, cl_object new_obj, cl_object tree) */ struct cl_test t[2]; @ - setup_test(t, Cnil, Cnil, Cnil, key); - setup_test(t+1, Cnil, test, test_not, Cnil); + setup_test(t, ECL_NIL, ECL_NIL, ECL_NIL, key); + setup_test(t+1, ECL_NIL, test, test_not, ECL_NIL); tree = sublis(t, alist, tree); close_test(t+1); close_test(t); @@ -780,8 +780,8 @@ sublis(struct cl_test *t, cl_object alist, cl_object tree) */ struct cl_test t[2]; @ - setup_test(t, Cnil, Cnil, Cnil, key); - setup_test(t+1, Cnil, test, test_not, Cnil); + setup_test(t, ECL_NIL, ECL_NIL, ECL_NIL, key); + setup_test(t+1, ECL_NIL, test, test_not, ECL_NIL); tree = nsublis(t, alist, tree); close_test(t+1); close_test(t); @@ -838,7 +838,7 @@ si_memq(cl_object x, cl_object l) if (x == ECL_CONS_CAR(l)) @(return l) } end_loop_for_in; - @(return Cnil) + @(return ECL_NIL) } /* Added for use by the compiler, instead of open coding them. Beppe */ @@ -849,7 +849,7 @@ ecl_memql(cl_object x, cl_object l) if (ecl_eql(x, ECL_CONS_CAR(l))) return(l); } end_loop_for_in; - return(Cnil); + return(ECL_NIL); } cl_object @@ -859,7 +859,7 @@ ecl_member(cl_object x, cl_object l) if (ecl_equal(x, ECL_CONS_CAR(l))) return(l); } end_loop_for_in; - return(Cnil); + return(ECL_NIL); } /* End of addition. Beppe */ @@ -868,7 +868,7 @@ si_member1(cl_object item, cl_object list, cl_object test, cl_object test_not, c { struct cl_test t; - if (key != Cnil) + if (key != ECL_NIL) item = funcall(2, key, item); setup_test(&t, item, test, test_not, key); loop_for_in(list) { @@ -883,7 +883,7 @@ cl_object cl_tailp(cl_object y, cl_object x) { loop_for_on(x) { - if (ecl_eql(x, y)) @(return Ct); + if (ecl_eql(x, y)) @(return ECL_T); } end_loop_for_on(x); return cl_eql(x, y); } @@ -952,7 +952,7 @@ do_assoc(struct cl_test *t, cl_object a_list) return pair; } } end_loop_for_in; - return Cnil; + return ECL_NIL; } @(defun rassoc (item a_list &key test test_not key) @@ -977,7 +977,7 @@ do_assoc(struct cl_test *t, cl_object a_list) cl_object ecl_remove_eq(cl_object x, cl_object l) { - cl_object head = Cnil, tail = Cnil; + cl_object head = ECL_NIL, tail = ECL_NIL; loop_for_on_unsafe(l) { if (ECL_CONS_CAR(l) != x) { cl_object cons = ecl_list1(ECL_CONS_CAR(l)); @@ -1017,7 +1017,7 @@ ecl_assq(cl_object x, cl_object l) if (x == CAR(pair)) return pair; } end_loop_for_in; - return(Cnil); + return(ECL_NIL); } cl_object @@ -1028,7 +1028,7 @@ ecl_assql(cl_object x, cl_object l) if (ecl_eql(x, CAR(pair))) return pair; } end_loop_for_in; - return(Cnil); + return(ECL_NIL); } cl_object @@ -1039,7 +1039,7 @@ ecl_assoc(cl_object x, cl_object l) if (ecl_equal(x, CAR(pair))) return pair; } end_loop_for_in; - return(Cnil); + return(ECL_NIL); } cl_object @@ -1050,6 +1050,6 @@ ecl_assqlp(cl_object x, cl_object l) if (ecl_equalp(x, CAR(pair))) return pair; } end_loop_for_in; - return(Cnil); + return(ECL_NIL); } /* End of addition. Beppe */ diff --git a/src/c/load.d b/src/c/load.d index 61d7b2ddc..0aea021e2 100644 --- a/src/c/load.d +++ b/src/c/load.d @@ -77,7 +77,7 @@ GO_ON: /* Finally, perform initialization */ ecl_init_module(block, (void (*)(cl_object))(block->cblock.entry)); - output = Cnil; + output = ECL_NIL; si_munmap(map); OUTPUT: @@ -96,10 +96,10 @@ si_load_source(cl_object source, cl_object verbose, cl_object print, cl_object e /* INV: if "source" is not a valid stream, file.d will complain */ strm = source; } else { - strm = ecl_open_stream(source, ecl_smm_input, Cnil, Cnil, 8, + strm = ecl_open_stream(source, ecl_smm_input, ECL_NIL, ECL_NIL, 8, ECL_STREAM_C_STREAM, external_format); if (Null(strm)) - @(return Cnil) + @(return ECL_NIL) } ECL_UNWIND_PROTECT_BEGIN(the_env) { cl_object form_index = ecl_make_fixnum(0); @@ -114,7 +114,7 @@ si_load_source(cl_object source, cl_object verbose, cl_object print, cl_object e break; if (the_env->nvalues) { si_eval_with_env(1, x); - if (print != Cnil) { + if (print != ECL_NIL) { @write(1, x); @terpri(0); } @@ -129,7 +129,7 @@ si_load_source(cl_object source, cl_object verbose, cl_object print, cl_object e if (strm != source) cl_close(3, strm, @':abort', @'t'); } ECL_UNWIND_PROTECT_END; - @(return Cnil) + @(return ECL_NIL) } @@ -145,19 +145,19 @@ si_load_bytecodes(cl_object source, cl_object verbose, cl_object print, cl_objec /* INV: if "source" is not a valid stream, file.d will complain */ strm = source; } else { - strm = ecl_open_stream(source, ecl_smm_input, Cnil, Cnil, 8, + strm = ecl_open_stream(source, ecl_smm_input, ECL_NIL, ECL_NIL, 8, ECL_STREAM_C_STREAM, external_format); if (Null(strm)) - @(return Cnil) + @(return ECL_NIL) } ECL_UNWIND_PROTECT_BEGIN(env) { { cl_object progv_list = ECL_SYM_VAL(env, @'si::+ecl-syntax-progv-list+'); cl_index bds_ndx = ecl_progv(env, ECL_CONS_CAR(progv_list), ECL_CONS_CDR(progv_list)); - env->packages_to_be_created_p = Ct; + env->packages_to_be_created_p = ECL_T; forms = cl_read(1, strm); - env->packages_to_be_created_p = Cnil; + env->packages_to_be_created_p = ECL_NIL; ecl_bds_unwind(env, bds_ndx); } while (!Null(forms)) { @@ -176,7 +176,7 @@ si_load_bytecodes(cl_object source, cl_object verbose, cl_object print, cl_objec x = cl_set_difference(2, env->packages_to_be_created, old_eptbc); old_eptbc = env->packages_to_be_created; unlikely_if (!Null(x)) { - CEerror(Ct, + CEerror(ECL_T, Null(ECL_CONS_CDR(x))? "Package ~A referenced in " "compiled file~& ~A~&but has not been created": @@ -193,7 +193,7 @@ si_load_bytecodes(cl_object source, cl_object verbose, cl_object print, cl_objec if (strm != source) cl_close(3, strm, @':abort', @'t'); } ECL_UNWIND_PROTECT_END; - @(return Cnil) + @(return ECL_NIL) } @(defun load (source @@ -209,7 +209,7 @@ si_load_bytecodes(cl_object source, cl_object verbose, cl_object print, cl_objec if (type_of(source) != t_pathname && !ecl_stringp(source)) { /* INV: if "source" is not a valid stream, file.d will complain */ filename = source; - function = Cnil; + function = ECL_NIL; not_a_filename = 1; goto NOT_A_FILENAME; } @@ -218,7 +218,7 @@ si_load_bytecodes(cl_object source, cl_object verbose, cl_object print, cl_objec pathname = coerce_to_file_pathname(source); pntype = pathname->pathname.type; - filename = Cnil; + filename = ECL_NIL; hooks = ecl_symbol_value(@'ext::*load-hooks*'); if (Null(pathname->pathname.directory) && Null(pathname->pathname.host) && @@ -230,9 +230,9 @@ si_load_bytecodes(cl_object source, cl_object verbose, cl_object print, cl_objec cl_object f = cl_merge_pathnames(2, pathname, d); cl_object ok = cl_load(11, f, @':verbose', verbose, @':print', print, - @':if-does-not-exist', Cnil, + @':if-does-not-exist', ECL_NIL, @':external-format', external_format, - @':search-list', Cnil); + @':search-list', ECL_NIL); if (!Null(ok)) { @(return ok); } @@ -243,9 +243,9 @@ si_load_bytecodes(cl_object source, cl_object verbose, cl_object print, cl_objec that the file exists */ cl_object kind; filename = si_coerce_to_filename(pathname); - kind = si_file_kind(filename, Ct); + kind = si_file_kind(filename, ECL_T); if (kind != @':file' && kind != @':special') { - filename = Cnil; + filename = ECL_NIL; } else { function = cl_cdr(ecl_assoc(pathname->pathname.type, hooks)); } @@ -256,28 +256,28 @@ si_load_bytecodes(cl_object source, cl_object verbose, cl_object print, cl_objec filename = pathname; filename->pathname.type = CAAR(hooks); function = CDAR(hooks); - kind = si_file_kind(filename, Ct); + kind = si_file_kind(filename, ECL_T); if (kind == @':file' || kind == @':special') break; else - filename = Cnil; + filename = ECL_NIL; } end_loop_for_in; if (Null(filename)) { if (Null(if_does_not_exist)) - @(return Cnil) + @(return ECL_NIL) else FEcannot_open(source); } NOT_A_FILENAME: - if (verbose != Cnil) { - cl_format(3, Ct, make_constant_base_string("~&;;; Loading ~s~%"), + if (verbose != ECL_NIL) { + cl_format(3, ECL_T, make_constant_base_string("~&;;; Loading ~s~%"), filename); } ecl_bds_bind(the_env, @'*package*', ecl_symbol_value(@'*package*')); ecl_bds_bind(the_env, @'*readtable*', ecl_symbol_value(@'*readtable*')); - ecl_bds_bind(the_env, @'*load-pathname*', not_a_filename? Cnil : source); + ecl_bds_bind(the_env, @'*load-pathname*', not_a_filename? ECL_NIL : source); ecl_bds_bind(the_env, @'*load-truename*', - not_a_filename? Cnil : (filename = cl_truename(filename))); + not_a_filename? ECL_NIL : (filename = cl_truename(filename))); if (!Null(function)) { ok = funcall(5, function, filename, verbose, print, external_format); } else { @@ -291,7 +291,7 @@ NOT_A_FILENAME: * just loads _anything_. */ if (not_a_filename) { - ok = Ct; + ok = ECL_T; } else { ok = si_load_binary(filename, verbose, print); } @@ -303,8 +303,8 @@ NOT_A_FILENAME: if (!Null(ok)) FEerror("LOAD: Could not load file ~S (Error: ~S)", 2, filename, ok); - if (print != Cnil) { - cl_format(3, Ct, make_constant_base_string("~&;;; Loading ~s~%"), + if (print != ECL_NIL) { + cl_format(3, ECL_T, make_constant_base_string("~&;;; Loading ~s~%"), filename); } @(return filename) diff --git a/src/c/macros.d b/src/c/macros.d index 5993e1c18..b76e44e10 100644 --- a/src/c/macros.d +++ b/src/c/macros.d @@ -45,12 +45,12 @@ static cl_object search_symbol_macro(cl_object name, cl_object env) { - for (env = CAR(env); env != Cnil; env = CDR(env)) { + for (env = CAR(env); env != ECL_NIL; env = CDR(env)) { cl_object record = CAR(env); if (CONSP(record) && CAR(record) == name) { if (CADR(record) == @'si::symbol-macro') return CADDR(record); - return Cnil; + return ECL_NIL; } } return si_get_sysprop(name, @'si::symbol-macro'); @@ -60,7 +60,7 @@ static cl_object search_macro_function(cl_object name, cl_object env) { int type = ecl_symbol_type(name); - if (env != Cnil) { + if (env != ECL_NIL) { /* When the environment has been produced by the compiler, there might be atoms/symbols signalling closure and block boundaries. */ @@ -71,7 +71,7 @@ search_macro_function(cl_object name, cl_object env) if (tag == @'si::macro') return CADDR(record); if (tag == @'function') - return Cnil; + return ECL_NIL; break; } } @@ -79,7 +79,7 @@ search_macro_function(cl_object name, cl_object env) if (type & ecl_stp_macro) { return SYM_FUN(name); } else { - return Cnil; + return ECL_NIL; } } @@ -94,8 +94,8 @@ search_macro_function(cl_object name, cl_object env) VALUES(1) is true when there was a macroexpansion. */ -@(defun macroexpand_1 (form &optional (env Cnil)) - cl_object exp_fun = Cnil; +@(defun macroexpand_1 (form &optional (env ECL_NIL)) + cl_object exp_fun = ECL_NIL; @ if (ECL_ATOM(form)) { if (ECL_SYMBOLP(form)) @@ -122,15 +122,15 @@ search_macro_function(cl_object name, cl_object env) @(defun macroexpand (form &optional env) cl_object done, old_form; @ - done = Cnil; + done = ECL_NIL; do { form = cl_macroexpand_1(2, old_form = form, env); - if (ecl_nth_value(the_env, 1) == Cnil) { + if (ecl_nth_value(the_env, 1) == ECL_NIL) { break; } else if (old_form == form) { FEerror("Infinite loop when expanding macro form ~A", 1, old_form); } else { - done = Ct; + done = ECL_T; } } while (1); @(return form done) @@ -139,18 +139,18 @@ search_macro_function(cl_object name, cl_object env) static cl_object or_macro(cl_object whole, cl_object env) { - cl_object output = Cnil; + cl_object output = ECL_NIL; whole = CDR(whole); if (Null(whole)) /* (OR) => NIL */ - @(return Cnil); + @(return ECL_NIL); while (!Null(CDR(whole))) { - output = CONS(CONS(CAR(whole), Cnil), output); + output = CONS(CONS(CAR(whole), ECL_NIL), output); whole = CDR(whole); } if (Null(output)) /* (OR form1) => form1 */ @(return CAR(whole)); /* (OR form1 ... formn forml) => (COND (form1) ... (formn) (t forml)) */ - output = CONS(cl_list(2, Ct, CAR(whole)), output); + output = CONS(cl_list(2, ECL_T, CAR(whole)), output); @(return CONS(@'cond', cl_nreverse(output))) } @@ -158,7 +158,7 @@ static cl_object expand_and(cl_object whole) { if (Null(whole)) - return Ct; + return ECL_T; if (Null(CDR(whole))) return CAR(whole); return cl_list(3, @'if', CAR(whole), expand_and(CDR(whole))); diff --git a/src/c/main.d b/src/c/main.d index 42a8b9150..8e5a9aa3f 100755 --- a/src/c/main.d +++ b/src/c/main.d @@ -133,9 +133,9 @@ ecl_init_env(cl_env_ptr env) { env->c_env = NULL; #if !defined(ECL_THREADS) - env->own_process = Cnil; + env->own_process = ECL_NIL; #endif - env->string_pool = Cnil; + env->string_pool = ECL_NIL; env->stack = NULL; env->stack_top = NULL; @@ -161,7 +161,7 @@ ecl_init_env(cl_env_ptr env) env->method_cache = ecl_make_cache(64, 4096); env->slot_cache = ecl_make_cache(3, 4096); #endif - env->pending_interrupt = Cnil; + env->pending_interrupt = ECL_NIL; { int size = ecl_option_values[ECL_OPT_SIGNAL_QUEUE_SIZE]; env->signal_queue = cl_make_list(1, ecl_make_fixnum(size)); @@ -180,8 +180,8 @@ ecl_init_env(cl_env_ptr env) env->trap_fpe_bits = 0; - env->packages_to_be_created = Cnil; - env->packages_to_be_created_p = Cnil; + env->packages_to_be_created = ECL_NIL; + env->packages_to_be_created_p = ECL_NIL; env->fault_address = env; } @@ -256,8 +256,8 @@ _ecl_alloc_env() * are activated later on by the thread entry point or init_unixint(). */ output->disable_interrupts = 1; - output->pending_interrupt = Cnil; - output->signal_queue_spinlock = Cnil; + output->pending_interrupt = ECL_NIL; + output->signal_queue_spinlock = ECL_NIL; return output; } @@ -266,10 +266,10 @@ cl_shutdown(void) { if (ecl_option_values[ECL_OPT_BOOTED] > 0) { cl_object l = ecl_symbol_value(@'si::*exit-hooks*'); - cl_object form = cl_list(2, @'funcall', Cnil); + cl_object form = cl_list(2, @'funcall', ECL_NIL); while (CONSP(l)) { ecl_elt_set(form, 1, ECL_CONS_CAR(l)); - si_safe_eval(3, form, Cnil, OBJNULL); + si_safe_eval(3, form, ECL_NIL, OBJNULL); l = CDR(l); ECL_SET(@'si::*exit-hooks*', l); } @@ -349,35 +349,35 @@ ecl_def_ct_complex(flt_imag_unit_neg,&flt_zero_data,&flt_one_neg_data,static,con ecl_def_ct_complex(flt_imag_two,&flt_zero_data,&flt_two_data,static,const); struct cl_core_struct cl_core = { - Cnil, /* packages */ - Cnil, /* lisp_package */ - Cnil, /* user_package */ - Cnil, /* keyword_package */ - Cnil, /* system_package */ - Cnil, /* ext_package */ + ECL_NIL, /* packages */ + ECL_NIL, /* lisp_package */ + ECL_NIL, /* user_package */ + ECL_NIL, /* keyword_package */ + ECL_NIL, /* system_package */ + ECL_NIL, /* ext_package */ #ifdef CLOS - Cnil, /* clos_package */ + ECL_NIL, /* clos_package */ # ifdef ECL_CLOS_STREAMS - Cnil, /* gray_package */ + ECL_NIL, /* gray_package */ # endif #endif - Cnil, /* mp_package */ - Cnil, /* c_package */ - Cnil, /* ffi_package */ + ECL_NIL, /* mp_package */ + ECL_NIL, /* c_package */ + ECL_NIL, /* ffi_package */ - Cnil, /* pathname_translations */ - Cnil, /* library_pathname */ + ECL_NIL, /* pathname_translations */ + ECL_NIL, /* library_pathname */ - Cnil, /* terminal_io */ - Cnil, /* null_stream */ - Cnil, /* standard_input */ - Cnil, /* standard_output */ - Cnil, /* error_output */ - Cnil, /* standard_readtable */ - Cnil, /* dispatch_reader */ - Cnil, /* default_dispatch_macro */ + ECL_NIL, /* terminal_io */ + ECL_NIL, /* null_stream */ + ECL_NIL, /* standard_input */ + ECL_NIL, /* standard_output */ + ECL_NIL, /* error_output */ + ECL_NIL, /* standard_readtable */ + ECL_NIL, /* dispatch_reader */ + ECL_NIL, /* default_dispatch_macro */ - Cnil, /* char_names */ + ECL_NIL, /* char_names */ (cl_object)&str_empty_data, /* null_string */ (cl_object)&plus_half_data, /* plus_half */ @@ -398,26 +398,26 @@ struct cl_core_struct cl_core = { (cl_object)&str_T_data, /* gentemp_prefix */ ecl_make_fixnum(0), /* gentemp_counter */ - Cnil, /* Jan1st1970UT */ + ECL_NIL, /* Jan1st1970UT */ - Cnil, /* system_properties */ - Cnil, /* setf_definition */ + ECL_NIL, /* system_properties */ + ECL_NIL, /* setf_definition */ #ifdef ECL_THREADS - Cnil, /* processes */ - Cnil, /* processes_spinlock */ - Cnil, /* global_lock */ - Cnil, /* error_lock */ - Cnil, /* global_env_lock */ + ECL_NIL, /* processes */ + ECL_NIL, /* processes_spinlock */ + ECL_NIL, /* global_lock */ + ECL_NIL, /* error_lock */ + ECL_NIL, /* global_env_lock */ #endif /* LIBRARIES is an adjustable vector of objects. It behaves as a vector of weak pointers thanks to the magic in gbc.d/alloc_2.d */ - Cnil, /* libraries */ + ECL_NIL, /* libraries */ 0, /* max_heap_size */ - Cnil, /* bytes_consed */ - Cnil, /* gc_counter */ + ECL_NIL, /* bytes_consed */ + ECL_NIL, /* gc_counter */ 0, /* gc_stats */ 0, /* path_max */ #ifdef GBC_BOEHM @@ -429,18 +429,18 @@ struct cl_core_struct cl_core = { #ifdef ECL_THREADS 0, /* last_var_index */ - Cnil, /* reused_indices */ + ECL_NIL, /* reused_indices */ #endif (cl_object)&str_slash_data, /* slash */ - Cnil, /* compiler_dispatch */ + ECL_NIL, /* compiler_dispatch */ (cl_object)&default_rehash_size_data, /* rehash_size */ (cl_object)&default_rehash_threshold_data, /* rehash_threshold */ - Cnil, /* external_processes */ - Cnil, /* external_processes_lock */ - Cnil /* known_signals */ + ECL_NIL, /* external_processes */ + ECL_NIL, /* external_processes_lock */ + ECL_NIL /* known_signals */ }; #if !defined(ECL_MS_WINDOWS_HOST) @@ -529,29 +529,29 @@ cl_boot(int argc, char **argv) * 1) Initialize symbols and packages */ - Cnil_symbol->symbol.t = t_symbol; - Cnil_symbol->symbol.dynamic = 0; - Cnil_symbol->symbol.value = Cnil; - Cnil_symbol->symbol.name = str_NIL; - Cnil_symbol->symbol.gfdef = Cnil; - Cnil_symbol->symbol.plist = Cnil; - Cnil_symbol->symbol.hpack = Cnil; - Cnil_symbol->symbol.stype = ecl_stp_constant; + ECL_NIL_SYMBOL->symbol.t = t_symbol; + ECL_NIL_SYMBOL->symbol.dynamic = 0; + ECL_NIL_SYMBOL->symbol.value = ECL_NIL; + ECL_NIL_SYMBOL->symbol.name = str_NIL; + ECL_NIL_SYMBOL->symbol.gfdef = ECL_NIL; + ECL_NIL_SYMBOL->symbol.plist = ECL_NIL; + ECL_NIL_SYMBOL->symbol.hpack = ECL_NIL; + ECL_NIL_SYMBOL->symbol.stype = ecl_stp_constant; #ifdef ECL_THREADS - Cnil_symbol->symbol.binding = ECL_MISSING_SPECIAL_BINDING; + ECL_NIL_SYMBOL->symbol.binding = ECL_MISSING_SPECIAL_BINDING; #endif cl_num_symbols_in_core=1; - Ct->symbol.t = (short)t_symbol; - Ct->symbol.dynamic = 0; - Ct->symbol.value = Ct; - Ct->symbol.name = str_T; - Ct->symbol.gfdef = Cnil; - Ct->symbol.plist = Cnil; - Ct->symbol.hpack = Cnil; - Ct->symbol.stype = ecl_stp_constant; + ECL_T->symbol.t = (short)t_symbol; + ECL_T->symbol.dynamic = 0; + ECL_T->symbol.value = ECL_T; + ECL_T->symbol.name = str_T; + ECL_T->symbol.gfdef = ECL_NIL; + ECL_T->symbol.plist = ECL_NIL; + ECL_T->symbol.hpack = ECL_NIL; + ECL_T->symbol.stype = ecl_stp_constant; #ifdef ECL_THREADS - Ct->symbol.binding = ECL_MISSING_SPECIAL_BINDING; + ECL_T->symbol.binding = ECL_MISSING_SPECIAL_BINDING; #endif cl_num_symbols_in_core=2; @@ -561,19 +561,19 @@ cl_boot(int argc, char **argv) cl_core.path_max = MAXPATHLEN; #endif - env->packages_to_be_created = Cnil; + env->packages_to_be_created = ECL_NIL; cl_core.lisp_package = ecl_make_package(str_common_lisp, cl_list(2, str_cl, str_LISP), - Cnil); + ECL_NIL); cl_core.user_package = ecl_make_package(str_common_lisp_user, cl_list(2, str_cl_user, str_user), ecl_list1(cl_core.lisp_package)); cl_core.keyword_package = - ecl_make_package(str_keyword, Cnil, Cnil); + ecl_make_package(str_keyword, ECL_NIL, ECL_NIL); cl_core.ext_package = - ecl_make_package(str_ext, Cnil, + ecl_make_package(str_ext, ECL_NIL, ecl_list1(cl_core.lisp_package)); cl_core.system_package = ecl_make_package(str_si, @@ -586,15 +586,15 @@ cl_boot(int argc, char **argv) ecl_list1(cl_core.lisp_package)); #ifdef CLOS cl_core.clos_package = - ecl_make_package(str_clos, Cnil, ecl_list1(cl_core.lisp_package)); + ecl_make_package(str_clos, ECL_NIL, ecl_list1(cl_core.lisp_package)); #endif cl_core.mp_package = ecl_make_package(str_mp, ecl_list1(str_multiprocessing), ecl_list1(cl_core.lisp_package)); #ifdef ECL_CLOS_STREAMS - cl_core.gray_package = ecl_make_package(str_gray, Cnil, - CONS(cl_core.lisp_package, Cnil)); + cl_core.gray_package = ecl_make_package(str_gray, ECL_NIL, + CONS(cl_core.lisp_package, ECL_NIL)); #endif cl_core.ffi_package = ecl_make_package(str_ffi, @@ -603,13 +603,13 @@ cl_boot(int argc, char **argv) cl_core.system_package, cl_core.ext_package)); - Cnil_symbol->symbol.hpack = cl_core.lisp_package; - cl_import2(Cnil, cl_core.lisp_package); - cl_export2(Cnil, cl_core.lisp_package); + ECL_NIL_SYMBOL->symbol.hpack = cl_core.lisp_package; + cl_import2(ECL_NIL, cl_core.lisp_package); + cl_export2(ECL_NIL, cl_core.lisp_package); - Ct->symbol.hpack = cl_core.lisp_package; - cl_import2(Ct, cl_core.lisp_package); - cl_export2(Ct, cl_core.lisp_package); + ECL_T->symbol.hpack = cl_core.lisp_package; + cl_import2(ECL_T, cl_core.lisp_package); + cl_export2(ECL_T, cl_core.lisp_package); /* At exit, clean up */ atexit(cl_shutdown); @@ -638,13 +638,13 @@ cl_boot(int argc, char **argv) ECL_SET(@'*default-pathname-defaults*', si_getcwd(0)); #else ECL_SET(@'*default-pathname-defaults*', - ecl_make_pathname(Cnil, Cnil, Cnil, Cnil, Cnil, Cnil, @':local')); + ecl_make_pathname(ECL_NIL, ECL_NIL, ECL_NIL, ECL_NIL, ECL_NIL, ECL_NIL, @':local')); #endif #ifdef ECL_THREADS - env->bindings_array = si_make_vector(Ct, ecl_make_fixnum(1024), - Cnil, Cnil, Cnil, Cnil); - si_fill_array_with_elt(env->bindings_array, OBJNULL, ecl_make_fixnum(0), Cnil); + env->bindings_array = si_make_vector(ECL_T, ecl_make_fixnum(1024), + ECL_NIL, ECL_NIL, ECL_NIL, ECL_NIL); + si_fill_array_with_elt(env->bindings_array, OBJNULL, ecl_make_fixnum(0), ECL_NIL); env->thread_local_bindings_size = env->bindings_array->vector.dim; env->thread_local_bindings = env->bindings_array->vector.self.t; ECL_SET(@'mp::*current-process*', env->own_process); @@ -694,7 +694,7 @@ cl_boot(int argc, char **argv) cl_core.rehash_size, cl_core.rehash_threshold); - ECL_SET(@'*random-state*', ecl_make_random_state(Ct)); + ECL_SET(@'*random-state*', ecl_make_random_state(ECL_T)); ECL_SET(@'ffi::c-int-max', ecl_make_integer(INT_MAX)); ECL_SET(@'ffi::c-int-min', ecl_make_integer(INT_MIN)); @@ -740,7 +740,7 @@ cl_boot(int argc, char **argv) CONS(str_LISP, @'si::load-source'), CONS(str_fasc, @'si::load-bytecodes'), CONS(str_FASC, @'si::load-bytecodes'), - CONS(Cnil, @'si::load-source')); + CONS(ECL_NIL, @'si::load-source')); ECL_SET(@'ext::*load-hooks*', aux); init_error(); init_macros(); @@ -764,7 +764,7 @@ cl_boot(int argc, char **argv) cl_list(8, @'&optional', @'&rest', @'&key', @'&allow-other-keys', @'&aux', @'&whole', @'&environment', @'&body')); - for (i = 0, features = Cnil; feature_names[i].elt.self; i++) { + for (i = 0, features = ECL_NIL; feature_names[i].elt.self; i++) { int flag; cl_object name = (cl_object)(feature_names + i); cl_object key = ecl_intern(name, cl_core.keyword_package, &flag); @@ -781,7 +781,7 @@ cl_boot(int argc, char **argv) ecl_init_module(OBJNULL,init_lib_LSP); - if (cl_fboundp(@'ext::make-encoding') != Cnil) { + if (cl_fboundp(@'ext::make-encoding') != ECL_NIL) { maybe_fix_console_stream(cl_core.standard_input); maybe_fix_console_stream(cl_core.standard_output); maybe_fix_console_stream(cl_core.error_output); @@ -795,7 +795,7 @@ cl_boot(int argc, char **argv) /************************* ENVIRONMENT ROUTINES ***********************/ -@(defun ext::quit (&optional (code ecl_make_fixnum(0)) (kill_all_threads Ct)) +@(defun ext::quit (&optional (code ecl_make_fixnum(0)) (kill_all_threads ECL_T)) @ { #ifdef ECL_THREADS @@ -852,7 +852,7 @@ si_getenv(cl_object var) /* Strings have to be null terminated base strings */ var = si_copy_to_simple_base_string(var); value = getenv((char*)var->base_string.self); - @(return ((value == NULL)? Cnil : make_base_string_copy(value))) + @(return ((value == NULL)? ECL_NIL : make_base_string_copy(value))) } #if defined(HAVE_SETENV) || defined(HAVE_PUTENV) @@ -864,7 +864,7 @@ si_setenv(cl_object var, cl_object value) /* Strings have to be null terminated base strings */ var = si_copy_to_simple_base_string(var); - if (value == Cnil) { + if (value == ECL_NIL) { #ifdef HAVE_SETENV /* Remove the variable when setting to nil, so that * (si:setenv "foo" nil), then (si:getenv "foo) returns @@ -884,15 +884,15 @@ si_setenv(cl_object var, cl_object value) ret_val = setenv((char*)var->base_string.self, (char*)value->base_string.self, 1); #else - value = cl_format(4, Cnil, make_constant_base_string("~A=~A"), var, + value = cl_format(4, ECL_NIL, make_constant_base_string("~A=~A"), var, value); value = si_copy_to_simple_base_string(value); putenv((char*)value->base_string.self); #endif } if (ret_val == -1) - CEerror(Ct, "SI:SETENV failed: insufficient space in environment.", - 1, Cnil); + CEerror(ECL_T, "SI:SETENV failed: insufficient space in environment.", + 1, ECL_NIL); ecl_return1(the_env, value); } #endif @@ -900,7 +900,7 @@ si_setenv(cl_object var, cl_object value) cl_object si_environ(void) { - cl_object output = Cnil; + cl_object output = ECL_NIL; #ifdef HAVE_ENVIRON char **p; extern char **environ; diff --git a/src/c/mapfun.d b/src/c/mapfun.d index 87cfa5fa4..563d3e0fd 100644 --- a/src/c/mapfun.d +++ b/src/c/mapfun.d @@ -34,7 +34,7 @@ cl_object res, *val = &res; @ { PREPARE_MAP(the_env, lists, cdrs_frame, cars_frame, narg); - res = Cnil; + res = ECL_NIL; while (TRUE) { cl_index i; for (i = 0; i < narg; i++) { @@ -58,7 +58,7 @@ cl_object res, *val = &res; @ { PREPARE_MAP(the_env, lists, cdrs_frame, cars_frame, narg); - res = Cnil; + res = ECL_NIL; while (TRUE) { cl_index i; for (i = 0; i < narg; i++) { @@ -128,7 +128,7 @@ cl_object res, *val = &res; @ { PREPARE_MAP(the_env, lists, cdrs_frame, cars_frame, narg); - res = Cnil; + res = ECL_NIL; while (TRUE) { cl_index i; for (i = 0; i < narg; i++) { @@ -153,7 +153,7 @@ cl_object res, *val = &res; @ { PREPARE_MAP(the_env, lists, cdrs_frame, cars_frame, narg); - res = Cnil; + res = ECL_NIL; while (TRUE) { cl_index i; for (i = 0; i < narg; i++) { diff --git a/src/c/multival.d b/src/c/multival.d index d2e5ffedb..2a13edcdc 100644 --- a/src/c/multival.d +++ b/src/c/multival.d @@ -24,7 +24,7 @@ unlikely_if (narg > ECL_MULTIPLE_VALUES_LIMIT) FEerror("Too many values in VALUES",0); the_env->nvalues = narg; - output = Cnil; + output = ECL_NIL; if (narg) { int i = 0; do { @@ -40,7 +40,7 @@ cl_values_list(cl_object list) { cl_env_ptr the_env = ecl_process_env(); int i; - the_env->values[0] = Cnil; + the_env->values[0] = ECL_NIL; for (i = 0; !Null(list); list=ECL_CONS_CDR(list)) { unlikely_if (!LISTP(list)) FEtype_error_list(list); diff --git a/src/c/num_co.d b/src/c/num_co.d index 08432731f..8449391f3 100644 --- a/src/c/num_co.d +++ b/src/c/num_co.d @@ -846,7 +846,7 @@ cl_object cl_float_radix(cl_object x) { const cl_env_ptr the_env = ecl_process_env(); - if (ecl_unlikely(cl_floatp(x) != Ct)) { + if (ecl_unlikely(cl_floatp(x) != ECL_T)) { FEwrong_type_nth_arg(@[float-radix],1,x,@[float]); } ecl_return1(the_env, ecl_make_fixnum(FLT_RADIX)); diff --git a/src/c/num_log.d b/src/c/num_log.d index 9ebc72dfd..bfe166fdc 100644 --- a/src/c/num_log.d +++ b/src/c/num_log.d @@ -397,7 +397,7 @@ cl_logbitp(cl_object p, cl_object x) else i = (_ecl_big_sign(x) < 0); } - @(return (i ? Ct : Cnil)) + @(return (i ? ECL_T : ECL_NIL)) } cl_object @@ -493,9 +493,9 @@ si_bit_array_op(cl_object o, cl_object x, cl_object y, cl_object r) goto ERROR; yp = y->vector.self.bit; yo = y->vector.offset; - if (r == Ct) + if (r == ECL_T) r = x; - if (r != Cnil) { + if (r != ECL_NIL) { if (type_of(r) != t_bitvector) goto ERROR; if (r->vector.dim != d) @@ -503,14 +503,14 @@ si_bit_array_op(cl_object o, cl_object x, cl_object y, cl_object r) i = (r->vector.self.bit - xp)*8 + (r->vector.offset - xo); if ((i > 0 && i < d) || (i < 0 && -i < d)) { r0 = r; - r = Cnil; + r = ECL_NIL; replace = TRUE; goto L1; } i = (r->vector.self.bit - yp)*8 + (r->vector.offset - yo); if ((i > 0 && i < d) || (i < 0 && -i < d)) { r0 = r; - r = Cnil; + r = ECL_NIL; replace = TRUE; } } @@ -537,9 +537,9 @@ si_bit_array_op(cl_object o, cl_object x, cl_object y, cl_object r) for (i = 0; i < x->array.rank; i++) if (x->array.dims[i] != y->array.dims[i]) goto ERROR; - if (r == Ct) + if (r == ECL_T) r = x; - if (r != Cnil) { + if (r != ECL_NIL) { if (type_of(r) != t_array) goto ERROR; if ((cl_elttype)r->array.elttype != ecl_aet_bit) @@ -552,14 +552,14 @@ si_bit_array_op(cl_object o, cl_object x, cl_object y, cl_object r) i = (r->vector.self.bit - xp)*8 + (r->vector.offset - xo); if ((i > 0 && i < d) || (i < 0 && -i < d)) { r0 = r; - r = Cnil; + r = ECL_NIL; replace = TRUE; goto L2; } i = (r->vector.self.bit - yp)*8 + (r->vector.offset - yo); if ((i > 0 && i < d) || (i < 0 && -i < d)) { r0 = r; - r = Cnil; + r = ECL_NIL; replace = TRUE; } } @@ -567,7 +567,7 @@ si_bit_array_op(cl_object o, cl_object x, cl_object y, cl_object r) if (Null(r)) { r = ecl_alloc_object(t_array); r->array.self.t = NULL; - r->array.displaced = Cnil; + r->array.displaced = ECL_NIL; r->array.rank = x->array.rank; r->array.dims = x->array.dims; r->array.elttype = ecl_aet_bit; diff --git a/src/c/num_pred.d b/src/c/num_pred.d index 171e3028b..c9b5f7822 100644 --- a/src/c/num_pred.d +++ b/src/c/num_pred.d @@ -43,25 +43,25 @@ ecl_evenp(cl_object x) cl_object cl_oddp(cl_object x) { /* INV: ecl_oddp() checks type */ - @(return (ecl_oddp(x) ? Ct : Cnil)) + @(return (ecl_oddp(x) ? ECL_T : ECL_NIL)) } cl_object cl_evenp(cl_object x) { /* INV: ecl_evenp() checks_type */ - @(return (ecl_evenp(x) ? Ct : Cnil)) + @(return (ecl_evenp(x) ? ECL_T : ECL_NIL)) } cl_object si_float_nan_p(cl_object x) { - @(return (ecl_float_nan_p(x)? Ct : Cnil)) + @(return (ecl_float_nan_p(x)? ECL_T : ECL_NIL)) } cl_object si_float_infinity_p(cl_object x) { - @(return (ecl_float_infinity_p(x)? Ct : Cnil)) + @(return (ecl_float_infinity_p(x)? ECL_T : ECL_NIL)) } bool diff --git a/src/c/num_rand.d b/src/c/num_rand.d index 79e24e273..2f4a21757 100644 --- a/src/c/num_rand.d +++ b/src/c/num_rand.d @@ -220,7 +220,7 @@ cl_object ecl_make_random_state(cl_object rs) { cl_object z = ecl_alloc_object(t_random); - if (rs == Ct) { + if (rs == ECL_T) { z->random.value = init_random_state(); } else { if (Null(rs)) { @@ -241,7 +241,7 @@ ecl_make_random_state(cl_object rs) @(return rando(x, rs)); @) -@(defun make_random_state (&optional (rs Cnil)) +@(defun make_random_state (&optional (rs ECL_NIL)) @ @(return ecl_make_random_state(rs)) @) @@ -249,5 +249,5 @@ ecl_make_random_state(cl_object rs) cl_object cl_random_state_p(cl_object x) { - @(return (ECL_RANDOM_STATE_P(x) ? Ct : Cnil)) + @(return (ECL_RANDOM_STATE_P(x) ? ECL_T : ECL_NIL)) } diff --git a/src/c/number.d b/src/c/number.d index 9a4ab8500..504f186e3 100644 --- a/src/c/number.d +++ b/src/c/number.d @@ -682,7 +682,7 @@ prepare_ratio_to_float(cl_object num, cl_object den, int digits, cl_fixnum *scal ecl_make_fixnum(1); if (rem == ecl_make_fixnum(0)) { if (cl_logbitp(ecl_make_fixnum(1), fraction) - != Cnil) + != ECL_NIL) fraction = ecl_plus(fraction, one); } else { fraction = ecl_plus(fraction, one); diff --git a/src/c/numbers/minusp.d b/src/c/numbers/minusp.d index d1ac03e27..b42538b20 100644 --- a/src/c/numbers/minusp.d +++ b/src/c/numbers/minusp.d @@ -21,7 +21,7 @@ cl_object cl_minusp(cl_object x) { /* INV: ecl_minusp() checks type */ - @(return (ecl_minusp(x) ? Ct : Cnil)) + @(return (ecl_minusp(x) ? ECL_T : ECL_NIL)) } static int diff --git a/src/c/numbers/number_compare.d b/src/c/numbers/number_compare.d index 94fa991ea..ddc4ebe0a 100644 --- a/src/c/numbers/number_compare.d +++ b/src/c/numbers/number_compare.d @@ -190,9 +190,9 @@ monotonic(int s, int t, int narg, ecl_va_list nums) for (c = ecl_va_arg(nums); --narg; c = d) { d = ecl_va_arg(nums); if (s*ecl_number_compare(d, c) < t) - return1(Cnil); + return1(ECL_NIL); } - return1(Ct); + return1(ECL_T); } #define MONOTONIC(i, j) (cl_narg narg, ...) \ diff --git a/src/c/numbers/number_equalp.d b/src/c/numbers/number_equalp.d index 367459c48..e6913a48a 100644 --- a/src/c/numbers/number_equalp.d +++ b/src/c/numbers/number_equalp.d @@ -26,8 +26,8 @@ /* INV: For >= 2 arguments, ecl_number_equalp() performs checks */ for (i = 1; i < narg; i++) if (!ecl_number_equalp(num, ecl_va_arg(nums))) - @(return Cnil) - @(return Ct) + @(return ECL_NIL) + @(return ECL_T) @) /* Returns 1 if both numbers compare to equal */ @@ -187,7 +187,7 @@ ecl_number_equalp(cl_object x, cl_object y) numi = ecl_va_arg(nums); for (j = 1; jsymbol.hpack == p) - s->symbol.hpack = Cnil; + s->symbol.hpack = ECL_NIL; } static INLINE void symbol_add_package(cl_object s, cl_object p) { if (Null(s)) - s = Cnil_symbol; - if (s->symbol.hpack == Cnil) + s = ECL_NIL_SYMBOL; + if (s->symbol.hpack == ECL_NIL) s->symbol.hpack = p; } @@ -120,10 +120,10 @@ alloc_package(cl_object name) p->pack.internal = make_package_hashtable(); p->pack.external = make_package_hashtable(); p->pack.name = name; - p->pack.nicknames = Cnil; - p->pack.shadowings = Cnil; - p->pack.uses = Cnil; - p->pack.usedby = Cnil; + p->pack.nicknames = ECL_NIL; + p->pack.shadowings = ECL_NIL; + p->pack.uses = ECL_NIL; + p->pack.usedby = ECL_NIL; p->pack.locked = FALSE; return p; } @@ -153,7 +153,7 @@ find_pending_package(cl_env_ptr env, cl_object name, cl_object nicknames) cl_object other_name = ECL_CONS_CAR(pair); if (ecl_equal(other_name, name) || _ecl_funcall5(@'member', other_name, nicknames, - @':test', @'string=') != Cnil) + @':test', @'string=') != ECL_NIL) { cl_object x = ECL_CONS_CDR(pair); env->packages_to_be_created = @@ -164,7 +164,7 @@ find_pending_package(cl_env_ptr env, cl_object name, cl_object nicknames) l = ECL_CONS_CDR(l); } } - return Cnil; + return ECL_NIL; } static cl_object @@ -172,7 +172,7 @@ process_nicknames(cl_object nicknames) { cl_object l; nicknames = cl_copy_list(nicknames); - for (l = nicknames; l != Cnil; l = ECL_CONS_CDR(l)) + for (l = nicknames; l != ECL_NIL; l = ECL_CONS_CDR(l)) ECL_RPLACA(l, cl_string(ECL_CONS_CAR(l))); return nicknames; } @@ -182,7 +182,7 @@ process_package_list(cl_object packages) { cl_object l; packages = cl_copy_list(packages); - for (l = packages; l != Cnil; l = ECL_CONS_CDR(l)) + for (l = packages; l != ECL_NIL; l = ECL_CONS_CDR(l)) ECL_RPLACA(l, si_coerce_to_package(ECL_CONS_CAR(l))); return packages; } @@ -191,7 +191,7 @@ cl_object ecl_make_package(cl_object name, cl_object nicknames, cl_object use_list) { const cl_env_ptr env = ecl_process_env(); - cl_object x, other = Cnil; + cl_object x, other = ECL_NIL; /* Type checking, coercions, and the like, happen before we * acquire the lock */ @@ -206,7 +206,7 @@ ecl_make_package(cl_object name, cl_object nicknames, cl_object use_list) x = find_pending_package(env, name, nicknames); if (Null(x)) { other = ecl_find_package_nolock(name); - if (other != Cnil) { + if (other != ECL_NIL) { goto OUTPUT; } else { x = alloc_package(name); @@ -215,7 +215,7 @@ ecl_make_package(cl_object name, cl_object nicknames, cl_object use_list) loop_for_in(nicknames) { cl_object nick = ECL_CONS_CAR(nicknames); other = ecl_find_package_nolock(nick); - if (other != Cnil) { + if (other != ECL_NIL) { name = nick; goto OUTPUT; } @@ -256,10 +256,10 @@ ecl_rename_package(cl_object x, cl_object name, cl_object nicknames) error = 0; ECL_WITH_GLOBAL_ENV_WRLOCK_BEGIN(ecl_process_env()) { cl_object l; - for (l = nicknames; l != Cnil; l = ECL_CONS_CDR(l)) { + for (l = nicknames; l != ECL_NIL; l = ECL_CONS_CDR(l)) { cl_object nick = ECL_CONS_CAR(l); cl_object p = ecl_find_package_nolock(nick); - if ((p != Cnil) && (p != x)) { + if ((p != ECL_NIL) && (p != x)) { name = nick; error = 1; break; @@ -308,11 +308,11 @@ ecl_find_package_nolock(cl_object name) /* Note that this function may actually be called _before_ symbols are set up * and bound! */ if (ecl_option_values[ECL_OPT_BOOTED] && - ECL_SYM_VAL(ecl_process_env(), @'si::*relative-package-names*') != Cnil) { + ECL_SYM_VAL(ecl_process_env(), @'si::*relative-package-names*') != ECL_NIL) { return si_find_relative_package(1, name); } #endif - return Cnil; + return ECL_NIL; } cl_object @@ -430,7 +430,7 @@ find_symbol_inner(cl_object name, cl_object p, int *intern_flag) } end_loop_for_on_unsafe(ul); NOTHING: *intern_flag = 0; - s = Cnil; + s = ECL_NIL; OUTPUT: return s; } @@ -464,7 +464,7 @@ potential_unintern_conflict(cl_object name, cl_object s, cl_object p) } } } end_loop_for_on_unsafe(l); - return Cnil; + return ECL_NIL; } bool @@ -479,7 +479,7 @@ ecl_unintern(cl_object s, cl_object p) CEpackage_error("Cannot unintern symbol ~S from locked package ~S.", "Ignore lock and proceed", p, 2, s, p); } - conflict = Cnil; + conflict = ECL_NIL; ECL_WITH_GLOBAL_ENV_WRLOCK_BEGIN(ecl_process_env()) { cl_object hash = p->pack.internal; cl_object x = ecl_gethash_safe(name, hash, OBJNULL); @@ -491,7 +491,7 @@ ecl_unintern(cl_object s, cl_object p) } if (ecl_member_eq(s, p->pack.shadowings)) { conflict = potential_unintern_conflict(name, s, p); - if (conflict != Cnil) { + if (conflict != ECL_NIL) { goto OUTPUT; } p->pack.shadowings = ecl_remove_eq(s, p->pack.shadowings); @@ -502,7 +502,7 @@ ecl_unintern(cl_object s, cl_object p) OUTPUT: (void)0; } ECL_WITH_GLOBAL_ENV_WRLOCK_END; - if (conflict != Cnil) { + if (conflict != ECL_NIL) { FEpackage_error("Cannot unintern the shadowing symbol ~S~%" "from ~S,~%" "because ~S and ~S will cause~%" @@ -525,7 +525,7 @@ potential_export_conflict(cl_object name, cl_object s, cl_object p) return other_p; } } end_loop_for_on_unsafe(l); - return Cnil; + return ECL_NIL; } void @@ -546,7 +546,7 @@ cl_export2(cl_object s, cl_object p) error = 2; } else if (intern_flag == ECL_EXTERNAL) { error = 0; - } else if ((other_p = potential_export_conflict(name, s, p)) != Cnil) { + } else if ((other_p = potential_export_conflict(name, s, p)) != ECL_NIL) { error = 3; } else { if (intern_flag == ECL_INTERNAL) @@ -585,7 +585,7 @@ cl_delete_package(cl_object p) if (Null(p)) { CEpackage_error("Package ~S not found. Cannot delete it.", "Ignore error and continue", p, 0); - @(return Cnil); + @(return ECL_NIL); } if (p->pack.locked) CEpackage_error("Cannot delete locked package ~S.", @@ -598,7 +598,7 @@ cl_delete_package(cl_object p) * and empty the package. */ if (Null(p->pack.name)) { - @(return Cnil) + @(return ECL_NIL) } while (!Null(l = p->pack.uses)) { ecl_unuse_package(ECL_CONS_CAR(l), p); @@ -620,12 +620,12 @@ cl_delete_package(cl_object p) symbol_remove_package(s, p); } cl_clrhash(p->pack.external); - p->pack.shadowings = Cnil; - p->pack.name = Cnil; + p->pack.shadowings = ECL_NIL; + p->pack.name = ECL_NIL; /* 2) Only at the end, remove the package from the list of packages. */ cl_core.packages = ecl_remove_eq(p, cl_core.packages); } ECL_WITH_GLOBAL_ENV_WRLOCK_END; - @(return Ct) + @(return ECL_T) } void @@ -830,7 +830,7 @@ ecl_unuse_package(cl_object x, cl_object p) } ECL_WITH_GLOBAL_ENV_WRLOCK_END; } -@(defun make_package (pack_name &key nicknames (use CONS(cl_core.lisp_package, Cnil))) +@(defun make_package (pack_name &key nicknames (use CONS(cl_core.lisp_package, ECL_NIL))) @ /* INV: ecl_make_package() performs type checking */ @(return ecl_make_package(pack_name, nicknames, use)) @@ -894,7 +894,7 @@ cl_object si_package_lock(cl_object p, cl_object t) { p = si_coerce_to_package(p); - p->pack.locked = (t != Cnil); + p->pack.locked = (t != ECL_NIL); @(return p) } @@ -914,7 +914,7 @@ cl_list_all_packages() @(return sym @':external') if (intern_flag == ECL_INHERITED) @(return sym @':inherited') - @(return sym Cnil) + @(return sym ECL_NIL) @) @(defun find_symbol (strng &optional (p ecl_current_package())) @@ -928,12 +928,12 @@ cl_list_all_packages() @(return x @':external') if (intern_flag == ECL_INHERITED) @(return x @':inherited') - @(return Cnil Cnil) + @(return ECL_NIL ECL_NIL) @) @(defun unintern (symbl &optional (p ecl_current_package())) @ - @(return (ecl_unintern(symbl, p) ? Ct : Cnil)) + @(return (ecl_unintern(symbl, p) ? ECL_T : ECL_NIL)) @) @(defun export (symbols &o (pack ecl_current_package())) @@ -952,7 +952,7 @@ cl_list_all_packages() FEwrong_type_nth_arg(@[export],1,symbols, cl_list(3,@'or',@'symbol',@'list')); } - @(return Ct) + @(return ECL_T) @) @(defun unexport (symbols &o (pack ecl_current_package())) @@ -971,7 +971,7 @@ cl_list_all_packages() FEwrong_type_nth_arg(@[unexport],1,symbols, cl_list(3,@'or',@'symbol',@'list')); } - @(return Ct) + @(return ECL_T) @) @(defun import (symbols &o (pack ecl_current_package())) @@ -990,7 +990,7 @@ cl_list_all_packages() FEwrong_type_nth_arg(@[import],1,symbols, cl_list(3,@'or',@'symbol',@'list')); } - @(return Ct) + @(return ECL_T) @) @(defun shadowing_import (symbols &o (pack ecl_current_package())) @@ -1009,7 +1009,7 @@ cl_list_all_packages() FEwrong_type_nth_arg(@[shadowing-import],1,symbols, cl_list(3,@'or',@'symbol',@'list')); } - @(return Ct) + @(return ECL_T) @) @(defun shadow (symbols &o (pack ecl_current_package())) @@ -1035,7 +1035,7 @@ cl_list_all_packages() FEwrong_type_nth_arg(@[shadow],1,symbols, cl_list(3,@'or',@'symbol',@'list')); } - @(return Ct) + @(return ECL_T) @) @(defun use_package (pack &o (pa ecl_current_package())) @@ -1057,7 +1057,7 @@ cl_list_all_packages() FEwrong_type_nth_arg(@[use-package], 1, pack, ecl_read_from_cstring("(OR SYMBOL CHARACTER STRING LIST PACKAGE)")); } - @(return Ct) + @(return ECL_T) @) @(defun unuse_package (pack &o (pa ecl_current_package())) @@ -1079,7 +1079,7 @@ cl_list_all_packages() FEwrong_type_nth_arg(@[unuse-package], 1, pack, ecl_read_from_cstring("(OR SYMBOL CHARACTER STRING LIST PACKAGE)")); } - @(return Ct) + @(return ECL_T) @) cl_object diff --git a/src/c/pathname.d b/src/c/pathname.d index 075ef9a34..7f539b9fc 100644 --- a/src/c/pathname.d +++ b/src/c/pathname.d @@ -273,31 +273,31 @@ ecl_make_pathname(cl_object host, cl_object device, cl_object directory, p = ecl_alloc_object(t_pathname); if (ecl_stringp(host)) p->pathname.logical = ecl_logical_hostname_p(host); - else if (host == Cnil) + else if (host == ECL_NIL) p->pathname.logical = FALSE; else { x = directory; component = @':host'; goto ERROR; } - if (device != Cnil && device != @':unspecific' && + if (device != ECL_NIL && device != @':unspecific' && !(!p->pathname.logical && ecl_stringp(device))) { x = device; component = @':device'; goto ERROR; } - if (name != Cnil && name != @':wild' && !ecl_stringp(name)) { + if (name != ECL_NIL && name != @':wild' && !ecl_stringp(name)) { x = name; component = @':name'; goto ERROR; } - if (type != Cnil && type != @':unspecific' && type != @':wild' && !ecl_stringp(type)) { + if (type != ECL_NIL && type != @':unspecific' && type != @':wild' && !ecl_stringp(type)) { x = type; component = @':type'; goto ERROR; } if (version != @':unspecific' && version != @':newest' && - version != @':wild' && version != Cnil && !ECL_FIXNUMP(version)) + version != @':wild' && version != ECL_NIL && !ECL_FIXNUMP(version)) { x = version; component = @':version'; @@ -363,13 +363,13 @@ tilde_expand(cl_object pathname) * a user name, we merge the user homedir pathname with this one. */ cl_object directory, head; - if (pathname->pathname.logical || pathname->pathname.host != Cnil - || pathname->pathname.device != Cnil) { + if (pathname->pathname.logical || pathname->pathname.host != ECL_NIL + || pathname->pathname.device != ECL_NIL) { return pathname; } directory = pathname->pathname.directory; if (!CONSP(directory) || ECL_CONS_CAR(directory) != @':relative' - || ECL_CONS_CDR(directory) == Cnil) { + || ECL_CONS_CDR(directory) == ECL_NIL) { return pathname; } head = CADR(directory); @@ -412,7 +412,7 @@ static int is_null(int c) { return c == '\0'; } * Output is either * 1) :error in case (3) above * 2) :wild, :wild-inferiors, :up - * 3) "" or Cnil when word has no elements + * 3) "" or ECL_NIL when word has no elements * 5) A non empty string */ static cl_object @@ -467,13 +467,13 @@ parse_word(cl_object s, delim_fn delim, int flags, cl_index start, the proper delimiter */ if (flags & WORD_INCLUDE_DELIM) { *end_of_word = start; - return Cnil; + return ECL_NIL; } } switch(i-j) { case 0: if (flags & WORD_EMPTY_IS_NIL) - return Cnil; + return ECL_NIL; return cl_core.null_string; case 1: if (ecl_char(s,j) == '*') @@ -509,14 +509,14 @@ parse_directories(cl_object s, int flags, cl_index start, cl_index end, cl_index *end_of_dir) { cl_index i, j; - cl_object path = Cnil; + cl_object path = ECL_NIL; delim_fn delim = (flags & WORD_LOGICAL) ? is_semicolon : is_slash; flags |= WORD_INCLUDE_DELIM | WORD_ALLOW_ASTERISK; *end_of_dir = start; for (i = j = start; i < end; j = i) { cl_object part = parse_word(s, delim, flags, j, end, &i); - if (part == @':error' || part == Cnil) + if (part == @':error' || part == ECL_NIL) break; if (part == cl_core.null_string) { /* "/", ";" */ if (j != start) { @@ -582,12 +582,12 @@ ecl_parse_namestring(cl_object s, cl_index start, cl_index end, cl_index *ep, /* We first try parsing as logical-pathname. In case of * failure, physical-pathname parsing is performed only when * there is no supplied *logical* host name. All other failures - * result in Cnil as output. + * result in ECL_NIL as output. */ host = parse_word(s, is_colon, WORD_LOGICAL | WORD_INCLUDE_DELIM | WORD_DISALLOW_SEMICOLON, start, end, ep); - if (default_host != Cnil) { - if (host == Cnil || host == @':error') + if (default_host != ECL_NIL) { + if (host == ECL_NIL || host == @':error') host = default_host; } if (!ecl_logical_hostname_p(host)) @@ -608,39 +608,39 @@ ecl_parse_namestring(cl_object s, cl_index start, cl_index end, cl_index *ep, path = CONS(@':absolute', path); } if (path == @':error') - return Cnil; + return ECL_NIL; name = parse_word(s, is_dot, WORD_LOGICAL | WORD_ALLOW_ASTERISK | WORD_EMPTY_IS_NIL, *ep, end, ep); if (name == @':error') - return Cnil; - type = Cnil; - version = Cnil; + return ECL_NIL; + type = ECL_NIL; + version = ECL_NIL; if (*ep == start || ecl_char(s, *ep-1) != '.') goto make_it; type = parse_word(s, is_dot, WORD_LOGICAL | WORD_ALLOW_ASTERISK | WORD_EMPTY_IS_NIL, *ep, end, ep); if (type == @':error') - return Cnil; + return ECL_NIL; if (*ep == start || ecl_char(s, *ep-1) != '.') goto make_it; aux = parse_word(s, is_null, WORD_LOGICAL | WORD_ALLOW_ASTERISK | WORD_EMPTY_IS_NIL, *ep, end, ep); if (aux == @':error') { - return Cnil; + return ECL_NIL; } else if (ECL_SYMBOLP(aux)) { version = aux; } else { const cl_env_ptr the_env = ecl_process_env(); cl_object parsed_length; - version = cl_parse_integer(3, aux, @':junk-allowed', Ct); + version = cl_parse_integer(3, aux, @':junk-allowed', ECL_T); parsed_length = ecl_nth_value(the_env, 1); if (ecl_fixnum(parsed_length) == ecl_length(aux) && - cl_integerp(version) != Cnil && ecl_plusp(version)) + cl_integerp(version) != ECL_NIL && ecl_plusp(version)) ; - else if (cl_string_equal(2, aux, @':newest') != Cnil) + else if (cl_string_equal(2, aux, @':newest') != ECL_NIL) version = @':newest'; else - return Cnil; + return ECL_NIL; } goto make_it; physical: @@ -657,43 +657,43 @@ ecl_parse_namestring(cl_object s, cl_index start, cl_index end, cl_index *ep, */ #if defined(ECL_MS_WINDOWS_HOST) if ((start+1 <= end) && is_slash(ecl_char(s, start))) { - device = Cnil; + device = ECL_NIL; goto maybe_parse_host; } #endif device = parse_word(s, is_colon, WORD_INCLUDE_DELIM | WORD_EMPTY_IS_NIL | WORD_DISALLOW_SLASH, start, end, ep); - if (device == @':error' || device == Cnil) { - device = Cnil; - host = Cnil; + if (device == @':error' || device == ECL_NIL) { + device = ECL_NIL; + host = ECL_NIL; goto done_device_and_host; } if (!ecl_stringp(device)) { - return Cnil; + return ECL_NIL; } maybe_parse_host: /* Files have no effective device. */ - if (@string-equal(2, device, @':file') == Ct) - device = Cnil; + if (@string-equal(2, device, @':file') == ECL_T) + device = ECL_NIL; start = *ep; - host = Cnil; + host = ECL_NIL; if ((start+2) <= end && is_slash(ecl_char(s, start)) && is_slash(ecl_char(s, start+1))) { host = parse_word(s, is_slash, WORD_EMPTY_IS_NIL, start+2, end, ep); if (host == @':error') { - host = Cnil; - } else if (host != Cnil) { + host = ECL_NIL; + } else if (host != ECL_NIL) { if (!ecl_stringp(host)) - return Cnil; + return ECL_NIL; start = *ep; if (is_slash(ecl_char(s,--start))) *ep = start; } } if (ecl_length(device) == 0) - device = Cnil; + device = ECL_NIL; done_device_and_host: path = parse_directories(s, 0, *ep, end, ep); if (CONSP(path)) { @@ -703,22 +703,22 @@ ecl_parse_namestring(cl_object s, cl_index start, cl_index end, cl_index *ep, path = destructively_check_directory(path, FALSE, FALSE); } if (path == @':error') - return Cnil; + return ECL_NIL; start = *ep; name = parse_word(s, is_dot, WORD_ALLOW_LEADING_DOT | WORD_SEARCH_LAST_DOT | WORD_ALLOW_ASTERISK | WORD_EMPTY_IS_NIL, start, end, ep); if (name == @':error') - return Cnil; + return ECL_NIL; if ((*ep - start) <= 1 || ecl_char(s, *ep-1) != '.') { - type = Cnil; + type = ECL_NIL; } else { type = parse_word(s, is_null, WORD_ALLOW_ASTERISK, *ep, end, ep); if (type == @':error') - return Cnil; + return ECL_NIL; } - version = (name != Cnil || type != Cnil) ? @':newest' : Cnil; + version = (name != ECL_NIL || type != ECL_NIL) ? @':newest' : ECL_NIL; make_it: if (*ep >= end) *ep = end; path = ecl_make_pathname(host, device, path, name, type, version, @@ -800,52 +800,52 @@ cl_logical_pathname(cl_object x) bool checked = 0; @ pathname = cl_pathname(pathname); - if (component == Cnil || component == @':host') { + if (component == ECL_NIL || component == @':host') { if (pathname->pathname.host == @':wild') - @(return Ct); + @(return ECL_T); checked = 1; } - if (component == Cnil || component == @':device') { + if (component == ECL_NIL || component == @':device') { if (pathname->pathname.device == @':wild') - @(return Ct); + @(return ECL_T); checked = 1; } - if (component == Cnil || component == @':version') { + if (component == ECL_NIL || component == @':version') { if (pathname->pathname.version == @':wild') - @(return Ct); + @(return ECL_T); checked = 1; } - if (component == Cnil || component == @':name') { + if (component == ECL_NIL || component == @':name') { cl_object name = pathname->pathname.name; - if (name != Cnil && + if (name != ECL_NIL && (name == @':wild' || ecl_wild_string_p(name))) - @(return Ct); + @(return ECL_T); checked = 1; } - if (component == Cnil || component == @':type') { + if (component == ECL_NIL || component == @':type') { cl_object name = pathname->pathname.type; - if (name != Cnil && + if (name != ECL_NIL && (name == @':wild' || ecl_wild_string_p(name))) - @(return Ct); + @(return ECL_T); checked = 1; } - if (component == Cnil || component == @':directory') { + if (component == ECL_NIL || component == @':directory') { cl_object list = pathname->pathname.directory; checked = 1; loop_for_on_unsafe(list) { cl_object name = ECL_CONS_CAR(list); - if (name != Cnil && + if (name != ECL_NIL && (name == @':wild' || name == @':wild-inferiors' || ecl_wild_string_p(name))) { - @(return Ct) + @(return ECL_T) } } end_loop_for_on_unsafe(list); } if (checked == 0) { FEerror("~A is not a valid pathname component", 1, component); } - @(return Cnil) + @(return ECL_NIL) @) /* @@ -862,14 +862,14 @@ coerce_to_file_pathname(cl_object pathname) pathname = cl_merge_pathnames(1, pathname); #if 0 #if !defined(cygwin) && !defined(ECL_MS_WINDOWS_HOST) - if (pathname->pathname.device != Cnil) + if (pathname->pathname.device != ECL_NIL) FEerror("Device ~S not yet supported.", 1, pathname->pathname.device); - if (pathname->pathname.host != Cnil) + if (pathname->pathname.host != ECL_NIL) FEerror("Access to remote files not yet supported.", 0); #endif #endif - if (pathname->pathname.directory == Cnil || + if (pathname->pathname.directory == ECL_NIL || ECL_CONS_CAR(pathname->pathname.directory) == @':relative') { pathname = cl_merge_pathnames(2, pathname, si_getcwd(0)); } @@ -903,12 +903,12 @@ si_coerce_to_filename(cl_object pathname_orig) /* We always go through the pathname representation and thus * cl_namestring() always outputs a fresh new string */ pathname = coerce_to_file_pathname(pathname_orig); - if (cl_wild_pathname_p(1,pathname) != Cnil) + if (cl_wild_pathname_p(1,pathname) != ECL_NIL) cl_error(3, @'file-error', @':pathname', pathname_orig); namestring = ecl_namestring(pathname, ECL_NAMESTRING_TRUNCATE_IF_ERROR | ECL_NAMESTRING_FORCE_BASE_STRING); - if (namestring == Cnil) { + if (namestring == ECL_NIL) { FEerror("Pathname without a physical namestring:" "~% :HOST ~A" "~% :DEVICE ~A" @@ -929,7 +929,7 @@ si_coerce_to_filename(cl_object pathname_orig) return namestring; } -#define default_device(host) Cnil +#define default_device(host) ECL_NIL cl_object ecl_merge_pathnames(cl_object path, cl_object defaults, cl_object default_version) @@ -938,7 +938,7 @@ ecl_merge_pathnames(cl_object path, cl_object defaults, cl_object default_versio cl_object tocase; defaults = cl_pathname(defaults); - path = cl_parse_namestring(1, path, Cnil, defaults); + path = cl_parse_namestring(1, path, ECL_NIL, defaults); if (Null(host = path->pathname.host)) host = defaults->pathname.host; tocase = host_case(host); @@ -981,7 +981,7 @@ ecl_merge_pathnames(cl_object path, cl_object defaults, cl_object default_versio } if (default_version == @':default') { if (Null(name) && Null(type)) { - version = Cnil; + version = ECL_NIL; } else { version = @':newest'; } @@ -1021,24 +1021,24 @@ ecl_namestring(cl_object x, int flags) if (logical) { if ((y = x->pathname.device) != @':unspecific' && truncate_if_unreadable) - return Cnil; - if (host != Cnil) { - si_do_write_sequence(host, buffer, ecl_make_fixnum(0), Cnil); + return ECL_NIL; + if (host != ECL_NIL) { + si_do_write_sequence(host, buffer, ecl_make_fixnum(0), ECL_NIL); writestr_stream(":", buffer); } } else { - if ((y = x->pathname.device) != Cnil) { - si_do_write_sequence(y, buffer, ecl_make_fixnum(0), Cnil); + if ((y = x->pathname.device) != ECL_NIL) { + si_do_write_sequence(y, buffer, ecl_make_fixnum(0), ECL_NIL); writestr_stream(":", buffer); } - if (host != Cnil) { + if (host != ECL_NIL) { #if !defined(ECL_MS_WINDOWS_HOST) - if (y == Cnil) { + if (y == ECL_NIL) { writestr_stream("file:", buffer); } #endif writestr_stream("//", buffer); - si_do_write_sequence(host, buffer, ecl_make_fixnum(0), Cnil); + si_do_write_sequence(host, buffer, ecl_make_fixnum(0), ECL_NIL); } } l = x->pathname.directory; @@ -1062,10 +1062,10 @@ ecl_namestring(cl_object x, int flags) } else if (y == @':wild-inferiors') { writestr_stream("**", buffer); } else if (y != @':back') { - si_do_write_sequence(y, buffer, ecl_make_fixnum(0), Cnil); + si_do_write_sequence(y, buffer, ecl_make_fixnum(0), ECL_NIL); } else { /* Directory :back has no namestring representation */ - return Cnil; + return ECL_NIL; } ecl_write_char(logical? ';' : DIR_SEPARATOR, buffer); } end_loop_for_in; @@ -1078,38 +1078,38 @@ NO_DIRECTORY: writestr_stream(":", buffer); } y = x->pathname.name; - if (y != Cnil) { + if (y != ECL_NIL) { if (y == @':wild') { writestr_stream("*", buffer); } else { - si_do_write_sequence(y, buffer, ecl_make_fixnum(0), Cnil); + si_do_write_sequence(y, buffer, ecl_make_fixnum(0), ECL_NIL); } } else if (!logical && !Null(x->pathname.type)) { /* #P".txt" is :NAME = ".txt" :TYPE = NIL and hence :NAME = NIL and :TYPE != NIL does not have a printed representation */ - return Cnil; + return ECL_NIL; } y = x->pathname.type; if (y == @':unspecific') { - return Cnil; - } else if (y != Cnil) { + return ECL_NIL; + } else if (y != ECL_NIL) { if (y == @':wild') { writestr_stream(".*", buffer); } else { writestr_stream(".", buffer); - si_do_write_sequence(y, buffer, ecl_make_fixnum(0), Cnil); + si_do_write_sequence(y, buffer, ecl_make_fixnum(0), ECL_NIL); } } y = x->pathname.version; if (logical) { - if (y != Cnil) { + if (y != ECL_NIL) { writestr_stream(".", buffer); if (y == @':wild') { writestr_stream("*", buffer); } else if (y == @':newest') { si_do_write_sequence(ecl_symbol_name(y), buffer, - ecl_make_fixnum(0), Cnil); + ecl_make_fixnum(0), ECL_NIL); } else { /* Since the printer is not reentrant, * we cannot use cl_write and friends. @@ -1131,11 +1131,11 @@ NO_DIRECTORY: /* Namestrings of physical pathnames have restrictions... */ if (Null(x->pathname.name) && Null(x->pathname.type)) { /* Directories cannot have a version number */ - if (y != Cnil) - return Cnil; + if (y != ECL_NIL) + return ECL_NIL; } else if (y != @':newest') { /* Filenames have an implicit version :newest */ - return Cnil; + return ECL_NIL; } } buffer = cl_get_output_stream_string(buffer); @@ -1163,7 +1163,7 @@ cl_namestring(cl_object x) &k (start ecl_make_fixnum(0)) end junk_allowed &a output) @ - if (host != Cnil) { + if (host != ECL_NIL) { host = cl_string(host); } if (!ecl_stringp(thing)) { @@ -1172,7 +1172,7 @@ cl_namestring(cl_object x) cl_object default_host = host; cl_index_pair p; cl_index ee; - if (default_host == Cnil && defaults != Cnil) { + if (default_host == ECL_NIL && defaults != ECL_NIL) { defaults = cl_pathname(defaults); default_host = defaults->pathname.host; } @@ -1182,16 +1182,16 @@ cl_namestring(cl_object x) p = ecl_vector_start_end(@[parse-namestring], thing, start, end); output = ecl_parse_namestring(thing, p.start, p.end, &ee, default_host); start = ecl_make_fixnum(ee); - if (output == Cnil || ee != p.end) { + if (output == ECL_NIL || ee != p.end) { if (Null(junk_allowed)) { FEparse_error("Cannot parse the namestring ~S~%" - "from ~S to ~S.", Cnil, + "from ~S to ~S.", ECL_NIL, 3, thing, start, end); } goto OUTPUT; } } - if (host != Cnil && !ecl_equal(output->pathname.host, host)) { + if (host != ECL_NIL && !ecl_equal(output->pathname.host, host)) { FEerror("The pathname ~S does not contain the required host ~S.", 2, thing, host); } @@ -1208,9 +1208,9 @@ cl_namestring(cl_object x) @(return ecl_merge_pathnames(path, defaults, default_version)) @) -@(defun make_pathname (&key (host Cnil hostp) (device Cnil devicep) - (directory Cnil directoryp) - (name Cnil namep) (type Cnil typep) (version Cnil versionp) +@(defun make_pathname (&key (host ECL_NIL hostp) (device ECL_NIL devicep) + (directory ECL_NIL directoryp) + (name ECL_NIL namep) (type ECL_NIL typep) (version ECL_NIL versionp) ((:case scase) @':local') defaults &aux x) @@ -1218,7 +1218,7 @@ cl_namestring(cl_object x) if (Null(defaults)) { defaults = si_default_pathname_defaults(); defaults = ecl_make_pathname(defaults->pathname.host, - Cnil, Cnil, Cnil, Cnil, Cnil, + ECL_NIL, ECL_NIL, ECL_NIL, ECL_NIL, ECL_NIL, @':local'); } else { defaults = cl_pathname(defaults); @@ -1237,14 +1237,14 @@ cl_namestring(cl_object x) cl_object cl_pathnamep(cl_object pname) { - @(return (ECL_PATHNAMEP(pname) ? Ct : Cnil)) + @(return (ECL_PATHNAMEP(pname) ? ECL_T : ECL_NIL)) } cl_object si_logical_pathname_p(cl_object pname) { @(return ((ECL_PATHNAMEP(pname) && pname->pathname.logical)? - Ct : Cnil)) + ECL_T : ECL_NIL)) } @(defun pathname_host (pname &key ((:case scase) @':local')) @@ -1298,7 +1298,7 @@ cl_object cl_file_namestring(cl_object pname) { pname = cl_pathname(pname); - @(return ecl_namestring(ecl_make_pathname(Cnil, Cnil, Cnil, + @(return ecl_namestring(ecl_make_pathname(ECL_NIL, ECL_NIL, ECL_NIL, pname->pathname.name, pname->pathname.type, pname->pathname.version, @@ -1310,9 +1310,9 @@ cl_object cl_directory_namestring(cl_object pname) { pname = cl_pathname(pname); - @(return ecl_namestring(ecl_make_pathname(Cnil, Cnil, + @(return ecl_namestring(ecl_make_pathname(ECL_NIL, ECL_NIL, pname->pathname.directory, - Cnil, Cnil, Cnil, + ECL_NIL, ECL_NIL, ECL_NIL, @':local'), ECL_NAMESTRING_TRUNCATE_IF_ERROR)) } @@ -1327,7 +1327,7 @@ cl_host_namestring(cl_object pname) @(return pname) } -#define EN_MATCH(p1,p2,el) (ecl_equalp(p1->pathname.el, p2->pathname.el)? Cnil : p1->pathname.el) +#define EN_MATCH(p1,p2,el) (ecl_equalp(p1->pathname.el, p2->pathname.el)? ECL_NIL : p1->pathname.el) @(defun enough_namestring (path &o (defaults si_default_pathname_defaults())) @@ -1349,15 +1349,15 @@ cl_host_namestring(cl_object pname) and if they have some common elements, we just output the remaining ones. */ cl_object dir_begin = funcall(5, @'mismatch', pathdir, defaultdir, @':test', @'equal'); - if (dir_begin == Cnil) { - pathdir = Cnil; + if (dir_begin == ECL_NIL) { + pathdir = ECL_NIL; } else if (dir_begin == cl_length(defaultdir)) { pathdir = funcall(3, @'subseq', pathdir, dir_begin); pathdir = CONS(@':relative', pathdir); } } fname = EN_MATCH(path, defaults, name); - if (fname == Cnil) fname = path->pathname.name; + if (fname == ECL_NIL) fname = path->pathname.name; /* Create a path with all elements that do not match the default */ newpath = ecl_make_pathname(EN_MATCH(path, defaults, host), @@ -1448,7 +1448,7 @@ path_item_match(cl_object a, cl_object mask) { return TRUE; /* If a component in the tested path is a wildcard field, this can only be matched by the same wildcard field in the mask */ - if (!ecl_stringp(a) || mask == Cnil) + if (!ecl_stringp(a) || mask == ECL_NIL) return (a == mask); if (!ecl_stringp(mask)) FEerror("~S is not supported as mask for pathname-match-p", 1, mask); @@ -1490,7 +1490,7 @@ path_list_match(cl_object a, cl_object mask) { cl_object cl_pathname_match_p(cl_object path, cl_object mask) { - cl_object output = Cnil; + cl_object output = ECL_NIL; path = cl_pathname(path); mask = cl_pathname(mask); if (path->pathname.logical != mask->pathname.logical) @@ -1510,7 +1510,7 @@ cl_pathname_match_p(cl_object path, cl_object mask) goto OUTPUT; if (Null(mask->pathname.version) || path_item_match(path->pathname.version, mask->pathname.version)) - output = Ct; + output = ECL_T; OUTPUT: @(return output) } @@ -1550,21 +1550,21 @@ coerce_to_from_pathname(cl_object x, cl_object host) /* Find its translation list */ pair = @assoc(4, host, cl_core.pathname_translations, @':test', @'string-equal'); if (set == OBJNULL) { - @(return ((pair == Cnil)? Cnil : CADR(pair))); + @(return ((pair == ECL_NIL)? ECL_NIL : CADR(pair))); } /* Set the new translation list */ if (ecl_unlikely(!LISTP(set))) { FEwrong_type_nth_arg(@[si::pathname-translations], 2, set, @[list]); } - if (pair == Cnil) { - pair = CONS(host, CONS(Cnil, Cnil)); + if (pair == ECL_NIL) { + pair = CONS(host, CONS(ECL_NIL, ECL_NIL)); cl_core.pathname_translations = CONS(pair, cl_core.pathname_translations); } - for (l = set, set = Cnil; !ecl_endp(l); l = CDR(l)) { + for (l = set, set = ECL_NIL; !ecl_endp(l); l = CDR(l)) { cl_object item = CAR(l); cl_object from = coerce_to_from_pathname(cl_car(item), host); cl_object to = cl_pathname(cl_cadr(item)); - set = CONS(CONS(from, CONS(to, Cnil)), set); + set = CONS(CONS(from, CONS(to, ECL_NIL)), set); } set = cl_nreverse(set); ECL_RPLACA(ECL_CONS_CDR(pair), set); @@ -1608,13 +1608,13 @@ find_wilds(cl_object l, cl_object source, cl_object match) static cl_object find_list_wilds(cl_object a, cl_object mask) { - cl_object l = Cnil, l2; + cl_object l = ECL_NIL, l2; while (!ecl_endp(mask)) { cl_object item_mask = CAR(mask); mask = CDR(mask); if (item_mask == @':wild-inferiors') { - l2 = Cnil; + l2 = ECL_NIL; while (!path_list_match(a, mask)) { if (ecl_endp(a)) return @':error'; @@ -1694,7 +1694,7 @@ copy_wildcards(cl_object *wilds_list, cl_object pattern) static cl_object copy_list_wildcards(cl_object *wilds, cl_object to) { - cl_object l = Cnil; + cl_object l = ECL_NIL; while (!ecl_endp(to)) { cl_object d, mask = CAR(to); @@ -1741,7 +1741,7 @@ copy_list_wildcards(cl_object *wilds, cl_object to) goto error; /* Match host names */ - if (cl_string_equal(2, source->pathname.host, from->pathname.host) == Cnil) + if (cl_string_equal(2, source->pathname.host, from->pathname.host) == ECL_NIL) goto error; host = to->pathname.host; @@ -1759,12 +1759,12 @@ copy_list_wildcards(cl_object *wilds, cl_object to) wilds = translate_list_case(wilds, fromcase, tocase); d = copy_list_wildcards(&wilds, to->pathname.directory); if (d == @':error') goto error; - if (wilds != Cnil) goto error2; + if (wilds != ECL_NIL) goto error2; } directory = d; /* Match name */ - wilds = find_wilds(Cnil, source->pathname.name, from->pathname.name); + wilds = find_wilds(ECL_NIL, source->pathname.name, from->pathname.name); if (wilds == @':error') goto error2; if (Null(to->pathname.name)) { d = translate_component_case(from->pathname.name, fromcase, tocase); @@ -1772,12 +1772,12 @@ copy_list_wildcards(cl_object *wilds, cl_object to) wilds = translate_list_case(wilds, fromcase, tocase); d = copy_wildcards(&wilds, to->pathname.name); if (d == @':error') goto error; - if (wilds != Cnil) goto error2; + if (wilds != ECL_NIL) goto error2; } name = d; /* Match type */ - wilds = find_wilds(Cnil, source->pathname.type, from->pathname.type); + wilds = find_wilds(ECL_NIL, source->pathname.type, from->pathname.type); if (wilds == @':error') goto error2; if (Null(to->pathname.type)) { d = translate_component_case(from->pathname.type, fromcase, tocase); @@ -1785,7 +1785,7 @@ copy_list_wildcards(cl_object *wilds, cl_object to) wilds = translate_list_case(wilds, fromcase, tocase); d = copy_wildcards(&wilds, to->pathname.type); if (d == @':error') goto error; - if (wilds != Cnil) goto error2; + if (wilds != ECL_NIL) goto error2; } type = d; diff --git a/src/c/predicate.d b/src/c/predicate.d index a56e92201..b9a8c1f51 100644 --- a/src/c/predicate.d +++ b/src/c/predicate.d @@ -29,38 +29,38 @@ cl_identity(cl_object x) cl_object cl_null(cl_object x) { - @(return (Null(x) ? Ct : Cnil)) + @(return (Null(x) ? ECL_T : ECL_NIL)) } cl_object cl_symbolp(cl_object x) { - @(return (ECL_SYMBOLP(x) ? Ct : Cnil)) + @(return (ECL_SYMBOLP(x) ? ECL_T : ECL_NIL)) } cl_object cl_atom(cl_object x) { - @(return (ECL_ATOM(x) ? Ct : Cnil)) + @(return (ECL_ATOM(x) ? ECL_T : ECL_NIL)) } cl_object cl_consp(cl_object x) { - @(return (CONSP(x) ? Ct : Cnil)) + @(return (CONSP(x) ? ECL_T : ECL_NIL)) } cl_object cl_listp(cl_object x) { - @(return ((Null(x) || CONSP(x)) ? Ct : Cnil)) + @(return ((Null(x) || CONSP(x)) ? ECL_T : ECL_NIL)) } cl_object cl_numberp(cl_object x) { cl_type t = type_of(x); - @(return (ECL_NUMBER_TYPE_P(t) ? Ct : Cnil)) + @(return (ECL_NUMBER_TYPE_P(t) ? ECL_T : ECL_NIL)) } /* Used in compiled code */ @@ -74,20 +74,20 @@ cl_object cl_integerp(cl_object x) { cl_type t = type_of(x); - @(return ((t == t_fixnum || t == t_bignum) ? Ct : Cnil)) + @(return ((t == t_fixnum || t == t_bignum) ? ECL_T : ECL_NIL)) } cl_object cl_rationalp(cl_object x) { cl_type t = type_of(x); - @(return ((t == t_fixnum || t == t_bignum || t == t_ratio) ? Ct : Cnil)) + @(return ((t == t_fixnum || t == t_bignum || t == t_ratio) ? ECL_T : ECL_NIL)) } cl_object cl_floatp(cl_object x) { - @(return (floatp(x)? Ct : Cnil)) + @(return (floatp(x)? ECL_T : ECL_NIL)) } bool @@ -105,7 +105,7 @@ cl_object cl_realp(cl_object x) { cl_type t = type_of(x); - @(return (ECL_REAL_TYPE_P(t) ? Ct : Cnil)) + @(return (ECL_REAL_TYPE_P(t) ? ECL_T : ECL_NIL)) } bool @@ -118,20 +118,20 @@ ecl_realp(cl_object x) cl_object cl_complexp(cl_object x) { - @(return (ECL_COMPLEXP(x) ? Ct : Cnil)) + @(return (ECL_COMPLEXP(x) ? ECL_T : ECL_NIL)) } cl_object cl_characterp(cl_object x) { - @(return (ECL_CHARACTERP(x) ? Ct : Cnil)) + @(return (ECL_CHARACTERP(x) ? ECL_T : ECL_NIL)) } #ifdef ECL_UNICODE cl_object si_base_char_p(cl_object c) { - @(return ((ECL_CHARACTERP(c) && ECL_BASE_CHAR_P(c))? Ct : Cnil)) + @(return ((ECL_CHARACTERP(c) && ECL_BASE_CHAR_P(c))? ECL_T : ECL_NIL)) } #endif @@ -149,19 +149,19 @@ ecl_stringp(cl_object x) cl_object cl_stringp(cl_object x) { - @(return (ECL_STRINGP(x)? Ct : Cnil)) + @(return (ECL_STRINGP(x)? ECL_T : ECL_NIL)) } cl_object cl_bit_vector_p(cl_object x) { - @(return (ECL_BIT_VECTOR_P(x) ? Ct : Cnil)) + @(return (ECL_BIT_VECTOR_P(x) ? ECL_T : ECL_NIL)) } cl_object cl_vectorp(cl_object x) { - @(return (ECL_VECTORP(x) ? Ct : Cnil)) + @(return (ECL_VECTORP(x) ? ECL_T : ECL_NIL)) } cl_object @@ -170,14 +170,14 @@ cl_simple_string_p(cl_object x) @(return ((ECL_STRINGP(x) && !ECL_ADJUSTABLE_ARRAY_P(x) && !ECL_ARRAY_HAS_FILL_POINTER_P(x) && - Null(CAR(x->base_string.displaced))) ? Ct : Cnil)) + Null(CAR(x->base_string.displaced))) ? ECL_T : ECL_NIL)) } #ifdef ECL_UNICODE cl_object si_base_string_p(cl_object x) { - @(return (ECL_BASE_STRING_P(x) ? Ct : Cnil)) + @(return (ECL_BASE_STRING_P(x) ? ECL_T : ECL_NIL)) } #endif @@ -187,7 +187,7 @@ cl_simple_bit_vector_p(cl_object x) @(return ((ECL_BIT_VECTOR_P(x) && !ECL_ADJUSTABLE_ARRAY_P(x) && !ECL_ARRAY_HAS_FILL_POINTER_P(x) && - Null(CAR(x->vector.displaced))) ? Ct : Cnil)) + Null(CAR(x->vector.displaced))) ? ECL_T : ECL_NIL)) } cl_object @@ -198,19 +198,19 @@ cl_simple_vector_p(cl_object x) !ECL_ADJUSTABLE_ARRAY_P(x) && !ECL_ARRAY_HAS_FILL_POINTER_P(x) && Null(CAR(x->vector.displaced)) && - (cl_elttype)x->vector.elttype == ecl_aet_object) ? Ct : Cnil)) + (cl_elttype)x->vector.elttype == ecl_aet_object) ? ECL_T : ECL_NIL)) } cl_object cl_arrayp(cl_object x) { - @(return (ECL_ARRAYP(x) ? Ct : Cnil)) + @(return (ECL_ARRAYP(x) ? ECL_T : ECL_NIL)) } cl_object cl_packagep(cl_object x) { - @(return (ECL_PACKAGEP(x) ? Ct : Cnil)) + @(return (ECL_PACKAGEP(x) ? ECL_T : ECL_NIL)) } cl_object @@ -226,9 +226,9 @@ cl_functionp(cl_object x) || (t == t_instance && x->instance.isgf) #endif ) - output = Ct; + output = ECL_T; else - output = Cnil; + output = ECL_NIL; @(return output) } @@ -237,13 +237,13 @@ cl_compiled_function_p(cl_object x) { cl_type t = type_of(x); @(return ((t == t_bytecodes || t == t_bclosure || t == t_cfun - || t == t_cfunfixed || t == t_cclosure) ? Ct : Cnil)) + || t == t_cfunfixed || t == t_cclosure) ? ECL_T : ECL_NIL)) } cl_object cl_eq(cl_object x, cl_object y) { - @(return ((x == y) ? Ct : Cnil)) + @(return ((x == y) ? ECL_T : ECL_NIL)) } /* @@ -312,7 +312,7 @@ ecl_eql(cl_object x, cl_object y) cl_object cl_eql(cl_object x, cl_object y) { - @(return (ecl_eql(x, y) ? Ct : Cnil)) + @(return (ecl_eql(x, y) ? ECL_T : ECL_NIL)) } bool @@ -406,7 +406,7 @@ BEGIN: cl_object cl_equal(cl_object x, cl_object y) { - @(return (ecl_equal(x, y) ? Ct : Cnil)) + @(return (ecl_equal(x, y) ? ECL_T : ECL_NIL)) } bool @@ -531,11 +531,11 @@ BEGIN: cl_object cl_equalp(cl_object x, cl_object y) { - @(return (ecl_equalp(x, y) ? Ct : Cnil)) + @(return (ecl_equalp(x, y) ? ECL_T : ECL_NIL)) } cl_object si_fixnump(cl_object x) { - @(return (ECL_FIXNUMP(x) ? Ct : Cnil)) + @(return (ECL_FIXNUMP(x) ? ECL_T : ECL_NIL)) } diff --git a/src/c/print.d b/src/c/print.d index a44411a26..6e2fe5828 100644 --- a/src/c/print.d +++ b/src/c/print.d @@ -23,7 +23,7 @@ _ecl_stream_or_default_output(cl_object stream) { if (Null(stream)) return ecl_symbol_value(@'*standard-output*'); - else if (stream == Ct) + else if (stream == ECL_T) return ecl_symbol_value(@'*terminal-io*'); return stream; } @@ -46,12 +46,12 @@ ecl_print_level(void) { cl_object object = ecl_symbol_value(@'*print-level*'); cl_fixnum level; - if (object == Cnil) { + if (object == ECL_NIL) { level = MOST_POSITIVE_FIXNUM; } else if (ECL_FIXNUMP(object)) { level = ecl_fixnum(object); if (level < 0) { - ERROR: ECL_SETQ(ecl_process_env(), @'*print-level*', Cnil); + ERROR: ECL_SETQ(ecl_process_env(), @'*print-level*', ECL_NIL); FEerror("The value of *PRINT-LEVEL*~% ~S~%" "is not of the expected type (OR NULL (INTEGER 0 *))", 1, object); @@ -69,12 +69,12 @@ ecl_print_length(void) { cl_object object = ecl_symbol_value(@'*print-length*'); cl_fixnum length; - if (object == Cnil) { + if (object == ECL_NIL) { length = MOST_POSITIVE_FIXNUM; } else if (ECL_FIXNUMP(object)) { length = ecl_fixnum(object); unlikely_if (length < 0) { - ERROR: ECL_SETQ(ecl_process_env(), @'*print-length*', Cnil); + ERROR: ECL_SETQ(ecl_process_env(), @'*print-length*', ECL_NIL); FEerror("The value of *PRINT-LENGTH*~% ~S~%" "is not of the expected type (OR NULL (INTEGER 0 *))", 1, object); @@ -90,7 +90,7 @@ ecl_print_length(void) bool ecl_print_radix(void) { - return ecl_symbol_value(@'*print-radix*') != Cnil; + return ecl_symbol_value(@'*print-radix*') != ECL_NIL; } cl_object @@ -112,35 +112,35 @@ ecl_print_case(void) bool ecl_print_gensym(void) { - return ecl_symbol_value(@'*print-gensym*') != Cnil; + return ecl_symbol_value(@'*print-gensym*') != ECL_NIL; } bool ecl_print_array(void) { - return ecl_symbol_value(@'*print-array*') != Cnil; + return ecl_symbol_value(@'*print-array*') != ECL_NIL; } bool ecl_print_readably(void) { - return ecl_symbol_value(@'*print-readably*') != Cnil; + return ecl_symbol_value(@'*print-readably*') != ECL_NIL; } bool ecl_print_escape(void) { - return ecl_symbol_value(@'*print-escape*') != Cnil; + return ecl_symbol_value(@'*print-escape*') != ECL_NIL; } bool ecl_print_circle(void) { - return ecl_symbol_value(@'*print-circle*') != Cnil; + return ecl_symbol_value(@'*print-circle*') != ECL_NIL; } @(defun write (x - &key ((:stream strm) Cnil) + &key ((:stream strm) ECL_NIL) (array ecl_symbol_value(@'*print-array*')) (base ecl_symbol_value(@'*print-base*')) ((:case cas) ecl_symbol_value(@'*print-case*')) @@ -196,8 +196,8 @@ ecl_print_circle(void) @(defun pprint (obj &optional strm) @ strm = _ecl_stream_or_default_output(strm); - ecl_bds_bind(the_env, @'*print-escape*', Ct); - ecl_bds_bind(the_env, @'*print-pretty*', Ct); + ecl_bds_bind(the_env, @'*print-escape*', ECL_T); + ecl_bds_bind(the_env, @'*print-pretty*', ECL_T); ecl_write_char('\n', strm); si_write_object(obj, strm); ecl_force_output(strm); @@ -252,7 +252,7 @@ ecl_print_circle(void) @(defun terpri (&optional strm) @ ecl_terpri(strm); - @(return Cnil) + @(return ECL_NIL) @) @(defun fresh-line (&optional strm) @@ -264,10 +264,10 @@ ecl_print_circle(void) } #endif if (ecl_file_column(strm) == 0) - @(return Cnil) + @(return ECL_NIL) ecl_write_char('\n', strm); ecl_force_output(strm); - @(return Ct) + @(return ECL_T) @) @(defun finish-output (&o strm) @@ -279,21 +279,21 @@ ecl_print_circle(void) } #endif ecl_force_output(strm); - @(return Cnil) + @(return ECL_NIL) @) @(defun force-output (&o strm) @ strm = _ecl_stream_or_default_output(strm); ecl_force_output(strm); - @(return Cnil) + @(return ECL_NIL) @) @(defun clear-output (&o strm) @ strm = _ecl_stream_or_default_output(strm); ecl_clear_output(strm); - @(return Cnil) + @(return ECL_NIL) @) cl_object @@ -319,8 +319,8 @@ ecl_princ(cl_object obj, cl_object strm) { const cl_env_ptr the_env = ecl_process_env(); strm = _ecl_stream_or_default_output(strm); - ecl_bds_bind(the_env, @'*print-escape*', Cnil); - ecl_bds_bind(the_env, @'*print-readably*', Cnil); + ecl_bds_bind(the_env, @'*print-escape*', ECL_NIL); + ecl_bds_bind(the_env, @'*print-readably*', ECL_NIL); si_write_object(obj, strm); ecl_bds_unwind_n(the_env, 2); return obj; @@ -331,7 +331,7 @@ ecl_prin1(cl_object obj, cl_object strm) { const cl_env_ptr the_env = ecl_process_env(); strm = _ecl_stream_or_default_output(strm); - ecl_bds_bind(the_env, @'*print-escape*', Ct); + ecl_bds_bind(the_env, @'*print-escape*', ECL_T); si_write_object(obj, strm); ecl_force_output(strm); ecl_bds_unwind1(the_env); @@ -359,7 +359,7 @@ ecl_terpri(cl_object strm) #endif ecl_write_char('\n', strm); ecl_force_output(strm); - return(Cnil); + return(ECL_NIL); } void diff --git a/src/c/printer/float_string_old.d b/src/c/printer/float_string_old.d index 37a50a22e..5330040f9 100644 --- a/src/c/printer/float_string_old.d +++ b/src/c/printer/float_string_old.d @@ -121,10 +121,10 @@ float_string(cl_object digits_string, if (Null(digits_string)) { digits_string = si_make_vector(@'base-char', ecl_make_fixnum(10), - Ct /* adjustable */, + ECL_T /* adjustable */, ecl_make_fixnum(0) /* fill pointer */, - Cnil /* displacement */, - Cnil /* displ. offset */); + ECL_NIL /* displacement */, + ECL_NIL /* displ. offset */); } /* Represent fraction as r/s, error bounds as m+/s and m-/s. * Rational arithmetic avoids loss of precision in subsequent @@ -281,8 +281,8 @@ float_string(cl_object digits_string, @(return digits_string ecl_make_fixnum(1+digits) - ((decpnt == 0)? Ct : Cnil) - ((decpnt == digits)? Ct : Cnil) + ((decpnt == 0)? ECL_T : ECL_NIL) + ((decpnt == digits)? ECL_T : ECL_NIL) ecl_make_fixnum(decpnt)) } @@ -297,9 +297,9 @@ ecl_def_ct_base_string(str_dot,".",1,static,const); @':initial-element', ECL_CODE_CHAR('0')); ecl_char_set(s, 0, '.'); - @(return s cl_length(s) Ct cl_zerop(fdigits) ecl_make_fixnum(0)); + @(return s cl_length(s) ECL_T cl_zerop(fdigits) ecl_make_fixnum(0)); } else { - @(return str_dot ecl_make_fixnum(1) Ct Ct ecl_make_fixnum(0)); + @(return str_dot ecl_make_fixnum(1) ECL_T ECL_T ecl_make_fixnum(0)); } } else { cl_object sig = cl_integer_decode_float(x); @@ -307,7 +307,7 @@ ecl_def_ct_base_string(str_dot,".",1,static,const); cl_object precision = cl_float_precision(x); cl_object digits = cl_float_digits(x); cl_object fudge = ecl_minus(digits, precision); - cl_object w = Null(width)? Cnil : cl_max(2, width, ecl_make_fixnum(1)); + cl_object w = Null(width)? ECL_NIL : cl_max(2, width, ecl_make_fixnum(1)); return float_string(string, cl_ash(sig, ecl_negate(fudge)), ecl_plus(exp, fudge), precision, w, fdigits, scale, fmin); diff --git a/src/c/printer/float_to_digits.d b/src/c/printer/float_to_digits.d index 370de257b..8cb07571c 100644 --- a/src/c/printer/float_to_digits.d +++ b/src/c/printer/float_to_digits.d @@ -210,10 +210,10 @@ si_float_to_digits(cl_object digits, cl_object number, cl_object position, k = scale(approx); if (Null(digits)) digits = si_make_vector(@'base-char', ecl_make_fixnum(10), - Ct /* adjustable */, + ECL_T /* adjustable */, ecl_make_fixnum(0) /* fill pointer */, - Cnil /* displacement */, - Cnil /* displ. offset */); + ECL_NIL /* displacement */, + ECL_NIL /* displ. offset */); generate(digits, approx); @(return ecl_make_fixnum(k) digits) } diff --git a/src/c/printer/float_to_string.d b/src/c/printer/float_to_string.d index a00b21685..294e423b8 100644 --- a/src/c/printer/float_to_string.d +++ b/src/c/printer/float_to_string.d @@ -20,10 +20,10 @@ _ecl_ensure_buffer(cl_object buffer, cl_fixnum length) { if (Null(buffer)) { buffer = si_make_vector(@'base-char', ecl_make_fixnum(length), - Ct /* adjustable */, + ECL_T /* adjustable */, ecl_make_fixnum(0) /* fill pointer */, - Cnil /* displacement */, - Cnil /* displ. offset */); + ECL_NIL /* displacement */, + ECL_NIL /* displ. offset */); } return buffer; } @@ -82,7 +82,7 @@ print_float_exponent(cl_object buffer, cl_object number, cl_fixnum exp) if (e != 'e' || exp != 0) { ecl_string_push_extend(buffer, e); si_integer_to_string(buffer, ecl_make_fixnum(exp), ecl_make_fixnum(10), - Cnil, Cnil); + ECL_NIL, ECL_NIL); } } @@ -101,7 +101,7 @@ si_float_to_string_free(cl_object buffer_or_nil, cl_object number, @(return push_base_string(buffer_or_nil, s)); } base = ecl_length(buffer_or_nil); - exp = si_float_to_digits(buffer_or_nil, number, Cnil, Cnil); + exp = si_float_to_digits(buffer_or_nil, number, ECL_NIL, ECL_NIL); buffer = VALUES(1); e = ecl_fixnum(exp); diff --git a/src/c/printer/integer_to_string.d b/src/c/printer/integer_to_string.d index 143347834..072a83fad 100644 --- a/src/c/printer/integer_to_string.d +++ b/src/c/printer/integer_to_string.d @@ -72,7 +72,7 @@ si_integer_to_string(cl_object buffer, cl_object integer, buffer = _ecl_ensure_buffer(buffer, 10); write_base_prefix(buffer, ecl_fixnum(base)); } - buffer = si_integer_to_string(buffer, integer, base, Cnil, Cnil); + buffer = si_integer_to_string(buffer, integer, base, ECL_NIL, ECL_NIL); if (!Null(decimalp) && base == ecl_make_fixnum(10)) { _ecl_string_push_c_string(buffer, "."); } diff --git a/src/c/printer/print_unreadable.d b/src/c/printer/print_unreadable.d index c9e34c98f..ac81d1bcd 100644 --- a/src/c/printer/print_unreadable.d +++ b/src/c/printer/print_unreadable.d @@ -78,5 +78,5 @@ si_print_unreadable_object_function(cl_object o, cl_object stream, cl_object typ } ecl_write_char('>', stream); } - @(return Cnil) + @(return ECL_NIL) } diff --git a/src/c/printer/write_array.d b/src/c/printer/write_array.d index f655ae509..268958587 100644 --- a/src/c/printer/write_array.d +++ b/src/c/printer/write_array.d @@ -66,7 +66,7 @@ write_array_inner(bool vector, cl_object x, cl_object stream) } ecl_write_char(')', stream); } else { - si_write_object(Cnil, stream); + si_write_object(ECL_NIL, stream); } ecl_write_char(' ', stream); } else if (!vector) { diff --git a/src/c/printer/write_code.d b/src/c/printer/write_code.d index 6818f8f50..74080219a 100644 --- a/src/c/printer/write_code.d +++ b/src/c/printer/write_code.d @@ -24,13 +24,13 @@ _ecl_write_bytecodes(cl_object x, cl_object stream) { if (ecl_print_readably()) { cl_index i; - cl_object lex = Cnil; - cl_object code_l=Cnil; + cl_object lex = ECL_NIL; + cl_object code_l=ECL_NIL; for ( i=x->bytecodes.code_size-1 ; i<(cl_index)(-1l) ; i-- ) code_l = ecl_cons(ecl_make_fixnum(((cl_opcode*)(x->bytecodes.code))[i]), code_l); writestr_stream("#Y", stream); si_write_ugly_object(cl_list(7, x->bytecodes.name, lex, - Cnil /* x->bytecodes.definition */, + ECL_NIL /* x->bytecodes.definition */, code_l, x->bytecodes.data, x->bytecodes.file, x->bytecodes.file_position), @@ -38,7 +38,7 @@ _ecl_write_bytecodes(cl_object x, cl_object stream) } else { cl_object name = x->bytecodes.name; writestr_stream("#bytecodes.name; writestr_stream("#sse.elttype; cl_object mode = ecl_symbol_value(@'ext::*sse-pack-print-mode*'); - if (mode != Cnil) { + if (mode != ECL_NIL) { if (mode == @':float') etype = ecl_aet_sf; else if (mode == @':double') etype = ecl_aet_df; else etype = ecl_aet_b8; @@ -78,9 +78,9 @@ write_sse_pack(cl_object x, cl_object stream) ecl_string_push_extend(buffer, ' '); if (i%4 == 0) ecl_string_push_extend(buffer, ' '); si_integer_to_string(buffer, ecl_make_fixnum(x->sse.data.b8[i]), - ecl_make_fixnum(16), Cnil, Cnil); + ecl_make_fixnum(16), ECL_NIL, ECL_NIL); } - si_do_write_sequence(buffer, stream, ecl_make_fixnum(0), Cnil); + si_do_write_sequence(buffer, stream, ecl_make_fixnum(0), ECL_NIL); si_put_buffer_string(buffer); break; } diff --git a/src/c/printer/write_symbol.d b/src/c/printer/write_symbol.d index 903103f39..50a2ca89d 100644 --- a/src/c/printer/write_symbol.d +++ b/src/c/printer/write_symbol.d @@ -166,8 +166,8 @@ _ecl_write_symbol(cl_object x, cl_object stream) bool forced_package = 0; if (Null(x)) { - package = Cnil_symbol->symbol.hpack; - name = Cnil_symbol->symbol.name; + package = ECL_NIL_SYMBOL->symbol.hpack; + name = ECL_NIL_SYMBOL->symbol.name; } else { package = x->symbol.hpack; name = x->symbol.name; diff --git a/src/c/printer/write_ugly.d b/src/c/printer/write_ugly.d index 39fafb95d..2355651c2 100644 --- a/src/c/printer/write_ugly.d +++ b/src/c/printer/write_ugly.d @@ -36,7 +36,7 @@ write_readable_pathname(cl_object path, cl_object stream) @':name', path->pathname.name, @':type', path->pathname.type, @':version', path->pathname.version, - @':defaults', Cnil); + @':defaults', ECL_NIL); writestr_stream("#.", stream); si_write_object(l, stream); } @@ -46,13 +46,13 @@ write_pathname(cl_object path, cl_object stream) { cl_object namestring = ecl_namestring(path, 0); bool readably = ecl_print_readably(); - if (namestring == Cnil) { + if (namestring == ECL_NIL) { if (readably) { write_readable_pathname(path, stream); return; } namestring = ecl_namestring(path, 1); - if (namestring == Cnil) { + if (namestring == ECL_NIL) { writestr_stream("#", stream); return; } @@ -70,8 +70,8 @@ write_integer(cl_object number, cl_object stream) si_integer_to_string(s, number, ecl_make_fixnum(print_base), ecl_symbol_value(@'*print-radix*'), - Ct /* decimal syntax */); - si_do_write_sequence(s, stream, ecl_make_fixnum(0), Cnil); + ECL_T /* decimal syntax */); + si_do_write_sequence(s, stream, ecl_make_fixnum(0), ECL_NIL); si_put_buffer_string(s); } @@ -79,8 +79,8 @@ void _ecl_write_fixnum(cl_fixnum i, cl_object stream) { cl_object s = si_get_buffer_string(); - si_integer_to_string(s, ecl_make_fixnum(i), ecl_make_fixnum(10), Cnil, Cnil); - si_do_write_sequence(s, stream, ecl_make_fixnum(0), Cnil); + si_integer_to_string(s, ecl_make_fixnum(i), ecl_make_fixnum(10), ECL_NIL, ECL_NIL); + si_do_write_sequence(s, stream, ecl_make_fixnum(0), ECL_NIL); si_put_buffer_string(s); } @@ -91,12 +91,12 @@ write_ratio(cl_object r, cl_object stream) int print_base = ecl_print_base(); si_integer_to_string(s, r->ratio.num, ecl_make_fixnum(print_base), ecl_symbol_value(@'*print-radix*'), - Cnil /* decimal syntax */); + ECL_NIL /* decimal syntax */); ecl_string_push_extend(s, '/'); si_integer_to_string(s, r->ratio.den, ecl_make_fixnum(print_base), - Cnil, Cnil); - si_do_write_sequence(s, stream, ecl_make_fixnum(0), Cnil); + ECL_NIL, ECL_NIL); + si_do_write_sequence(s, stream, ecl_make_fixnum(0), ECL_NIL); si_put_buffer_string(s); } @@ -115,7 +115,7 @@ write_float(cl_object f, cl_object stream) { cl_object s = si_get_buffer_string(); s = si_float_to_string_free(s, f, ecl_make_fixnum(-3), ecl_make_fixnum(8)); - si_do_write_sequence(s, stream, ecl_make_fixnum(0), Cnil); + si_do_write_sequence(s, stream, ecl_make_fixnum(0), ECL_NIL); si_put_buffer_string(s); } @@ -161,7 +161,7 @@ write_hashtable(cl_object x, cl_object stream) writestr_stream("#.", stream); si_write_ugly_object(init, stream); } else { - _ecl_write_unreadable(x, "hash-table", Cnil, stream); + _ecl_write_unreadable(x, "hash-table", ECL_NIL, stream); } } @@ -172,7 +172,7 @@ write_random(cl_object x, cl_object stream) writestr_stream("#$", stream); _ecl_write_vector(x->random.value, stream); } else { - _ecl_write_unreadable(x->random.value, "random-state", Cnil, stream); + _ecl_write_unreadable(x->random.value, "random-state", ECL_NIL, stream); } } @@ -240,19 +240,19 @@ write_stream(cl_object x, cl_object stream) break; case ecl_smm_broadcast: prefix = "closed broadcast stream"; - tag = Cnil; + tag = ECL_NIL; break; case ecl_smm_concatenated: prefix = "closed concatenated stream"; - tag = Cnil; + tag = ECL_NIL; break; case ecl_smm_two_way: prefix = "closed two-way stream"; - tag = Cnil; + tag = ECL_NIL; break; case ecl_smm_echo: prefix = "closed echo stream"; - tag = Cnil; + tag = ECL_NIL; break; case ecl_smm_string_input: { cl_object text = x->stream.object0; @@ -281,15 +281,15 @@ write_stream(cl_object x, cl_object stream) } case ecl_smm_string_output: prefix = "closed string-output stream"; - tag = Cnil; + tag = ECL_NIL; break; case ecl_smm_sequence_input: prefix = "closed sequence-input stream"; - tag = Cnil; + tag = ECL_NIL; break; case ecl_smm_sequence_output: prefix = "closed sequence-output stream"; - tag = Cnil; + tag = ECL_NIL; break; default: ecl_internal_error("illegal stream mode"); @@ -331,7 +331,7 @@ write_structure(cl_object x, cl_object stream) static void write_readtable(cl_object x, cl_object stream) { - _ecl_write_unreadable(x, "readtable", Cnil, stream); + _ecl_write_unreadable(x, "readtable", ECL_NIL, stream); } static void @@ -349,7 +349,7 @@ write_codeblock(cl_object x, cl_object stream) static void write_cclosure(cl_object x, cl_object stream) { - _ecl_write_unreadable(x, "compiled-closure", Cnil, stream); + _ecl_write_unreadable(x, "compiled-closure", ECL_NIL, stream); } static void @@ -367,7 +367,7 @@ write_frame(cl_object x, cl_object stream) static void write_weak_pointer(cl_object x, cl_object stream) { - _ecl_write_unreadable(x, "weak-pointer", Cnil, stream); + _ecl_write_unreadable(x, "weak-pointer", ECL_NIL, stream); } #ifdef ECL_THREADS @@ -388,25 +388,25 @@ write_lock(cl_object x, cl_object stream) static void write_condition_variable(cl_object x, cl_object stream) { - _ecl_write_unreadable(x, "semaphore", Cnil, stream); + _ecl_write_unreadable(x, "semaphore", ECL_NIL, stream); } static void write_semaphore(cl_object x, cl_object stream) { - _ecl_write_unreadable(x, "semaphore", Cnil, stream); + _ecl_write_unreadable(x, "semaphore", ECL_NIL, stream); } static void write_barrier(cl_object x, cl_object stream) { - _ecl_write_unreadable(x, "barrier", Cnil, stream); + _ecl_write_unreadable(x, "barrier", ECL_NIL, stream); } static void write_mailbox(cl_object x, cl_object stream) { - _ecl_write_unreadable(x, "mailbox", Cnil, stream); + _ecl_write_unreadable(x, "mailbox", ECL_NIL, stream); } #endif /* ECL_THREADS */ @@ -414,7 +414,7 @@ write_mailbox(cl_object x, cl_object stream) static void write_illegal(cl_object x, cl_object stream) { - _ecl_write_unreadable(x, "illegal pointer", Cnil, stream); + _ecl_write_unreadable(x, "illegal pointer", ECL_NIL, stream); } typedef void (*printer)(cl_object x, cl_object stream); diff --git a/src/c/read.d b/src/c/read.d index 5a1f06648..54b4c4315 100644 --- a/src/c/read.d +++ b/src/c/read.d @@ -31,7 +31,7 @@ static cl_object dispatch_macro_character(cl_object table, cl_object strm, int c); -#define read_suppress (ecl_symbol_value(@'*read-suppress*') != Cnil) +#define read_suppress (ecl_symbol_value(@'*read-suppress*') != ECL_NIL) #ifdef ECL_UNICODE # define TOKEN_STRING_DIM(s) ((s)->string.dim) @@ -56,7 +56,7 @@ si_get_buffer_string() const cl_env_ptr env = ecl_process_env(); cl_object pool = env->string_pool; cl_object output; - if (pool == Cnil) { + if (pool == ECL_NIL) { #ifdef ECL_UNICODE output = ecl_alloc_adjustable_extended_string(ECL_BUFFER_STRING_SIZE); #else @@ -73,11 +73,11 @@ si_get_buffer_string() cl_object si_put_buffer_string(cl_object string) { - if (string != Cnil) { + if (string != ECL_NIL) { const cl_env_ptr env = ecl_process_env(); cl_object pool = env->string_pool; cl_index l = 0; - if (pool != Cnil) { + if (pool != ECL_NIL) { /* We store the size of the pool in the string index */ l = TOKEN_STRING_FILLP(ECL_CONS_CAR(pool)); } @@ -113,7 +113,7 @@ ecl_read_object_non_recursive(cl_object in) cl_object x; const cl_env_ptr env = ecl_process_env(); - ecl_bds_bind(env, @'si::*sharp-eq-context*', Cnil); + ecl_bds_bind(env, @'si::*sharp-eq-context*', ECL_NIL); ecl_bds_bind(env, @'si::*backq-level*', ecl_make_fixnum(0)); x = ecl_read_object(in); if (!Null(ECL_SYM_VAL(env, @'si::*sharp-eq-context*'))) @@ -135,7 +135,7 @@ invert_buffer_case(cl_object x, cl_object escape_list, int sign) cl_fixnum high_limit, low_limit; cl_fixnum i = TOKEN_STRING_FILLP(x); do { - if (escape_list != Cnil) { + if (escape_list != ECL_NIL) { cl_object escape_interval = CAR(escape_list); high_limit = ecl_fixnum(CAR(escape_interval)); low_limit = ecl_fixnum(CDR(escape_interval)); @@ -202,7 +202,7 @@ BEGIN: } if (the_env->nvalues == 0) { if (flags == ECL_READ_RETURN_IGNORABLE) - return Cnil; + return ECL_NIL; goto BEGIN; } unlikely_if (the_env->nvalues > 1) { @@ -212,7 +212,7 @@ BEGIN: return o; } LOOP: - p = escape_list = Cnil; + p = escape_list = ECL_NIL; upcase = count = length = 0; external_symbol = colon = 0; token = si_get_buffer_string(); @@ -260,7 +260,7 @@ LOOP: } TOKEN_STRING_FILLP(token) = length = 0; upcase = count = colon = 0; - escape_list = Cnil; + escape_list = ECL_NIL; } if (a == cat_single_escape) { c = ecl_read_char_noeof(in); @@ -270,7 +270,7 @@ LOOP: ecl_make_fixnum(length)), escape_list); } else { - escape_list = Ct; + escape_list = ECL_T; } ecl_string_push_extend(token, c); length++; @@ -294,7 +294,7 @@ LOOP: ecl_make_fixnum(length-1)), escape_list); } else { - escape_list = Ct; + escape_list = ECL_T; } goto NEXT; } @@ -329,13 +329,13 @@ LOOP: } if (suppress) { - x = Cnil; + x = ECL_NIL; goto OUTPUT; } /* If there are some escaped characters, it must be a symbol */ - if ((flags == ECL_READ_ONLY_TOKEN) || p != Cnil || - escape_list != Cnil || length == 0) + if ((flags == ECL_READ_ONLY_TOKEN) || p != ECL_NIL || + escape_list != ECL_NIL || length == 0) goto SYMBOL; /* The case in which the buffer is full of dots has to be especial cased */ @@ -355,7 +355,7 @@ LOOP: if ((base <= 10) && ecl_alpha_char_p(TOKEN_STRING_CHAR(token,0))) goto SYMBOL; x = ecl_parse_number(token, 0, TOKEN_STRING_FILLP(token), &i, base); - unlikely_if (x == Cnil) + unlikely_if (x == ECL_NIL) FEreader_error("Syntax error when reading number.~%Offending string: ~S.", in, 1, token); if (x != OBJNULL && length == i) @@ -381,7 +381,7 @@ LOOP: 2, cl_copy_seq(token), p); } } else { - if (p == Cnil) { + if (p == ECL_NIL) { p = ecl_current_package(); } /* INV: cl_make_symbol() copies the string */ @@ -409,7 +409,7 @@ si_read_object_or_ignore(cl_object in, cl_object eof) cl_object x; const cl_env_ptr env = ecl_process_env(); - ecl_bds_bind(env, @'si::*sharp-eq-context*', Cnil); + ecl_bds_bind(env, @'si::*sharp-eq-context*', ECL_NIL); ecl_bds_bind(env, @'si::*backq-level*', ecl_make_fixnum(0)); x = ecl_read_object_with_delimiter(in, EOF, ECL_READ_RETURN_IGNORABLE, cat_constituent); @@ -451,7 +451,7 @@ cl_object comma_reader(cl_object in, cl_object c) unlikely_if (backq_level <= 0) FEreader_error("A comma has appeared out of a backquote.", in, 0); /* Read character & complain at EOF */ - c = cl_peek_char(2,Cnil,in); + c = cl_peek_char(2,ECL_NIL,in); if (c == ECL_CODE_CHAR('@@')) { x = @'si::unquote-splice'; ecl_read_char(in); @@ -476,7 +476,7 @@ cl_object backquote_reader(cl_object in, cl_object c) in = ecl_read_object(in); ECL_SETQ(the_env, @'si::*backq-level*', ecl_make_fixnum(backq_level)); #if 0 - @(return cl_macroexpand_1(2, cl_list(2, @'si::quasiquote', in), Cnil)); + @(return cl_macroexpand_1(2, cl_list(2, @'si::quasiquote', in), ECL_NIL)); #else @(return cl_list(2,@'si::quasiquote',in)) #endif @@ -513,7 +513,7 @@ read_constituent(cl_object in) } not_first = 1; } while(1); - return (read_suppress)? Cnil : token; + return (read_suppress)? ECL_NIL : token; } static cl_object @@ -570,11 +570,11 @@ dispatch_macro_character(cl_object table, cl_object in, int c) } while (d >= 0); arg = ecl_make_fixnum(i); } else { - arg = Cnil; + arg = ECL_NIL; } { cl_object dc = ECL_CODE_CHAR(c); - cl_object fun = ecl_gethash_safe(dc, table, Cnil); + cl_object fun = ecl_gethash_safe(dc, table, ECL_NIL); unlikely_if (Null(fun)) { FEreader_error("No dispatch function defined " "for character ~S", @@ -622,13 +622,13 @@ sharp_C_reader(cl_object in, cl_object c, cl_object d) const cl_env_ptr the_env = ecl_process_env(); cl_object x, real, imag; - if (d != Cnil && !read_suppress) + if (d != ECL_NIL && !read_suppress) extra_argument('C', in, d); x = ecl_read_object(in); unlikely_if (x == OBJNULL) FEend_of_file(in); if (read_suppress) - @(return Cnil); + @(return ECL_NIL); unlikely_if (!ECL_CONSP(x) || ecl_length(x) != 2) FEreader_error("Reader macro #C should be followed by a list", in, 0); @@ -654,15 +654,15 @@ sharp_backslash_reader(cl_object in, cl_object c, cl_object d) { const cl_env_ptr the_env = ecl_process_env(); cl_object token; - if (d != Cnil && !read_suppress) { + if (d != ECL_NIL && !read_suppress) { unlikely_if (!ECL_FIXNUMP(d) || d != ecl_make_fixnum(0)) { FEreader_error("~S is an illegal CHAR-FONT.", in, 1, d); } } token = ecl_read_object_with_delimiter(in, EOF, ECL_READ_ONLY_TOKEN, cat_single_escape); - if (token == Cnil) { - c = Cnil; + if (token == ECL_NIL) { + c = ECL_NIL; } else if (TOKEN_STRING_FILLP(token) == 1) { c = ECL_CODE_CHAR(TOKEN_STRING_CHAR(token,0)); } else if (TOKEN_STRING_FILLP(token) == 2 && TOKEN_STRING_CHAR_CMP(token,0,'^')) { @@ -683,13 +683,13 @@ static cl_object sharp_single_quote_reader(cl_object in, cl_object c, cl_object d) { bool suppress = read_suppress; - if(d != Cnil && !suppress) + if(d != ECL_NIL && !suppress) extra_argument('\'', in, d); c = ecl_read_object(in); unlikely_if (c == OBJNULL) { FEend_of_file(in); } else if (suppress) { - c = Cnil; + c = ECL_NIL; } else { c = cl_list(2, @'function', c); } @@ -702,14 +702,14 @@ sharp_Y_reader(cl_object in, cl_object c, cl_object d) cl_index i; cl_object x, rv, nth, lex; - if (d != Cnil && !read_suppress) + if (d != ECL_NIL && !read_suppress) extra_argument('C', in, d); x = ecl_read_object(in); unlikely_if (x == OBJNULL) { FEend_of_file(in); } if (read_suppress) { - @(return Cnil); + @(return ECL_NIL); } unlikely_if (!ECL_CONSP(x) || ecl_length(x) < 5) { FEreader_error("Reader macro #Y should be followed by a list", @@ -748,7 +748,7 @@ sharp_Y_reader(cl_object in, cl_object c, cl_object d) rv->bytecodes.data = nth; if (ECL_ATOM(x)) { - nth = Cnil; + nth = ECL_NIL; } else { nth = ECL_CONS_CAR(x); x = ECL_CONS_CDR(x); @@ -807,7 +807,7 @@ sharp_left_parenthesis_reader(cl_object in, cl_object c, cl_object d) } else if (read_suppress) { /* Second case: *read-suppress* = t, we ignore the data */ do_read_delimited_list(')', in, 1); - v = Cnil; + v = ECL_NIL; } else if (Null(d)) { /* Third case: no dimension provided. Read a list and coerce it to vector. */ @@ -825,7 +825,7 @@ sharp_left_parenthesis_reader(cl_object in, cl_object c, cl_object d) FEreader_error("Invalid dimension size ~D in #()", in, 1, d); } v = ecl_alloc_simple_vector(dim, ecl_aet_object); - for (i = 0, last = Cnil;; i++) { + for (i = 0, last = ECL_NIL;; i++) { cl_object aux = ecl_read_object_with_delimiter(in, ')', 0, cat_constituent); if (aux == OBJNULL) @@ -856,7 +856,7 @@ sharp_asterisk_reader(cl_object in, cl_object c, cl_object d) if (read_suppress) { read_constituent(in); - @(return Cnil) + @(return ECL_NIL) } for (dimcount = 0 ;; dimcount++) { int x = ecl_read_char(in); @@ -911,7 +911,7 @@ sharp_colon_reader(cl_object in, cl_object ch, cl_object d) int c; cl_object output, token; - if (d != Cnil && !read_suppress) + if (d != ECL_NIL && !read_suppress) extra_argument(':', in, d); c = ecl_read_char_noeof(in); a = ecl_readtable_get(rtbl, c, NULL); @@ -952,7 +952,7 @@ sharp_colon_reader(cl_object in, cl_object ch, cl_object d) M: if (read_suppress) { - output = Cnil; + output = ECL_NIL; } else { output = cl_make_symbol(token); } @@ -963,14 +963,14 @@ M: static cl_object sharp_dot_reader(cl_object in, cl_object c, cl_object d) { - if (d != Cnil && !read_suppress) + if (d != ECL_NIL && !read_suppress) extra_argument('.', in, d); c = ecl_read_object(in); unlikely_if (c == OBJNULL) FEend_of_file(in); if (read_suppress) - @(return Cnil); - unlikely_if (ecl_symbol_value(@'*read-eval*') == Cnil) + @(return ECL_NIL); + unlikely_if (ecl_symbol_value(@'*read-eval*') == ECL_NIL) FEreader_error("Cannot evaluate the form #.~A", in, 1, c); /* FIXME! We should do something here to ensure that the #. * only uses the #n# that have been defined */ @@ -985,17 +985,17 @@ read_number(cl_object in, int radix, cl_object macro_char) cl_index i; cl_object x; cl_object token = read_constituent(in); - if (token == Cnil) { - x = Cnil; + if (token == ECL_NIL) { + x = ECL_NIL; } else { x = ecl_parse_number(token, 0, TOKEN_STRING_FILLP(token), &i, radix); - unlikely_if (x == OBJNULL || x == Cnil || + unlikely_if (x == OBJNULL || x == ECL_NIL || i != TOKEN_STRING_FILLP(token)) { FEreader_error("Cannot parse the #~A readmacro.", in, 1, macro_char); } - unlikely_if (cl_rationalp(x) == Cnil) { + unlikely_if (cl_rationalp(x) == ECL_NIL) { FEreader_error("The float ~S appeared after the #~A readmacro.", in, 2, x, macro_char); } @@ -1007,7 +1007,7 @@ read_number(cl_object in, int radix, cl_object macro_char) static cl_object sharp_B_reader(cl_object in, cl_object c, cl_object d) { - if(d != Cnil && !read_suppress) + if(d != ECL_NIL && !read_suppress) extra_argument('B', in, d); @(return (read_number(in, 2, ECL_CODE_CHAR('B')))) } @@ -1015,7 +1015,7 @@ sharp_B_reader(cl_object in, cl_object c, cl_object d) static cl_object sharp_O_reader(cl_object in, cl_object c, cl_object d) { - if(d != Cnil && !read_suppress) + if(d != ECL_NIL && !read_suppress) extra_argument('O', in, d); @(return (read_number(in, 8, ECL_CODE_CHAR('O')))) } @@ -1023,7 +1023,7 @@ sharp_O_reader(cl_object in, cl_object c, cl_object d) static cl_object sharp_X_reader(cl_object in, cl_object c, cl_object d) { - if(d != Cnil && !read_suppress) + if(d != ECL_NIL && !read_suppress) extra_argument('X', in, d); @(return (read_number(in, 16, ECL_CODE_CHAR('X')))) } @@ -1059,10 +1059,10 @@ sharp_eq_reader(cl_object in, cl_object c, cl_object d) unlikely_if (Null(d)) { FEreader_error("The #= readmacro requires an argument.", in, 0); } - unlikely_if (ecl_assq(d, sharp_eq_context) != Cnil) { + unlikely_if (ecl_assq(d, sharp_eq_context) != ECL_NIL) { FEreader_error("Duplicate definitions for #~D=.", in, 1, d); } - pair = CONS(d, Cnil); + pair = CONS(d, ECL_NIL); ECL_SETQ(the_env, @'si::*sharp-eq-context*', CONS(pair, sharp_eq_context)); value = ecl_read_object(in); unlikely_if (value == pair) { @@ -1079,12 +1079,12 @@ sharp_sharp_reader(cl_object in, cl_object c, cl_object d) cl_object pair; if (read_suppress) - @(return Cnil); + @(return ECL_NIL); unlikely_if (Null(d)) { FEreader_error("The ## readmacro requires an argument.", in, 0); } pair = ecl_assq(d, ECL_SYM_VAL(the_env, @'si::*sharp-eq-context*')); - unlikely_if (pair == Cnil) { + unlikely_if (pair == ECL_NIL) { FEreader_error("#~D# is undefined.", in, 1, d); } @(return pair) @@ -1284,7 +1284,7 @@ sharp_vertical_bar_reader(cl_object in, cl_object ch, cl_object d) int c; int level = 0; - if (d != Cnil && !read_suppress) + if (d != ECL_NIL && !read_suppress) extra_argument('|', in, d); for (;;) { c = ecl_read_char_noeof(in); @@ -1321,13 +1321,13 @@ static cl_object sharp_P_reader(cl_object in, cl_object c, cl_object d) { bool suppress = read_suppress; - if (d != Cnil && !suppress) + if (d != ECL_NIL && !suppress) extra_argument('P', in, d); d = ecl_read_object(in); if (suppress) { - d = Cnil; + d = ECL_NIL; } else { - d = cl_parse_namestring(3, d, Cnil, Cnil); + d = cl_parse_namestring(3, d, ECL_NIL, ECL_NIL); } @(return d) } @@ -1340,7 +1340,7 @@ static cl_object sharp_dollar_reader(cl_object in, cl_object c, cl_object d) { cl_object rs; - if (d != Cnil && !read_suppress) + if (d != ECL_NIL && !read_suppress) extra_argument('$', in, d); c = ecl_read_object(in); rs = ecl_alloc_object(t_random); @@ -1393,7 +1393,7 @@ ecl_copy_readtable(cl_object from, cl_object to) if (!Null(from->readtable.hash)) { output->readtable.hash = si_copy_hash_table(from->readtable.hash); } else { - output->readtable.hash = Cnil; + output->readtable.hash = ECL_NIL; } #endif if (!Null(to)) { @@ -1468,12 +1468,12 @@ stream_or_default_input(cl_object stream) const cl_env_ptr the_env = ecl_process_env(); if (Null(stream)) return ECL_SYM_VAL(the_env, @'*standard-input*'); - if (stream == Ct) + if (stream == ECL_T) return ECL_SYM_VAL(the_env, @'*terminal-io*'); return stream; } -@(defun read (&optional (strm Cnil) (eof_errorp Ct) eof_value recursivep) +@(defun read (&optional (strm ECL_NIL) (eof_errorp ECL_T) eof_value recursivep) cl_object x; @ strm = stream_or_default_input(strm); @@ -1499,8 +1499,8 @@ stream_or_default_input(cl_object stream) @) @(defun read_preserving_whitespace - (&optional (strm Cnil) - (eof_errorp Ct) + (&optional (strm ECL_NIL) + (eof_errorp ECL_T) eof_value recursivep) cl_object x; @@ -1524,7 +1524,7 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) { int after_dot = 0; bool suppress = read_suppress; - cl_object x, y = Cnil; + cl_object x, y = ECL_NIL; cl_object *p = &y; do { x = ecl_read_object_with_delimiter(in, d, 0, cat_constituent); @@ -1561,7 +1561,7 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) } while (1); } -@(defun read_delimited_list (d &optional (strm Cnil) recursivep) +@(defun read_delimited_list (d &optional (strm ECL_NIL) recursivep) cl_object l; int delimiter; @ @@ -1570,7 +1570,7 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) if (!Null(recursivep)) { l = do_read_delimited_list(delimiter, strm, 1); } else { - ecl_bds_bind(the_env, @'si::*sharp-eq-context*', Cnil); + ecl_bds_bind(the_env, @'si::*sharp-eq-context*', ECL_NIL); ecl_bds_bind(the_env, @'si::*backq-level*', ecl_make_fixnum(0)); l = do_read_delimited_list(delimiter, strm, 1); if (!Null(ECL_SYM_VAL(the_env, @'si::*sharp-eq-context*'))) @@ -1580,7 +1580,7 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) @(return l) @) -@(defun read_line (&optional (strm Cnil) (eof_errorp Ct) eof_value recursivep) +@(defun read_line (&optional (strm ECL_NIL) (eof_errorp ECL_T) eof_value recursivep) int c; cl_object token, value0, value1; @ @@ -1593,7 +1593,7 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) if (!Null(eof_errorp)) FEend_of_file(strm); value0 = eof_value; - value1 = Ct; + value1 = ECL_T; } goto OUTPUT; } @@ -1609,7 +1609,7 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) if (!Null(eof_errorp)) FEend_of_file(strm); value0 = eof_value; - value1 = Ct; + value1 = ECL_T; } else { #ifdef ECL_NEWLINE_IS_CRLF /* From \r\n, ignore \r */ if (TOKEN_STRING_FILLP(token) > 0 && @@ -1620,14 +1620,14 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) ecl_read_char(strm); #endif value0 = cl_copy_seq(token); - value1 = (c == EOF? Ct : Cnil); + value1 = (c == EOF? ECL_T : ECL_NIL); } si_put_buffer_string(token); OUTPUT: @(return value0 value1) @) -@(defun read-char (&optional (strm Cnil) (eof_errorp Ct) eof_value recursivep) +@(defun read-char (&optional (strm ECL_NIL) (eof_errorp ECL_T) eof_value recursivep) int c; cl_object output; @ @@ -1642,22 +1642,22 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) @(return output) @) -@(defun unread_char (c &optional (strm Cnil)) +@(defun unread_char (c &optional (strm ECL_NIL)) @ /* INV: unread_char() checks the type `c' */ strm = stream_or_default_input(strm); ecl_unread_char(ecl_char_code(c), strm); - @(return Cnil) + @(return ECL_NIL) @) -@(defun peek-char (&optional peek_type (strm Cnil) (eof_errorp Ct) eof_value recursivep) +@(defun peek-char (&optional peek_type (strm ECL_NIL) (eof_errorp ECL_T) eof_value recursivep) int c; cl_object rtbl = ecl_current_readtable(); @ strm = stream_or_default_input(strm); c = ecl_peek_char(strm); if (c != EOF && !Null(peek_type)) { - if (peek_type == Ct) { + if (peek_type == ECL_T) { do { /* If the character is not a whitespace, output */ if (ecl_readtable_get(rtbl, c, NULL) != cat_whitespace) @@ -1688,13 +1688,13 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) @(return eof_value) @) -@(defun listen (&optional (strm Cnil)) +@(defun listen (&optional (strm ECL_NIL)) @ strm = stream_or_default_input(strm); - @(return ((ecl_listen_stream(strm) == ECL_LISTEN_AVAILABLE)? Ct : Cnil)) + @(return ((ecl_listen_stream(strm) == ECL_LISTEN_AVAILABLE)? ECL_T : ECL_NIL)) @) -@(defun read_char_no_hang (&optional (strm Cnil) (eof_errorp Ct) eof_value recursivep) +@(defun read_char_no_hang (&optional (strm ECL_NIL) (eof_errorp ECL_T) eof_value recursivep) int f; @ strm = stream_or_default_input(strm); @@ -1724,18 +1724,18 @@ do_read_delimited_list(int d, cl_object in, bool proper_list) FEend_of_file(strm); @) -@(defun clear_input (&optional (strm Cnil)) +@(defun clear_input (&optional (strm ECL_NIL)) @ strm = stream_or_default_input(strm); ecl_clear_input(strm); - @(return Cnil) + @(return ECL_NIL) @) -@(defun read_byte (binary_input_stream &optional (eof_errorp Ct) eof_value) +@(defun read_byte (binary_input_stream &optional (eof_errorp ECL_T) eof_value) cl_object c; @ c = ecl_read_byte(binary_input_stream); - if (c == Cnil) { + if (c == ECL_NIL) { if (Null(eof_errorp)) @(return eof_value) else @@ -1813,7 +1813,7 @@ si_readtable_case_set(cl_object r, cl_object mode) cl_object cl_readtablep(cl_object readtable) { - @(return (ECL_READTABLEP(readtable) ? Ct : Cnil)) + @(return (ECL_READTABLEP(readtable) ? ECL_T : ECL_NIL)) } int @@ -1825,9 +1825,9 @@ ecl_readtable_get(cl_object readtable, int c, cl_object *macro_or_table) if (c >= RTABSIZE) { cl_object hash = readtable->readtable.hash; cat = cat_constituent; - m = Cnil; + m = ECL_NIL; if (!Null(hash)) { - cl_object pair = ecl_gethash_safe(ECL_CODE_CHAR(c), hash, Cnil); + cl_object pair = ecl_gethash_safe(ECL_CODE_CHAR(c), hash, ECL_NIL); if (!Null(pair)) { cat = ecl_fixnum(ECL_CONS_CAR(pair)); m = ECL_CONS_CDR(pair); @@ -1897,7 +1897,7 @@ ecl_invalid_character_p(int c) dispatch = si_copy_hash_table(dispatch); } ecl_readtable_set(tordtbl, tc, cat, dispatch); - @(return Ct) + @(return ECL_T) @) @(defun set_macro_character (c function &optional non_terminating_p @@ -1908,7 +1908,7 @@ ecl_invalid_character_p(int c) cat_terminating : cat_non_terminating, function); - @(return Ct) + @(return ECL_T) @) @(defun get_macro_character (c &optional (readtable ecl_current_readtable())) @@ -1920,7 +1920,7 @@ ecl_invalid_character_p(int c) cat = ecl_readtable_get(readtable, ecl_char_code(c), &dispatch); if (ECL_HASH_TABLE_P(dispatch)) dispatch = cl_core.dispatch_reader; - @(return dispatch ((cat == cat_non_terminating)? Ct : Cnil)) + @(return dispatch ((cat == cat_non_terminating)? ECL_T : ECL_NIL)) @) @(defun make_dispatch_macro_character (chr @@ -1936,7 +1936,7 @@ ecl_invalid_character_p(int c) cl_core.rehash_size, cl_core.rehash_threshold); ecl_readtable_set(readtable, c, cat, table); - @(return Ct) + @(return ECL_T) @) @(defun set_dispatch_macro_character (dspchr subchr fnc @@ -1968,7 +1968,7 @@ ecl_invalid_character_p(int c) } else { _ecl_sethash(ECL_CODE_CHAR(subcode), table, fnc); } - @(return Ct) + @(return ECL_T) @) @(defun get_dispatch_macro_character (dspchr subchr @@ -1990,8 +1990,8 @@ ecl_invalid_character_p(int c) /* Since macro characters may take a number as argument, it is not allowed to turn digits into dispatch macro characters */ if (ecl_digitp(c, 10) >= 0) - @(return Cnil) - @(return ecl_gethash_safe(subchr, table, Cnil)) + @(return ECL_NIL) + @(return ecl_gethash_safe(subchr, table, ECL_NIL)) @) cl_object @@ -2004,7 +2004,7 @@ si_standard_readtable() cl_object output; @ assert_type_readtable(@[ext::readtable-lock], 1, r); - output = (r->readtable.locked)? Ct : Cnil; + output = (r->readtable.locked)? ECL_T : ECL_NIL; if (narg > 1) { r->readtable.locked = !Null(yesno); } @@ -2019,8 +2019,8 @@ extra_argument(int c, cl_object stream, cl_object d) } -#define make_cf2(f) ecl_make_cfun((f), Cnil, NULL, 2) -#define make_cf3(f) ecl_make_cfun((f), Cnil, NULL, 3) +#define make_cf2(f) ecl_make_cfun((f), ECL_NIL, NULL, 2) +#define make_cf3(f) ecl_make_cfun((f), ECL_NIL, NULL, 3) void init_read(void) @@ -2037,19 +2037,19 @@ init_read(void) ecl_alloc(RTABSIZE * sizeof(struct ecl_readtable_entry)); for (i = 0; i < RTABSIZE; i++) { rtab[i].syntax_type = cat_constituent; - rtab[i].dispatch = Cnil; + rtab[i].dispatch = ECL_NIL; } #ifdef ECL_UNICODE - r->readtable.hash = Cnil; + r->readtable.hash = ECL_NIL; #endif cl_core.dispatch_reader = make_cf2(dispatch_reader_fun); - ecl_readtable_set(r, '\t', cat_whitespace, Cnil); - ecl_readtable_set(r, '\n', cat_whitespace, Cnil); - ecl_readtable_set(r, '\f', cat_whitespace, Cnil); - ecl_readtable_set(r, '\r', cat_whitespace, Cnil); - ecl_readtable_set(r, ' ', cat_whitespace, Cnil); + ecl_readtable_set(r, '\t', cat_whitespace, ECL_NIL); + ecl_readtable_set(r, '\n', cat_whitespace, ECL_NIL); + ecl_readtable_set(r, '\f', cat_whitespace, ECL_NIL); + ecl_readtable_set(r, '\r', cat_whitespace, ECL_NIL); + ecl_readtable_set(r, ' ', cat_whitespace, ECL_NIL); ecl_readtable_set(r, '"', cat_terminating, make_cf2(double_quote_reader)); @@ -2064,15 +2064,15 @@ init_read(void) make_cf2(comma_reader)); ecl_readtable_set(r, ';', cat_terminating, make_cf2(semicolon_reader)); - ecl_readtable_set(r, '\\', cat_single_escape, Cnil); + ecl_readtable_set(r, '\\', cat_single_escape, ECL_NIL); ecl_readtable_set(r, '`', cat_terminating, make_cf2(backquote_reader)); - ecl_readtable_set(r, '|', cat_multiple_escape, Cnil); + ecl_readtable_set(r, '|', cat_multiple_escape, ECL_NIL); cl_core.default_dispatch_macro = make_cf3(default_dispatch_macro_fun); cl_make_dispatch_macro_character(3, ECL_CODE_CHAR('#'), - Ct /* non terminating */, r); + ECL_T /* non terminating */, r); cl_set_dispatch_macro_character(4, ECL_CODE_CHAR('#'), ECL_CODE_CHAR('C'), make_cf3(sharp_C_reader), r); @@ -2122,7 +2122,7 @@ init_read(void) make_cf3(sharp_Y_reader), r); /* This is specific to this implementation: ignore BOM */ #ifdef ECL_UNICODE - ecl_readtable_set(r, 0xfeff, cat_whitespace, Cnil); + ecl_readtable_set(r, 0xfeff, cat_whitespace, ECL_NIL); #endif /* Lock the standard read table so that we do not have to make copies @@ -2132,9 +2132,9 @@ init_read(void) init_backq(); ECL_SET(@'*readtable*', - r=ecl_copy_readtable(cl_core.standard_readtable, Cnil)); + r=ecl_copy_readtable(cl_core.standard_readtable, ECL_NIL)); cl_set_dispatch_macro_character(4, ECL_CODE_CHAR('#'), ECL_CODE_CHAR('!'), - Cnil, r); + ECL_NIL, r); ECL_SET(@'*read-default-float-format*', @'single-float'); { @@ -2165,30 +2165,30 @@ init_read(void) @'si::*sharp-eq-context*', @'si::*circle-counter*'); val = cl_list(24, - /**pprint-dispatch-table**/ Cnil, - /**print-array**/ Ct, + /**pprint-dispatch-table**/ ECL_NIL, + /**print-array**/ ECL_T, /**print-base**/ ecl_make_fixnum(10), /**print-case**/ @':downcase', - /**print-circle**/ Ct, - /**print-escape**/ Ct, - /**print-gensym**/ Ct, - /**print-length**/ Cnil, - /**print-level**/ Cnil, - /**print-lines**/ Cnil, - /**print-miser-width**/ Cnil, - /**print-pretty**/ Cnil, - /**print-radix**/ Cnil, - /**print-readably**/ Ct, - /**print-right-margin**/ Cnil, + /**print-circle**/ ECL_T, + /**print-escape**/ ECL_T, + /**print-gensym**/ ECL_T, + /**print-length**/ ECL_NIL, + /**print-level**/ ECL_NIL, + /**print-lines**/ ECL_NIL, + /**print-miser-width**/ ECL_NIL, + /**print-pretty**/ ECL_NIL, + /**print-radix**/ ECL_NIL, + /**print-readably**/ ECL_T, + /**print-right-margin**/ ECL_NIL, /**read-base**/ ecl_make_fixnum(10), /**read-default-float-format**/ @'single-float', - /**read-eval**/ Ct, - /**read-suppress**/ Cnil, + /**read-eval**/ ECL_T, + /**read-suppress**/ ECL_NIL, /**readtable**/ cl_core.standard_readtable, /*si::*print-package**/ cl_core.lisp_package, - /*si::*print-structure**/ Ct, - /*si::*sharp-eq-context**/ Cnil, - /*si::*cicle-counter**/ Cnil); + /*si::*print-structure**/ ECL_T, + /*si::*sharp-eq-context**/ ECL_NIL, + /*si::*cicle-counter**/ ECL_NIL); ECL_SET(@'si::+ecl-syntax-progv-list+', CONS(var,val)); var = cl_list(23, @'*print-pprint-dispatch*', /* See end of pprint.lsp */ @@ -2215,29 +2215,29 @@ init_read(void) @'si::*sharp-eq-context*', @'si::*circle-counter*'); val = cl_list(23, - /**pprint-dispatch-table**/ Cnil, - /**print-array**/ Ct, + /**pprint-dispatch-table**/ ECL_NIL, + /**print-array**/ ECL_T, /**print-base**/ ecl_make_fixnum(10), /**print-case**/ @':upcase', - /**print-circle**/ Cnil, - /**print-escape**/ Ct, - /**print-gensym**/ Ct, - /**print-length**/ Cnil, - /**print-level**/ Cnil, - /**print-lines**/ Cnil, - /**print-miser-width**/ Cnil, - /**print-pretty**/ Cnil, - /**print-radix**/ Cnil, - /**print-readably**/ Ct, - /**print-right-margin**/ Cnil, + /**print-circle**/ ECL_NIL, + /**print-escape**/ ECL_T, + /**print-gensym**/ ECL_T, + /**print-length**/ ECL_NIL, + /**print-level**/ ECL_NIL, + /**print-lines**/ ECL_NIL, + /**print-miser-width**/ ECL_NIL, + /**print-pretty**/ ECL_NIL, + /**print-radix**/ ECL_NIL, + /**print-readably**/ ECL_T, + /**print-right-margin**/ ECL_NIL, /**read-base**/ ecl_make_fixnum(10), /**read-default-float-format**/ @'single-float', - /**read-eval**/ Ct, - /**read-suppress**/ Cnil, + /**read-eval**/ ECL_T, + /**read-suppress**/ ECL_NIL, /**readtable**/ cl_core.standard_readtable, /**package**/ cl_core.user_package, - /*si::*sharp-eq-context**/ Cnil, - /*si::*cicle-counter**/ Cnil); + /*si::*sharp-eq-context**/ ECL_NIL, + /*si::*cicle-counter**/ ECL_NIL); ECL_SET(@'si::+io-syntax-progv-list+', CONS(var,val)); } } @@ -2273,7 +2273,7 @@ ecl_init_module(cl_object block, void (*entry_point)(cl_object)) cl_object progv_list; ecl_bds_bind(env, @'si::*cblock*', block); - env->packages_to_be_created_p = Ct; + env->packages_to_be_created_p = ECL_T; /* Communicate the library which Cblock we are using, and get * back the amount of data to be processed. @@ -2358,7 +2358,7 @@ ecl_init_module(cl_object block, void (*entry_point)(cl_object)) in = OBJNULL; #endif NO_DATA_LABEL: - env->packages_to_be_created_p = Cnil; + env->packages_to_be_created_p = ECL_NIL; for (i = 0; i < block->cblock.cfuns_size; i++) { const struct ecl_cfun *prototype = block->cblock.cfuns+i; @@ -2384,7 +2384,7 @@ ecl_init_module(cl_object block, void (*entry_point)(cl_object)) x = cl_set_difference(2, env->packages_to_be_created, old_eptbc); old_eptbc = env->packages_to_be_created; unlikely_if (!Null(x)) { - CEerror(Ct, + CEerror(ECL_T, Null(ECL_CONS_CDR(x))? "Package ~A referenced in " "compiled file~& ~A~&but has not been created": @@ -2402,7 +2402,7 @@ ecl_init_module(cl_object block, void (*entry_point)(cl_object)) if (in != OBJNULL) cl_close(1,in); env->packages_to_be_created = old_eptbc; - env->packages_to_be_created_p = Cnil; + env->packages_to_be_created_p = ECL_NIL; } ECL_UNWIND_PROTECT_END; return block; diff --git a/src/c/reader/parse_integer.d b/src/c/reader/parse_integer.d index 566071df6..8966e5ae0 100644 --- a/src/c/reader/parse_integer.d +++ b/src/c/reader/parse_integer.d @@ -86,20 +86,20 @@ ecl_parse_integer(cl_object str, cl_index start, cl_index end, s++; } if (s >= e) { - if (junk_allowed != Cnil) - @(return Cnil ecl_make_fixnum(s)) + if (junk_allowed != ECL_NIL) + @(return ECL_NIL ecl_make_fixnum(s)) else goto CANNOT_PARSE; } x = ecl_parse_integer(strng, s, e, &ep, ecl_fixnum(radix)); if (x == OBJNULL) { - if (junk_allowed != Cnil) { - @(return Cnil ecl_make_fixnum(ep)); + if (junk_allowed != ECL_NIL) { + @(return ECL_NIL ecl_make_fixnum(ep)); } else { goto CANNOT_PARSE; } } - if (junk_allowed != Cnil) { + if (junk_allowed != ECL_NIL) { @(return x ecl_make_fixnum(ep)); } for (s = ep; s < e; s++) { @@ -107,7 +107,7 @@ ecl_parse_integer(cl_object str, cl_index start, cl_index end, != cat_whitespace) { CANNOT_PARSE: FEparse_error("Cannot parse an integer in the string ~S.", - Cnil, 1, strng); + ECL_NIL, 1, strng); } } @(return x ecl_make_fixnum(e)); diff --git a/src/c/reader/parse_number.d b/src/c/reader/parse_number.d index 20323e1ae..125eafed8 100644 --- a/src/c/reader/parse_number.d +++ b/src/c/reader/parse_number.d @@ -153,7 +153,7 @@ ecl_parse_number(cl_object str, cl_index start, cl_index end, if (den == OBJNULL || (*ep < end)) { return OBJNULL; } else if (den == ecl_make_fixnum(0)) { - return Cnil; + return ECL_NIL; } else { return ecl_make_ratio(num, den); } diff --git a/src/c/reference.d b/src/c/reference.d index f1fd5c04d..e17f323dc 100644 --- a/src/c/reference.d +++ b/src/c/reference.d @@ -32,7 +32,7 @@ cl_symbol_function(cl_object sym) int type = ecl_symbol_type(sym); if (type & ecl_stp_special_form) { output = @'special'; - } else if (Null(sym) || (SYM_FUN(sym) == Cnil)) { + } else if (Null(sym) || (SYM_FUN(sym) == ECL_NIL)) { FEundefined_function(sym); } else if (type & ecl_stp_macro) { output = CONS(@'si::macro', SYM_FUN(sym)); @@ -52,18 +52,18 @@ cl_object cl_fboundp(cl_object fname) { if (Null(fname)) { - @(return Cnil); + @(return ECL_NIL); } else if (ECL_SYMBOLP(fname)) { @(return (((fname->symbol.stype & ecl_stp_special_form) - || SYM_FUN(fname) != Cnil)? Ct : Cnil)) + || SYM_FUN(fname) != ECL_NIL)? ECL_T : ECL_NIL)) } else if (LISTP(fname)) { if (CAR(fname) == @'setf') { cl_object sym = CDR(fname); - if (CONSP(sym) && CDR(sym) == Cnil) { + if (CONSP(sym) && CDR(sym) == ECL_NIL) { cl_object pair; sym = CAR(sym); if (ECL_SYMBOLP(sym)) { - pair = ecl_setf_definition(sym, Cnil); + pair = ecl_setf_definition(sym, ECL_NIL); @(return ecl_cdr(pair)); } } @@ -80,7 +80,7 @@ ecl_fdefinition(cl_object fun) if (t == t_symbol) { output = SYM_FUN(fun); - unlikely_if (output == Cnil) + unlikely_if (output == ECL_NIL) FEundefined_function(fun); unlikely_if (fun->symbol.stype & (ecl_stp_macro | ecl_stp_special_form)) FEundefined_function(fun); @@ -91,17 +91,17 @@ ecl_fdefinition(cl_object fun) unlikely_if (!CONSP(sym)) FEinvalid_function_name(fun); if (CAR(fun) == @'setf') { - unlikely_if (CDR(sym) != Cnil) + unlikely_if (CDR(sym) != ECL_NIL) FEinvalid_function_name(fun); sym = CAR(sym); unlikely_if (type_of(sym) != t_symbol) FEinvalid_function_name(fun); - output = ecl_setf_definition(sym, Cnil); + output = ecl_setf_definition(sym, ECL_NIL); unlikely_if (Null(ecl_cdr(output))) FEundefined_function(fun); output = ECL_CONS_CAR(output); } else if (CAR(fun) == @'lambda') { - return si_make_lambda(Cnil, sym); + return si_make_lambda(ECL_NIL, sym); } else if (CAR(fun) == @'ext::lambda-block') { return si_make_lambda(CAR(sym), CDR(sym)); } else { @@ -163,7 +163,7 @@ cl_object cl_boundp(cl_object sym) { const cl_env_ptr the_env = ecl_process_env(); - ecl_return1(the_env, ecl_boundp(the_env,sym)? Ct : Cnil); + ecl_return1(the_env, ecl_boundp(the_env,sym)? ECL_T : ECL_NIL); } cl_object @@ -171,5 +171,5 @@ cl_special_operator_p(cl_object form) { const cl_env_ptr the_env = ecl_process_env(); int special = ecl_symbol_type(form) & ecl_stp_special_form; - ecl_return1(the_env, special? Ct : Cnil); + ecl_return1(the_env, special? ECL_T : ECL_NIL); } diff --git a/src/c/sequence.d b/src/c/sequence.d index 84339f2ba..f115effd9 100644 --- a/src/c/sequence.d +++ b/src/c/sequence.d @@ -152,7 +152,7 @@ ecl_subseq(cl_object sequence, cl_index start, cl_index limit) if (start) sequence = ecl_nthcdr(start, sequence); { - cl_object x = Cnil; + cl_object x = ECL_NIL; cl_object *z = &x; while (!Null(sequence) && (limit--)) { if (ECL_ATOM(sequence)) @@ -246,7 +246,7 @@ cl_reverse(cl_object seq) switch (type_of(seq)) { case t_list: { - for (x = seq, output = Cnil; !Null(x); x = ECL_CONS_CDR(x)) { + for (x = seq, output = ECL_NIL; !Null(x); x = ECL_CONS_CDR(x)) { if (!LISTP(x)) goto E; output = CONS(ECL_CONS_CAR(x), output); } @@ -275,7 +275,7 @@ cl_nreverse(cl_object seq) switch (type_of(seq)) { case t_list: { cl_object x, y, z; - for (x = seq, y = Cnil; !Null(x); ) { + for (x = seq, y = ECL_NIL; !Null(x); ) { if (!LISTP(x)) FEtype_error_list(x); z = x; x = ECL_CONS_CDR(x); diff --git a/src/c/serialize.d b/src/c/serialize.d index 6c9274f30..15cd5b120 100644 --- a/src/c/serialize.d +++ b/src/c/serialize.d @@ -133,7 +133,7 @@ enqueue(pool_t pool, cl_object what) cl_object cons; index = ecl_make_fixnum(pool->hash->hash.entries); ecl_sethash(what, pool->hash, index); - cons = ecl_cons(what, Cnil); + cons = ecl_cons(what, ECL_NIL); ECL_RPLACD(pool->last, cons); pool->last = cons; } @@ -175,7 +175,7 @@ serialize_displaced_vector(pool_t pool, cl_object v) cl_object disp = v->vector.displaced; cl_object to = ECL_CONS_CAR(disp); if (Null(to)) { - v->vector.displaced = Cnil; + v->vector.displaced = ECL_NIL; serialize_vector(pool, v); } else { cl_index index = v->vector.self.b8 - to->vector.self.b8; @@ -305,9 +305,9 @@ init_pool(pool_t pool, cl_object root) { pool->data = si_make_vector(@'ext::byte8', ecl_make_fixnum(1024), - Ct, + ECL_T, ecl_make_fixnum(2 * sizeof(cl_index)), - Cnil, + ECL_NIL, ecl_make_fixnum(0)); pool->hash = cl__make_hash_table(@'eql', ecl_make_fixnum(256), cl_core.rehash_size, @@ -357,7 +357,7 @@ reconstruct_object_ptr(uint8_t *data, cl_index bytes) static uint8_t * reconstruct_vector(cl_object v, uint8_t *data) { - if (v->vector.displaced == Cnil) { + if (v->vector.displaced == ECL_NIL) { cl_type t = v->vector.elttype; cl_index size = v->vector.dim * ecl_aet_size[t]; cl_index bytes = ROUND_TO_WORD(size); @@ -447,9 +447,9 @@ fixup_vector(cl_object v, cl_object *o_list) if (!ECL_IMMEDIATE(v->vector.displaced)) { cl_object disp = get_object(v->vector.displaced, o_list); cl_object to = ECL_CONS_CAR(disp); - if (to != Cnil) { + if (to != ECL_NIL) { cl_index offset = (cl_index)v->vector.self.b8; - v->vector.displaced = Cnil; + v->vector.displaced = ECL_NIL; ecl_displace(v, to, ecl_make_fixnum(offset)); return; } diff --git a/src/c/sse2.d b/src/c/sse2.d index ea393021e..3c9762f68 100644 --- a/src/c/sse2.d +++ b/src/c/sse2.d @@ -28,7 +28,7 @@ cl_object si_sse_pack_p(cl_object x) { - @(return (ECL_SSE_PACK_P(x) ? Ct : Cnil)) + @(return (ECL_SSE_PACK_P(x) ? ECL_T : ECL_NIL)) } /* Element type substitution */ @@ -108,7 +108,7 @@ si_sse_pack_to_vector(cl_object x, cl_object elt_type) } etype = x->sse.elttype; - if (elt_type != Cnil) + if (elt_type != ECL_NIL) etype = symbol_to_sse_elttype(elt_type); vec = ecl_alloc_simple_vector(16/ecl_aet_size[etype], etype); diff --git a/src/c/stacks.d b/src/c/stacks.d index a9eb243bb..f7468dabd 100644 --- a/src/c/stacks.d +++ b/src/c/stacks.d @@ -256,7 +256,7 @@ ecl_new_binding_index(cl_env_ptr env, cl_object symbol) symbol->symbol.binding = new_index; symbol->symbol.dynamic |= 1; } - si_set_finalizer(symbol, Ct); + si_set_finalizer(symbol, ECL_T); return new_index; } @@ -264,9 +264,9 @@ static cl_object ecl_extend_bindings_array(cl_object vector) { cl_index new_size = cl_core.last_var_index * 1.25; - cl_object new_vector = si_make_vector(Ct, ecl_make_fixnum(new_size), Cnil, - Cnil, Cnil, Cnil); - si_fill_array_with_elt(new_vector, OBJNULL, ecl_make_fixnum(0), Cnil); + cl_object new_vector = si_make_vector(ECL_T, ecl_make_fixnum(new_size), ECL_NIL, + ECL_NIL, ECL_NIL, ECL_NIL); + si_fill_array_with_elt(new_vector, OBJNULL, ecl_make_fixnum(0), ECL_NIL); ecl_copy_subarray(new_vector, 0, vector, 0, vector->vector.dim); return new_vector; } @@ -402,7 +402,7 @@ ihs_function_name(cl_object x) return(x->cfun.name); default: - return(Cnil); + return(ECL_NIL); } } @@ -597,7 +597,7 @@ si_sch_frs_base(cl_object fr, cl_object ihs) for (x = get_frame_ptr(fr); x <= env->frs_top && x->frs_ihs->index < y; x++); - @(return ((x > env->frs_top) ? Cnil : ecl_make_fixnum(x - env->frs_org))) + @(return ((x > env->frs_top) ? ECL_NIL : ecl_make_fixnum(x - env->frs_org))) } /********************* INITIALIZATION ***********************/ @@ -661,7 +661,7 @@ init_stacks(cl_env_ptr env) env->bds_limit = &env->bds_org[size - 2*margin]; env->ihs_top = &ihs_org; - ihs_org.function = Cnil; - ihs_org.lex_env = Cnil; + ihs_org.function = ECL_NIL; + ihs_org.lex_env = ECL_NIL; ihs_org.index = 0; } diff --git a/src/c/string.d b/src/c/string.d index cb53b86bd..a641b1794 100644 --- a/src/c/string.d +++ b/src/c/string.d @@ -60,10 +60,10 @@ do_make_string(cl_index s, ecl_character code) } else if (element_type == @'character') { cl_index code = ecl_char_code(initial_element); x = do_make_string(s, code); - } else if (_ecl_funcall3(@'subtypep', element_type, @'base-char') == Ct) { + } else if (_ecl_funcall3(@'subtypep', element_type, @'base-char') == ECL_T) { int code = ecl_base_char_code(initial_element); x = do_make_base_string(s, code); - } else if (_ecl_funcall3(@'subtypep', element_type, @'character') == Ct) { + } else if (_ecl_funcall3(@'subtypep', element_type, @'character') == ECL_T) { cl_index code = ecl_char_code(initial_element); x = do_make_string(s, code); } else { @@ -86,7 +86,7 @@ ecl_alloc_adjustable_base_string(cl_index l) output->base_string.self[l] = 0; output->base_string.flags = ECL_FLAG_HAS_FILL_POINTER | ECL_FLAG_ADJUSTABLE; output->base_string.elttype = ecl_aet_bc; - output->base_string.displaced = Cnil; + output->base_string.displaced = ECL_NIL; output->base_string.dim = l; output->base_string.fillp = 0; return output; @@ -101,7 +101,7 @@ ecl_alloc_adjustable_extended_string(cl_index l) output->string.self = (ecl_character *)ecl_alloc_atomic(bytes); output->string.flags = ECL_FLAG_HAS_FILL_POINTER | ECL_FLAG_ADJUSTABLE; output->string.elttype = ecl_aet_ch; - output->string.displaced = Cnil; + output->string.displaced = ECL_NIL; output->string.dim = l; output->string.fillp = 0; return output; @@ -117,7 +117,7 @@ ecl_make_simple_base_string(char *s, cl_fixnum l) cl_object x = ecl_alloc_object(t_base_string); x->base_string.elttype = ecl_aet_bc; x->base_string.flags = 0; /* no fill pointer, no adjustable */ - x->base_string.displaced = Cnil; + x->base_string.displaced = ECL_NIL; if (l < 0) l = strlen(s); x->base_string.dim = (x->base_string.fillp = l); x->base_string.self = (ecl_base_char *)s; @@ -139,7 +139,7 @@ cl_object ecl_cstring_to_base_string_or_nil(const char *s) { if (s == NULL) - return Cnil; + return ECL_NIL; else return make_base_string_copy(s); } @@ -198,7 +198,7 @@ si_copy_to_simple_base_string(cl_object x) } case t_list: if (Null(x)) { - x = Cnil_symbol->symbol.name; + x = ECL_NIL_SYMBOL->symbol.name; goto AGAIN; } default: @@ -241,7 +241,7 @@ cl_string(cl_object x) break; case t_list: if (Null(x)) { - x = Cnil_symbol->symbol.name; + x = ECL_NIL_SYMBOL->symbol.name; break; } default: @@ -286,7 +286,7 @@ si_coerce_to_extended_string(cl_object x) break; case t_list: if (Null(x)) { - x = Cnil_symbol->symbol.name; + x = ECL_NIL_SYMBOL->symbol.name; goto AGAIN; } default: @@ -432,39 +432,39 @@ compare_base(unsigned char *s1, cl_index l1, unsigned char *s2, cl_index l2, p = ecl_vector_start_end(@[string=], string2, start2, end2); s2 = p.start; e2 = p.end; if (e1 - s1 != e2 - s2) - @(return Cnil); + @(return ECL_NIL); #ifdef ECL_UNICODE if (string1->string.t == t_string) { if (string2->string.t == t_string) { while (s1 < e1) if (string1->string.self[s1++] != string2->string.self[s2++]) - @(return Cnil); - @(return Ct); + @(return ECL_NIL); + @(return ECL_T); } else { while (s1 < e1) if (string1->string.self[s1++] != string2->base_string.self[s2++]) - @(return Cnil); - @(return Ct); + @(return ECL_NIL); + @(return ECL_T); } } else { if (string2->string.t == t_string) { while (s1 < e1) if (string1->base_string.self[s1++] != string2->string.self[s2++]) - @(return Cnil); - @(return Ct); + @(return ECL_NIL); + @(return ECL_T); } else { while (s1 < e1) if (string1->base_string.self[s1++] != string2->base_string.self[s2++]) - @(return Cnil); - @(return Ct); + @(return ECL_NIL); + @(return ECL_T); } } #else while (s1 < e1) if (string1->base_string.self[s1++] != string2->base_string.self[s2++]) - @(return Cnil); + @(return ECL_NIL); #endif - @(return Ct); + @(return ECL_T); } @) @@ -527,7 +527,7 @@ ecl_string_eq(cl_object x, cl_object y) p = ecl_vector_start_end(@[string=], string2, start2, end2); s2 = p.start; e2 = p.end; if (e1 - s1 != e2 - s2) - @(return Cnil); + @(return ECL_NIL); #ifdef ECL_UNICODE if (ECL_EXTENDED_STRING_P(string1) || ECL_EXTENDED_STRING_P(string2)) { output = compare_strings(string1, s1, e1, string2, s2, e2, 0, &e1); @@ -536,7 +536,7 @@ ecl_string_eq(cl_object x, cl_object y) output = compare_base(string1->base_string.self + s1, e1 - s1, string2->base_string.self + s2, e2 - s2, 0, &e1); - @(return ((output == 0)? Ct : Cnil)) + @(return ((output == 0)? ECL_T : ECL_NIL)) @) static cl_object @@ -566,8 +566,8 @@ string_compare(cl_narg narg, int sign1, int sign2, int case_sensitive, ecl_va_li string1 = cl_string(string1); string2 = cl_string(string2); - if (start1p == Cnil) start1 = ecl_make_fixnum(0); - if (start2p == Cnil) start2 = ecl_make_fixnum(0); + if (start1p == ECL_NIL) start1 = ecl_make_fixnum(0); + if (start2p == ECL_NIL) start2 = ecl_make_fixnum(0); p = ecl_vector_start_end(@[string=], string1, start1, end1); s1 = p.start; e1 = p.end; p = ecl_vector_start_end(@[string=], string2, start2, end2); @@ -587,7 +587,7 @@ string_compare(cl_narg narg, int sign1, int sign2, int case_sensitive, ecl_va_li if (output == sign1 || output == sign2) { result = ecl_make_fixnum(e1); } else { - result = Cnil; + result = ECL_NIL; } @(return result) #undef start1p @@ -752,7 +752,7 @@ string_case(cl_narg narg, cl_object fun, ecl_casefun casefun, ecl_va_list ARGS) strng = cl_string(strng); strng = cl_copy_seq(strng); - if (kstartp == Cnil) + if (kstartp == ECL_NIL) kstart = ecl_make_fixnum(0); p = ecl_vector_start_end(fun, strng, kstart, kend); b = TRUE; @@ -835,7 +835,7 @@ nstring_case(cl_narg narg, cl_object fun, ecl_casefun casefun, ecl_va_list ARGS) if (ecl_unlikely(!ECL_STRINGP(strng))) FEwrong_type_nth_arg(fun, 1, strng, @[string]); - if (kstartp == Cnil) + if (kstartp == ECL_NIL) kstart = ecl_make_fixnum(0); p = ecl_vector_start_end(fun, strng, kstart, kend); b = TRUE; diff --git a/src/c/structure.d b/src/c/structure.d index bbe7a1588..5c6bbc024 100644 --- a/src/c/structure.d +++ b/src/c/structure.d @@ -50,7 +50,7 @@ structure_subtypep(cl_object x, cl_object y) if (x == y) return(TRUE); x = si_get_sysprop(x, @'si::structure-include'); - } while (x != Cnil); + } while (x != ECL_NIL); return(FALSE); } #endif /* CLOS */ @@ -59,7 +59,7 @@ cl_object si_structure_subtype_p(cl_object x, cl_object y) { @(return ((type_of(x) == T_STRUCTURE - && structure_subtypep(STYPE(x), y)) ? Ct : Cnil)) + && structure_subtypep(STYPE(x), y)) ? ECL_T : ECL_NIL)) } @(defun si::make-structure (type &rest args) @@ -184,11 +184,11 @@ si_structurep(cl_object s) { #ifdef CLOS if (ECL_INSTANCEP(s) && structure_subtypep(CLASS_OF(s), @'structure-object')) - return Ct; + return ECL_T; #else if (type_of(s) == t_structure) - return Ct; + return ECL_T; #endif else - return Cnil; + return ECL_NIL; } diff --git a/src/c/symbol.d b/src/c/symbol.d index ac32e7cc0..907e2df17 100644 --- a/src/c/symbol.d +++ b/src/c/symbol.d @@ -26,7 +26,7 @@ cl_object ecl_symbol_package(cl_object s) { if (Null(s)) - return Cnil_symbol->symbol.hpack; + return ECL_NIL_SYMBOL->symbol.hpack; if (type_of(s) == t_symbol) return s->symbol.hpack; FEwrong_type_nth_arg(@[symbol-package], 1, s, @[symbol]); @@ -36,7 +36,7 @@ int ecl_symbol_type(cl_object s) { if (Null(s)) - return Cnil_symbol->symbol.stype; + return ECL_NIL_SYMBOL->symbol.stype; if (type_of(s) == t_symbol) return s->symbol.stype; FEwrong_type_nth_arg(@[symbol-name], 1, s, @[symbol]); @@ -46,7 +46,7 @@ void ecl_symbol_type_set(cl_object s, int type) { if (Null(s)) { - Cnil_symbol->symbol.stype = type; + ECL_NIL_SYMBOL->symbol.stype = type; return; } if (type_of(s) == t_symbol) { @@ -60,7 +60,7 @@ cl_object ecl_symbol_name(cl_object s) { if (Null(s)) { - return Cnil_symbol->symbol.name; + return ECL_NIL_SYMBOL->symbol.name; } if (type_of(s) == t_symbol) { return s->symbol.name; @@ -72,7 +72,7 @@ static cl_object * ecl_symbol_plist(cl_object s) { if (Null(s)) { - return &Cnil_symbol->symbol.plist; + return &ECL_NIL_SYMBOL->symbol.plist; } if (type_of(s) == t_symbol) { return &s->symbol.plist; @@ -112,9 +112,9 @@ cl_make_symbol(cl_object str) x->symbol.binding = ECL_MISSING_SPECIAL_BINDING; #endif /* */ ECL_SET(x,OBJNULL); - SYM_FUN(x) = Cnil; - x->symbol.plist = Cnil; - x->symbol.hpack = Cnil; + SYM_FUN(x) = ECL_NIL; + x->symbol.plist = ECL_NIL; + x->symbol.hpack = ECL_NIL; x->symbol.stype = ecl_stp_ordinary; @(return x) } @@ -180,7 +180,7 @@ ecl_getf(cl_object place, cl_object indicator, cl_object deflt) return ECL_CONS_CAR(cdr_l); l = ECL_CONS_CDR(cdr_l); } - if (l != Cnil) + if (l != ECL_NIL) FEtype_error_plist(place); return(deflt); } @@ -215,7 +215,7 @@ si_put_f(cl_object place, cl_object value, cl_object indicator) } l = ECL_CONS_CDR(cdr_l); } - if (l != Cnil) + if (l != ECL_NIL) FEtype_error_plist(place); place = CONS(value, place); @(return CONS(indicator, place)); @@ -233,7 +233,7 @@ si_put_f(cl_object place, cl_object value, cl_object indicator) static bool remf(cl_object *place, cl_object indicator) { - cl_object l = *place, tail = Cnil; + cl_object l = *place, tail = ECL_NIL; while (!Null(l)) { cl_object ind; if (!LISTP(l)) @@ -273,7 +273,7 @@ cl_object cl_remprop(cl_object sym, cl_object prop) { cl_object *plist = ecl_symbol_plist(sym); - @(return (remf(plist, prop)? Ct: Cnil)) + @(return (remf(plist, prop)? ECL_T: ECL_NIL)) } cl_object @@ -304,9 +304,9 @@ cl_get_properties(cl_object place, cl_object indicator_list) ecl_return3(the_env,ECL_CONS_CAR(l),ECL_CONS_CAR(cdr_l),l); l = ECL_CONS_CDR(cdr_l); } - if (l != Cnil) + if (l != ECL_NIL) FEtype_error_plist(place); - ecl_return3(the_env, Cnil, Cnil, Cnil); + ecl_return3(the_env, ECL_NIL, ECL_NIL, ECL_NIL); } cl_object @@ -318,7 +318,7 @@ cl_symbol_name(cl_object x) @(defun copy_symbol (sym &optional cp &aux x) @ if (Null(sym)) - sym = Cnil_symbol; + sym = ECL_NIL_SYMBOL; x = cl_make_symbol(ecl_symbol_name(sym)); if (!Null(cp)) { x->symbol.dynamic = 0; @@ -351,10 +351,10 @@ cl_symbol_name(cl_object x) cl_list(3, @'or', @'string', @'integer')); } output = ecl_make_string_output_stream(64, 1); - ecl_bds_bind(the_env, @'*print-escape*', Cnil); - ecl_bds_bind(the_env, @'*print-readably*', Cnil); + ecl_bds_bind(the_env, @'*print-escape*', ECL_NIL); + ecl_bds_bind(the_env, @'*print-readably*', ECL_NIL); ecl_bds_bind(the_env, @'*print-base*', ecl_make_fixnum(10)); - ecl_bds_bind(the_env, @'*print-radix*', Cnil); + ecl_bds_bind(the_env, @'*print-radix*', ECL_NIL); si_write_ugly_object(prefix, output); si_write_ugly_object(counter, output); ecl_bds_unwind_n(the_env, 4); @@ -373,10 +373,10 @@ cl_symbol_name(cl_object x) pack = si_coerce_to_package(pack); ONCE_MORE: output = ecl_make_string_output_stream(64, 1); - ecl_bds_bind(the_env, @'*print-escape*', Cnil); - ecl_bds_bind(the_env, @'*print-readably*', Cnil); + ecl_bds_bind(the_env, @'*print-escape*', ECL_NIL); + ecl_bds_bind(the_env, @'*print-readably*', ECL_NIL); ecl_bds_bind(the_env, @'*print-base*', ecl_make_fixnum(10)); - ecl_bds_bind(the_env, @'*print-radix*', Cnil); + ecl_bds_bind(the_env, @'*print-radix*', ECL_NIL); si_write_ugly_object(prefix, output); si_write_ugly_object(cl_core.gentemp_counter, output); ecl_bds_unwind_n(the_env, 4); @@ -396,7 +396,7 @@ cl_symbol_package(cl_object sym) cl_object cl_keywordp(cl_object sym) { - @(return (ecl_keywordp(sym)? Ct: Cnil)) + @(return (ecl_keywordp(sym)? ECL_T: ECL_NIL)) } /* @@ -415,7 +415,7 @@ si_rem_f(cl_object plist, cl_object indicator) { cl_env_ptr the_env = ecl_process_env(); bool found = remf(&plist, indicator); - ecl_return2(the_env, plist, (found? Ct : Cnil)); + ecl_return2(the_env, plist, (found? ECL_T : ECL_NIL)); } cl_object @@ -470,11 +470,11 @@ cl_object void ecl_defvar(cl_object sym, cl_object val) { - si_safe_eval(3, cl_list(3, @'defvar', sym, cl_list(2, @'quote', val)), Cnil, Cnil); + si_safe_eval(3, cl_list(3, @'defvar', sym, cl_list(2, @'quote', val)), ECL_NIL, ECL_NIL); } void ecl_defparameter(cl_object sym, cl_object val) { - si_safe_eval(3, cl_list(3, @'defparameter', sym, cl_list(2, @'quote', val)), Cnil, Cnil); + si_safe_eval(3, cl_list(3, @'defparameter', sym, cl_list(2, @'quote', val)), ECL_NIL, ECL_NIL); } diff --git a/src/c/symbols_list.h b/src/c/symbols_list.h index d2b0574b4..e5d69fea7 100755 --- a/src/c/symbols_list.h +++ b/src/c/symbols_list.h @@ -10,9 +10,9 @@ # define ECL_NAME(x) NULL #endif #ifdef ECL_RELATIVE_PACKAGE_NAMES -# define RELATIVE_PACKAGES_P Ct +# define RELATIVE_PACKAGES_P ECL_T #else -# define RELATIVE_PACKAGES_P Cnil +# define RELATIVE_PACKAGES_P ECL_NIL #endif #ifdef DPP #define CLOS_ "CLOS::" @@ -100,61 +100,61 @@ cl_symbols[] = { {"&OPTIONAL", CL_ORDINARY, NULL, -1, OBJNULL}, {"&REST", CL_ORDINARY, NULL, -1, OBJNULL}, {"&WHOLE", CL_ORDINARY, NULL, -1, OBJNULL}, -{"+", CL_SPECIAL, cl_P, -1, Cnil}, -{"++", CL_SPECIAL, NULL, -1, Cnil}, -{"+++", CL_SPECIAL, NULL, -1, Cnil}, -{"-", CL_SPECIAL, cl_M, -1, Cnil}, -{"*", CL_SPECIAL, cl_X, -1, Cnil}, -{"**", CL_SPECIAL, NULL, -1, Cnil}, -{"***", CL_SPECIAL, NULL, -1, Cnil}, -{"/", CL_SPECIAL, cl_N, -1, Cnil}, -{"//", CL_SPECIAL, NULL, -1, Cnil}, -{"///", CL_SPECIAL, NULL, -1, Cnil}, +{"+", CL_SPECIAL, cl_P, -1, ECL_NIL}, +{"++", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"+++", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"-", CL_SPECIAL, cl_M, -1, ECL_NIL}, +{"*", CL_SPECIAL, cl_X, -1, ECL_NIL}, +{"**", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"***", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"/", CL_SPECIAL, cl_N, -1, ECL_NIL}, +{"//", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"///", CL_SPECIAL, NULL, -1, ECL_NIL}, {"/=", CL_ORDINARY, cl_NE, -1, OBJNULL}, -{"*BREAK-ON-SIGNALS*", CL_SPECIAL, NULL, -1, Cnil}, -{"*COMPILE-FILE-PATHNAME*", CL_SPECIAL, NULL, -1, Cnil}, -{"*COMPILE-FILE-TRUENAME*", CL_SPECIAL, NULL, -1, Cnil}, -{"*COMPILE-PRINT*", CL_SPECIAL, NULL, -1, Ct}, -{"*COMPILE-VERBOSE*", CL_SPECIAL, NULL, -1, Ct}, +{"*BREAK-ON-SIGNALS*", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"*COMPILE-FILE-PATHNAME*", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"*COMPILE-FILE-TRUENAME*", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"*COMPILE-PRINT*", CL_SPECIAL, NULL, -1, ECL_T}, +{"*COMPILE-VERBOSE*", CL_SPECIAL, NULL, -1, ECL_T}, {"*DEBUG-IO*", CL_SPECIAL, NULL, -1, OBJNULL}, -{"*DEBUGGER-HOOK*", CL_SPECIAL, NULL, -1, Cnil}, +{"*DEBUGGER-HOOK*", CL_SPECIAL, NULL, -1, ECL_NIL}, {"*DEFAULT-PATHNAME-DEFAULTS*", CL_SPECIAL, NULL, -1, OBJNULL}, {"*ERROR-OUTPUT*", CL_SPECIAL, NULL, -1, OBJNULL}, {"*FEATURES*", CL_SPECIAL, NULL, -1, OBJNULL}, {"*GENSYM-COUNTER*", CL_SPECIAL, NULL, -1, ecl_make_fixnum(0)}, -{"*LOAD-PATHNAME*", CL_SPECIAL, NULL, -1, Cnil}, -{"*LOAD-PRINT*", CL_SPECIAL, NULL, -1, Cnil}, -{"*LOAD-TRUENAME*", CL_SPECIAL, NULL, -1, Cnil}, -{"*LOAD-VERBOSE*", CL_SPECIAL, NULL, -1, Ct}, +{"*LOAD-PATHNAME*", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"*LOAD-PRINT*", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"*LOAD-TRUENAME*", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"*LOAD-VERBOSE*", CL_SPECIAL, NULL, -1, ECL_T}, {"*MACROEXPAND-HOOK*", CL_SPECIAL, NULL, -1, OBJNULL}, {"*MODULES*", CL_SPECIAL, NULL, -1, OBJNULL}, {EXT_ "*MODULE-PROVIDER-FUNCTIONS*", EXT_SPECIAL, NULL, -1, OBJNULL}, {"*PACKAGE*", CL_SPECIAL, NULL, -1, OBJNULL}, -{"*PRINT-ARRAY*", CL_SPECIAL, NULL, -1, Ct}, +{"*PRINT-ARRAY*", CL_SPECIAL, NULL, -1, ECL_T}, {"*PRINT-BASE*", CL_SPECIAL, NULL, -1, ecl_make_fixnum(10)}, {"*PRINT-CASE*", CL_SPECIAL, NULL, -1, OBJNULL}, -{"*PRINT-CIRCLE*", CL_SPECIAL, NULL, -1, Cnil}, -{"*PRINT-ESCAPE*", CL_SPECIAL, NULL, -1, Ct}, -{"*PRINT-GENSYM*", CL_SPECIAL, NULL, -1, Ct}, -{"*PRINT-LENGTH*", CL_SPECIAL, NULL, -1, Cnil}, -{"*PRINT-LEVEL*", CL_SPECIAL, NULL, -1, Cnil}, -{"*PRINT-LINES*", CL_SPECIAL, NULL, -1, Cnil}, -{"*PRINT-MISER-WIDTH*", CL_SPECIAL, NULL, -1, Cnil}, -{"*PRINT-PPRINT-DISPATCH*", CL_SPECIAL, NULL, -1, Cnil}, +{"*PRINT-CIRCLE*", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"*PRINT-ESCAPE*", CL_SPECIAL, NULL, -1, ECL_T}, +{"*PRINT-GENSYM*", CL_SPECIAL, NULL, -1, ECL_T}, +{"*PRINT-LENGTH*", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"*PRINT-LEVEL*", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"*PRINT-LINES*", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"*PRINT-MISER-WIDTH*", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"*PRINT-PPRINT-DISPATCH*", CL_SPECIAL, NULL, -1, ECL_NIL}, #if defined(ECL_CMU_FORMAT) -{"*PRINT-PRETTY*", CL_SPECIAL, NULL, -1, Cnil}, +{"*PRINT-PRETTY*", CL_SPECIAL, NULL, -1, ECL_NIL}, #else -{"*PRINT-PRETTY*", CL_SPECIAL, NULL, -1, Ct}, +{"*PRINT-PRETTY*", CL_SPECIAL, NULL, -1, ECL_T}, #endif -{"*PRINT-RADIX*", CL_SPECIAL, NULL, -1, Cnil}, -{"*PRINT-READABLY*", CL_SPECIAL, NULL, -1, Cnil}, -{"*PRINT-RIGHT-MARGIN*", CL_SPECIAL, NULL, -1, Cnil}, +{"*PRINT-RADIX*", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"*PRINT-READABLY*", CL_SPECIAL, NULL, -1, ECL_NIL}, +{"*PRINT-RIGHT-MARGIN*", CL_SPECIAL, NULL, -1, ECL_NIL}, {"*QUERY-IO*", CL_SPECIAL, NULL, -1, OBJNULL}, {"*RANDOM-STATE*", CL_SPECIAL, NULL, -1, OBJNULL}, {"*READ-BASE*", CL_SPECIAL, NULL, -1, ecl_make_fixnum(10)}, {"*READ-DEFAULT-FLOAT-FORMAT*", CL_SPECIAL, NULL, -1, OBJNULL}, -{"*READ-EVAL*", CL_SPECIAL, NULL, -1, Ct}, -{"*READ-SUPPRESS*", CL_SPECIAL, NULL, -1, Cnil}, +{"*READ-EVAL*", CL_SPECIAL, NULL, -1, ECL_T}, +{"*READ-SUPPRESS*", CL_SPECIAL, NULL, -1, ECL_NIL}, {"*READTABLE*", CL_SPECIAL, NULL, -1, OBJNULL}, {"*STANDARD-INPUT*", CL_SPECIAL, NULL, -1, OBJNULL}, {"*STANDARD-OUTPUT*", CL_SPECIAL, NULL, -1, OBJNULL}, @@ -1108,27 +1108,27 @@ cl_symbols[] = { /* SYSTEM PACKAGE */ {SYS_ "#!", SI_ORDINARY, NULL, -1, OBJNULL}, {SYS_ "*BACKQ-LEVEL*", SI_SPECIAL, NULL, -1, ecl_make_fixnum(0)}, -{SYS_ "*CBLOCK*", SI_SPECIAL, NULL, -1, Cnil}, -{SYS_ "*CIRCLE-COUNTER*", SI_SPECIAL, NULL, -1, Cnil}, +{SYS_ "*CBLOCK*", SI_SPECIAL, NULL, -1, ECL_NIL}, +{SYS_ "*CIRCLE-COUNTER*", SI_SPECIAL, NULL, -1, ECL_NIL}, {SYS_ "*CIRCLE-STACK*", SI_SPECIAL, NULL, -1, OBJNULL}, {SYS_ "*CLASS-NAME-HASH-TABLE*", SI_SPECIAL, NULL, -1, OBJNULL}, {SYS_ "*COMPILER-CONSTANTS*", SI_SPECIAL, NULL, -1, OBJNULL}, -{SYS_ "*GC-MESSAGE*", SI_SPECIAL, NULL, -1, Cnil}, -{SYS_ "*GC-VERBOSE*", SI_SPECIAL, NULL, -1, Cnil}, -{SYS_ "*IGNORE-EOF-ON-TERMINAL-IO*", SI_SPECIAL, NULL, -1, Cnil}, -{SYS_ "*INDENT-FORMATTED-OUTPUT*", SI_SPECIAL, NULL, -1, Cnil}, -{SYS_ "*INIT-FUNCTION-PREFIX*", SI_SPECIAL, NULL, -1, Cnil}, -{EXT_ "*INTERRUPTS-ENABLED*", EXT_SPECIAL, NULL, 1, Ct}, -{SYS_ "*KEEP-DEFINITIONS*", SI_SPECIAL, NULL, -1, Ct}, +{SYS_ "*GC-MESSAGE*", SI_SPECIAL, NULL, -1, ECL_NIL}, +{SYS_ "*GC-VERBOSE*", SI_SPECIAL, NULL, -1, ECL_NIL}, +{SYS_ "*IGNORE-EOF-ON-TERMINAL-IO*", SI_SPECIAL, NULL, -1, ECL_NIL}, +{SYS_ "*INDENT-FORMATTED-OUTPUT*", SI_SPECIAL, NULL, -1, ECL_NIL}, +{SYS_ "*INIT-FUNCTION-PREFIX*", SI_SPECIAL, NULL, -1, ECL_NIL}, +{EXT_ "*INTERRUPTS-ENABLED*", EXT_SPECIAL, NULL, 1, ECL_T}, +{SYS_ "*KEEP-DEFINITIONS*", SI_SPECIAL, NULL, -1, ECL_T}, {EXT_ "*LOAD-HOOKS*", EXT_SPECIAL, NULL, -1, OBJNULL}, -{SYS_ "*LOAD-SEARCH-LIST*", SI_SPECIAL, NULL, -1, Cnil}, +{SYS_ "*LOAD-SEARCH-LIST*", SI_SPECIAL, NULL, -1, ECL_NIL}, {SYS_ "*MAKE-CONSTANT", SI_ORDINARY, si_Xmake_constant, 2, OBJNULL}, {SYS_ "*MAKE-SPECIAL", SI_ORDINARY, si_Xmake_special, 1, OBJNULL}, -{SYS_ "*PRINT-PACKAGE*", SI_SPECIAL, NULL, -1, Cnil}, -{SYS_ "*PRINT-STRUCTURE*", SI_SPECIAL, NULL, -1, Cnil}, -{SYS_ "*SHARP-EQ-CONTEXT*", SI_SPECIAL, NULL, -1, Cnil}, +{SYS_ "*PRINT-PACKAGE*", SI_SPECIAL, NULL, -1, ECL_NIL}, +{SYS_ "*PRINT-STRUCTURE*", SI_SPECIAL, NULL, -1, ECL_NIL}, +{SYS_ "*SHARP-EQ-CONTEXT*", SI_SPECIAL, NULL, -1, ECL_NIL}, {SYS_ "*STEP-LEVEL*", SI_SPECIAL, OBJNULL, -1, ecl_make_fixnum(0)}, -{SYS_ "*STEP-ACTION*", SI_SPECIAL, OBJNULL, -1, Cnil}, +{SYS_ "*STEP-ACTION*", SI_SPECIAL, OBJNULL, -1, ECL_NIL}, {SYS_ ".", SI_ORDINARY, NULL, -1, OBJNULL}, {SYS_ "UNQUOTE", SI_ORDINARY, NULL, -1, OBJNULL}, {SYS_ "UNQUOTE-NSPLICE", SI_ORDINARY, NULL, -1, OBJNULL}, @@ -1291,8 +1291,8 @@ cl_symbols[] = { /*{SYS_ "UNBOUND", SI_ORDINARY, si_unbound, 0, OBJNULL}, */ #endif -{EXT_ "*SOURCE-LOCATION*", EXT_SPECIAL, NULL, -1, Cnil}, -{EXT_ "*REGISTER-WITH-PDE-HOOK*", EXT_SPECIAL, NULL, -1, Cnil}, +{EXT_ "*SOURCE-LOCATION*", EXT_SPECIAL, NULL, -1, ECL_NIL}, +{EXT_ "*REGISTER-WITH-PDE-HOOK*", EXT_SPECIAL, NULL, -1, ECL_NIL}, {EXT_ "REGISTER-WITH-PDE", EXT_ORDINARY, NULL, -1, OBJNULL}, /* #ifdef PROFILE */ @@ -1620,18 +1620,18 @@ cl_symbols[] = { {SYS_ "WHILE", SI_ORDINARY, NULL, -1, OBJNULL}, {SYS_ "UNTIL", SI_ORDINARY, NULL, -1, OBJNULL}, {SYS_ "QUASIQUOTE", SI_ORDINARY, NULL, -1, OBJNULL}, -{SYS_ "*EXIT-HOOKS*", SI_SPECIAL, NULL, -1, Cnil}, +{SYS_ "*EXIT-HOOKS*", SI_SPECIAL, NULL, -1, ECL_NIL}, #ifdef CLOS -{CLOS_ ".COMBINED-METHOD-ARGS.", CLOS_SPECIAL, NULL, -1, Cnil}, -{CLOS_ "+BUILTIN-CLASSES+", CLOS_ORDINARY, NULL, -1, Cnil}, -{CLOS_ "*NEXT-METHODS*", CLOS_SPECIAL, NULL, -1, Cnil}, -{CLOS_ "*OPTIMIZE-SLOT-ACCESS*", CLOS_SPECIAL, NULL, -1, Ct}, -{CLOS_ "+THE-T-CLASS+", CLOS_ORDINARY, NULL, -1, Cnil}, -{CLOS_ "+THE-CLASS+", CLOS_ORDINARY, NULL, -1, Cnil}, -{CLOS_ "+THE-STD-CLASS+", CLOS_ORDINARY, NULL, -1, Cnil}, -{CLOS_ "+THE-STANDARD-CLASS+", CLOS_ORDINARY, NULL, -1, Cnil}, -{CLOS_ "+THE-FUNCALLABLE-STANDARD-CLASS+", CLOS_ORDINARY, NULL, -1, Cnil}, +{CLOS_ ".COMBINED-METHOD-ARGS.", CLOS_SPECIAL, NULL, -1, ECL_NIL}, +{CLOS_ "+BUILTIN-CLASSES+", CLOS_ORDINARY, NULL, -1, ECL_NIL}, +{CLOS_ "*NEXT-METHODS*", CLOS_SPECIAL, NULL, -1, ECL_NIL}, +{CLOS_ "*OPTIMIZE-SLOT-ACCESS*", CLOS_SPECIAL, NULL, -1, ECL_T}, +{CLOS_ "+THE-T-CLASS+", CLOS_ORDINARY, NULL, -1, ECL_NIL}, +{CLOS_ "+THE-CLASS+", CLOS_ORDINARY, NULL, -1, ECL_NIL}, +{CLOS_ "+THE-STD-CLASS+", CLOS_ORDINARY, NULL, -1, ECL_NIL}, +{CLOS_ "+THE-STANDARD-CLASS+", CLOS_ORDINARY, NULL, -1, ECL_NIL}, +{CLOS_ "+THE-FUNCALLABLE-STANDARD-CLASS+", CLOS_ORDINARY, NULL, -1, ECL_NIL}, {CLOS_ "ACCESSOR-METHOD-SLOT-DEFINITION", CLOS_ORDINARY, NULL, -1, OBJNULL}, {CLOS_ "ADD-DEPENDENT", CLOS_ORDINARY, NULL, -1, OBJNULL}, {CLOS_ "ADD-DIRECT-METHOD", CLOS_ORDINARY, NULL, -1, OBJNULL}, @@ -1732,7 +1732,7 @@ cl_symbols[] = { {SYS_ "DO-DEFTYPE", SI_ORDINARY, ECL_NAME(si_do_deftype), -1, OBJNULL}, {SYS_ "CREATE-TYPE-NAME", SI_ORDINARY, NULL, -1, OBJNULL}, -{SYS_ "*ALIEN-DECLARATIONS*", SI_SPECIAL, NULL, -1, Cnil}, +{SYS_ "*ALIEN-DECLARATIONS*", SI_SPECIAL, NULL, -1, ECL_NIL}, #ifdef ENABLE_DLOPEN {SYS_ "LOAD-BINARY", SI_ORDINARY, si_load_binary, 4, OBJNULL}, @@ -1753,7 +1753,7 @@ cl_symbols[] = { {SYS_ "TRAP-FPE", SI_ORDINARY, si_trap_fpe, 2, OBJNULL}, -{EXT_ "*ACTION-ON-UNDEFINED-VARIABLE*", EXT_SPECIAL, NULL, -1, Cnil}, +{EXT_ "*ACTION-ON-UNDEFINED-VARIABLE*", EXT_SPECIAL, NULL, -1, ECL_NIL}, {SYS_ "SET-BUFFERING-MODE", SI_ORDINARY, si_set_buffering_mode, 2, OBJNULL}, {KEY_ "NONE", KEYWORD, NULL, -1, OBJNULL}, @@ -1828,8 +1828,8 @@ cl_symbols[] = { {SYS_ "LOG1P", SI_ORDINARY, si_log1p, 1, OBJNULL}, -{EXT_ "BC-FILE", EXT_ORDINARY, si_compiled_function_file, 1, Cnil}, -{EXT_ "COMPILED-FUNCTION-FILE", EXT_ORDINARY, si_compiled_function_file, 1, Cnil}, +{EXT_ "BC-FILE", EXT_ORDINARY, si_compiled_function_file, 1, ECL_NIL}, +{EXT_ "COMPILED-FUNCTION-FILE", EXT_ORDINARY, si_compiled_function_file, 1, ECL_NIL}, {SYS_ "PROPERTY-LIST", SI_ORDINARY, NULL, 1, OBJNULL}, @@ -1887,7 +1887,7 @@ cl_symbols[] = { {KEY_ "LITTLE-ENDIAN", KEYWORD, NULL, -1, OBJNULL}, {KEY_ "BIG-ENDIAN", KEYWORD, NULL, -1, OBJNULL}, -{SYS_ "+UNICODE-DATABASE+", SI_CONSTANT, NULL, -1, Cnil}, +{SYS_ "+UNICODE-DATABASE+", SI_CONSTANT, NULL, -1, ECL_NIL}, {EXT_ "COPY-FILE", EXT_ORDINARY, si_copy_file, 2, OBJNULL}, @@ -1895,7 +1895,7 @@ cl_symbols[] = { {EXT_ "+ECL-VERSION-NUMBER+", EXT_CONSTANT, NULL, -1, ecl_make_fixnum(ECL_VERSION_NUMBER)}, -{EXT_ "*BYTECODES-COMPILER*", EXT_SPECIAL, NULL, -1, Cnil}, +{EXT_ "*BYTECODES-COMPILER*", EXT_SPECIAL, NULL, -1, ECL_NIL}, {EXT_ "SHORT-FLOAT-POSITIVE-INFINITY", EXT_CONSTANT, NULL, -1, OBJNULL}, {EXT_ "SINGLE-FLOAT-POSITIVE-INFINITY", EXT_CONSTANT, NULL, -1, OBJNULL}, @@ -1928,7 +1928,7 @@ cl_symbols[] = { {EXT_ "MAKE-WEAK-POINTER", EXT_ORDINARY, si_make_weak_pointer, 1, OBJNULL}, {EXT_ "WEAK-POINTER-VALUE", EXT_ORDINARY, si_weak_pointer_value, 1, OBJNULL}, -{SYS_ "*ALLOW-WITH-INTERRUPTS*", SI_SPECIAL, NULL, -1, Ct}, +{SYS_ "*ALLOW-WITH-INTERRUPTS*", SI_SPECIAL, NULL, -1, ECL_T}, {EXT_ "WITH-UNIQUE-NAMES", EXT_ORDINARY, NULL, -1, OBJNULL}, @@ -1970,22 +1970,22 @@ cl_symbols[] = { {SYS_ "CLOSE-WINDOWS-HANDLE", SI_ORDINARY, NULL, -1, OBJNULL}, #endif -{EXT_ "*INVOKE-DEBUGGER-HOOK*", EXT_SPECIAL, NULL, -1, Cnil}, +{EXT_ "*INVOKE-DEBUGGER-HOOK*", EXT_SPECIAL, NULL, -1, ECL_NIL}, -{EXT_ "*DOCUMENTATION-POOL*", EXT_SPECIAL, NULL, -1, Cnil}, -{EXT_ "ANNOTATE", EXT_ORDINARY, NULL, -1, Cnil}, -{EXT_ "GET-ANNOTATION", EXT_ORDINARY, NULL, -1, Cnil}, -{EXT_ "REMOVE-ANNOTATION", EXT_ORDINARY, NULL, -1, Cnil}, -{EXT_ "FUNCTION-LAMBDA-LIST", EXT_ORDINARY, NULL, -1, Cnil}, -{EXT_ "DEFAULT-ANNOTATION-LOGIC", EXT_ORDINARY, NULL, -1, Cnil}, -{EXT_ "OPTIONAL-ANNOTATION", EXT_ORDINARY, NULL, -1, Cnil}, -{EXT_ "LOCATION", EXT_ORDINARY, NULL, -1, Cnil}, +{EXT_ "*DOCUMENTATION-POOL*", EXT_SPECIAL, NULL, -1, ECL_NIL}, +{EXT_ "ANNOTATE", EXT_ORDINARY, NULL, -1, ECL_NIL}, +{EXT_ "GET-ANNOTATION", EXT_ORDINARY, NULL, -1, ECL_NIL}, +{EXT_ "REMOVE-ANNOTATION", EXT_ORDINARY, NULL, -1, ECL_NIL}, +{EXT_ "FUNCTION-LAMBDA-LIST", EXT_ORDINARY, NULL, -1, ECL_NIL}, +{EXT_ "DEFAULT-ANNOTATION-LOGIC", EXT_ORDINARY, NULL, -1, ECL_NIL}, +{EXT_ "OPTIONAL-ANNOTATION", EXT_ORDINARY, NULL, -1, ECL_NIL}, +{EXT_ "LOCATION", EXT_ORDINARY, NULL, -1, ECL_NIL}, -{EXT_ "LISP-IMPLEMENTATION-VCS-ID", EXT_ORDINARY, NULL, -1, Cnil}, +{EXT_ "LISP-IMPLEMENTATION-VCS-ID", EXT_ORDINARY, NULL, -1, ECL_NIL}, -{SYS_ "SIGNAL-SERVICING", SI_ORDINARY, NULL, -1, Cnil}, +{SYS_ "SIGNAL-SERVICING", SI_ORDINARY, NULL, -1, ECL_NIL}, -{EXT_ "*DEFAULT-EXTERNAL-FORMAT*", EXT_SPECIAL, NULL, -1, Ct}, +{EXT_ "*DEFAULT-EXTERNAL-FORMAT*", EXT_SPECIAL, NULL, -1, ECL_T}, {KEY_ "PASS-THROUGH", KEYWORD, NULL, -1, OBJNULL}, {EXT_ "WITH-BACKEND", EXT_ORDINARY, NULL, -1, OBJNULL}, @@ -2026,7 +2026,7 @@ cl_symbols[] = { {EXT_ "FLOAT-SSE-PACK", EXT_ORDINARY, NULL, -1, OBJNULL}, {EXT_ "DOUBLE-SSE-PACK", EXT_ORDINARY, NULL, -1, OBJNULL}, {EXT_ "SSE-PACK-ELEMENT-TYPE", EXT_ORDINARY, IF_SSE2(si_sse_pack_element_type), 1, OBJNULL}, -{EXT_ "*SSE-PACK-PRINT-MODE*", EXT_SPECIAL, NULL, -1, Cnil}, +{EXT_ "*SSE-PACK-PRINT-MODE*", EXT_SPECIAL, NULL, -1, ECL_NIL}, /* #endif ECL_SSE2 */ {EXT_ "UNIX-SIGNAL-RECEIVED", EXT_ORDINARY, NULL, -1, OBJNULL}, @@ -2043,17 +2043,17 @@ cl_symbols[] = { {EXT_ "DUMP-C-BACKTRACE", EXT_ORDINARY, si_dump_c_backtrace, 1, OBJNULL}, -{EXT_ "+PROCESS-STANDARD-INPUT+", EXT_CONSTANT, NULL, -1, Cnil}, -{EXT_ "+PROCESS-STANDARD-OUTPUT+", EXT_CONSTANT, NULL, -1, Cnil}, -{EXT_ "+PROCESS-ERROR-OUTPUT+", EXT_CONSTANT, NULL, -1, Cnil}, +{EXT_ "+PROCESS-STANDARD-INPUT+", EXT_CONSTANT, NULL, -1, ECL_NIL}, +{EXT_ "+PROCESS-STANDARD-OUTPUT+", EXT_CONSTANT, NULL, -1, ECL_NIL}, +{EXT_ "+PROCESS-ERROR-OUTPUT+", EXT_CONSTANT, NULL, -1, ECL_NIL}, -{EXT_ "*HELP-MESSAGE*", EXT_SPECIAL, NULL, -1, Cnil}, -{EXT_ "*LISP-INIT-FILE-LIST*", EXT_SPECIAL, NULL, -1, Cnil}, +{EXT_ "*HELP-MESSAGE*", EXT_SPECIAL, NULL, -1, ECL_NIL}, +{EXT_ "*LISP-INIT-FILE-LIST*", EXT_SPECIAL, NULL, -1, ECL_NIL}, {EXT_ "+DEFAULT-COMMAND-ARG-RULES+", EXT_ORDINARY, NULL, -1, OBJNULL}, {EXT_ "COMMAND-ARGS", EXT_ORDINARY, NULL, -1, OBJNULL}, -{EXT_ "*COMMAND-ARGS*", EXT_SPECIAL, NULL, -1, Cnil}, +{EXT_ "*COMMAND-ARGS*", EXT_SPECIAL, NULL, -1, ECL_NIL}, {EXT_ "PROCESS-COMMAND-ARGS", EXT_ORDINARY, NULL, -1, OBJNULL}, -{EXT_ "*UNPROCESSED-ECL-COMMAND-ARGS*", EXT_SPECIAL, NULL, -1, Cnil}, +{EXT_ "*UNPROCESSED-ECL-COMMAND-ARGS*", EXT_SPECIAL, NULL, -1, ECL_NIL}, /* #ifdef ECL_UNICODE */ {KEY_ "OCTETS", KEYWORD, NULL, -1, OBJNULL}, @@ -2071,11 +2071,11 @@ cl_symbols[] = { {SYS_ "PROPER-LIST-P", SI_ORDINARY, si_proper_list_p, 1, OBJNULL}, {SYS_ "TRACED-OLD-DEFINITION", SI_ORDINARY, ECL_NAME(si_traced_old_definition), 1, OBJNULL}, -{SYS_ "*TRACE-LIST*", SI_SPECIAL, NULL, -1, Cnil}, +{SYS_ "*TRACE-LIST*", SI_SPECIAL, NULL, -1, ECL_NIL}, {SYS_ "FUNCTION-BOUNDARY", SI_ORDINARY, NULL, -1, OBJNULL}, -{EXT_ "*INSPECTOR-HOOK*", EXT_SPECIAL, NULL, -1, Cnil}, +{EXT_ "*INSPECTOR-HOOK*", EXT_SPECIAL, NULL, -1, ECL_NIL}, {KEY_ "RESOLVE-SYMLINKS", KEYWORD, NULL, -1, OBJNULL}, diff --git a/src/c/symbols_list2.h b/src/c/symbols_list2.h index 952ffb997..8db24935a 100644 --- a/src/c/symbols_list2.h +++ b/src/c/symbols_list2.h @@ -10,9 +10,9 @@ # define ECL_NAME(x) NULL #endif #ifdef ECL_RELATIVE_PACKAGE_NAMES -# define RELATIVE_PACKAGES_P Ct +# define RELATIVE_PACKAGES_P ECL_T #else -# define RELATIVE_PACKAGES_P Cnil +# define RELATIVE_PACKAGES_P ECL_NIL #endif #ifdef DPP #define CLOS_ "CLOS::" diff --git a/src/c/tcp.d b/src/c/tcp.d index 19b0cacf2..97c47e58d 100644 --- a/src/c/tcp.d +++ b/src/c/tcp.d @@ -289,12 +289,12 @@ si_open_client_stream(cl_object host, cl_object port) ecl_enable_interrupts(); if (fd == 0) - @(return Cnil) + @(return ECL_NIL) #if defined(ECL_MS_WINDOWS_HOST) - stream = ecl_make_stream_from_fd(host, fd, ecl_smm_io_wsock, 8, 0, Cnil); + stream = ecl_make_stream_from_fd(host, fd, ecl_smm_io_wsock, 8, 0, ECL_NIL); #else - stream = ecl_make_stream_from_fd(host, fd, ecl_smm_io, 8, 0, Cnil); + stream = ecl_make_stream_from_fd(host, fd, ecl_smm_io, 8, 0, ECL_NIL); #endif @(return stream) @@ -317,7 +317,7 @@ si_open_server_stream(cl_object port) fd = create_server_port(p); ecl_enable_interrupts(); - @(return ((fd == 0)? Cnil : ecl_make_stream_from_fd(Cnil, fd, ecl_smm_io, 8, 0, Cnil))) + @(return ((fd == 0)? ECL_NIL : ecl_make_stream_from_fd(ECL_NIL, fd, ecl_smm_io, 8, 0, ECL_NIL))) } /************************************************************ @@ -342,7 +342,7 @@ si_open_unix_socket_stream(cl_object path) fd = socket(PF_UNIX, SOCK_STREAM, 0); if (fd < 0) { FElibc_error("Unable to create unix socket", 0); - @(return Cnil) + @(return ECL_NIL) } memcpy(addr.sun_path, path->base_string.self, path->base_string.fillp); @@ -352,10 +352,10 @@ si_open_unix_socket_stream(cl_object path) if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { close(fd); FElibc_error("Unable to connect to unix socket ~A", 1, path); - @(return Cnil) + @(return ECL_NIL) } - @(return ecl_make_stream_from_fd(path, fd, ecl_smm_io, 8, 0, Cnil)) + @(return ecl_make_stream_from_fd(path, fd, ecl_smm_io, 8, 0, ECL_NIL)) #endif } @@ -394,12 +394,12 @@ si_lookup_host_entry(cl_object host_or_address) 1, host_or_address); } if (he == NULL) - @(return Cnil Cnil Cnil) + @(return ECL_NIL ECL_NIL ECL_NIL) name = make_base_string_copy(he->h_name); - aliases = Cnil; + aliases = ECL_NIL; for (i = 0; he->h_aliases[i] != 0; i++) aliases = CONS(make_base_string_copy(he->h_aliases[i]), aliases); - addresses = Cnil; + addresses = ECL_NIL; for (i = 0; he->h_addr_list[i]; i++) { unsigned long *s = (unsigned long*)(he->h_addr_list[i]); l = *s; diff --git a/src/c/threads/atomic.d b/src/c/threads/atomic.d index 731900e9a..8ee41f796 100755 --- a/src/c/threads/atomic.d +++ b/src/c/threads/atomic.d @@ -27,7 +27,7 @@ ecl_atomic_get(cl_object *slot) cl_object old; do { old = (cl_object)AO_load((AO_t*)slot); - } while (!AO_compare_and_swap_full((AO_t*)slot, (AO_t)old, (AO_t)Cnil)); + } while (!AO_compare_and_swap_full((AO_t*)slot, (AO_t)old, (AO_t)ECL_NIL)); return old; } diff --git a/src/c/threads/barrier.d b/src/c/threads/barrier.d index 484a3128d..b542771a4 100755 --- a/src/c/threads/barrier.d +++ b/src/c/threads/barrier.d @@ -31,14 +31,14 @@ ecl_make_barrier(cl_object name, cl_index count) output->barrier.name = name; output->barrier.arrivers_count = count; output->barrier.count = count; - output->barrier.queue_list = Cnil; - output->barrier.queue_spinlock = Cnil; + output->barrier.queue_list = ECL_NIL; + output->barrier.queue_spinlock = ECL_NIL; return output; } @(defun mp::make-barrier (count &key name) @ - if (count == Ct) + if (count == ECL_T) count = ecl_make_fixnum(MOST_POSITIVE_FIXNUM); @(return ecl_make_barrier(name, fixnnint(count))) @) @@ -103,12 +103,12 @@ barrier_wait_condition(cl_env_ptr env, cl_object barrier) { /* We were signaled */ if (env->own_process->process.waiting_for != barrier) - return Ct; + return ECL_T; /* Disabled barrier */ else if (barrier->barrier.arrivers_count < 0) - return Ct; + return ECL_T; else - return Cnil; + return ECL_NIL; } static cl_fixnum @@ -152,7 +152,7 @@ decrement_counter(cl_fixnum *counter) /* There are (count-1) threads in the queue and we * are the last one. We thus unblock all threads and * proceed. */ - own_process->process.waiting_for = Cnil; + own_process->process.waiting_for = ECL_NIL; mp_barrier_unblock(1, barrier); ecl_enable_interrupts_env(the_env); output = @':unblocked'; @@ -160,11 +160,11 @@ decrement_counter(cl_fixnum *counter) print_lock("barrier %p waiting", barrier, barrier); ecl_enable_interrupts_env(the_env); ecl_wait_on(the_env, barrier_wait_condition, barrier); - output = Ct; + output = ECL_T; } else { print_lock("barrier %p pass-through", barrier, barrier); /* Barrier disabled */ - output = Cnil; + output = ECL_NIL; } @(return output) } diff --git a/src/c/threads/condition_variable.d b/src/c/threads/condition_variable.d index 22b0498e1..d9daa37ef 100644 --- a/src/c/threads/condition_variable.d +++ b/src/c/threads/condition_variable.d @@ -24,9 +24,9 @@ cl_object mp_make_condition_variable(void) { cl_object output = ecl_alloc_object(t_condition_variable); - output->condition_variable.queue_list = Cnil; - output->condition_variable.queue_spinlock = Cnil; - output->condition_variable.lock = Cnil; + output->condition_variable.queue_list = ECL_NIL; + output->condition_variable.queue_spinlock = ECL_NIL; + output->condition_variable.lock = ECL_NIL; @(return output) } @@ -37,11 +37,11 @@ condition_variable_wait(cl_env_ptr env, cl_object cv) if (own_process->process.waiting_for != cv) { /* We have been signaled */ cl_object lock = cv->condition_variable.lock; - if (mp_get_lock_nowait(lock) != Cnil) - return Ct; + if (mp_get_lock_nowait(lock) != ECL_NIL) + return ECL_T; own_process->process.waiting_for = cv; } - return Cnil; + return ECL_NIL; } cl_object @@ -57,7 +57,7 @@ mp_condition_variable_wait(cl_object cv, cl_object lock) FEwrong_type_nth_arg(@[mp::condition-variable-wait], 2, lock, @[mp::lock]); } - unlikely_if (cv->condition_variable.lock != Cnil && + unlikely_if (cv->condition_variable.lock != ECL_NIL && cv->condition_variable.lock != lock) { FEerror("Attempt to associate lock ~A~%with condition variable ~A," @@ -75,7 +75,7 @@ mp_condition_variable_wait(cl_object cv, cl_object lock) env->own_process->process.waiting_for = cv; mp_giveup_lock(cv->condition_variable.lock = lock); ecl_wait_on(env, condition_variable_wait, cv); - @(return Ct) + @(return ECL_T) } cl_object @@ -89,7 +89,7 @@ mp_condition_variable_signal(cl_object cv) { ecl_wakeup_waiters(ecl_process_env(), cv, ECL_WAKEUP_RESET_FLAG | ECL_WAKEUP_ONE); - @(return Ct) + @(return ECL_T) } cl_object @@ -97,5 +97,5 @@ mp_condition_variable_broadcast(cl_object cv) { ecl_wakeup_waiters(ecl_process_env(), cv, ECL_WAKEUP_RESET_FLAG | ECL_WAKEUP_ALL); - @(return Ct) + @(return ECL_T) } diff --git a/src/c/threads/mailbox.d b/src/c/threads/mailbox.d index 648672630..27e302af6 100755 --- a/src/c/threads/mailbox.d +++ b/src/c/threads/mailbox.d @@ -35,12 +35,12 @@ ecl_make_mailbox(cl_object name, cl_fixnum count) count = mask; mask = count - 1; output->mailbox.name = name; - output->mailbox.data = si_make_vector(Ct, /* element type */ + output->mailbox.data = si_make_vector(ECL_T, /* element type */ ecl_make_fixnum(count), /* size */ - Cnil, /* adjustable */ - Cnil, /* fill pointer */ - Cnil, /* displaced to */ - Cnil); /* displacement */ + ECL_NIL, /* adjustable */ + ECL_NIL, /* fill pointer */ + ECL_NIL, /* displaced to */ + ECL_NIL); /* displacement */ output->mailbox.reader_semaphore = ecl_make_semaphore(name, 0); output->mailbox.writer_semaphore = @@ -85,7 +85,7 @@ mp_mailbox_empty_p(cl_object mailbox) unlikely_if (type_of(mailbox) != t_mailbox) { FEerror_not_a_mailbox(mailbox); } - ecl_return1(env, mailbox->mailbox.reader_semaphore->semaphore.counter? Cnil : Ct); + ecl_return1(env, mailbox->mailbox.reader_semaphore->semaphore.counter? ECL_NIL : ECL_T); } cl_object diff --git a/src/c/threads/mutex.d b/src/c/threads/mutex.d index a80b15fdf..bf975a9a6 100755 --- a/src/c/threads/mutex.d +++ b/src/c/threads/mutex.d @@ -48,15 +48,15 @@ ecl_make_lock(cl_object name, bool recursive) { cl_object output = ecl_alloc_object(t_lock); output->lock.name = name; - output->lock.owner = Cnil; + output->lock.owner = ECL_NIL; output->lock.counter = 0; output->lock.recursive = recursive; - output->lock.queue_list = Cnil; - output->lock.queue_spinlock = Cnil; + output->lock.queue_list = ECL_NIL; + output->lock.queue_spinlock = ECL_NIL; return output; } -@(defun mp::make-lock (&key name ((:recursive recursive) Cnil)) +@(defun mp::make-lock (&key name ((:recursive recursive) ECL_NIL)) @ @(return ecl_make_lock(name, !Null(recursive))) @) @@ -67,7 +67,7 @@ mp_recursive_lock_p(cl_object lock) cl_env_ptr env = ecl_process_env(); unlikely_if (type_of(lock) != t_lock) FEerror_not_a_lock(lock); - ecl_return1(env, lock->lock.recursive? Ct : Cnil); + ecl_return1(env, lock->lock.recursive? ECL_T : ECL_NIL); } cl_object @@ -113,13 +113,13 @@ mp_giveup_lock(cl_object lock) FEerror_not_owned(lock); } if (--lock->lock.counter == 0) { - lock->lock.owner = Cnil; + lock->lock.owner = ECL_NIL; print_lock("releasing %p\t", lock, lock); ecl_wakeup_waiters(env, lock, ECL_WAKEUP_ONE); } else { print_lock("released %p\t", lock, lock); } - ecl_return1(env, Ct); + ecl_return1(env, ECL_T); } static cl_object @@ -129,20 +129,20 @@ get_lock_inner(cl_env_ptr env, cl_object lock) cl_object own_process = env->own_process; ecl_disable_interrupts_env(env); if (AO_compare_and_swap_full((AO_t*)&(lock->lock.owner), - (AO_t)Cnil, (AO_t)own_process)) { + (AO_t)ECL_NIL, (AO_t)own_process)) { lock->lock.counter = 1; - output = Ct; + output = ECL_T; print_lock("acquired %p\t", lock, lock); } else if (lock->lock.owner == own_process) { unlikely_if (!lock->lock.recursive) { FEerror_not_a_recursive_lock(lock); } ++lock->lock.counter; - output = Ct; + output = ECL_T; } else { print_lock("failed acquiring %p for %d\t", lock, lock, lock->lock.owner); - output = Cnil; + output = ECL_NIL; } ecl_enable_interrupts_env(env); return output; @@ -165,13 +165,13 @@ mp_get_lock_wait(cl_object lock) unlikely_if (type_of(lock) != t_lock) { FEerror_not_a_lock(lock); } - if (lock->lock.queue_list != Cnil || get_lock_inner(env, lock) == Cnil) { + if (lock->lock.queue_list != ECL_NIL || get_lock_inner(env, lock) == ECL_NIL) { ecl_wait_on(env, get_lock_inner, lock); } - @(return Ct) + @(return ECL_T) } -@(defun mp::get-lock (lock &optional (wait Ct)) +@(defun mp::get-lock (lock &optional (wait ECL_T)) @ if (Null(wait)) return mp_get_lock_nowait(lock); diff --git a/src/c/threads/process.d b/src/c/threads/process.d index d21f68836..c81af54bb 100755 --- a/src/c/threads/process.d +++ b/src/c/threads/process.d @@ -105,10 +105,10 @@ extend_process_vector() ECL_WITH_SPINLOCK_BEGIN(the_env, &cl_core.processes_spinlock) { cl_object other = cl_core.processes; if (new_size > other->vector.dim) { - cl_object new = si_make_vector(Ct, + cl_object new = si_make_vector(ECL_T, ecl_make_fixnum(new_size), ecl_make_fixnum(other->vector.fillp), - Cnil, Cnil, Cnil); + ECL_NIL, ECL_NIL, ECL_NIL); ecl_copy_subarray(new, 0, other, 0, other->vector.dim); cl_core.processes = new; } @@ -160,14 +160,14 @@ static cl_object ecl_process_list() { cl_env_ptr the_env = ecl_process_env(); - cl_object output = Cnil; + cl_object output = ECL_NIL; ECL_WITH_SPINLOCK_BEGIN(the_env, &cl_core.processes_spinlock) { cl_object vector = cl_core.processes; cl_object *data = vector->vector.self.t; cl_index i; for (i = 0; i < vector->vector.fillp; i++) { cl_object p = data[i]; - if (p != Cnil) + if (p != ECL_NIL) output = ecl_cons(p, output); } } ECL_WITH_SPINLOCK_END; @@ -214,7 +214,7 @@ thread_cleanup(void *aux) #endif process->process.env = NULL; ecl_unlist_process(process); - mp_barrier_unblock(3, process->process.exit_barrier, @':disable', Ct); + mp_barrier_unblock(3, process->process.exit_barrier, @':disable', ECL_T); ecl_set_process_env(NULL); if (env) _ecl_dealloc_env(env); AO_store_release((AO_t*)&process->process.phase, ECL_PROCESS_INACTIVE); @@ -247,7 +247,7 @@ thread_entry_point(void *arg) pthread_cleanup_push(thread_cleanup, (void *)process); #endif ecl_cs_set_org(env); - print_lock("ENVIRON %p %p %p %p", Cnil, process, + print_lock("ENVIRON %p %p %p %p", ECL_NIL, process, env->bds_org, env->bds_top, env->bds_limit); /* 2) Execute the code. The CATCH_ALL point is the destination @@ -263,12 +263,12 @@ thread_entry_point(void *arg) #endif process->process.phase = ECL_PROCESS_ACTIVE; ecl_enable_interrupts_env(env); - si_trap_fpe(@'last', Ct); + si_trap_fpe(@'last', ECL_T); ecl_bds_bind(env, @'mp::*current-process*', process); env->values[0] = cl_apply(2, process->process.function, process->process.args); { - cl_object output = Cnil; + cl_object output = ECL_NIL; int i = env->nvalues; while (i--) { output = CONS(env->values[i], output); @@ -300,25 +300,25 @@ alloc_process(cl_object name, cl_object initial_bindings) cl_object process = ecl_alloc_object(t_process), array; process->process.phase = ECL_PROCESS_INACTIVE; process->process.name = name; - process->process.function = Cnil; - process->process.args = Cnil; - process->process.interrupt = Cnil; - process->process.exit_values = Cnil; + process->process.function = ECL_NIL; + process->process.args = ECL_NIL; + process->process.interrupt = ECL_NIL; + process->process.exit_values = ECL_NIL; process->process.env = NULL; if (initial_bindings != OBJNULL) { - array = si_make_vector(Ct, ecl_make_fixnum(256), - Cnil, Cnil, Cnil, Cnil); - si_fill_array_with_elt(array, OBJNULL, ecl_make_fixnum(0), Cnil); + array = si_make_vector(ECL_T, ecl_make_fixnum(256), + ECL_NIL, ECL_NIL, ECL_NIL, ECL_NIL); + si_fill_array_with_elt(array, OBJNULL, ecl_make_fixnum(0), ECL_NIL); } else { array = cl_copy_seq(ecl_process_env()->bindings_array); } process->process.initial_bindings = array; - process->process.waiting_for = Cnil; + process->process.waiting_for = ECL_NIL; process->process.queue_record = ecl_list1(process); /* Creates the exit barrier so that processes can wait for termination, * but it is created in a disabled state. */ process->process.exit_barrier = ecl_make_barrier(name, MOST_POSITIVE_FIXNUM); - mp_barrier_unblock(3, process->process.exit_barrier, @':disable', Ct); + mp_barrier_unblock(3, process->process.exit_barrier, @':disable', ECL_T); return process; } @@ -387,7 +387,7 @@ ecl_release_current_thread(void) #endif } -@(defun mp::make-process (&key name ((:initial-bindings initial_bindings) Ct)) +@(defun mp::make-process (&key name ((:initial-bindings initial_bindings) ECL_T)) cl_object process; @ process = alloc_process(name, initial_bindings); @@ -410,10 +410,10 @@ mp_process_preset(cl_narg narg, cl_object process, cl_object function, ...) cl_object mp_interrupt_process(cl_object process, cl_object function) { - unlikely_if (mp_process_active_p(process) == Cnil) + unlikely_if (mp_process_active_p(process) == ECL_NIL) FEerror("Cannot interrupt the inactive process ~A", 1, process); ecl_interrupt_process(process, function); - @(return Ct) + @(return ECL_T) } cl_object @@ -538,12 +538,12 @@ mp_process_enable(cl_object process) ecl_unlist_process(process); /* Disable the barrier and alert possible waiting processes. */ mp_barrier_unblock(3, process->process.exit_barrier, - @':disable', Ct); + @':disable', ECL_T); process->process.phase = ECL_PROCESS_INACTIVE; process->process.env = NULL; _ecl_dealloc_env(process_env); } - @(return (ok? process : Cnil)) + @(return (ok? process : ECL_NIL)) } cl_object @@ -577,7 +577,7 @@ cl_object mp_process_active_p(cl_object process) { assert_type_process(process); - @(return (process->process.phase? Ct : Cnil)) + @(return (process->process.phase? ECL_T : ECL_NIL)) } cl_object @@ -667,7 +667,7 @@ mp_block_signals(void) #ifdef ECL_WINDOWS_THREADS cl_env_ptr the_env = ecl_process_env(); cl_object previous = ecl_symbol_value(@'ext::*interrupts-enabled*'); - ECL_SETQ(the_env, @'ext::*interrupts-enabled*', Cnil); + ECL_SETQ(the_env, @'ext::*interrupts-enabled*', ECL_NIL); @(return previous) #else cl_object previous = mp_get_sigmask(); @@ -732,20 +732,20 @@ init_threads(cl_env_ptr env) process = ecl_alloc_object(t_process); process->process.phase = ECL_PROCESS_ACTIVE; process->process.name = @'si::top-level'; - process->process.function = Cnil; - process->process.args = Cnil; + process->process.function = ECL_NIL; + process->process.args = ECL_NIL; process->process.thread = main_thread; process->process.env = env; - process->process.waiting_for = Cnil; + process->process.waiting_for = ECL_NIL; process->process.queue_record = ecl_list1(process); env->own_process = process; { - cl_object v = si_make_vector(Ct, /* Element type */ + cl_object v = si_make_vector(ECL_T, /* Element type */ ecl_make_fixnum(256), /* Size */ ecl_make_fixnum(0), /* fill pointer */ - Cnil, Cnil, Cnil); + ECL_NIL, ECL_NIL, ECL_NIL); v->vector.self.t[0] = process; v->vector.fillp = 1; cl_core.processes = v; diff --git a/src/c/threads/queue.d b/src/c/threads/queue.d index 4b840f6a3..357e2979e 100755 --- a/src/c/threads/queue.d +++ b/src/c/threads/queue.d @@ -37,7 +37,7 @@ void ECL_INLINE ecl_get_spinlock(cl_env_ptr the_env, cl_object *lock) { cl_object own_process = the_env->own_process; - while (!AO_compare_and_swap_full((AO_t*)lock, (AO_t)Cnil, + while (!AO_compare_and_swap_full((AO_t*)lock, (AO_t)ECL_NIL, (AO_t)own_process)) { ecl_process_yield(); } @@ -46,7 +46,7 @@ ecl_get_spinlock(cl_env_ptr the_env, cl_object *lock) void ECL_INLINE ecl_giveup_spinlock(cl_object *lock) { - AO_store((AO_t*)lock, (AO_t)Cnil); + AO_store((AO_t*)lock, (AO_t)ECL_NIL); } static ECL_INLINE void @@ -65,7 +65,7 @@ wait_queue_pop_all(cl_env_ptr the_env, cl_object q) { ecl_get_spinlock(the_env, &q->queue.spinlock); output = q->queue.list; - q->queue.list = Cnil; + q->queue.list = ECL_NIL; ecl_giveup_spinlock(&q->queue.spinlock); } ecl_enable_interrupts_env(the_env); @@ -139,26 +139,26 @@ ecl_wait_on_timed(cl_env_ptr env, cl_object (*condition)(cl_env_ptr, cl_object), * too slow */ for (iteration = 0; iteration < 10; iteration++) { cl_object output = condition(the_env,o); - if (output != Cnil) + if (output != ECL_NIL) return output; } /* 0) We reserve a record for the queue. In order to avoid * using the garbage collector, we reuse records */ record = own_process->process.queue_record; - unlikely_if (record == Cnil) { + unlikely_if (record == ECL_NIL) { record = ecl_list1(own_process); } else { - own_process->process.queue_record = Cnil; + own_process->process.queue_record = ECL_NIL; } - ecl_bds_bind(the_env, @'ext::*interrupts-enabled*', Cnil); + ecl_bds_bind(the_env, @'ext::*interrupts-enabled*', ECL_NIL); ECL_UNWIND_PROTECT_BEGIN(the_env) { /* 2) Now we add ourselves to the queue. In order to * avoid a call to the GC, we try to reuse records. */ print_lock("adding to queue", o); wait_queue_nconc(the_env, o, record); - ecl_bds_bind(the_env, @'ext::*interrupts-enabled*', Ct); + ecl_bds_bind(the_env, @'ext::*interrupts-enabled*', ECL_T); ecl_check_pending_interrupts(the_env); /* 3) Unlike the sigsuspend() implementation, this @@ -177,12 +177,12 @@ ecl_wait_on_timed(cl_env_ptr env, cl_object (*condition)(cl_env_ptr, cl_object), * signal. Note that we recover the cons for later use.*/ cl_object firstone = o->queue.list; wait_queue_delete(the_env, o, own_process); - own_process->process.waiting_for = Cnil; + own_process->process.waiting_for = ECL_NIL; own_process->process.queue_record = record; - ECL_RPLACD(record, Cnil); + ECL_RPLACD(record, ECL_NIL); /* 5) When this process exits, it may be because it - * aborts (which we know because output == Cnil), or + * aborts (which we know because output == ECL_NIL), or * because the condition is satisfied. In both cases * we allow the first in the queue to test again its * condition. This is needed for objects, such as @@ -238,10 +238,10 @@ ecl_wait_on(cl_env_ptr env, cl_object (*condition)(cl_env_ptr, cl_object), cl_ob /* 0) We reserve a record for the queue. In order to avoid * using the garbage collector, we reuse records */ record = own_process->process.queue_record; - unlikely_if (record == Cnil) { + unlikely_if (record == ECL_NIL) { record = ecl_list1(own_process); } else { - own_process->process.queue_record = Cnil; + own_process->process.queue_record = ECL_NIL; } /* 1) First we block lisp interrupt signals. This ensures that @@ -283,12 +283,12 @@ ecl_wait_on(cl_env_ptr env, cl_object (*condition)(cl_env_ptr, cl_object), cl_ob * signal. Note that we recover the cons for later use.*/ cl_object firstone = o->queue.list; wait_queue_delete(the_env, o, own_process); - own_process->process.waiting_for = Cnil; + own_process->process.waiting_for = ECL_NIL; own_process->process.queue_record = record; - ECL_RPLACD(record, Cnil); + ECL_RPLACD(record, ECL_NIL); /* 5) When this process exits, it may be because it - * aborts (which we know because output == Cnil), or + * aborts (which we know because output == ECL_NIL), or * because the condition is satisfied. In both cases * we allow the first in the queue to test again its * condition. This is needed for objects, such as @@ -322,7 +322,7 @@ ecl_wakeup_waiters(cl_env_ptr the_env, cl_object q, int flags) * because of the UNWIND-PROTECT in ecl_wait_on(), but * sometimes shit happens */ cl_object *tail, l; - for (tail = &q->queue.list; (l = *tail) != Cnil; ) { + for (tail = &q->queue.list; (l = *tail) != ECL_NIL; ) { cl_object p = ECL_CONS_CAR(l); if (p->process.phase == ECL_PROCESS_INACTIVE || p->process.phase == ECL_PROCESS_EXITING) { @@ -333,7 +333,7 @@ ecl_wakeup_waiters(cl_env_ptr the_env, cl_object q, int flags) * simply awake it with a signal.*/ print_lock("awaking %p", q, p); if (flags & ECL_WAKEUP_RESET_FLAG) - p->process.waiting_for = Cnil; + p->process.waiting_for = ECL_NIL; if (flags & ECL_WAKEUP_KILL) mp_process_kill(p); else @@ -353,18 +353,18 @@ ecl_wakeup_waiters(cl_env_ptr the_env, cl_object q, int flags) void print_lock(char *prefix, cl_object l, ...) { - static cl_object lock = Cnil; + static cl_object lock = ECL_NIL; va_list args; va_start(args, l); return; - if (l == Cnil || ECL_FIXNUMP(l->lock.name)) { + if (l == ECL_NIL || ECL_FIXNUMP(l->lock.name)) { cl_env_ptr env = ecl_process_env(); ecl_get_spinlock(env, &lock); printf("\n%ld\t", ecl_fixnum(env->own_process->process.name)); vprintf(prefix, args); - if (l != Cnil) { + if (l != ECL_NIL) { cl_object p = l->lock.queue_list; - while (p != Cnil) { + while (p != ECL_NIL) { printf(" %lx", ecl_fixnum(ECL_CONS_CAR(p)->process.name)); p = ECL_CONS_CDR(p); } diff --git a/src/c/threads/rwlock.d b/src/c/threads/rwlock.d index f96f24b0c..d15e8c02f 100644 --- a/src/c/threads/rwlock.d +++ b/src/c/threads/rwlock.d @@ -77,7 +77,7 @@ ecl_make_rwlock(cl_object name) if (rc) { FEerror("Unable to create read/write lock", 0); } - ecl_set_finalizer_unprotected(output, Ct); + ecl_set_finalizer_unprotected(output, ECL_T); #else output->rwlock.mutex = ecl_make_lock(name, 0); #endif @@ -110,7 +110,7 @@ mp_giveup_rwlock_read(cl_object lock) int rc = pthread_rwlock_unlock(&lock->rwlock.mutex); if (rc) FEunknown_rwlock_error(lock, rc); - @(return Ct); + @(return ECL_T); } #else return mp_giveup_lock(lock->rwlock.mutex); @@ -131,12 +131,12 @@ mp_get_rwlock_read_nowait(cl_object lock) #ifdef ECL_RWLOCK { const cl_env_ptr env = ecl_process_env(); - cl_object output = Ct; + cl_object output = ECL_T; int rc = pthread_rwlock_tryrdlock(&lock->rwlock.mutex); if (rc == 0) { - output = Ct; + output = ECL_T; } else if (rc == EBUSY) { - output = Cnil; + output = ECL_NIL; } else { FEunknown_rwlock_error(lock, rc); } @@ -159,14 +159,14 @@ mp_get_rwlock_read_wait(cl_object lock) if (rc != 0) { FEunknown_rwlock_error(lock, rc); } - ecl_return1(env, Ct); + ecl_return1(env, ECL_T); } #else return mp_get_lock_wait(lock->rwlock.mutex); #endif } -@(defun mp::get-rwlock-read (lock &optional (wait Ct)) +@(defun mp::get-rwlock-read (lock &optional (wait ECL_T)) @ if (Null(wait)) return mp_get_rwlock_read_nowait(lock); @@ -182,12 +182,12 @@ mp_get_rwlock_write_nowait(cl_object lock) #ifdef ECL_RWLOCK { const cl_env_ptr env = ecl_process_env(); - cl_object output = Ct; + cl_object output = ECL_T; int rc = pthread_rwlock_trywrlock(&lock->rwlock.mutex); if (rc == 0) { - output = Ct; + output = ECL_T; } else if (rc == EBUSY) { - output = Cnil; + output = ECL_NIL; } else { FEunknown_rwlock_error(lock, rc); } @@ -210,14 +210,14 @@ mp_get_rwlock_write_wait(cl_object lock) if (rc != 0) { FEunknown_rwlock_error(lock, rc); } - @(return Ct) + @(return ECL_T) } #else return mp_get_lock_wait(lock->rwlock.mutex); #endif } -@(defun mp::get-rwlock-write (lock &optional (wait Ct)) +@(defun mp::get-rwlock-write (lock &optional (wait ECL_T)) @ if (Null(wait)) return mp_get_rwlock_write_nowait(lock); diff --git a/src/c/threads/semaphore.d b/src/c/threads/semaphore.d index ec1b3e9f3..617e0e0b2 100644 --- a/src/c/threads/semaphore.d +++ b/src/c/threads/semaphore.d @@ -33,8 +33,8 @@ ecl_make_semaphore(cl_object name, cl_fixnum count) cl_object output = ecl_alloc_object(t_semaphore); output->semaphore.name = name; output->semaphore.counter = count; - output->semaphore.queue_list = Cnil; - output->semaphore.queue_spinlock = Cnil; + output->semaphore.queue_list = ECL_NIL; + output->semaphore.queue_spinlock = ECL_NIL; return output; } @@ -84,7 +84,7 @@ mp_semaphore_wait_count(cl_object semaphore) FEerror_not_a_semaphore(semaphore); } AO_fetch_and_add((AO_t*)&semaphore->semaphore.counter, n); - if (semaphore->semaphore.queue_list != Cnil) { + if (semaphore->semaphore.queue_list != ECL_NIL) { ecl_wakeup_waiters(env, semaphore, ECL_WAKEUP_ONE); } @(return) @@ -99,7 +99,7 @@ get_semaphore_inner(cl_env_ptr env, cl_object semaphore) do { cl_fixnum counter = semaphore->semaphore.counter; if (!counter) { - output = Cnil; + output = ECL_NIL; break; } if (AO_compare_and_swap_full((AO_t*)&(semaphore->semaphore.counter), diff --git a/src/c/time.d b/src/c/time.d index 61f1c6265..797fe936d 100644 --- a/src/c/time.d +++ b/src/c/time.d @@ -197,7 +197,7 @@ cl_sleep(cl_object z) } } ECL_WITHOUT_FPE_END; ecl_musleep(time, 0); - @(return Cnil) + @(return ECL_NIL) } static cl_object diff --git a/src/c/typespec.d b/src/c/typespec.d index 74e54521c..740c0211c 100644 --- a/src/c/typespec.d +++ b/src/c/typespec.d @@ -52,7 +52,7 @@ void FEcircular_list(cl_object x) { /* FIXME: Is this the right way to rebind it? */ - ecl_bds_bind(ecl_process_env(), @'*print-circle*', Ct); + ecl_bds_bind(ecl_process_env(), @'*print-circle*', ECL_T); cl_error(9, @'simple-type-error', @':format-control', make_constant_base_string("Circular list ~D"), @':format-arguments', cl_list(1, x), @@ -94,7 +94,7 @@ ecl_type_error(cl_object function, const char *place, cl_object o, cl_object type) { return funcall(5, @'si::wrong-type-argument', o, type, - (*place? make_constant_base_string(place) : Cnil), + (*place? make_constant_base_string(place) : ECL_NIL), function); } @@ -222,9 +222,9 @@ assert_type_non_negative_integer(cl_object p) void assert_type_proper_list(cl_object p) { - if (ECL_ATOM(p) && p != Cnil) + if (ECL_ATOM(p) && p != ECL_NIL) FEtype_error_list(p); - if (cl_list_length(p) == Cnil) + if (cl_list_length(p) == ECL_NIL) FEcircular_list(p); } @@ -238,7 +238,7 @@ cl_type_of(cl_object x) case t_instance: { cl_object cl = CLASS_OF(x); t = CLASS_NAME(cl); - if (t == Cnil || cl != cl_find_class(2, t, Cnil)) + if (t == ECL_NIL || cl != cl_find_class(2, t, ECL_NIL)) t = cl; break; } @@ -261,7 +261,7 @@ cl_type_of(cl_object x) } case t_symbol: - if (x == Ct) + if (x == ECL_T) t = @'boolean'; else if (x->symbol.hpack == cl_core.keyword_package) t = @'keyword'; diff --git a/src/c/unify.d b/src/c/unify.d index 0b8cdd3e2..79019be53 100644 --- a/src/c/unify.d +++ b/src/c/unify.d @@ -36,13 +36,13 @@ object **trail_top = trail; @(defun trail_restore () @ trail_restore; - @(return Cnil) + @(return ECL_NIL) @) @(defun trail_unmark () @ trail_unmark; - @(return Cnil) + @(return ECL_NIL) @) /* -------------------- Mode Operators -------------------- */ @@ -72,17 +72,17 @@ bool set_slot(object x) /* write mode */ @(defun get_value (v x) @ - @(return (get_value(v, x)?Ct:Cnil)) + @(return (get_value(v, x)?ECL_T:ECL_NIL)) @) @(defun get_constant (c x) @ - @(return (get_constant(c, x)?Ct:Cnil)) + @(return (get_constant(c, x)?ECL_T:ECL_NIL)) @) @(defun get_nil (arg) @ - @(return (get_nil(arg)?Ct:Cnil)) + @(return (get_nil(arg)?ECL_T:ECL_NIL)) @) bool @@ -115,7 +115,7 @@ RETRY: switch (type_of(x)) { @(defun get_cons (arg) @ - @(return (get_cons(arg)?Ct:Cnil)) + @(return (get_cons(arg)?ECL_T:ECL_NIL)) @) bool @@ -148,7 +148,7 @@ RETRY: switch (type_of(x)) { @(defun get_instance (x class arity) @ - @(return (get_instance(x, class, ecl_fixnum(arity))?Ct:Cnil)) + @(return (get_instance(x, class, ecl_fixnum(arity))?ECL_T:ECL_NIL)) @) @@ -227,21 +227,21 @@ unify(object x, object y) object x; @ x = (object)unify_value(loc); - @(return ((x == Cnil || x)?Ct:Cnil)) + @(return ((x == ECL_NIL || x)?ECL_T:ECL_NIL)) @) @(defun unify_constant (c) object x; @ x = (object)unify_constant(c); - @(return ((x == Cnil || x)?Ct:Cnil)) + @(return ((x == ECL_NIL || x)?ECL_T:ECL_NIL)) @) @(defun unify_nil () object x; @ x = (object)unify_nil; - @(return ((x == Cnil || x)?Ct:Cnil)) + @(return ((x == ECL_NIL || x)?ECL_T:ECL_NIL)) @) /* -------------------- Test Functions -------------------- */ @@ -253,12 +253,12 @@ unify(object x, object y) @(defun locativep (obje) @ - @(return (LOCATIVEP(obje)?Ct:Cnil)) + @(return (LOCATIVEP(obje)?ECL_T:ECL_NIL)) @) @(defun unboundp (loc) @ - @(return (UNBOUNDP(loc)?Ct:Cnil)) + @(return (UNBOUNDP(loc)?ECL_T:ECL_NIL)) @) @(defun dereference (x) @@ -282,13 +282,13 @@ object Ssetq, Sunify_slot; @ @(return list(3, Sprogn, list(3, Ssetq, CADR(var), - CONS(Sunify_slot, Cnil)), - Ct)) + CONS(Sunify_slot, ECL_NIL)), + ECL_T)) @) #define make_si_macro(name, cfun) \ {object x = make_si_ordinary(name); \ - SYM_FUN(x) = make_cfun(cfun, Cnil, NULL); \ + SYM_FUN(x) = make_cfun(cfun, ECL_NIL, NULL); \ x->symbol.mflag = TRUE; \ } diff --git a/src/c/unixfsys.d b/src/c/unixfsys.d index 02deebabd..bb12edf09 100644 --- a/src/c/unixfsys.d +++ b/src/c/unixfsys.d @@ -68,10 +68,10 @@ coerce_to_posix_filename(cl_object filename) static int safe_chdir(const char *path, cl_object prefix) { - if (prefix != Cnil) { + if (prefix != ECL_NIL) { cl_object aux = make_constant_base_string(path); aux = si_base_string_concatenate(2, prefix, aux); - return safe_chdir((char *)aux->base_string.self, Cnil); + return safe_chdir((char *)aux->base_string.self, ECL_NIL); } else { int output; ecl_disable_interrupts(); @@ -109,14 +109,14 @@ drive_host_prefix(cl_object pathname) { cl_object device = pathname->pathname.device; cl_object host = pathname->pathname.host; - cl_object output = Cnil; - if (device != Cnil) { + cl_object output = ECL_NIL; + if (device != ECL_NIL) { output = make_base_string_copy("X:"); output->base_string.self[0] = device->base_string.self[0]; } - if (host != Cnil) { + if (host != ECL_NIL) { cl_object slash = cl_core.slash; - if (output != Cnil) + if (output != ECL_NIL) output = si_base_string_concatenate(5, output, slash, slash, host, slash); else @@ -126,7 +126,7 @@ drive_host_prefix(cl_object pathname) return output; } #else -#define drive_host_prefix(x) Cnil +#define drive_host_prefix(x) ECL_NIL #endif /* @@ -191,7 +191,7 @@ file_kind(char *filename, bool follow_links) { ecl_disable_interrupts(); dw = GetFileAttributes( filename ); if (dw == -1) - output = Cnil; + output = ECL_NIL; else if ( dw & FILE_ATTRIBUTE_DIRECTORY ) output = @':directory'; else @@ -204,7 +204,7 @@ file_kind(char *filename, bool follow_links) { # else if (safe_stat(filename, &buf) < 0) # endif - output = Cnil; + output = ECL_NIL; # ifdef HAVE_LSTAT else if (S_ISLNK(buf.st_mode)) output = @':link'; @@ -282,21 +282,21 @@ enter_directory(cl_object base_dir, cl_object subdir, bool ignore_if_failure) aux = ecl_namestring(output, ECL_NAMESTRING_FORCE_BASE_STRING); aux->base_string.self[aux->base_string.fillp-1] = 0; kind = file_kind((char*)aux->base_string.self, FALSE); - if (kind == Cnil) { - if (ignore_if_failure) return Cnil; + if (kind == ECL_NIL) { + if (ignore_if_failure) return ECL_NIL; FEcannot_open(aux); #ifdef HAVE_LSTAT } else if (kind == @':link') { output = cl_truename(ecl_merge_pathnames(si_readlink(aux), base_dir, @':default')); - if (output->pathname.name != Cnil || - output->pathname.type != Cnil) + if (output->pathname.name != ECL_NIL || + output->pathname.type != ECL_NIL) goto WRONG_DIR; return output; #endif } else if (kind != @':directory') { WRONG_DIR: - if (ignore_if_failure) return Cnil; + if (ignore_if_failure) return ECL_NIL; FEerror("The directory~& ~S~&in pathname~& ~S~&" "actually points to a file or special device.", 2, subdir, base_dir); @@ -305,7 +305,7 @@ enter_directory(cl_object base_dir, cl_object subdir, bool ignore_if_failure) cl_object newdir= output->pathname.directory; newdir = ecl_nbutlast(newdir, 2); if (Null(newdir)) { - if (ignore_if_failure) return Cnil; + if (ignore_if_failure) return ECL_NIL; FEerror("Pathname contained an :UP component " "that goes above the base directory:" "~& ~S", 1, output); @@ -329,7 +329,7 @@ make_base_pathname(cl_object pathname) return ecl_make_pathname(pathname->pathname.host, pathname->pathname.device, ecl_list1(@':absolute'), - Cnil, Cnil, Cnil, @':local'); + ECL_NIL, ECL_NIL, ECL_NIL, @':local'); } #define FOLLOW_SYMLINKS 1 @@ -351,7 +351,7 @@ file_truename(cl_object pathname, cl_object filename, int flags) } } kind = file_kind((char*)filename->base_string.self, FALSE); - if (kind == Cnil) { + if (kind == ECL_NIL) { FEcannot_open(filename); #ifdef HAVE_LSTAT } else if (kind == @':link' && (flags & FOLLOW_SYMLINKS)) { @@ -361,7 +361,7 @@ file_truename(cl_object pathname, cl_object filename, int flags) pathname = ecl_make_pathname(pathname->pathname.host, pathname->pathname.device, pathname->pathname.directory, - Cnil, Cnil, Cnil, @':local'); + ECL_NIL, ECL_NIL, ECL_NIL, @':local'); pathname = ecl_merge_pathnames(filename, pathname, @':default'); return cl_truename(pathname); #endif @@ -369,8 +369,8 @@ file_truename(cl_object pathname, cl_object filename, int flags) /* If the pathname is a directory but we have supplied a file name, correct the type by appending a directory separator and re-parsing again the namestring */ - if (pathname->pathname.name != Cnil || - pathname->pathname.type != Cnil) { + if (pathname->pathname.name != ECL_NIL || + pathname->pathname.type != ECL_NIL) { pathname = si_base_string_concatenate (2, filename, make_constant_base_string("/")); @@ -379,14 +379,14 @@ file_truename(cl_object pathname, cl_object filename, int flags) } /* ECL does not contemplate version numbers in directory pathnames */ - if (pathname->pathname.name == Cnil && - pathname->pathname.type == Cnil) { + if (pathname->pathname.name == ECL_NIL && + pathname->pathname.type == ECL_NIL) { /* We have to destructively change the * pathname version here. Otherwise * merge_pathnames will not do it. It is * safe because coerce_to_file_pathname * created a copy. */ - pathname->pathname.version = Cnil; + pathname->pathname.version = ECL_NIL; } else { pathname->pathname.version = @':newest'; } @@ -416,7 +416,7 @@ cl_truename(cl_object orig_pathname) base_dir = enter_directory(base_dir, ECL_CONS_CAR(dir), 0); } pathname = ecl_merge_pathnames(base_dir, pathname, @':default'); - @(return file_truename(pathname, Cnil, FOLLOW_SYMLINKS)) + @(return file_truename(pathname, ECL_NIL, FOLLOW_SYMLINKS)) } int @@ -474,10 +474,10 @@ ecl_file_len(int f) newn = ecl_merge_pathnames(newn, oldn, @':newest'); new_filename = si_coerce_to_filename(newn); - while (if_exists == @':error' || if_exists == Cnil) + while (if_exists == @':error' || if_exists == ECL_NIL) { - if (cl_probe_file(new_filename) == Cnil) { - if_exists = Ct; + if (cl_probe_file(new_filename) == ECL_NIL) { + if_exists = ECL_T; break; } /* if the file already exists */ @@ -485,13 +485,13 @@ ecl_file_len(int f) if_exists = CEerror(@':supersede', "When trying to rename ~S, ~S already exists", 2, oldn, new_filename); - if (if_exists == Ct) if_exists= @':error'; + if (if_exists == ECL_T) if_exists= @':error'; } - if (if_exists == Cnil) { - @(return Cnil Cnil Cnil) + if (if_exists == ECL_NIL) { + @(return ECL_NIL ECL_NIL ECL_NIL) } } - if (ecl_unlikely(if_exists != @':supersede' && if_exists != Ct)) { + if (ecl_unlikely(if_exists != @':supersede' && if_exists != ECL_T)) { /* invalid key */ FEerror("~S is an illegal IF-EXISTS option for RENAME-FILE.", 1, if_exists); @@ -558,8 +558,8 @@ SUCCESS: static int directory_pathname_p(cl_object path) { - return (path->pathname.name == Cnil) && - (path->pathname.type == Cnil); + return (path->pathname.name == ECL_NIL) && + (path->pathname.type == ECL_NIL); } cl_object @@ -581,14 +581,14 @@ cl_delete_file(cl_object file) "Cannot delete the directory ~S."; FElibc_error(msg, 1, file); } - @(return Ct) + @(return ECL_T) } cl_object cl_probe_file(cl_object file) { /* INV: Both SI:FILE-KIND and TRUENAME complain if "file" has wildcards */ - @(return (si_file_kind(file, Ct) != Cnil? cl_truename(file) : Cnil)) + @(return (si_file_kind(file, ECL_T) != ECL_NIL? cl_truename(file) : ECL_NIL)) } cl_object @@ -597,7 +597,7 @@ cl_file_write_date(cl_object file) cl_object time, filename = coerce_to_posix_filename(file); struct stat filestatus; if (safe_stat((char*)filename->base_string.self, &filestatus) < 0) { - time = Cnil; + time = ECL_NIL; } else { time = UTC_time_to_universal_time(filestatus.st_mtime); } @@ -646,7 +646,7 @@ ecl_homedir_pathname(cl_object user) i--; } if (i == 0) - return ecl_homedir_pathname(Cnil); + return ecl_homedir_pathname(ECL_NIL); #ifdef HAVE_PWD_H pwent = getpwnam(p); if (pwent == NULL) @@ -673,19 +673,19 @@ ecl_homedir_pathname(cl_object user) if (!IS_DIR_SEPARATOR(namestring->base_string.self[i-1])) namestring = si_base_string_concatenate(2, namestring, ECL_CODE_CHAR(DIR_SEPARATOR)); - return cl_parse_namestring(3, namestring, Cnil, Cnil); + return cl_parse_namestring(3, namestring, ECL_NIL, ECL_NIL); } @(defun user_homedir_pathname (&optional host) @ /* Ignore optional host argument. */ - @(return ecl_homedir_pathname(Cnil)); + @(return ecl_homedir_pathname(ECL_NIL)); @) static bool string_match(const char *s, cl_object pattern) { - if (pattern == Cnil || pattern == @':wild') { + if (pattern == ECL_NIL || pattern == @':wild') { return 1; } else { cl_index ls = strlen(s); @@ -706,7 +706,7 @@ list_directory(cl_object base_dir, cl_object text_mask, cl_object pathname_mask, int flags) { const cl_env_ptr the_env = ecl_process_env(); - cl_object out = Cnil; + cl_object out = ECL_NIL; cl_object prefix = ecl_namestring(base_dir, ECL_NAMESTRING_FORCE_BASE_STRING); cl_object component, component_path, kind; char *text; @@ -717,7 +717,7 @@ list_directory(cl_object base_dir, cl_object text_mask, cl_object pathname_mask, ecl_disable_interrupts(); dir = opendir((char*)prefix->base_string.self); if (dir == NULL) { - out = Cnil; + out = ECL_NIL; goto OUTPUT; } @@ -736,7 +736,7 @@ list_directory(cl_object base_dir, cl_object text_mask, cl_object pathname_mask, cl_object mask = si_base_string_concatenate(2, prefix, aux); hFind = FindFirstFile((char*)mask->base_string.self, &fd); if (hFind == INVALID_HANDLE_VALUE) { - out = Cnil; + out = ECL_NIL; goto OUTPUT; } found = TRUE; @@ -754,7 +754,7 @@ list_directory(cl_object base_dir, cl_object text_mask, cl_object pathname_mask, ecl_disable_interrupts(); fp = fopen((char*)prefix->base_string.self, OPEN_R); if (fp == NULL) { - out = Cnil; + out = ECL_NIL; goto OUTPUT; } setbuf(fp, iobuffer); @@ -807,17 +807,17 @@ OUTPUT: static cl_object dir_files(cl_object base_dir, cl_object pathname, int flags) { - cl_object all_files, output = Cnil; + cl_object all_files, output = ECL_NIL; cl_object mask; cl_object name = pathname->pathname.name; cl_object type = pathname->pathname.type; - if (name == Cnil && type == Cnil) { + if (name == ECL_NIL && type == ECL_NIL) { return cl_list(1, base_dir); } - mask = ecl_make_pathname(Cnil, Cnil, Cnil, + mask = ecl_make_pathname(ECL_NIL, ECL_NIL, ECL_NIL, name, type, pathname->pathname.version, @':local'); - for (all_files = list_directory(base_dir, Cnil, mask, flags); + for (all_files = list_directory(base_dir, ECL_NIL, mask, flags); !Null(all_files); all_files = ECL_CONS_CDR(all_files)) { @@ -840,7 +840,7 @@ dir_files(cl_object base_dir, cl_object pathname, int flags) static cl_object dir_recursive(cl_object base_dir, cl_object directory, cl_object filemask, int flags) { - cl_object item, output = Cnil; + cl_object item, output = ECL_NIL; AGAIN: /* There are several possibilities here: * @@ -849,7 +849,7 @@ dir_recursive(cl_object base_dir, cl_object directory, cl_object filemask, int f * we simply output the truename of the current directory. Otherwise * we have to find a file which corresponds to the description. */ - if (directory == Cnil) { + if (directory == ECL_NIL) { return ecl_nconc(dir_files(base_dir, filemask, flags), output); } /* @@ -864,7 +864,7 @@ dir_recursive(cl_object base_dir, cl_object directory, cl_object filemask, int f * 2.1) If CAR(DIRECTORY) is a string or :WILD, we have to * enter & scan all subdirectories in our curent directory. */ - cl_object next_dir = list_directory(base_dir, item, Cnil, flags); + cl_object next_dir = list_directory(base_dir, item, ECL_NIL, flags); for (; !Null(next_dir); next_dir = ECL_CONS_CDR(next_dir)) { cl_object record = ECL_CONS_CAR(next_dir); cl_object component = ECL_CONS_CAR(record); @@ -882,7 +882,7 @@ dir_recursive(cl_object base_dir, cl_object directory, cl_object filemask, int f * scan all subdirectories from _all_ levels, looking for a * tree that matches the remaining part of DIRECTORY. */ - cl_object next_dir = list_directory(base_dir, Cnil, Cnil, flags); + cl_object next_dir = list_directory(base_dir, ECL_NIL, ECL_NIL, flags); for (; !Null(next_dir); next_dir = ECL_CONS_CDR(next_dir)) { cl_object record = ECL_CONS_CAR(next_dir); cl_object component = ECL_CONS_CAR(record); @@ -907,14 +907,14 @@ dir_recursive(cl_object base_dir, cl_object directory, cl_object filemask, int f * for the file part. */ if (Null(base_dir)) - return Cnil; + return ECL_NIL; directory = ECL_CONS_CDR(directory); goto AGAIN; } return output; } -@(defun directory (mask &key (resolve_symlinks Ct) &allow_other_keys) +@(defun directory (mask &key (resolve_symlinks ECL_T) &allow_other_keys) cl_object base_dir; cl_object output; @ @@ -926,10 +926,10 @@ dir_recursive(cl_object base_dir, cl_object directory, cl_object filemask, int f @(return output) @) -@(defun ext::getcwd (&optional (change_d_p_d Cnil)) +@(defun ext::getcwd (&optional (change_d_p_d ECL_NIL)) cl_object output; @ - output = cl_parse_namestring(3, current_dir(), Cnil, Cnil); + output = cl_parse_namestring(3, current_dir(), ECL_NIL, ECL_NIL); if (!Null(change_d_p_d)) { ECL_SETQ(the_env, @'*default-pathname-defaults*', output); } @@ -967,8 +967,8 @@ si_get_library_pathname(void) s->base_string.fillp = len; /* GetModuleFileName returns a file name. We have to strip * the directory component. */ - s = cl_make_pathname(8, @':name', Cnil, @':type', Cnil, - @':version', Cnil, + s = cl_make_pathname(8, @':name', ECL_NIL, @':type', ECL_NIL, + @':version', ECL_NIL, @':defaults', s); s = ecl_namestring(s, ECL_NAMESTRING_FORCE_BASE_STRING); } @@ -990,22 +990,22 @@ si_get_library_pathname(void) @(return s); } -@(defun ext::chdir (directory &optional (change_d_p_d Ct)) +@(defun ext::chdir (directory &optional (change_d_p_d ECL_T)) cl_object previous = si_getcwd(0); cl_object namestring; @ /* This will fail if the new directory does not exist */ directory = cl_truename(directory); - if (directory->pathname.name != Cnil || - directory->pathname.type != Cnil) + if (directory->pathname.name != ECL_NIL || + directory->pathname.type != ECL_NIL) FEerror("~A is not a directory pathname.", 1, directory); namestring = ecl_namestring(directory, ECL_NAMESTRING_TRUNCATE_IF_ERROR | ECL_NAMESTRING_FORCE_BASE_STRING); - if (safe_chdir((char*)namestring->base_string.self, Cnil) < 0) + if (safe_chdir((char*)namestring->base_string.self, ECL_NIL) < 0) FElibc_error("Can't change the current directory to ~A", 1, namestring); - if (change_d_p_d != Cnil) + if (change_d_p_d != ECL_NIL) ECL_SETQ(the_env, @'*default-pathname-defaults*', directory); @(return previous) @) @@ -1064,9 +1064,9 @@ si_mkstemp(cl_object template) phys = cl_translate_logical_pathname(1, template); dir = cl_make_pathname(8, - @':type', Cnil, - @':name', Cnil, - @':version', Cnil, + @':type', ECL_NIL, + @':name', ECL_NIL, + @':version', ECL_NIL, @':defaults', phys); dir = si_coerce_to_filename(dir); file = cl_file_namestring(phys); @@ -1083,7 +1083,7 @@ si_mkstemp(cl_object template) strTempFileName); ecl_enable_interrupts(); if (!ok) { - output = Cnil; + output = ECL_NIL; } else { l = strlen(strTempFileName); output = ecl_alloc_simple_base_string(l); @@ -1109,7 +1109,7 @@ si_mkstemp(cl_object template) ecl_enable_interrupts(); if (fd < 0) { - output = Cnil; + output = ECL_NIL; } else { close(fd); } @@ -1120,8 +1120,8 @@ si_mkstemp(cl_object template) cl_object si_rmdir(cl_object directory) { - return cl_delete_file(cl_make_pathname(6, @':name', Cnil, - @':type', Cnil, + return cl_delete_file(cl_make_pathname(6, @':name', ECL_NIL, + @':type', ECL_NIL, @':defaults', directory)); } @@ -1149,7 +1149,7 @@ si_copy_file(cl_object orig, cl_object dest) fclose(in); } ecl_enable_interrupts(); - @(return (ok? Ct : Cnil)) + @(return (ok? ECL_T : ECL_NIL)) } cl_object diff --git a/src/c/unixint.d b/src/c/unixint.d index 20a122688..af903fdde 100644 --- a/src/c/unixint.d +++ b/src/c/unixint.d @@ -101,31 +101,31 @@ static struct { cl_object handler; } known_signals[] = { #ifdef SIGHUP - { SIGHUP, "+SIGHUP+", Cnil}, + { SIGHUP, "+SIGHUP+", ECL_NIL}, #endif #ifdef SIGINT { SIGINT, "+SIGINT+", @'si::terminal-interrupt'}, #endif #ifdef SIGQUIT - { SIGQUIT, "+SIGQUIT+", Cnil}, + { SIGQUIT, "+SIGQUIT+", ECL_NIL}, #endif #ifdef SIGILL { SIGILL, "+SIGILL+", @'ext::illegal-instruction'}, #endif #ifdef SIGTRAP - { SIGTRAP, "+SIGTRAP+", Cnil}, + { SIGTRAP, "+SIGTRAP+", ECL_NIL}, #endif #ifdef SIGABRT - { SIGABRT, "+SIGABRT+", Cnil}, + { SIGABRT, "+SIGABRT+", ECL_NIL}, #endif #ifdef SIGEMT - { SIGEMT, "+SIGEMT+", Cnil}, + { SIGEMT, "+SIGEMT+", ECL_NIL}, #endif #ifdef SIGFPE - { SIGFPE, "+SIGFPE+", Cnil}, + { SIGFPE, "+SIGFPE+", ECL_NIL}, #endif #ifdef SIGKILL - { SIGKILL, "+SIGKILL+", Cnil}, + { SIGKILL, "+SIGKILL+", ECL_NIL}, #endif #ifdef SIGBUS { SIGBUS, "+SIGBUS+", @'ext::segmentation-violation'}, @@ -134,69 +134,69 @@ static struct { { SIGSEGV, "+SIGSEGV+", @'ext::segmentation-violation'}, #endif #ifdef SIGSYS - { SIGSYS, "+SIGSYS+", Cnil}, + { SIGSYS, "+SIGSYS+", ECL_NIL}, #endif #ifdef SIGPIPE - { SIGPIPE, "+SIGPIPE+", Cnil}, + { SIGPIPE, "+SIGPIPE+", ECL_NIL}, #endif #ifdef SIGALRM - { SIGALRM, "+SIGALRM+", Cnil}, + { SIGALRM, "+SIGALRM+", ECL_NIL}, #endif #ifdef SIGTERM - { SIGTERM, "+SIGTERM+", Cnil}, + { SIGTERM, "+SIGTERM+", ECL_NIL}, #endif #ifdef SIGURG - { SIGURG, "+SIGURG+", Cnil}, + { SIGURG, "+SIGURG+", ECL_NIL}, #endif #ifdef SIGSTOP - { SIGSTOP, "+SIGSTOP+", Cnil}, + { SIGSTOP, "+SIGSTOP+", ECL_NIL}, #endif #ifdef SIGTSTP - { SIGTSTP, "+SIGTSTP+", Cnil}, + { SIGTSTP, "+SIGTSTP+", ECL_NIL}, #endif #ifdef SIGCONT - { SIGCONT, "+SIGCONT+", Cnil}, + { SIGCONT, "+SIGCONT+", ECL_NIL}, #endif #ifdef SIGCHLD { SIGCHLD, "+SIGCHLD+", @'si::wait-for-all-processes'}, #endif #ifdef SIGTTIN - { SIGTTIN, "+SIGTTIN+", Cnil}, + { SIGTTIN, "+SIGTTIN+", ECL_NIL}, #endif #ifdef SIGTTOU - { SIGTTOU, "+SIGTTOU+", Cnil}, + { SIGTTOU, "+SIGTTOU+", ECL_NIL}, #endif #ifdef SIGIO - { SIGIO, "+SIGIO+", Cnil}, + { SIGIO, "+SIGIO+", ECL_NIL}, #endif #ifdef SIGXCPU - { SIGXCPU, "+SIGXCPU+", Cnil}, + { SIGXCPU, "+SIGXCPU+", ECL_NIL}, #endif #ifdef SIGXFSZ - { SIGXFSZ, "+SIGXFSZ+", Cnil}, + { SIGXFSZ, "+SIGXFSZ+", ECL_NIL}, #endif #ifdef SIGVTALRM - { SIGVTALRM, "+SIGVTALRM+", Cnil}, + { SIGVTALRM, "+SIGVTALRM+", ECL_NIL}, #endif #ifdef SIGPROF - { SIGPROF, "+SIGPROF+", Cnil}, + { SIGPROF, "+SIGPROF+", ECL_NIL}, #endif #ifdef SIGWINCH - { SIGWINCH, "+SIGWINCH+", Cnil}, + { SIGWINCH, "+SIGWINCH+", ECL_NIL}, #endif #ifdef SIGINFO - { SIGINFO, "+SIGINFO+", Cnil}, + { SIGINFO, "+SIGINFO+", ECL_NIL}, #endif #ifdef SIGUSR1 - { SIGUSR1, "+SIGUSR1+", Cnil}, + { SIGUSR1, "+SIGUSR1+", ECL_NIL}, #endif #ifdef SIGUSR2 - { SIGUSR2, "+SIGUSR2+", Cnil}, + { SIGUSR2, "+SIGUSR2+", ECL_NIL}, #endif #ifdef SIGTHR - { SIGTHR, "+SIGTHR+", Cnil}, + { SIGTHR, "+SIGTHR+", ECL_NIL}, #endif - { -1, "", Cnil } + { -1, "", ECL_NIL } }; #ifdef HAVE_SIGPROCMASK @@ -334,7 +334,7 @@ handle_signal_now(cl_object signal_code, cl_object process) * be a function, a symbol denoting a function or * a symbol denoting a condition. */ - if (cl_find_class(2, signal_code, Cnil) != Cnil) + if (cl_find_class(2, signal_code, ECL_NIL) != ECL_NIL) cl_cerror(2, str_ignore_signal, signal_code); #ifdef ECL_THREADS else if (!Null(process)) @@ -364,7 +364,7 @@ si_handle_signal(cl_object signal_code, cl_object process) static void handle_all_queued(cl_env_ptr env) { - while (env->pending_interrupt != Cnil) { + while (env->pending_interrupt != ECL_NIL) { handle_signal_now(pop_signal(env), env->own_process); } } @@ -375,14 +375,14 @@ queue_signal(cl_env_ptr env, cl_object code, int allocate) ECL_WITH_SPINLOCK_BEGIN(env, &env->signal_queue_spinlock) { cl_object record; if (allocate) { - record = ecl_list1(Cnil); + record = ecl_list1(ECL_NIL); } else { record = ECL_CONS_CAR(env->signal_queue); - if (record != Cnil) { + if (record != ECL_NIL) { env->signal_queue = ECL_CONS_CDR(record); } } - if (record != Cnil) { + if (record != ECL_NIL) { ECL_RPLACD(record, env->pending_interrupt); ECL_RPLACA(record, code); env->pending_interrupt = record; @@ -394,8 +394,8 @@ static cl_object pop_signal(cl_env_ptr env) { cl_object record, value; - if (env->pending_interrupt == Cnil) { - return Cnil; + if (env->pending_interrupt == ECL_NIL) { + return ECL_NIL; } ECL_WITH_SPINLOCK_BEGIN(env, &env->signal_queue_spinlock) { record = env->pending_interrupt; @@ -439,7 +439,7 @@ handle_or_queue(cl_env_ptr the_env, cl_object signal_code, int code) */ else { if (code) unblock_signal(the_env, code); - si_trap_fpe(@'last', Ct); /* Clear FPE exception flag */ + si_trap_fpe(@'last', ECL_T); /* Clear FPE exception flag */ handle_signal_now(signal_code, the_env->own_process); } } @@ -457,7 +457,7 @@ handler_fn_prototype(non_evil_signal_handler, int sig, siginfo_t *siginfo, void return; signal_object = ecl_gethash_safe(ecl_make_fixnum(sig), cl_core.known_signals, - Cnil); + ECL_NIL); handle_or_queue(the_env, signal_object, sig); errno = old_errno; } @@ -475,7 +475,7 @@ handler_fn_prototype(evil_signal_handler, int sig, siginfo_t *siginfo, void *dat return; signal_object = ecl_gethash_safe(ecl_make_fixnum(sig), cl_core.known_signals, - Cnil); + ECL_NIL); handle_signal_now(signal_object, the_env->own_process); errno = old_errno; } @@ -485,9 +485,9 @@ typedef struct { cl_object process; int signo; } signal_thread_message; -static cl_object signal_thread_process = Cnil; +static cl_object signal_thread_process = ECL_NIL; static signal_thread_message signal_thread_msg; -static cl_object signal_thread_spinlock = Cnil; +static cl_object signal_thread_spinlock = ECL_NIL; static int signal_thread_pipe[2] = {-1,-1}; static void @@ -544,10 +544,10 @@ asynchronous_signal_servicing_thread() ecl_get_spinlock(the_env, &signal_thread_spinlock); pipe(signal_thread_pipe); ecl_giveup_spinlock(&signal_thread_spinlock); - signal_thread_msg.process = Cnil; + signal_thread_msg.process = ECL_NIL; for (;;) { cl_object signal_code; - signal_thread_msg.process = Cnil; + signal_thread_msg.process = ECL_NIL; if (read(signal_thread_pipe[0], &signal_thread_msg, sizeof(signal_thread_msg)) < 0) { @@ -567,7 +567,7 @@ asynchronous_signal_servicing_thread() #endif signal_code = ecl_gethash_safe(ecl_make_fixnum(signal_thread_msg.signo), cl_core.known_signals, - Cnil); + ECL_NIL); if (!Null(signal_code)) { mp_process_run_function(4, @'si::handle-signal', @'si::handle-signal', @@ -683,9 +683,9 @@ handler_fn_prototype(fpe_signal_handler, int sig, siginfo_t *info, void *data) #endif /* SA_SIGINFO */ /* if (code && !(code & the_env->trap_fpe_bits)) - condition = Cnil; + condition = ECL_NIL; */ - si_trap_fpe(@'last', Ct); /* Clear FPE exception flag */ + si_trap_fpe(@'last', ECL_T); /* Clear FPE exception flag */ unblock_signal(the_env, code); handle_signal_now(condition, the_env->own_process); /* We will not reach past this point. */ @@ -784,12 +784,12 @@ static cl_object do_catch_signal(int code, cl_object action, cl_object process) { cl_object code_fixnum = ecl_make_fixnum(code); - if (action == Cnil || action == @':ignore') { + if (action == ECL_NIL || action == @':ignore') { mysignal(code, SIG_IGN); - return Ct; + return ECL_T; } else if (action == @':default') { mysignal(code, SIG_DFL); - return Ct; + return ECL_T; } else if (action == @':mask' || action == @':unmask') { #ifdef HAVE_SIGPROCMASK # ifdef ECL_THREADS @@ -804,7 +804,7 @@ do_catch_signal(int code, cl_object action, cl_object process) } else { sigdelset(handled_set, code); } - return Ct; + return ECL_T; } else { sigset_t handled_set; pthread_sigmask(SIG_SETMASK, NULL, &handled_set); @@ -814,7 +814,7 @@ do_catch_signal(int code, cl_object action, cl_object process) sigdelset(&handled_set, code); } pthread_sigmask(SIG_SETMASK, &handled_set, NULL); - return Ct; + return ECL_T; } # else { @@ -826,13 +826,13 @@ do_catch_signal(int code, cl_object action, cl_object process) sigdelset(&handled_set, code); } sigprocmask(SIG_SETMASK, &handled_set, NULL); - return Ct; + return ECL_T; } # endif /* !ECL_THREADS */ #else /* !HAVE_SIGPROCMASK */ - return Cnil; + return ECL_NIL; #endif /* !HAVE_SIGPROCMASK */ - } else if (action == Ct || action == @':catch') { + } else if (action == ECL_T || action == @':catch') { if (code == SIGSEGV) { mysignal(code, sigsegv_handler); } @@ -857,7 +857,7 @@ do_catch_signal(int code, cl_object action, cl_object process) else { mysignal(code, non_evil_signal_handler); } - return Ct; + return ECL_T; } else { FEerror("Unknown 2nd argument to EXT:CATCH-SIGNAL: ~A", 1, action); @@ -882,7 +882,7 @@ si_set_signal_handler(cl_object code, cl_object handler) illegal_signal_code(code); } ecl_sethash(code, cl_core.known_signals, handler); - si_catch_signal(2, code, Ct); + si_catch_signal(2, code, ECL_T); @(return handler) } @@ -956,7 +956,7 @@ do_interrupt_thread(cl_object process) ok = 0; goto EXIT; } - process->process.interrupt = Ct; + process->process.interrupt = ECL_T; if (!VirtualProtect(process->process.env, sizeof(struct cl_env_struct), guard, @@ -1048,8 +1048,8 @@ _ecl_w32_exception_filter(struct _EXCEPTION_POINTERS* ep) cl_object process = the_env->own_process; if (!Null(process->process.interrupt)) { cl_object signal = pop_signal(the_env); - process->process.interrupt = Cnil; - while (signal != Cnil && signal) { + process->process.interrupt = ECL_NIL; + while (signal != ECL_NIL && signal) { handle_signal_now(signal, the_env->own_process); signal = pop_signal(the_env); } @@ -1103,10 +1103,10 @@ _ecl_w32_exception_filter(struct _EXCEPTION_POINTERS* ep) static cl_object W32_handle_in_new_thread(cl_object signal_code) { - int outside_ecl = ecl_import_current_thread(@'si::handle-signal', Cnil); + int outside_ecl = ecl_import_current_thread(@'si::handle-signal', ECL_NIL); mp_process_run_function(4, @'si::handle-signal', @'si::handle-signal', - signal_code, Cnil); + signal_code, ECL_NIL); if (outside_ecl) ecl_release_current_thread(); } @@ -1185,7 +1185,7 @@ asynchronous_signal_servicing_thread() #endif signal_code = ecl_gethash_safe(ecl_make_fixnum(signo), cl_core.known_signals, - Cnil); + ECL_NIL); if (!Null(signal_code)) { mp_process_run_function(3, @'si::handle-signal', @'si::handle-signal', @@ -1210,7 +1210,7 @@ si_trap_fpe(cl_object condition, cl_object flag) if (condition == @'last') { bits = the_env->trap_fpe_bits; } else { - if (condition == Ct) + if (condition == ECL_T) bits = FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INVALID; else if (condition == @'division-by-zero') bits = FE_DIVBYZERO; @@ -1224,7 +1224,7 @@ si_trap_fpe(cl_object condition, cl_object flag) bits = FE_INEXACT; else if (ECL_FIXNUMP(condition)) bits = ecl_fixnum(condition) & all; - if (flag == Cnil) { + if (flag == ECL_NIL) { bits = the_env->trap_fpe_bits & ~bits; } else { bits = the_env->trap_fpe_bits | bits; @@ -1323,7 +1323,7 @@ install_signal_handling_thread() ecl_make_cfun((cl_objectfn_fixed) asynchronous_signal_servicing_thread, @'si::signal-servicing', - Cnil, + ECL_NIL, 0); cl_object process = signal_thread_process = @@ -1348,22 +1348,22 @@ install_synchronous_signal_handlers() { #ifdef SIGBUS if (ecl_option_values[ECL_OPT_TRAP_SIGBUS]) { - do_catch_signal(SIGBUS, Ct, Cnil); + do_catch_signal(SIGBUS, ECL_T, ECL_NIL); } #endif #ifdef SIGSEGV if (ecl_option_values[ECL_OPT_TRAP_SIGSEGV]) { - do_catch_signal(SIGSEGV, Ct, Cnil); + do_catch_signal(SIGSEGV, ECL_T, ECL_NIL); } #endif #ifdef SIGPIPE if (ecl_option_values[ECL_OPT_TRAP_SIGPIPE]) { - do_catch_signal(SIGPIPE, Ct, Cnil); + do_catch_signal(SIGPIPE, ECL_T, ECL_NIL); } #endif #ifdef SIGILL if (ecl_option_values[ECL_OPT_TRAP_SIGILL]) { - do_catch_signal(SIGILL, Ct, Cnil); + do_catch_signal(SIGILL, ECL_T, ECL_NIL); } #endif /* In order to implement MP:INTERRUPT-PROCESS, MP:PROCESS-KILL @@ -1403,13 +1403,13 @@ install_fpe_signal_handlers() #ifdef SIGFPE if (ecl_option_values[ECL_OPT_TRAP_SIGFPE]) { mysignal(SIGFPE, fpe_signal_handler); - si_trap_fpe(Ct, Ct); + si_trap_fpe(ECL_T, ECL_T); # ifdef ECL_IEEE_FP /* By default deactivate errors and accept * denormals in floating point computations */ - si_trap_fpe(@'floating-point-invalid-operation', Cnil); - si_trap_fpe(@'division-by-zero', Cnil); - si_trap_fpe(@'floating-point-overflow', Cnil); + si_trap_fpe(@'floating-point-invalid-operation', ECL_NIL); + si_trap_fpe(@'division-by-zero', ECL_NIL); + si_trap_fpe(@'floating-point-overflow', ECL_NIL); # endif } #endif @@ -1452,14 +1452,14 @@ create_signal_code_constants() name = ecl_intern(make_base_string_copy(buffer), cl_core.ext_package, intern_flag); - add_one_signal(hash, i, name, Cnil); + add_one_signal(hash, i, name, ECL_NIL); } add_one_signal(hash, SIGRTMIN, _ecl_intern("+SIGRTMIN+", cl_core.ext_package), - Cnil); + ECL_NIL); add_one_signal(hash, SIGRTMAX, _ecl_intern("+SIGRTMAX+", cl_core.ext_package), - Cnil); + ECL_NIL); #endif } @@ -1473,7 +1473,7 @@ init_unixint(int pass) create_signal_code_constants(); install_fpe_signal_handlers(); install_signal_handling_thread(); - ECL_SET(@'ext::*interrupts-enabled*', Ct); + ECL_SET(@'ext::*interrupts-enabled*', ECL_T); ecl_process_env()->disable_interrupts = 0; } } diff --git a/src/c/unixsys.d b/src/c/unixsys.d index 249cd5d8b..080b6211b 100644 --- a/src/c/unixsys.d +++ b/src/c/unixsys.d @@ -73,12 +73,12 @@ si_make_pipe() #endif if (ret < 0) { FElibc_error("Unable to create pipe", 0); - output = Cnil; + output = ECL_NIL; } else { cl_object in = ecl_make_stream_from_fd(fake_in_name, fds[0], ecl_smm_input, 8, - ECL_STREAM_DEFAULT_FORMAT, Cnil); + ECL_STREAM_DEFAULT_FORMAT, ECL_NIL); cl_object out = ecl_make_stream_from_fd(fake_out_name, fds[1], ecl_smm_output, 8, - ECL_STREAM_DEFAULT_FORMAT, Cnil); + ECL_STREAM_DEFAULT_FORMAT, ECL_NIL); output = cl_make_two_way_stream(in, out); } @(return output) @@ -171,7 +171,7 @@ set_external_process_streams(cl_object process, cl_object input, cl_object outpu static void update_process_status(cl_object process, cl_object status, cl_object code) { - ecl_structure_set(process, @'ext::external-process', 0, Cnil); + ecl_structure_set(process, @'ext::external-process', 0, ECL_NIL); ecl_structure_set(process, @'ext::external-process', 4, code); ecl_structure_set(process, @'ext::external-process', 3, status); } @@ -207,12 +207,12 @@ remove_external_process(cl_env_ptr env, cl_object process) static cl_object find_external_process(cl_env_ptr env, cl_object pid) { - cl_object output = Cnil; + cl_object output = ECL_NIL; ecl_disable_interrupts_env(env); ECL_WITH_SPINLOCK_BEGIN(env, &cl_core.external_processes_lock); { cl_object p; - for (p = cl_core.external_processes; p != Cnil; p = ECL_CONS_CDR(p)) { + for (p = cl_core.external_processes; p != ECL_NIL; p = ECL_CONS_CDR(p)) { cl_object process = ECL_CONS_CAR(p); if (external_process_pid(process) == pid) { output = process; @@ -243,10 +243,10 @@ ecl_waitpid(cl_object pid, cl_object wait) ok = GetExitCodeProcess(*hProcess, &exitcode); if (!ok) { status = @':error'; - code = Cnil; + code = ECL_NIL; } else if (exitcode == STILL_ACTIVE) { status = @':running'; - code = Cnil; + code = ECL_NIL; } else { status = @':exited'; code = ecl_make_fixnum(exitcode); @@ -263,12 +263,12 @@ ecl_waitpid(cl_object pid, cl_object wait) } else { status = @':error'; } - code = Cnil; - pid = Cnil; + code = ECL_NIL; + pid = ECL_NIL; } else if (error == 0) { - status = Cnil; - code = Cnil; - pid = Cnil; + status = ECL_NIL; + code = ECL_NIL; + pid = ECL_NIL; } else { pid = ecl_make_fixnum(error); if (WIFEXITED(code_int)) { @@ -282,7 +282,7 @@ ecl_waitpid(cl_object pid, cl_object wait) code = ecl_make_fixnum(WSTOPSIG(code_int)); } else { status = @':running'; - code = Cnil; + code = ECL_NIL; } } #endif @@ -295,7 +295,7 @@ si_wait_for_all_processes() const cl_env_ptr env = ecl_process_env(); #if defined(SIGCHLD) && !defined(ECL_WINDOWS_HOST) do { - cl_object status = ecl_waitpid(ecl_make_fixnum(-1), Cnil); + cl_object status = ecl_waitpid(ecl_make_fixnum(-1), ECL_NIL); cl_object code = env->values[1]; cl_object pid = env->values[2]; if (Null(pid)) { @@ -304,7 +304,7 @@ si_wait_for_all_processes() } else { cl_object p = find_external_process(env, pid); if (!Null(p)) { - set_external_process_pid(p, Cnil); + set_external_process_pid(p, ECL_NIL); update_process_status(p, status, code); } if (status != @':running') { @@ -338,7 +338,7 @@ make_windows_handle(HANDLE h) } #endif -@(defun ext::external-process-wait (process &optional (wait Cnil)) +@(defun ext::external-process-wait (process &optional (wait ECL_NIL)) @ { cl_object status, code, pid; @@ -402,14 +402,14 @@ ecl_stream_to_HANDLE(cl_object s, bool output) #endif @(defun ext::run-program (command argv &key (input @':stream') (output @':stream') - (error @'t') (wait @'t') (environ Cnil) + (error @'t') (wait @'t') (environ ECL_NIL) (if_output_exists @':supersede')) int parent_write = 0, parent_read = 0; int child_pid; cl_object pid, process; cl_object stream_write; cl_object stream_read; - cl_object exit_status = Cnil; + cl_object exit_status = ECL_NIL; @ command = si_copy_to_simple_base_string(command); argv = cl_mapcar(2, @'si::copy-to-simple-base-string', argv); @@ -430,7 +430,7 @@ ecl_stream_to_HANDLE(cl_object s, bool output) in double quotes, to avoid problems when these arguments or file names have spaces */ command = - cl_format(4, Cnil, + cl_format(4, ECL_NIL, ecl_make_simple_base_string("~S~{ ~S~}", -1), command, argv); command = si_copy_to_simple_base_string(command); @@ -596,7 +596,7 @@ ecl_stream_to_HANDLE(cl_object s, bool output) NULL, NULL, /* lpProcess/ThreadAttributes */ TRUE, /* Inherit handles (for files) */ /*CREATE_NEW_CONSOLE |*/ - 0 /*(input == Ct || output == Ct || error == Ct ? 0 : CREATE_NO_WINDOW)*/, + 0 /*(input == ECL_T || output == ECL_T || error == ECL_T ? 0 : CREATE_NO_WINDOW)*/, env, /* Inherit environment */ NULL, /* Current directory */ &st_info, /* Startup info */ @@ -636,7 +636,7 @@ ecl_stream_to_HANDLE(cl_object s, bool output) 0, GetLastError(), 0, (void*)&message, 0, NULL); printf("%s\n", message); LocalFree(message); - pid = Cnil; + pid = ECL_NIL; } set_external_process_pid(process, pid); if (child_stdin) CloseHandle(child_stdin); @@ -647,7 +647,7 @@ ecl_stream_to_HANDLE(cl_object s, bool output) { int child_stdin, child_stdout, child_stderr; int pipe_fd[2]; - argv = CONS(command, ecl_nconc(argv, ecl_list1(Cnil))); + argv = CONS(command, ecl_nconc(argv, ecl_list1(ECL_NIL))); argv = _ecl_funcall3(@'coerce', argv, @'vector'); AGAIN_INPUT: if (input == @':stream') { @@ -748,7 +748,7 @@ ecl_stream_to_HANDLE(cl_object s, bool output) dup2(child_stderr, STDERR_FILENO); for (j = 0; j < argv->vector.fillp; j++) { cl_object arg = argv->vector.self.t[j]; - if (arg == Cnil) { + if (arg == ECL_NIL) { argv_ptr[j] = NULL; } else { argv_ptr[j] = arg->base_string.self; @@ -767,7 +767,7 @@ ecl_stream_to_HANDLE(cl_object s, bool output) abort(); } if (child_pid < 0) { - pid = Cnil; + pid = ECL_NIL; } else { pid = ecl_make_fixnum(child_pid); } @@ -802,7 +802,7 @@ ecl_stream_to_HANDLE(cl_object s, bool output) if (parent_write > 0) { stream_write = ecl_make_stream_from_fd(command, parent_write, ecl_smm_output, 8, - ECL_STREAM_DEFAULT_FORMAT, Ct); + ECL_STREAM_DEFAULT_FORMAT, ECL_T); } else { parent_write = 0; stream_write = cl_core.null_stream; @@ -810,19 +810,19 @@ ecl_stream_to_HANDLE(cl_object s, bool output) if (parent_read > 0) { stream_read = ecl_make_stream_from_fd(command, parent_read, ecl_smm_input, 8, - ECL_STREAM_DEFAULT_FORMAT, Ct); + ECL_STREAM_DEFAULT_FORMAT, ECL_T); } else { parent_read = 0; stream_read = cl_core.null_stream; } set_external_process_streams(process, stream_write, stream_read); if (!Null(wait)) { - exit_status = si_external_process_wait(2, process, Ct); + exit_status = si_external_process_wait(2, process, ECL_T); exit_status = ecl_nth_value(the_env, 1); } @(return ((parent_read || parent_write)? cl_make_two_way_stream(stream_read, stream_write) : - Cnil) + ECL_NIL) exit_status process) @) diff --git a/src/c/vector_push.d b/src/c/vector_push.d index ced997cfa..d9410c560 100644 --- a/src/c/vector_push.d +++ b/src/c/vector_push.d @@ -38,9 +38,9 @@ extend_vector(cl_object v, cl_index amount) if (new_length > ECL_ARRAY_DIMENSION_LIMIT) new_length = ECL_ARRAY_DIMENSION_LIMIT; other = si_make_vector(cl_array_element_type(v), - ecl_make_fixnum(new_length), Ct, + ecl_make_fixnum(new_length), ECL_T, ecl_make_fixnum(v->vector.fillp), - Cnil, ecl_make_fixnum(0)); + ECL_NIL, ecl_make_fixnum(0)); ecl_copy_subarray(other, 0, v, 0, v->vector.fillp); return si_replace_array(v, other); } @@ -70,7 +70,7 @@ cl_vector_push(cl_object value, cl_object v) { cl_index f = ecl_fixnum(cl_fill_pointer(v)); if (f >= v->vector.dim) { - @(return Cnil); + @(return ECL_NIL); } else { ecl_aset1(v, v->vector.fillp, value); @(return ecl_make_fixnum(v->vector.fillp++)); diff --git a/src/cmp/cmparray.lsp b/src/cmp/cmparray.lsp index 4baa020d1..0a25a5a3c 100644 --- a/src/cmp/cmparray.lsp +++ b/src/cmp/cmparray.lsp @@ -250,14 +250,14 @@ `(c-inline (,array ,index ,limit) (:object :fixnum :fixnum) :void "if (ecl_unlikely((#1)>=(#2))) - FEwrong_index(Cnil,#0,-1,ecl_make_fixnum(#1),#2);" + FEwrong_index(ECL_NIL,#0,-1,ecl_make_fixnum(#1),#2);" :one-liner nil)) (defmacro check-vector-in-bounds (vector index) `(c-inline (,vector ,index) (:object :fixnum) :void "if (ecl_unlikely((#1)>=(#0)->vector.dim)) - FEwrong_index(Cnil,#0,-1,ecl_make_fixnum(#1),(#0)->vector.dim);" + FEwrong_index(ECL_NIL,#0,-1,ecl_make_fixnum(#1),(#0)->vector.dim);" :one-liner nil)) (defconstant +array-dimension-accessor+ diff --git a/src/cmp/cmpbind.lsp b/src/cmp/cmpbind.lsp index cec06dad2..986da8d34 100644 --- a/src/cmp/cmpbind.lsp +++ b/src/cmp/cmpbind.lsp @@ -30,7 +30,7 @@ ;; first binding: assign location (setq var-loc (next-env)) (setf (var-loc var) var-loc)) - (when (zerop var-loc) (wt-nl "env" *env-lvl* " = Cnil;")) + (when (zerop var-loc) (wt-nl "env" *env-lvl* " = ECL_NIL;")) (wt-nl "CLV" var-loc "=env" *env-lvl* "=CONS(") (wt-coerce-loc :object loc) (wt ",env" *env-lvl* ");") diff --git a/src/cmp/cmpblock.lsp b/src/cmp/cmpblock.lsp index 64497d1f0..4b1dce2bc 100644 --- a/src/cmp/cmpblock.lsp +++ b/src/cmp/cmpblock.lsp @@ -112,7 +112,7 @@ (wt-nl "cl_return_from(" (blk-var blk) "," (add-symbol (blk-name blk)) ");")) ((CLB UNWIND-PROTECT) (let ((*destination* 'VALUES)) (c2expr* val)) - (wt-nl "cl_return_from(" (blk-var blk) ",Cnil);")) + (wt-nl "cl_return_from(" (blk-var blk) ",ECL_NIL);")) (T (let ((*destination* (blk-destination blk)) (*exit* (blk-exit blk))) (c2expr val)))) diff --git a/src/cmp/cmpffi.lsp b/src/cmp/cmpffi.lsp index be7ebbd5c..be6f9c38e 100755 --- a/src/cmp/cmpffi.lsp +++ b/src/cmp/cmpffi.lsp @@ -367,7 +367,7 @@ (#.+all-number-rep-types+ ; number type (wt "1")) ((:object) - (wt "(" loc ")!=Cnil")) + (wt "(" loc ")!=ECL_NIL")) (otherwise (coercion-error)))) ((:object) diff --git a/src/cmp/cmpif.lsp b/src/cmp/cmpif.lsp index 56dc94497..7c83d89a3 100644 --- a/src/cmp/cmpif.lsp +++ b/src/cmp/cmpif.lsp @@ -98,12 +98,12 @@ (list inlined-arg) (if (eq (loc-representation-type dest-loc) :bool) (case rep-type - (:bool '((:bool) (:bool) "(#0)==Cnil" nil t)) - (:object '((:object) (:bool) "(#0)!=Cnil" nil t)) + (:bool '((:bool) (:bool) "(#0)==ECL_NIL" nil t)) + (:object '((:object) (:bool) "(#0)!=ECL_NIL" nil t)) (otherwise (return-from negate-argument nil))) (case rep-type - (:bool '((:bool) (:object) "(#0)?Cnil:Ct" nil t)) - (:object '((:object) (:object) "Null(#0)?Ct:Cnil" nil t)) + (:bool '((:bool) (:object) "(#0)?ECL_NIL:ECL_T" nil t)) + (:object '((:object) (:object) "Null(#0)?ECL_T:ECL_NIL" nil t)) (otherwise (return-from negate-argument nil))))))) (defun c2fmla-not (c1form arg) @@ -174,7 +174,7 @@ (t (wt-nl "if((") (wt-coerce-loc :object loc) - (wt ")!=Cnil){"))) + (wt ")!=ECL_NIL){"))) (unwind-no-exit label) (wt-nl) (wt-go label) (wt "}")) @@ -192,7 +192,7 @@ (t (wt-nl "if((") (wt-coerce-loc :object loc) - (wt ")==Cnil){"))) + (wt ")==ECL_NIL){"))) (unwind-no-exit label) (wt-nl) (wt-go label) (wt "}")) diff --git a/src/cmp/cmplam.lsp b/src/cmp/cmplam.lsp index 84734ec0d..b3931c977 100644 --- a/src/cmp/cmplam.lsp +++ b/src/cmp/cmplam.lsp @@ -484,13 +484,13 @@ The function thus belongs to the type of functions that ecl_make_cfun accepts." (cond ((and (eq (c1form-name init) 'LOCATION) (null (c1form-arg 0 init))) ;; no initform - ;; Cnil has been set in keyvars if keyword parameter is not supplied. + ;; ECL_NIL has been set in keyvars if keyword parameter is not supplied. (setf (second KEYVARS[i]) i) (bind KEYVARS[i] var)) (t ;; with initform (setf (second KEYVARS[i]) (+ nkey i)) - (wt-nl "if(") (wt-loc KEYVARS[i]) (wt "==Cnil){") + (wt-nl "if(") (wt-loc KEYVARS[i]) (wt "==ECL_NIL){") (let ((*unwind-exit* *unwind-exit*)) (bind-init init var)) (wt-nl "}else{") diff --git a/src/cmp/cmpmain.lsp b/src/cmp/cmpmain.lsp index b5f6a8fa1..e6fb582e4 100755 --- a/src/cmp/cmpmain.lsp +++ b/src/cmp/cmpmain.lsp @@ -422,7 +422,7 @@ filesystem or in the database of ASDF modules." (princ "; cl_object output; si_select_package(ecl_make_simple_base_string(\"CL-USER\", 7)); -output = si_safe_eval(2, ecl_read_from_cstring(lisp_code), Cnil); +output = si_safe_eval(2, ecl_read_from_cstring(lisp_code), ECL_NIL); }" stream) ))))) (cond ((null prologue-code) @@ -438,7 +438,7 @@ output = si_safe_eval(2, ecl_read_from_cstring(lisp_code), Cnil); (princ "; cl_object output; si_select_package(ecl_make_simple_base_string(\"CL-USER\", 7)); -output = si_safe_eval(2, ecl_read_from_cstring(lisp_code), Cnil); +output = si_safe_eval(2, ecl_read_from_cstring(lisp_code), ECL_NIL); }" stream) ))))) ;; diff --git a/src/cmp/cmpmulti.lsp b/src/cmp/cmpmulti.lsp index 82f6e0954..a63f91b2b 100644 --- a/src/cmp/cmpmulti.lsp +++ b/src/cmp/cmpmulti.lsp @@ -82,10 +82,10 @@ ;; of a function. ((endp forms) (cond ((eq *destination* 'RETURN) - (wt-nl "value0=Cnil; cl_env_copy->nvalues=0;") + (wt-nl "value0=ECL_NIL; cl_env_copy->nvalues=0;") (unwind-exit 'RETURN)) ((eq *destination* 'VALUES) - (wt-nl "cl_env_copy->values[0]=Cnil; cl_env_copy->nvalues=0;") + (wt-nl "cl_env_copy->values[0]=ECL_NIL; cl_env_copy->nvalues=0;") (unwind-exit 'VALUES)) (t (unwind-exit 'NIL)))) @@ -169,7 +169,7 @@ (dolist (v vars) (if use-bind (bind (c1form-arg 0 (default-init v)) v) - (set-var '(C-INLINE (:object) "Cnil" () t nil) v))) + (set-var '(C-INLINE (:object) "ECL_NIL" () t nil) v))) output) (defun do-m-v-setq-any (min-values max-values vars use-bind) @@ -220,8 +220,8 @@ (dolist (v vars) (when labels (wt-label (pop labels))) (if use-bind - (bind '(C-INLINE (:object) "Cnil" () t nil) v) - (set-var '(C-INLINE (:object) "Cnil" () t nil) v))) + (bind '(C-INLINE (:object) "ECL_NIL" () t nil) v) + (set-var '(C-INLINE (:object) "ECL_NIL" () t nil) v))) (when labels (wt-label label)))) output)) diff --git a/src/cmp/cmpspecial.lsp b/src/cmp/cmpspecial.lsp index dd61ae46a..452897e8c 100644 --- a/src/cmp/cmpspecial.lsp +++ b/src/cmp/cmpspecial.lsp @@ -183,6 +183,6 @@ ((eq closure 'LEXICAL) (baboon)) ((setf narg (fun-fixed-narg fun)) ; empty environment fixed number of args - (wt "ecl_make_cfun((cl_objectfn_fixed)" cfun ",Cnil,Cblock," narg ")")) + (wt "ecl_make_cfun((cl_objectfn_fixed)" cfun ",ECL_NIL,Cblock," narg ")")) (t ; empty environment variable number of args - (wt "ecl_make_cfun_va((cl_objectfn)" cfun ",Cnil,Cblock)"))))) + (wt "ecl_make_cfun_va((cl_objectfn)" cfun ",ECL_NIL,Cblock)"))))) diff --git a/src/cmp/cmptables.lsp b/src/cmp/cmptables.lsp index d4916fb62..23c5320aa 100644 --- a/src/cmp/cmptables.lsp +++ b/src/cmp/cmptables.lsp @@ -193,8 +193,8 @@ (structure-ref . wt-structure-ref) - (nil . "Cnil") - (t . "Ct") + (nil . "ECL_NIL") + (t . "ECL_T") (return . "value0") (values . "cl_env_copy->values[0]") (va-arg . "va_arg(args,cl_object)") diff --git a/src/cmp/cmptop.lsp b/src/cmp/cmptop.lsp index 97d12d68d..6bb4ea0db 100644 --- a/src/cmp/cmptop.lsp +++ b/src/cmp/cmptop.lsp @@ -245,7 +245,7 @@ return f2; ") (wt-nl-h "#define ECL_DEFINE_SETF_FUNCTIONS ") (loop for (name setf-vv name-vv) in *setf-definitions* - do (wt-h #\\ #\Newline setf-vv "=ecl_setf_definition(" name-vv ",Ct);")) + do (wt-h #\\ #\Newline setf-vv "=ecl_setf_definition(" name-vv ",ECL_T);")) (wt-nl-h "#ifdef __cplusplus") (wt-nl-h "}") @@ -427,7 +427,7 @@ return f2; (when *ihs-used-p* (wt-h " \\") (wt-nl-h "struct ecl_ihs_frame ihs; \\") - (wt-nl-h "const cl_object _ecl_debug_env = Cnil;")) + (wt-nl-h "const cl_object _ecl_debug_env = ECL_NIL;")) (wt-nl-h "#define VLEX" *reservation-cmacro*) ;; There should be no need to mark lex as volatile, since we ;; are going to pass pointers of this array around and the compiler @@ -634,7 +634,7 @@ return f2; do (wt-nl (if (zerop i) "{" ",{") name "," code "}")) (wt "};") (wt-nl "const cl_index _ecl_debug_info_raw[]={") - (wt-nl (if first "(cl_index)(Cnil)," "(cl_index)(_ecl_debug_env),") + (wt-nl (if first "(cl_index)(ECL_NIL)," "(cl_index)(_ecl_debug_env),") "(cl_index)(_ecl_descriptors)") (loop for var-loc in filtered-locations do (wt ",(cl_index)(&" (lcl-name var-loc) ")")) @@ -857,7 +857,7 @@ return f2; (<= maxarg si:c-arguments-limit)) maxarg -1))) - (format stream "~%{0,0,~D,0,ecl_make_fixnum(~D),ecl_make_fixnum(~D),(cl_objectfn)~A,Cnil,ecl_make_fixnum(~D)}," + (format stream "~%{0,0,~D,0,ecl_make_fixnum(~D),ecl_make_fixnum(~D),(cl_objectfn)~A,ECL_NIL,ecl_make_fixnum(~D)}," narg (vv-location loc) (vv-location fname-loc) diff --git a/src/cmp/sysfun.lsp b/src/cmp/sysfun.lsp index fdb1e44ed..471e86289 100644 --- a/src/cmp/sysfun.lsp +++ b/src/cmp/sysfun.lsp @@ -277,7 +277,7 @@ ;; file hash.d (def-inline gethash :always (t t t) t "ecl_gethash_safe(#0,#1,#2)" :multiple-values nil) -(def-inline gethash :always (t t) t "ecl_gethash_safe(#0,#1,Cnil)" :multiple-values nil) +(def-inline gethash :always (t t) t "ecl_gethash_safe(#0,#1,ECL_NIL)" :multiple-values nil) ;; file list.d @@ -360,7 +360,7 @@ (def-inline cons :always (t t) t "CONS(#0,#1)") (def-inline endp :safe (t) :bool "ecl_endp(#0)") -(def-inline endp :unsafe (t) :bool "#0==Cnil") +(def-inline endp :unsafe (t) :bool "#0==ECL_NIL") (def-inline nth :always (t t) t "ecl_nth(ecl_to_size(#0),#1)") (def-inline nth :always (fixnum t) t "ecl_nth(#0,#1)") @@ -374,7 +374,7 @@ (def-inline last :always (t) t "ecl_last(#0,1)") -(def-inline list :always nil t "Cnil") +(def-inline list :always nil t "ECL_NIL") (def-inline list :always (t) t "ecl_list1(#0)") (def-inline list* :always (t) t "#0") @@ -583,7 +583,7 @@ ;; file pathname.d -(def-inline null :always (t) :bool "#0==Cnil") +(def-inline null :always (t) :bool "#0==ECL_NIL") (def-inline symbolp :always (t) :bool "@0;ECL_SYMBOLP(#0)") @@ -632,19 +632,19 @@ (def-inline equalp :always (t t) :bool "ecl_equalp(#0,#1)") (def-inline equalp :always (fixnum fixnum) :bool "(#0)==(#1)") -(def-inline not :always (t) :bool "(#0)==Cnil") +(def-inline not :always (t) :bool "(#0)==ECL_NIL") ;; file print.d, read.d -(def-inline clear-output :always (stream) NULL "(ecl_clear_output(#0),Cnil)") +(def-inline clear-output :always (stream) NULL "(ecl_clear_output(#0),ECL_NIL)") -(def-inline finish-output :always (stream) NULL "(ecl_finish_output(#0),Cnil)") +(def-inline finish-output :always (stream) NULL "(ecl_finish_output(#0),ECL_NIL)") -(def-inline finish-output :always (stream) NULL "(ecl_force_output(#0),Cnil)") +(def-inline finish-output :always (stream) NULL "(ecl_force_output(#0),ECL_NIL)") -(def-inline write-char :always (t) t "@0;(ecl_princ_char(ecl_char_code(#0),Cnil),(#0))") +(def-inline write-char :always (t) t "@0;(ecl_princ_char(ecl_char_code(#0),ECL_NIL),(#0))") -(def-inline clear-input :always (stream) NULL "(ecl_clear_input(#0),Cnil)") +(def-inline clear-input :always (stream) NULL "(ecl_clear_input(#0),ECL_NIL)") (def-inline copy-readtable :always (null null) t "standard_readtable") @@ -766,7 +766,7 @@ ;; file symbol.d (def-inline get :always (t t t) t "ecl_get(#0,#1,#2)") -(def-inline get :always (t t) t "ecl_get(#0,#1,Cnil)") +(def-inline get :always (t t) t "ecl_get(#0,#1,ECL_NIL)") (def-inline symbol-name :always (t) string "ecl_symbol_name(#0)") diff --git a/src/cmp/test.lsp b/src/cmp/test.lsp index 814c0a088..8760149af 100644 --- a/src/cmp/test.lsp +++ b/src/cmp/test.lsp @@ -439,7 +439,7 @@ (outer))) ;; let*: extra bds_unwind1 -;; if((V3=CDR(V3))==Cnil){ +;; if((V3=CDR(V3))==ECL_NIL){ ;; bds_bind(VV[0],T0); /* *VAL* */ ;; bds_unwind1; ;; goto L1;} diff --git a/src/h/cons.h b/src/h/cons.h index 1d2aa1bc4..37de436a1 100644 --- a/src/h/cons.h +++ b/src/h/cons.h @@ -22,7 +22,7 @@ extern "C" { #endif -#define Null(x) ((x)==Cnil) +#define Null(x) ((x)==ECL_NIL) #define CONS(a,d) ecl_cons((a),(d)) #define ACONS(a,b,c) ecl_cons(ecl_cons((a),(b)),(c)) diff --git a/src/h/ecl-inl.h b/src/h/ecl-inl.h index b6c96bd8d..ad0d324bd 100644 --- a/src/h/ecl-inl.h +++ b/src/h/ecl-inl.h @@ -20,7 +20,7 @@ */ #define loop_for_in(list) { \ const cl_object __ecl_l0 = list; \ - for (; list != Cnil; list = ECL_CONS_CDR(list)) { \ + for (; list != ECL_NIL; list = ECL_CONS_CDR(list)) { \ if (ecl_unlikely(!ECL_LISTP(list))) FEtype_error_proper_list(__ecl_l0); #define end_loop_for_in }} @@ -30,7 +30,7 @@ */ #define loop_for_on_no_circle(list) \ if (!CONSP(list)) { \ - if (list != Cnil) FEtype_error_list(list); \ + if (list != ECL_NIL) FEtype_error_list(list); \ }else { \ cl_object __slow; \ bool __flag = TRUE; \ @@ -75,14 +75,14 @@ #define ecl_def_string_array_elt(chars) { \ (int8_t)t_base_string, 0, ecl_aet_bc, 0, \ - Cnil, (cl_index)(sizeof(chars))-1, \ + ECL_NIL, (cl_index)(sizeof(chars))-1, \ (cl_index)(sizeof(chars))-1, \ (ecl_base_char*)(chars) } #define ecl_def_ct_base_string(name,chars,len,static,const) \ static const struct ecl_base_string name ## _data = { \ (int8_t)t_base_string, 0, ecl_aet_bc, 0, \ - Cnil, (cl_index)(len), (cl_index)(len), \ + ECL_NIL, (cl_index)(len), (cl_index)(len), \ (ecl_base_char*)(chars) }; \ static const cl_object name = (cl_object)(& name ## _data) @@ -119,7 +119,7 @@ #define ecl_def_ct_vector(name,type,raw,len,static,const) \ static const struct ecl_vector name ## _data = { \ (int8_t)t_vector, 0, (type), 0, \ - Cnil, (cl_index)(len), (cl_index)(len), \ + ECL_NIL, (cl_index)(len), (cl_index)(len), \ ecl_cast_ptr(cl_object*,raw), 0 }; \ static const cl_object name = (cl_object)(& name ## _data) diff --git a/src/h/external.h b/src/h/external.h index a0a9eaeca..41992cc96 100755 --- a/src/h/external.h +++ b/src/h/external.h @@ -652,7 +652,7 @@ extern ECL_API cl_object si_make_dynamic_callback(cl_narg, cl_object fun, cl_obj extern ECL_API cl_object si_free_ffi_closure(cl_object closure); /* Only foreign data types can be coerced to a pointer */ -#define ecl_make_pointer(x) ecl_make_foreign_data(Cnil,0,(x)) +#define ecl_make_pointer(x) ecl_make_foreign_data(ECL_NIL,0,(x)) #define ecl_to_pointer(x) ecl_foreign_data_pointer_safe(x) extern ECL_API cl_object ecl_make_foreign_data(cl_object tag, cl_index size, void *data); extern ECL_API cl_object ecl_allocate_foreign_data(cl_object tag, cl_index size); diff --git a/src/h/legacy.h b/src/h/legacy.h index b86478d6a..80b8e654f 100644 --- a/src/h/legacy.h +++ b/src/h/legacy.h @@ -140,7 +140,7 @@ #define NVALUES cl_env.nvalues #define VALUES(n) cl_env.values[n] -#define return0() return ((NVALUES = 0),Cnil) +#define return0() return ((NVALUES = 0),ECL_NIL) #define return1(x) return ((VALUES(0)=(x)),(NVALUES=1),VALUES(0)) #define returnn(x) return x @@ -188,3 +188,6 @@ enum { /* stream mode */ smm_sequence_input, /* sequence input */ smm_sequence_output /* sequence output */ }; + +#define Cnil ECL_NIL +#define Ct ECL_T diff --git a/src/h/object.h b/src/h/object.h index 555da8e10..bb96bff1d 100644 --- a/src/h/object.h +++ b/src/h/object.h @@ -123,8 +123,8 @@ typedef cl_object (*cl_objectfn_fixed)(); #define ECL_IMMEDIATE(o) ((cl_fixnum)(o) & 3) #define ECL_IMMEDIATE_TAG 3 -#define ecl_to_bool(x) ((x)!=Cnil) -#define ecl_make_bool(x) ((x)? Ct : Cnil) +#define ecl_to_bool(x) ((x)!=ECL_NIL) +#define ecl_make_bool(x) ((x)? ECL_T : ECL_NIL) /* Immediate fixnums: */ #define ECL_FIXNUM_TAG t_fixnum @@ -242,9 +242,9 @@ enum ecl_stype { /* symbol type */ ecl_stp_special_form = 8 }; -#define Cnil ((cl_object)t_list) -#define Cnil_symbol ((cl_object)cl_symbols) -#define Ct ((cl_object)(cl_symbols+1)) +#define ECL_NIL ((cl_object)t_list) +#define ECL_NIL_SYMBOL ((cl_object)cl_symbols) +#define ECL_T ((cl_object)(cl_symbols+1)) #define ECL_UNBOUND ((cl_object)(cl_symbols+2)) #define ECL_PROTECT_TAG ((cl_object)(cl_symbols+3)) @@ -261,7 +261,7 @@ struct ecl_symbol { /* This field coincides with cons.car */ cl_object name; /* print name */ cl_object hpack; /* home package */ - /* Cnil for uninterned symbols */ + /* ECL_NIL for uninterned symbols */ #ifdef ECL_THREADS cl_index binding; /* index into the bindings array */ #endif diff --git a/src/h/stacks.h b/src/h/stacks.h index 195a015c3..3ce1ed05c 100755 --- a/src/h/stacks.h +++ b/src/h/stacks.h @@ -285,7 +285,7 @@ extern ECL_API ecl_frame_ptr _ecl_frs_push(register cl_env_ptr, register cl_obje #define ecl_nth_value(env,n) ((env)->values[n]) #define ecl_nvalues(env) ((env)->nvalues) #define ecl_return0(env) \ - do { (env)->nvalues = 0; return Cnil; } while (0) + do { (env)->nvalues = 0; return ECL_NIL; } while (0) #define ecl_return1(env,x) \ do { (env)->nvalues = 1; return (x); } while (0) #define ecl_return2(env,x,y) \ diff --git a/src/h/unify.h b/src/h/unify.h index 05c855fae..1cc0ce96b 100644 --- a/src/h/unify.h +++ b/src/h/unify.h @@ -25,9 +25,9 @@ #define get_value(v, x) unify(x, v) #define get_constant(c, x) (c == x || unify(x, c)) -#define get_nil(x) (Cnil == x || unify(x, Cnil)) +#define get_nil(x) (ECL_NIL == x || unify(x, ECL_NIL)) #define unify_slot (*slotf)(*slot) #define unify_value(loc) (*slotf)(loc) #define unify_constant(c) (*slotf)(c) -#define unify_nil (*slotf)(Cnil) +#define unify_nil (*slotf)(ECL_NIL) diff --git a/src/lsp/config.lsp.in b/src/lsp/config.lsp.in index 0a53574a5..42cb36119 100644 --- a/src/lsp/config.lsp.in +++ b/src/lsp/config.lsp.in @@ -16,7 +16,7 @@ cl_object output; struct utsname aux; if (uname(&aux) < 0) - output = Cnil; + output = ECL_NIL; else output = cl_list(5, make_base_string_copy(aux.sysname), make_base_string_copy(aux.nodename),