Forum OpenACS Development: Re: ad_parameter deprecated in favor of parameter::get?

Posted by Jerry Asher on
An argument against explicitly naming required arguments is that it can make them appear to be optional.

When I man a function, it helps my 7+-2 brain to be able to skim past the hyphenage to get a quick understanding of a function.

Slightly offtopic, I appreciate the value of using namespace evals, but I dislike what it does to my TAGS table.

namespace eval mypackage {
  proc get {} {}
  proc set {} {}

results in my not being able to find the right get/set function without a great deal of search.  I suspect most people's tcltag uses a combination of find and etags with regexps and a man of etags doesn't make it appear that we can get etags to ignore line breaks.

Using namespaces is probably the right thing to do, but one of these days we may have to break etags and etags.el....  grumble.

Posted by Bart Teeuwisse on


the solution is simple but requires a slightly different coding practice. First define the namespace like so:

namespace eval mypackage {}

Then create the procedures using their fully qualified name as such:

proc mypackage::get {} {}
proc mypackage::set {} {}

This way etags still works.


Posted by Jerry Asher on
Thanks Bart,

I'm not sure that's sufficient though -- unfortunately, we also need to cvs::get all the other packages and developers to follow this pattern.