At 06:17 PM 1/3/2002 -0800, Brent Dax wrote:
>Dan Sugalski:
># At 03:37 PM 1/3/2002 -0800, Brent Dax wrote:
># While cool, I'm interested in why? For regexes you can stash
># a pointer to
># the string buffer into an S register if you want to bypass
># even one level
># of indirection.
>
>Handles would probably be used for other things besides regex info
>structures--basically, anything where you needed to stash a pointer
>somewhere without worrying about the size of INTVAL.  This seemed like a
>pretty good time to introduce such a thing, since I was working on
>something where I needed to stash a pointer.  They're also safer than S
>registers--you can't segfault by accidentally printing one or something.
>(Besides, I still can't wrap my brain around the idea that 'S' is for
>'structure', not 'string'.  :^) )

Fair enough. Could you pop the patch to me again? The black hole ate it.

>Can you take a reference to an S register and bless the reference into
>an object?  Can you store an S register into a symbol table?

Nope, but you can stash the pointer in the s register somewhere. But that's 
not quite the same.

>My current
>idea for implementing /g is that you reuse the same structure; it would
>be very nice if it wasn't too hard to do such a thing.

Ah, I see. GC'll whack that, though--the thing pointed to might move. 
Better to store an offset rather than a pointer.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to