No registered users in community xowiki
in last 10 minutes
in last 10 minutes
[Xotcl] Non-pos arguments with args
From: Kurt Stoll <kstoll_at_echelon.com>
Date: Fri, 17 Feb 2006 08:24:04 -0800
I am having difficulty getting non-positional arguments to behave correctly
with args. The simple example below shows what I have found. This does not
appear to be appropriate behavior. Am I doing something wrong?
Object obj
obj proc pr1 { {-npos default} args } {
puts "npos: $npos"
puts "args: $args"
}
> ## This works:
> obj pr1 a
npos: default
args: a
>
> ## As does this:
> obj pr1 -npos 3 a
npos: 3
args: a
>
> ## But this does not:
> obj pr1 -npos 3
npos: 3
args: -npos 3
>
> ## I expected args to be {}, but instead it contains the non-positional
parameter
Thanks for any insight you can provide.
-Kurt Stoll
Date: Fri, 17 Feb 2006 08:24:04 -0800
I am having difficulty getting non-positional arguments to behave correctly
with args. The simple example below shows what I have found. This does not
appear to be appropriate behavior. Am I doing something wrong?
Object obj
obj proc pr1 { {-npos default} args } {
puts "npos: $npos"
puts "args: $args"
}
> ## This works:
> obj pr1 a
npos: default
args: a
>
> ## As does this:
> obj pr1 -npos 3 a
npos: 3
args: a
>
> ## But this does not:
> obj pr1 -npos 3
npos: 3
args: -npos 3
>
> ## I expected args to be {}, but instead it contains the non-positional
parameter
Thanks for any insight you can provide.
-Kurt Stoll