A TclOO question

Liste des GroupesRevenir à cl tcl 
Sujet : A TclOO question
De : hgiese (at) *nospam* ratiosoft.com (Helmut Giese)
Groupes : comp.lang.tcl
Date : 17. May 2025, 21:57:56
Autres entêtes
Organisation : ratiosoft
Message-ID : <marh2ktom6u4bkkdcd5nbsef9lnvqi02gq@4ax.com>
User-Agent : Forte Free Agent 1.93/32.576 English (American)
Hello out  there,
say I have a class and 2 instances like so

oo::class create MyClass {
    constructor {someVal} {
        my variable myVar
        set myVar $someVal
    }
    method get {} {
        my variable myVar
       return $myVar
   }
    method set {val} {
        my variable myVar
        set myVar $val
    }
}

MyClass create obj1 33
MyClass create obj2 99

How can I set a trace on 'myVar' of 'obj2'? 
I found an example on the doc of the 'my' command but it sets a trace
on a global variable during which an object is invoked - which doesn't
fit my situation
Any help will be greatly appreciated
Helmut

Date Sujet#  Auteur
17 May 25 * A TclOO question3Helmut Giese
18 May 25 `* Re: A TclOO question2Rich
18 May 25  `- Re: A TclOO question1Helmut Giese

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal