[Xotcl] How do I get a parameters default-value?

Murr, Florian florian.murr at siemens.com
Tue Jul 18 14:40:52 CEST 2006


    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



More information about the Xotcl mailing list