ad_page_contract
and ad_form
do multi var validation via an additional -validate
code block. Probably ad_form
could make better use of this, since it isn't usually the first proc called on the page.
I'm wondering if a lot of this type of coding could be condensed by expanding the argspec. The additional argspec would be something like
{{name var1 var2}:flag,flag,flag}
Another issue is how filter procs are called. They are relatively static. What if flag, became {flag arg1 arg2 ...}? Then you could easily do, for instance, string length checking {length 1 30} to enforce a length of 1 to 30 chars. Or list checking: {inlist a b c d}.