No registered users in community xowiki
in last 10 minutes
in last 10 minutes
[Xotcl] How do I get a parameters default-value?
From: Murr, Florian <florian.murr_at_siemens.com>
Date: Tue, 18 Jul 2006 14:40:52 +0200
package require XOTcl
namespace import xotcl::*
# Let's say, I got:
Class X -parameter {
{p1 val1A}
}
X create x1 -p1 x1val1
# ...
# Now I change the default-values
X parameter {
{p1 val1B}
}
X create x2 -p1 x2val1
# How do I get the current default-value 'val1B' for p1?
# Note 'X info parameter' is no option, since after:
X parameter {}
puts "X parameter = [X info parameter]"
X create x3
puts "x3 p1 --> [::x3 p1]" ;# still works.
# So the default-values are remembered somewhere!
# My guess was somewhere around '::xotcl::Class::Parameter', but I
just
# could not find, where? - and how to access them?
#
# Somehow there must be a better way to access the current
default-values
# then via some newly created dummy object?!
# (May be even the "old" default-values 'val1A, val2A' (for ::x1)
are still remembered somewhere?)
#
# regards,
# - Florian
Date: Tue, 18 Jul 2006 14:40:52 +0200
package require XOTcl
namespace import xotcl::*
# Let's say, I got:
Class X -parameter {
{p1 val1A}
}
X create x1 -p1 x1val1
# ...
# Now I change the default-values
X parameter {
{p1 val1B}
}
X create x2 -p1 x2val1
# How do I get the current default-value 'val1B' for p1?
# Note 'X info parameter' is no option, since after:
X parameter {}
puts "X parameter = [X info parameter]"
X create x3
puts "x3 p1 --> [::x3 p1]" ;# still works.
# So the default-values are remembered somewhere!
# My guess was somewhere around '::xotcl::Class::Parameter', but I
just
# could not find, where? - and how to access them?
#
# Somehow there must be a better way to access the current
default-values
# then via some newly created dummy object?!
# (May be even the "old" default-values 'val1A, val2A' (for ::x1)
are still remembered somewhere?)
#
# regards,
# - Florian