On Tue, Jan 24, 2006 at 08:49:55PM -0000, Jonathan Worthington wrote: > "Chip Salzenberg" <[EMAIL PROTECTED]> wrote: > >I'd prefer to reuse something in the engine already for those callbacks. > >If a lightweight callback mechanism, with parameter, doesn't already > >exist, then you could either use a closure for -that- (eh, too expensive) > >or else invent such a mechanism for general use, with yourself as first > >customer. > > There is a mechanism used to do this kinda thing for exit handlers > (src/exit.c), but it doesn't look particularly general. I guess leo will > know if there is something I've missed - leo, thoughts? I guess such a > mechanism probably shouldn't be much work to implement, though, and would > certainly be a nice, clean answer.
Words I love to hear. Er, read. > >I imagined that the references would only ever be to -PMC- registers...? > > I wouldn't have thought so. I thought in Perl 6 the lowercased types like > "int" were to go in the I registers. Yes... > I think we'd still want to be able to create a reference to them though. No, sorry. "my int $a" means that $a is fast (good) but can't participate in any of the reindeer games like CALLER, MY, and references (bad). > In the .NET case, there's no reason not to use I registers for its > integers. Urque. So the real Reference PMC type actually doesn't do everything you want, and there's no point in waiting for it. As for your .Net-specific pointer PMC, if you're already keeping a contecxt pointer and an index, all you need in addition is a type enum for [INSP] and you're set. (Or separate subclasses of the pmc, whichever works better for you.) -- Chip Salzenberg <[EMAIL PROTECTED]>