Forum OpenACS Development: ad_proc and the "--" option

Collapse
Posted by Andrew Piskorski on
Offhand, I doubt that URLs starting with "-" occur anywhere in OpenACS in practice.

But this is a good example of one of Tcl's minor but annoying warts. I tend to habitually use "--" everywhere I think it might work, until "Oops, got an error, oh yeah, this particular Tcl command doesn't accept the '--' option, take it out."

And once you define a proc with no option switches at all, it seems that for 100% backwards compatibility you must never add any switches ever. Actually, hm, I suppose you could kludge something into ad_returnredirect to check the number of arguments it received, and implicitly add the "--" if necessary. That means doing its own parsing rather than using ad_proc though, which is probably both not worth it and a bad idea. Instead, perhaps it would be worthwhile to extend ad_proc itself to optionally support some such feature?