At 05:42 PM 8/7/00 +0100, Graham Barr wrote:
>On Mon, Aug 07, 2000 at 12:03:36PM -0400, Dan Sugalski wrote:
> > I've been thinking we could have a "state change" op that would
> selectively
> > and lexically alter the appropriate state variable (warnings, stricture,
> > shell, taint checking, whatever) on the fly. Each op would check the
> > current state if the situation warranted, rather than sprinkling "check
> > this assumption" ops througout the code.
>
>This could solve the problem of running out of bits in the OPs to
>add a new flag etc. and make it much more easy to add new pragmas
That's what I was thinking about, and it also makes the ops smaller. (We
got a warning flag field in every op as of 5.6.0, IIRC) Since the various
state things change infrequently it makes sense to encode the changes to
state rather than the current state. Plus the extendability doesn't hurt. :)
I'm not sure the form of the state fields at the moment--probably an array
of IVs hanging off the interpreter or something--but it'd be keen. We could
have ops like:
setstate 1, 0x4556F432
andstate 3, 0xFFFFFF8F
orstate 6, 0x00000001
where 1, 3 and 6 would translate to known array offsets. (top half of
warnings, taint on/off, whatever)
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk