[Xotcl] XOTcl extending nonPosArgs class

Giovanni Cristelli giovanni.cristelli at telecomitalia.it
Thu Nov 4 08:59:03 CET 2004


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

--------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://alice.wu-wien.ac.at/pipermail/xotcl/attachments/20041104/f87c6843/attachment.html


More information about the Xotcl mailing list