View · Search · Index
No registered users in community xowiki
in last 10 minutes

[Xotcl] XOTcl extending nonPosArgs class

From: Giovanni Cristelli <giovanni.cristelli_at_telecomitalia.it>
Date: Thu, 04 Nov 2004 08:59:03 +0100

With version 1.3.0 I've tried to extend the class to support a new
option in using the following code:

xotcl::nonPosArgs proc in { allowedValues argName args} {
 if { [lsearch $allowedValues $args] == -1 } {
     error "Invalid value |$args| for option $argName (allowed values:
[join $allowedValues {, }])"
 }
}

example:

Class create A
A proc y {{{-q:in {add remove}} add}} {} {
puts $q
}
A y; # prints add
A t -q bad; # throw an error
A y -q remove; # prints remove

With version 1.3.1 this code doesn't work anymore and the error returned
is:

::xotcl::nonPosArgs: unable to dispatch method 'in {add remove}'

How can I change the prototype to make it work again ?

Thanks,
Giovanni.
--------------------------------------------------------------------

CONFIDENTIALITY NOTICE

This message and its attachments are addressed solely to the persons above and may contain confidential information. If you have received the message in error, be informed that any use of the content hereof is prohibited. Please return it immediately to the sender and delete the message. Should you have any questions, please contact us by replying to webmaster_at_telecomitalia.it.

        Thank you

                                        www.telecomitalia.it

--------------------------------------------------------------------