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

[Xotcl] assign proc - how to execute assign from superclass?

From: Krzysztof Frukacz <frukacz.krzysztof_at_gmail.com>
Date: Wed, 05 Jan 2011 15:50:54 +0100

Hello,

I have a question for which I haven't been able to find the answer.
I have two classes:

Class create A -slots {
        Attribute foo -proc assign {domain var value} {
                if {$var > 5} {
                        error "Value cannot be bigger than 5"
                }
                $domain set $var $value
        }
}

Class create B -superclass A -slots {
        Attribute foo -proc assign {domain var value} {
                if {$var < 0} {
                        error "Value cannot be less than 0"
                }
                #I don't know how to call assign for foo in class A here
        }
}

What I want to to is for assign proc from B to call assign proc from A
too check both conditions.
Thank you for your help.

-- 
Krzysztof Frukacz