Forum OpenACS Q&A: Re: Assertions in OpenACS

Collapse
12: Re: Assertions in OpenACS (response to 1)
Posted by Michael Bryzek on
Regarding a patch: We forked a long time ago (originally ACS 2.x). I'm happy to send you the code we use if you want to create a patch for OpenACS.

A couple other "additions" to ad_proc which may be of interest:

1) -private flag which acts like a protected method in Java using TCL namespaces, and which is only enforced in development servers:

ad_proc -private bryzek::test {} {

}

## This will throw an error since we are calling it 
## from the global namespace
namespace eval :: bryzek::test
2) a -cache flag with parameters request|precompute. This makes it easy to evaluate a procedure on server startup permanently caching its value, or to cache the value for the duration of a request.

If you are interested in the code, pls let me know - I have a feeling it will be easier to chat for 5 minutes and then reimplement this code in OpenACS rather than to try to reuse what we developed.

Regarding post conditions - We didn't implement them because we didn't have a real need at the time. I can see their use, and it should be relatively simple to add. That said, adding support for preconditions was simpler as we did not have to worry about exceptions in the body of the procedures.