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

[Xotcl] getter

From: Krzysztof Frukacz <frukacz.krzysztof_at_gmail.com>
Date: Tue, 18 Jan 2011 15:32:45 +0100

Hello,

I need an example of implementation of a getter.
I have an attribute in a class which now needs a customized getter.
Class A -slots {
        Attribute attr -proc get {domain var} {
                #how to get attr value here? if I do [my attr] I get recursive call.
$attr says that there is no such variable
        }
}

Another question: should I use -proc get or -proc valuecmd? valuecmd
does seems to be not called at all.

Best Regards
-- 
Krzysztof Frukacz