Hi Damon On 01/22/2014 11:16 PM, Damon Courtney wrote: > Then back away slowly and come up with a new plan. > > I would suggest that for now we leave the [info script] behavior > alone. It doesn’t hurt anyone that I can see, and it would break
do you mean you want to keep that ugly hack in Rivet_SendContent? > compatibility right now. As near as I can tell from the docs, it’s > never even mentioned that we do that, and we certainly don’t define > its behavior for including or sourcing files. > > My other suggestion would be to add our own info command or > something like it to dig into the internals of Rivet when necessary. > We currently have the ::server() array that we populate with some > configuration variables. Those could be moved to a new > introspection command as well. we have ::rivet::inspect now (whose manual page needs further elaboration). It's easy to place those variables in a new dictionary returned by it. I chose the name 'inspect' to avoid conflict with 'info'. I new core commands were in the namespace ::tcl but I didn't know they were an ensemble and, as a matter of fact, I didn't know of the -map option of namespace configure either > > Tcl is known for its introspection. There’s no reason we shouldn’t > also provide some hooks to give insight on what Rivet is doing. We’ve > faked around it for years now, let’s just make it official. > > And stop messing with Tcl internals. :) OK, but I don't see it as the mine field it could look like at first. The only problem I can think of is implementing a simple and safe way for keeping the state of of a request processing and depending on it calling either our implementation of 'info script' or Tcl's. The crux of the problem is that we need to run our info script only during the execution of any script/template referenced by the URL and call the default implementation from any other script (ChildInitScript, BeforeScript, AfterScript, ErrorScript etc). The method of remapping a Tcl command would make possible to simply extend both 'info' and 'source' provided also this one is an ensemble method. A URL referenced file name should be stored in the rivet_interp_globals structure and a method of ::rivet::inspect could be used to read it. I think everything could be done within Rivet_ExecuteAndCheck but the transition between those 3 procedures (where the state has to change in order to drive our wrappers of 'info' and 'source') isn't marked by anything, as scripts are simply concatenated and then executed. I think the problem is leaning more on mod_rivet rather than Tcl. -- Massimo --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
