Basically, reqvar means to give me a "global" variable for this request only. It basically does:
namespace upvar ::request foo foo So you get your variable locally, but it's coming from the ::request namespace. It will get cleaned up along with the namespace when the request is complete. If you want a TRULY global variable, meaning one that will actually persist between instances, you would use the global command or the variable command within your own namespace. reqvar is just a way to say "Give me a variable for this request only". Damon On Sep 10, 2010, at 4:52 AM, Massimo Manghi wrote: > I use myself to store reusable code and variables outside the ::request > namespace using other namespaces to give every symbols a meaningful scope. It > did make sense in the usual Tcl programming and it makes sense in Rivet too. > So I never used the ::request::global command and dropping it would not affect > anything I did. > > I have a question about reqvar: does it mean the ::request namespace won't be > wiped out at the end of the request processing and at least some of the > contents (reqvars) preserved? Will you create a new 'private' namespace were > reqvars are copied back and forth? > > -- Massimo > > On Thu, 9 Sep 2010 21:22:13 -0500, Damon Courtney wrote >> After chatting with Karl a bit, I think my plan is to add a new >> command called reqvar that can be used as a way of getting a local >> variable from the ::request namespace. We'll leave the >> ::request::global command in for now, but I think it's a hack and >> needs to probably get removed. If people want a global, you global >> it. If you want a namespace variable, you variable. You want a >> "request" variable, reqvar. >> >> Any objections? >> >> D >> > > > -- > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
