Am 27.05.2005 um 18:44 schrieb Stephen Deasey:
ns_parseargs {-a:int -b:bool -s:switch} $args
So the boolean switch could use the type syntax. I'm not desperate
for [string is ...] checks so leaving that out will certainly make
life easier, but we still have to think about the syntax for
specifying types as seems we need it anyway...
Hmmm.... not very excited about the syntax, but have not any
other idea yet... will have to think about it.
You mean checking for integers etc.? The C API does do this (has to,
it's C!), but the Tcl wrapper doesn't use it. It was easier to define
a new Ns_ObjvSpec proc to handle all Tcl args than to massage the arg
spec into what the C API expects. I don't know whether it makes sense
to try and use the underlying C stuff or not.
Oh NO! Excatly that I did not wanted to do. I would not check argument
types on being integer or similar... This should really be left to the
programmer.
Sure. How would you specify an option list? And would there be the
two types that the C API supports, the choose 1 and the choose 1 or
more? For the choose 1 or more the result should probably be an array
(where the C implementation logically OR's bits).
Do not know. I will invest some time in thinking about that tomorrow
morning...
Zoran