Forum OpenACS Development: Re: RFC: Callbacks

Collapse
6: Re: RFC: Callbacks (response to 1)
Posted by Andrew Grumet on
Okay, so we'll use the second style for collecting implementations into namespaces.

ad_proc -callback acs_user::change_state -implementation dotlrn { ... }

I like it, but just to be clear, we'd be asking them to put these in namespaces, e.g.

namespace eval dotlrn {

    ad_proc -callback acs_user::change_state -implementation dotlrn  { ... }

}

Right? The alternative, asking programmers to use the same fully qualified function name repeatedly across the toolit, seems like a problem waiting to happen.

If we can require that the callback implementations are declared in namespaces, we could conceivably drop the <strike>-callback</strike> -implementation flag and introspect for it.

Collapse
15: Re: Re: RFC: Callbacks (response to 6)
Posted by Andrew Piskorski on
Please do not define Tcl procs via the "namespace eval foo { pages_of_procs_here }" mechanism. That makes finding the procs in the files via Emacs or ctags unreasonably difficult. (And it also adds an unnecessary and annoying additional level of indentation.) Instead, simply define each proc using its fully-qualified name, e.g.:
ad_proc -callback dotlrn::acs_user::foo::bar { ... }

As far as the actual topic of this thread - yes, good OpenACS callback support would be excellent, I applaud this effort. I have no particular thoughts or feedback on it myself, but between Jeff and Andrew working on it I'm pretty sure you'll end up with something good. :)