From: <cli...@li...> - 2005-01-31 04:14:04
|
Send clisp-cvs mailing list submissions to cli...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/clisp-cvs or, via email, send a message with subject or body 'help' to cli...@li... You can reach the person managing the list at cli...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of clisp-cvs digest..." CLISP CVS commits for today Today's Topics: 1. clisp/src control.d,1.125,1.126 ChangeLog,1.4180,1.4181 (Sam Steingold) 2. clisp/src lispbibl.d,1.611,1.612 eval.d,1.189,1.190 control.d,1.126,1.127 ChangeLog,1.4181,1.4182 (Sam Steingold) 3. clisp/src lispbibl.d,1.612,1.613 eval.d,1.190,1.191 control.d,1.127,1.128 ChangeLog,1.4182,1.4183 (Sam Steingold) 4. clisp/src NEWS,1.235,1.236 (Sam Steingold) 5. clisp/src TODO,1.60,1.61 (Sam Steingold) --__--__-- Message: 1 From: Sam Steingold <sd...@us...> To: cli...@li... Subject: clisp/src control.d,1.125,1.126 ChangeLog,1.4180,1.4181 Date: Sun, 30 Jan 2005 17:56:43 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9525/src Modified Files: control.d ChangeLog Log Message: activate SPECDECL bindings Index: control.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/control.d,v retrieving revision 1.125 retrieving revision 1.126 diff -u -d -r1.125 -r1.126 --- control.d 29 Jan 2005 15:02:31 -0000 1.125 +++ control.d 30 Jan 2005 17:56:36 -0000 1.126 @@ -416,10 +416,46 @@ /* add a bit to the object */ #define SET_BIT(o,b) as_object(as_oint(o) | wbit(b)); +/* the variables declared special appear on the stack twice: + with binding SPECDECL (added when processing declarations) + and the actual value (added when processing bindings). + here we activate the SPECDECL bindings */ +#define specdecled_p(sym,ptr,nn) (nn>0 ? specdecled_(sym,ptr,nn) : NULL) +/* Find the SPECDECL binding for the symbol + > spec_pointer & spec_anz are returned by make_variable_frame() + < return the pointer to the flags (or symbol+flags) + i.e., something suitable to SET_BIT, + or NULL if no such binding is found */ +local inline gcv_object_t* specdecled_ +(object symbol, gcv_object_t* spec_pointer, uintL spec_anz) { + do { + NEXT(spec_pointer); + #ifdef NO_symbolflags + if (eq(NEXT(spec_pointer),symbol)) { + if (eq(NEXT(spec_pointer),Fixnum_0)) + return &Before(spec_pointer); + } else { + NEXT(spec_pointer); + } + #else + if (eq(NEXT(spec_pointer),symbol)) + return &Before(spec_pointer); + #endif + } while (--spec_anz); + return NULL; +} +/* activate the SPECDECL binding if found */ +#define activate_specdecl(sym,ptr,nn) do { \ + var gcv_object_t *spec = specdecled_p(sym,ptr,nn); \ + if (spec) \ + *spec = SET_BIT(*spec,active_bit_o); /* activate binding */ \ + } while(0) + + /* UP for LET, LET*, LOCALLY, MULTIPLE-VALUE-BIND, SYMBOL-MACROLET: Analyzes the variables and declarations, builds up a variable binding- frame and extends VENV and poss. also DENV by a frame. - make_variable_frame(caller,varspecs,&bind_ptr,&bind_count) + make_variable_frame(caller,varspecs,&bind_ptr,&bind_count,&spec_ptr,&spec_count) > object caller: Caller, a symbol > object varspecs: list of variable-specifiers > object value2: list of declaration-specifiers @@ -427,10 +463,13 @@ < stack layout: variable binding frame, Env-binding-frame, ({form}). < gcv_object_t* bind_ptr: pointer to the first "genuine" binding. < uintC bind_count: number of "genuine" bindings. + < gcv_object_t* spec_ptr: pointer to the first SPECDECL binding. + < uintC spec_count: number of SPECDECL bindings. changes STACK can trigger GC */ local /*maygc*/ void make_variable_frame -(object caller, object varspecs, gcv_object_t** bind_ptr_, uintC* bind_count_) +(object caller, object varspecs, gcv_object_t** bind_ptr_, uintC* bind_count_, + gcv_object_t** spec_ptr_, uintC* spec_count_) { GCTRIGGER4(caller,varspecs,value1,value2); var object declarations = value2; @@ -467,6 +506,8 @@ } declspecs = Cdr(declspecs); } + *spec_count_ = spec_anz; + *spec_ptr_ = spec_pointer; } *bind_ptr_ = args_end_pointer; /* pointer to first "genuine" binding */ { /* Then store the "genuine" variable bindings (the variable @@ -507,32 +548,8 @@ pushSTACK_symbolwithflags(symbol,0); /* store variable */ check_STACK(); /* determine, if static or dynamic binding: */ - var bool specdecled = false; /* variable is declared special? */ - if (spec_anz > 0) { - #ifdef NO_symbolflags - var gcv_object_t* ptr = spec_pointer; - var uintL count = spec_anz; - do { - NEXT(ptr); - if (eq(NEXT(ptr),symbol)) { - if (eq(NEXT(ptr),Fixnum_0)) { - specdecled = true; break; - } - } else { - NEXT(ptr); - } - } while (--count); - #else - var gcv_object_t* ptr = spec_pointer; - var uintL count = spec_anz; - do { - NEXT(ptr); - if (eq(NEXT(ptr),symbol)) { - specdecled = true; break; - } - } while (--count); - #endif - } + var bool specdecled = /* variable is declared special? */ + (specdecled_p(symbol,spec_pointer,spec_anz) != NULL); if (eq(caller,S(symbol_macrolet))) { if (special_var_p(TheSymbol(symbol))) { pushSTACK(symbol); @@ -640,6 +657,14 @@ *markptr = SET_BIT(*markptr,active_bit_o); /* activate binding */ } while (--count); } +/* activate all SPECDECL declarations */ +local void activate_specdecls (gcv_object_t* spec_ptr, uintC spec_count) { + do { + spec_ptr skipSTACKop -varframe_binding_size; + var gcv_object_t* markptr = &Before(spec_ptr); + *markptr = SET_BIT(*markptr,active_bit_o); /* activate binding */ + } while (--spec_count); +} LISPSPECFORM(let, 1,0,body) { /* (LET ({varspec}) {decl} {form}), CLTL p. 110 */ @@ -650,9 +675,10 @@ } else { skipSTACK(1); /* build variable binding frame, extend VAR_ENV : */ - var gcv_object_t* bind_ptr; - var uintC bind_count; - make_variable_frame(S(let),popSTACK(),&bind_ptr,&bind_count); + var gcv_object_t *bind_ptr, *spec_ptr; + var uintC bind_count, spec_count; + make_variable_frame(S(let),popSTACK(),&bind_ptr,&bind_count, + &spec_ptr,&spec_count); if (bind_count > 0) { { /* Then, evaluate the initialization forms: */ var gcv_object_t* frame_pointer = bind_ptr; @@ -666,6 +692,7 @@ } activate_bindings(bind_ptr,bind_count); } + if (spec_count > 0) activate_specdecls(spec_ptr,spec_count); /* interpret body: */ implicit_progn(popSTACK(),NIL); /* unwind frames: */ @@ -683,9 +710,10 @@ } else { skipSTACK(1); /* build variable binding frame, extend VAR_ENV : */ - var gcv_object_t* bind_ptr; - var uintC bind_count; - make_variable_frame(S(letstern),popSTACK(),&bind_ptr,&bind_count); + var gcv_object_t *bind_ptr, *spec_ptr; + var uintC bind_count, spec_count; + make_variable_frame(S(letstern),popSTACK(),&bind_ptr,&bind_count, + &spec_ptr,&spec_count); /* Then, evaluate the initialization forms and activate the bindings */ if (bind_count > 0) { var gcv_object_t* frame_pointer = bind_ptr; @@ -700,6 +728,7 @@ var object symbol = *(markptr STACKop varframe_binding_sym); /* variable */ *initptr = TheSymbolflagged(symbol)->symvalue; /* save old value in frame */ TheSymbolflagged(symbol)->symvalue = newval; /* new value */ + activate_specdecl(symbol,spec_ptr,spec_count); } else { *initptr = newval; /* new value into the frame */ } @@ -724,10 +753,12 @@ return_Values compile_eval_form(); } else { /* build variable binding frame, extend VAR_ENV : */ - var gcv_object_t* bind_ptr; - var uintC bind_count; - make_variable_frame(S(locally),NIL,&bind_ptr,&bind_count); + var gcv_object_t *bind_ptr, *spec_ptr; + var uintC bind_count, spec_count; + make_variable_frame(S(locally),NIL,&bind_ptr,&bind_count, + &spec_ptr,&spec_count); if (bind_count) activate_bindings(bind_ptr,bind_count); + if (spec_count) activate_specdecls(spec_ptr,spec_count); /* interpret body: */ implicit_progn(popSTACK(),NIL); /* unwind frames: */ @@ -1114,9 +1145,10 @@ } else { skipSTACK(1); /* build variable binding frame, extend VAR_ENV : */ - var gcv_object_t* bind_ptr; - var uintC bind_count; - make_variable_frame(S(symbol_macrolet),popSTACK(),&bind_ptr,&bind_count); + var gcv_object_t *bind_ptr, *spec_ptr; + var uintC bind_count, spec_count; + make_variable_frame(S(symbol_macrolet),popSTACK(),&bind_ptr,&bind_count, + &spec_ptr,&spec_count); /* then form the symbol-macros and activate the bindings: */ if (bind_count > 0) { var gcv_object_t* frame_pointer = bind_ptr; @@ -1752,9 +1784,10 @@ skipSTACK(2); /* build variable binding frame, extend VAR_ENV : */ var gcv_object_t* form_ = &STACK_0; - var gcv_object_t* bind_ptr; - var uintC bind_count; - make_variable_frame(S(multiple_value_bind),varlist,&bind_ptr,&bind_count); + var gcv_object_t *bind_ptr, *spec_ptr; + var uintC bind_count, spec_count; + make_variable_frame(S(multiple_value_bind),varlist,&bind_ptr,&bind_count, + &spec_ptr,&spec_count); /* stack layout: values-form, variable binding frame, env-binding-frame, ({form}). now evaluate values-form: */ @@ -1769,6 +1802,7 @@ var object sym = *(markptr STACKop varframe_binding_sym); /* var */ \ *valptr = TheSymbolflagged(sym)->symvalue; /* old val into the frame */ \ TheSymbolflagged(sym)->symvalue = (value); /* new value into the value cell */ \ + activate_specdecl(sym,spec_ptr,spec_count); \ } else /* static binding : */ \ *valptr = (value); /* new value into the frame */ \ *markptr = SET_BIT(*markptr,active_bit_o); /* activate binding */ \ Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.4180 retrieving revision 1.4181 diff -u -d -r1.4180 -r1.4181 --- ChangeLog 30 Jan 2005 00:55:33 -0000 1.4180 +++ ChangeLog 30 Jan 2005 17:56:36 -0000 1.4181 @@ -1,3 +1,12 @@ +2005-01-30 Sam Steingold <sd...@gn...> + + activate SPECDECL bindings + * control.d (specdecled_): extracted from make_variable_frame() + (specdecled_p, activate_specdecl): new macros + (make_variable_frame): also return SPECDECL bindings pointer and count + (LET, LET*, LOCALLY, SYMBOL-MACROLET, MULTIPLE-VALUE-BIND): + also activate SPECDECL bindings + 2005-01-29 Sam Steingold <sd...@gn...> * modules/berkeley-db/bdb.c (fill_dbt): use I_to_LEbytes() --__--__-- Message: 2 From: Sam Steingold <sd...@us...> To: cli...@li... Subject: clisp/src lispbibl.d,1.611,1.612 eval.d,1.189,1.190 control.d,1.126,1.127 ChangeLog,1.4181,1.4182 Date: Sun, 30 Jan 2005 19:11:53 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26832/src Modified Files: lispbibl.d eval.d control.d ChangeLog Log Message: moved SET_BIT from control.d to lispbibl.d, added CLR_BIT; use them in eval.d Index: eval.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/eval.d,v retrieving revision 1.189 retrieving revision 1.190 diff -u -d -r1.189 -r1.190 --- eval.d 30 Jan 2005 03:52:46 -0000 1.189 +++ eval.d 30 Jan 2005 19:11:26 -0000 1.190 @@ -752,7 +752,7 @@ (eq(*(bindingptr STACKop 1),sym) /* the right symbol? */ \ && eq(*(bindingptr STACKop 0),fixnum(bit(active_bit)))) /* active & static? */ #else - var object cmp = as_object(as_oint(sym) | wbit(active_bit_o)); /* for comparison: binding must be active */ + var object cmp = SET_BIT(sym,active_bit_o); /* for comparison: binding must be active */ #define binds_sym_p(bindingptr) \ (eq(*(bindingptr STACKop 0),cmp)) /* right symbol & active & static? */ #endif @@ -1143,7 +1143,7 @@ } else { # static binding, lexical scope *(bindingsptr STACKop varframe_binding_mark) = - as_object(as_oint(*(bindingsptr STACKop varframe_binding_mark)) & ~wbit(active_bit_o)); # deactivate binding + CLR_BIT(*(bindingsptr STACKop varframe_binding_mark),active_bit_o); /* deactivate binding */ *ptr++ = *(bindingsptr STACKop varframe_binding_sym); # copy binding in the vector *ptr++ = *(bindingsptr STACKop varframe_binding_value); } @@ -2418,7 +2418,7 @@ /* the special-references first: */ dotimesC(count,spec_count, { pushSTACK(specdecl); /* SPECDECL as "value" */ - pushSTACK_symbolwithflags(*varptr++,wbit(active_bit_o)); /* active */ + pushSTACK_symbolwithflags(*varptr++,0); /* INactive */ }); frame_pointer = args_end_pointer; if (var_count-spec_count > 0) { @@ -2466,16 +2466,13 @@ var object sym = *(markptr STACKop varframe_binding_sym); /* var */ \ *(markptr STACKop varframe_binding_value) = /* old value in frame */ \ TheSymbolflagged(sym)->symvalue; \ - /* activate binding: */ \ - *markptr = as_object(as_oint(*markptr) | wbit(active_bit_o)); \ /* new value in value-cell: */ \ TheSymbolflagged(sym)->symvalue = (value); \ } else { /* activate static binding: */ \ /* new value in frame: */ \ *(markptr STACKop varframe_binding_value) = (value); \ - /* activate binding: */ \ - *markptr = as_object(as_oint(*markptr) | wbit(active_bit_o)); \ } \ + *markptr = SET_BIT(*markptr,active_bit_o);/* activate binding */ \ }} { /* process required parameters: fetch next argument and bind in stack */ var uintC count = posfixnum_to_L(TheIclosure(closure)->clos_req_anz); @@ -2510,7 +2507,7 @@ bind_next_var(next_arg,optmarkptr=); /* bind next variable */ if (as_oint(*optmarkptr) & wbit(svar_bit_o)) { /* supplied-p-Parameter follows? */ - *optmarkptr = as_object(as_oint(*optmarkptr) & ~wbit(svar_bit_o)); + *optmarkptr = CLR_BIT(*optmarkptr,svar_bit_o); bind_next_var(T,); /* yes -> bind to T */ } inits = Cdr(inits); /* shorten Init-Forms-List */ @@ -2529,7 +2526,7 @@ bind_next_var(inits,optmarkptr=); /* bind next variable */ if (as_oint(*optmarkptr) & wbit(svar_bit_o)) { /* supplied-p-Parameter follows? */ - *optmarkptr = as_object(as_oint(*optmarkptr) & ~wbit(svar_bit_o)); + *optmarkptr = CLR_BIT(*optmarkptr,svar_bit_o); bind_next_var(NIL,); /* yes -> bind to NIL */ } }); @@ -2549,7 +2546,7 @@ bind_next_var(inits,keymarkptr=); /* bind next Variable */ if (as_oint(*keymarkptr) & wbit(svar_bit_o)) { /* supplied-p-Parameter follows? */ - *keymarkptr = as_object(as_oint(*keymarkptr) & ~wbit(svar_bit_o)); + *keymarkptr = CLR_BIT(*keymarkptr,svar_bit_o); bind_next_var(NIL,); /* yes -> bind to NIL */ } }); @@ -2638,7 +2635,7 @@ var gcv_object_t* keymarkptr; bind_next_var(var_value,keymarkptr=); /* bind keyword-var */ if (as_oint(*keymarkptr) & wbit(svar_bit_o)) { /* supplied-p-Parameter follows? */ - *keymarkptr = as_object(as_oint(*keymarkptr) & ~wbit(svar_bit_o)); + *keymarkptr = CLR_BIT(*keymarkptr,svar_bit_o); bind_next_var(svar_value,); /* yes -> bind to NIL resp. T */ } } Index: control.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/control.d,v retrieving revision 1.126 retrieving revision 1.127 diff -u -d -r1.126 -r1.127 --- control.d 30 Jan 2005 17:56:36 -0000 1.126 +++ control.d 30 Jan 2005 19:11:43 -0000 1.127 @@ -413,9 +413,6 @@ return value1; } -/* add a bit to the object */ -#define SET_BIT(o,b) as_object(as_oint(o) | wbit(b)); - /* the variables declared special appear on the stack twice: with binding SPECDECL (added when processing declarations) and the actual value (added when processing bindings). Index: lispbibl.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/lispbibl.d,v retrieving revision 1.611 retrieving revision 1.612 diff -u -d -r1.611 -r1.612 --- lispbibl.d 29 Jan 2005 14:57:10 -0000 1.611 +++ lispbibl.d 30 Jan 2005 19:11:21 -0000 1.612 @@ -4411,6 +4411,10 @@ #define symbol_without_flags(symbol) \ as_object(as_oint(symbol) & ~((wbit(active_bit)|wbit(dynam_bit)|wbit(svar_bit))<<oint_symbolflags_shift)) #endif +/* add a flag to the object */ +#define SET_BIT(o,b) as_object(as_oint(o) | wbit(b)); +/* remove a flag from the object */ +#define CLR_BIT(o,b) as_object(as_oint(o) & ~wbit(b)); # Characters Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.4181 retrieving revision 1.4182 diff -u -d -r1.4181 -r1.4182 --- ChangeLog 30 Jan 2005 17:56:36 -0000 1.4181 +++ ChangeLog 30 Jan 2005 19:11:44 -0000 1.4182 @@ -1,5 +1,11 @@ 2005-01-30 Sam Steingold <sd...@gn...> + * lispbibl.d (SET_BIT, CLR_BIT): moved here from ... + * control.d: here + * eval.d: use SET_BIT & CLR_BIT + +2005-01-30 Sam Steingold <sd...@gn...> + activate SPECDECL bindings * control.d (specdecled_): extracted from make_variable_frame() (specdecled_p, activate_specdecl): new macros --__--__-- Message: 3 From: Sam Steingold <sd...@us...> To: cli...@li... Subject: clisp/src lispbibl.d,1.612,1.613 eval.d,1.190,1.191 control.d,1.127,1.128 ChangeLog,1.4182,1.4183 Date: Sun, 30 Jan 2005 19:27:08 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30346/src Modified Files: lispbibl.d eval.d control.d ChangeLog Log Message: (activate_specdecl, specdecled_p, specdecled_): global (funcall_iclosure): activate SPECDECL bindings together with the variable bindings Index: eval.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/eval.d,v retrieving revision 1.190 retrieving revision 1.191 diff -u -d -r1.190 -r1.191 --- eval.d 30 Jan 2005 19:11:26 -0000 1.190 +++ eval.d 30 Jan 2005 19:27:04 -0000 1.191 @@ -2406,6 +2406,8 @@ } var gcv_object_t* closure_ = &STACK_(frame_closure); /* &closure */ var gcv_object_t* frame_pointer; /* pointer to the frame */ + var uintC spec_count = posfixnum_to_L(TheIclosure(closure)->clos_spec_anz); + var gcv_object_t *spec_ptr; { /* 2nd step: build variable-binding-frame: */ var gcv_object_t* top_of_frame = STACK; /* Pointer to Frame */ var object vars = TheIclosure(closure)->clos_vars; /* Vector of variable-names */ @@ -2413,9 +2415,9 @@ get_space_on_STACK(var_count*varframe_binding_size*sizeof(gcv_object_t)); { var gcv_object_t* varptr = &TheSvector(vars)->data[0]; /* Pointer to variables in vector */ - var uintC spec_count = posfixnum_to_L(TheIclosure(closure)->clos_spec_anz); var uintC count; /* the special-references first: */ + spec_ptr = args_end_pointer; dotimesC(count,spec_count, { pushSTACK(specdecl); /* SPECDECL as "value" */ pushSTACK_symbolwithflags(*varptr++,0); /* INactive */ @@ -2468,6 +2470,7 @@ TheSymbolflagged(sym)->symvalue; \ /* new value in value-cell: */ \ TheSymbolflagged(sym)->symvalue = (value); \ + activate_specdecl(sym,spec_ptr,spec_count); \ } else { /* activate static binding: */ \ /* new value in frame: */ \ *(markptr STACKop varframe_binding_value) = (value); \ Index: control.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/control.d,v retrieving revision 1.127 retrieving revision 1.128 diff -u -d -r1.127 -r1.128 --- control.d 30 Jan 2005 19:11:43 -0000 1.127 +++ control.d 30 Jan 2005 19:27:04 -0000 1.128 @@ -416,15 +416,14 @@ /* the variables declared special appear on the stack twice: with binding SPECDECL (added when processing declarations) and the actual value (added when processing bindings). - here we activate the SPECDECL bindings */ -#define specdecled_p(sym,ptr,nn) (nn>0 ? specdecled_(sym,ptr,nn) : NULL) -/* Find the SPECDECL binding for the symbol + here we activate the SPECDECL bindings: + Find the SPECDECL binding for the symbol > spec_pointer & spec_anz are returned by make_variable_frame() < return the pointer to the flags (or symbol+flags) i.e., something suitable to SET_BIT, or NULL if no such binding is found */ -local inline gcv_object_t* specdecled_ -(object symbol, gcv_object_t* spec_pointer, uintL spec_anz) { +global gcv_object_t* specdecled_ (object symbol, gcv_object_t* spec_pointer, + uintL spec_anz) { do { NEXT(spec_pointer); #ifdef NO_symbolflags @@ -441,13 +440,6 @@ } while (--spec_anz); return NULL; } -/* activate the SPECDECL binding if found */ -#define activate_specdecl(sym,ptr,nn) do { \ - var gcv_object_t *spec = specdecled_p(sym,ptr,nn); \ - if (spec) \ - *spec = SET_BIT(*spec,active_bit_o); /* activate binding */ \ - } while(0) - /* UP for LET, LET*, LOCALLY, MULTIPLE-VALUE-BIND, SYMBOL-MACROLET: Analyzes the variables and declarations, builds up a variable binding- Index: lispbibl.d =================================================================== RCS file: /cvsroot/clisp/clisp/src/lispbibl.d,v retrieving revision 1.612 retrieving revision 1.613 diff -u -d -r1.612 -r1.613 --- lispbibl.d 30 Jan 2005 19:11:21 -0000 1.612 +++ lispbibl.d 30 Jan 2005 19:27:01 -0000 1.613 @@ -11439,6 +11439,26 @@ # ##################### CTRLBIBL for CONTROL.D ############################# # +/* the variables declared special appear on the stack twice: + with binding SPECDECL (added when processing declarations) + and the actual value (added when processing bindings). + here we activate the SPECDECL bindings */ +#define specdecled_p(sym,ptr,nn) (nn>0 ? specdecled_(sym,ptr,nn) : NULL) +/* Find the SPECDECL binding for the symbol + > spec_pointer & spec_anz are returned by make_variable_frame() + < return the pointer to the flags (or symbol+flags) + i.e., something suitable to SET_BIT, + or NULL if no such binding is found */ +extern gcv_object_t* specdecled_ (object symbol, gcv_object_t* spec_pointer, + uintL spec_anz); + +/* activate the SPECDECL binding if found */ +#define activate_specdecl(sym,ptr,nn) do { \ + var gcv_object_t *spec = specdecled_p(sym,ptr,nn); \ + if (spec) \ + *spec = SET_BIT(*spec,active_bit_o); /* activate binding */ \ + } while(0) + # Error if a block has already been left. # fehler_block_left(name); # > name: Block-name Index: ChangeLog =================================================================== RCS file: /cvsroot/clisp/clisp/src/ChangeLog,v retrieving revision 1.4182 retrieving revision 1.4183 diff -u -d -r1.4182 -r1.4183 --- ChangeLog 30 Jan 2005 19:11:44 -0000 1.4182 +++ ChangeLog 30 Jan 2005 19:27:05 -0000 1.4183 @@ -1,5 +1,13 @@ 2005-01-30 Sam Steingold <sd...@gn...> + * lispbibl.d (activate_specdecl, specdecled_p): moved here from + * control.d: here + (specdecled_): global + * eval.d (funcall_iclosure): activate SPECDECL bindings together + with the variable bindings + +2005-01-30 Sam Steingold <sd...@gn...> + * lispbibl.d (SET_BIT, CLR_BIT): moved here from ... * control.d: here * eval.d: use SET_BIT & CLR_BIT --__--__-- Message: 4 From: Sam Steingold <sd...@us...> To: cli...@li... Subject: clisp/src NEWS,1.235,1.236 Date: Sun, 30 Jan 2005 19:59:13 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5338/src Modified Files: NEWS Log Message: don't -> do not Index: NEWS =================================================================== RCS file: /cvsroot/clisp/clisp/src/NEWS,v retrieving revision 1.235 retrieving revision 1.236 diff -u -d -r1.235 -r1.236 --- NEWS 29 Jan 2005 15:02:36 -0000 1.235 +++ NEWS 30 Jan 2005 19:59:10 -0000 1.236 @@ -139,7 +139,7 @@ * ANSI CL compliance issues: + Issue <DECLARATION-SCOPE:NO-HOISTING> is implemented: The scope of - declarations that don't apply to bindings, such as free SPECIAL, NOTINLINE + declarations that do not apply to bindings, such as free SPECIAL, NOTINLINE or OPTIMIZE declarations, includes only the body forms and no longer includes the initforms of the LAMBDA/LET/LET*/MULTIPLE-VALUE-BIND bindings. + Vectors of element type NIL are now strings in all aspects. But the type --__--__-- Message: 5 From: Sam Steingold <sd...@us...> To: cli...@li... Subject: clisp/src TODO,1.60,1.61 Date: Sun, 30 Jan 2005 19:59:33 +0000 Reply-To: cli...@li... Update of /cvsroot/clisp/clisp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5447/src Modified Files: TODO Log Message: special declarations now work as they should Index: TODO =================================================================== RCS file: /cvsroot/clisp/clisp/src/TODO,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- TODO 28 Jan 2005 17:40:39 -0000 1.60 +++ TODO 30 Jan 2005 19:59:30 -0000 1.61 @@ -130,35 +130,6 @@ for Emacs: GC root macro, YETANOTHER macro -(let ((x 0)) (declare (special x)) (let ((x 1)) (let ((y x)) (declare (special x)) y))) -(let ((x 0)) (declare (special x)) (let ((x 1)) (let ((y x) (x 5)) (declare (special x)) y))) -(let ((x 0)) (declare (special x)) (let ((x 1)) (let* ((y x) (x 5)) (declare (special x)) y))) -should all return 1, not 0. -Scope von declare-special x: -LET ohne x: free: only the body, bind last -LET* ohne x: free: only the body, bind last -LET mit x: bound: only the body, bind last -LET* mit x: bound: ab der nächsten initform, bind after corresponding initform -LAMBDA: erst alle Argumente auswerten, dann erst die vorhandenen Parameter -binden, dann jeweils initform und binden. -<http://groups-beta.google.com/group/comp.lang.lisp/browse_thread/thread/6a9841771d95feb2?tvc=2> -(setf (symbol-value 'x) 6) -(defun foo (x) ;a lexical binding of x - (print x) - (let ((x (1+ x))) ;a special binding of x - (declare (special x)) ;and a lexical reference - (bar)) - (1+ x)) -(defun bar () - (print (locally (declare (special x)) x))) -(foo 10) ->> 10 11 => 11 -in clisp 2.33.1 it is 10 7 => 11 -Another example is: -(let ((x 5)) (let ((x (1+ x))) (declare (special x)) (print x))) -should print 6. - - (directory "/proc/self/*" :full t ) ((#P"/proc/self/status" #P"/proc/self/status" (6 44 0 1 4 1999) 0) (#P"/proc/self/mem" #P"/proc/self/mem" (6 44 0 1 4 1999) 0) --__--__-- _______________________________________________ clisp-cvs mailing list cli...@li... https://lists.sourceforge.net/lists/listinfo/clisp-cvs End of clisp-cvs Digest |