On Wednesday 18 August 2004 16:17, Kristoffer Lawson wrote:
On Wed, 18 Aug 2004, Gustaf Neumann wrote:
* Nonpositional arguments for xotcl procs/instprocs; this is a flexible way to check arguments, to provide defaults etc for every xotcl proc/instproc. It uses a similar syntax as ad_proc and ad_page_contract in OACS. See the tutorial for more details.
Interesting... I wonder if something like that could be TIPped into Tcl itself?
sure, it can. It can be implemented as well fully in Tcl, as done in ad_proc (or ad_page_contract) in Open ACS. Uwe implemented a fast c-based version, borrowing the syntax from OACS.
What about if I don't define any nonpositional arguments, can I pass arguments beginning with a dash? I kind of hope so, or otherwise it may be necessary to pass "--" everywhere, and it adds incompatibility with older XOTcls.
one can define procs/instprocs with non-positional arguments and without. If you have nonposistional arguments defined, and you want to pass e.g. -a as "traditional" argument, you must use "--".
Since existing scripts have no nonpositional arguments defined, nothing changed there, older scripts continue to work unmodified.
-gustaf
/ http://www.fishpool.com/~setok/
Xotcl mailing list - Xotcl@alice.wu-wien.ac.at http://alice.wu-wien.ac.at/mailman/listinfo/xotcl