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

Posted by Andrew Piskorski on
For, um, posterity, I just wanted to note that Tom's statement above that "the OpenACS style is to flip all the tcl conventions around anyway. Required parameters in ad_procs come after the options, unlike tcl." is, AFAIK, completely untrue - there are no standard Tcl conventions when it comes to ordering of optional vs. required parameters, nor named vs. un-named parameters.

This is easily demonstrated by reading the Tcl docs for various Tcl commands. Many, like string, seem to have all the named optional arguments first, all required un-named arguments next, and maybe a few extra un-named optional arguments at the end. Others, like clock format, have a required un-named argument first, with optional named arguments after it.

So I hope these examples from the Tcl core put that particular red herring to rest.

The OpenACS ad_proc standard of "all named -foo parameters first, then all un-named positional parameters next" is at least completely consistent with unix command-line usage parameter ordering (which inspired it), and at least in that one respect, is used consistently throughout OpenACS.

(The whole "parameter::get -parameter $parameter_id" foolishness that started off this thread, and the related question of whether parameters should generally be named or un-named, are of course entirely separate matters. And here and now, I am specifically not addressing those at all.)