At 12:55 PM 11/7/2001 -0800, Brent Dax wrote: >Is there a reason we have the current two-pointer stack setup, instead >of a struct stack or something to abstract the pointers away?
No real reason. Seemed to make sense at the time. The base pointer points at the chunk at the start of each stack, while top points to an element potentially in a different chunk (that you don't even have a pointer to) which doesn't help. If you think you can redo it so it's as fast or faster but less confusing, go for it. There's no code in the code base I have any particular attachment to. > The >current setup is hard to use and easy to confuse. (I know I confused >myself with the stacks in the regexp code... :^) ) Segmented stacks are a bit of a pain in general. > /* what exactly is cleanup used for, anyway? */ > push_generic_entry(interp, &mystack->top, data, type, cleanup); >} If something's pushed on the stack that needs to take some sort of action when popped, it gets a cleanup routine. Lexical locks, for example. Dan --------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk