From: Andreas K. <aku...@sh...> - 2002-11-16 21:27:47
|
> Why only a way to get the type of something? Why not a way to set > its type as well? I have an experimental command, objprobe, that > will tell you the type of an object, and it can try to set it as > well. The cool thing about setting it, for example, you can force > procs to compile without executing them, by changing their type to > bytecode. No. The result of [info body] is _not_ the Tcl_Obj* bodyPtr stored in the Proc structure. It takes the string rep of that object and creates a new (string) object from that, making it completely disjoint from the internal representation of the procedure. I know, I looked at that code 2 days ago, when I was experimenting with the code reachable through 'http://wiki.tcl.tk/tclVM'. The reason is sort of obvious, to me: procomp/tbcload. For precompiled procedures generated by procomp the string rep is (essentially) error {you are not suppossed to see this} and has nothing to do with the actual bytecode. If [info body] were to return the true objeect something like 'tclVM' makes recovery of a large amount of the original sources possible. With the current scheme you get only the safe-guarding error message and looking at its bytecodes does not help either in recovering the precompiled sources. -- So long, Andreas Kupries <aku...@sh...> <http://www.purl.org/NET/akupries/> Developer @ <http://www.activestate.com/> ------------------------------------------------------------------------------- |