Hi Andy, Andy Wingo <[email protected]> writes: > On Fri 13 Apr 2012 07:22, Mark H Weaver <[email protected]> writes: >>> * module/language/tree-il/peval.scm (fold-constants): Returns #f instead >>> of the expression, as all continuations handle #f themselves. >>> (negate, bailout?, extract-facts, infer, infer-defined?) >>> (infer-struct-vtable): New helpers. >> >> I haven't looked at the code, but it sounds like you are trying to >> eliminate redundant 'struct-vtable' checks. Unfortunately, it seems to >> me that this cannot be done safely. > > The identity of the vtable does not change when it is redefined. If the > vtable is redefined, the equality check still succeeds. There are > comments in the source.
Okay, I've just reread: http://wingolog.org/archives/2009/11/09/class-redefinition-in-guile and I see that I had some misconceptions about this. Point taken: when a class is redefined, the result of 'struct-vtable' on the instances remain the same. Nonetheless, the vtable checks involve comparisons with a mutable top-level variable. Whenever unknown code is run (e.g. when a top-level procedure is called) you must assume the worst: that any top-level variable might have been 'set!'. Regards, Mark
