[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

&rest with &key cons too much



Hi,

here's a (not too much tested) patch for the problem reported this
morning:

*** lisp:src.orig/eval.d	Thu Apr 24 21:55:12 1997
--- lisp:src/eval.d	Mon Sep 01 13:05:45 1997
***************
*** 4919,4923 ****
                dotimesC(count,key_anz, { NEXT(ptr1) = unbound; } );
                set_args_end_pointer(new_args_end_pointer);
!             }}
            key_from_list: # restliche Argumente fu:r Keywords aus der Liste nehmen
              while (consp(args))
--- 4919,4936 ----
                dotimesC(count,key_anz, { NEXT(ptr1) = unbound; } );
                set_args_end_pointer(new_args_end_pointer);
!               if (flags & bit(0)) # Baue Rest-Parameter sparsam auf
!                 { pushSTACK(closure); # Closure muss gerettet werden
!                   pushSTACK(args); # args muss gerettet werden, args_on_stack nicht
!                   pushSTACK(args);
!                   dotimesC(args_on_stack,args_on_stack,
!                     { var object new_cons = allocate_cons();
!                       Cdr(new_cons) = STACK_0;
!                       Car(new_cons) = BEFORE(new_args_end_pointer); # na:chstes Argument draufconsen
!                         STACK_0 = new_cons;
!                     });
!                   Before(key_args_pointer) = popSTACK(); # Rest-Parameter
!                   args = popSTACK();
!                   closure = popSTACK();
!             }}  }
            key_from_list: # restliche Argumente fu:r Keywords aus der Liste nehmen
              while (consp(args))
With this patch
(time (intersection '(1 2 3 4 5 6 7 8 9) '(a b c d e f g h i j k l) :test #'eql :key #'identity))
goes down to 16 or 32 bytes of consumed space only.

Be careful when applying it, as the GMD mailer will munge accents :-(
a:o:u:ssA:O:U:
aousAOU

	Jo:rg Ho:hle.
Joerg.Hoehle@gmd.de		http://zeus.gmd.de/~hoehle/amiga-clisp.html