Re: A TclOO question (for experts?)

Liste des GroupesRevenir à cl tcl 
Sujet : Re: A TclOO question (for experts?)
De : aotto1968 (at) *nospam* t-online.de (aotto1968)
Groupes : comp.lang.tcl
Date : 11. Apr 2025, 18:08:27
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vtbiab$24pkk$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
On 07.04.25 18:34, Helmut Giese wrote:
Hello out there,
look at the following sample:
---
catch {Sample destroy}
 oo::class create Sample {
     variable classVar ;# automatically exists in every instance
     constructor {someVar} {
         my variable objVar
         set classVar $someVar
         set objVar 99
     }
     destructor {
         my variable objVar classVar
         puts "classVar: $classVar, objVar: $objVar"
     }
}
 Sample create s1 100
Sample create s2 200
s1 destroy ;# -> classVar: 100, objVar: 99
s2 destroy ;# -> classVar: 200, objVar: 99
---
My question is: What happens, if I add 'classVar', although not
needed, to a 'my variable' statement  - like I did in the destructor
above. Is it just superfluous or can it have consequences in a more
complex situation than the above example.
Thank you for any enlightenment
Helmut
a very good source for all kind of programming questions is the KI
for example the GROK from X(twitter)
https://x.com/i/grok
it is really impressive, here is your answer:
https://x.com/i/grok/share/Wo4XKUycnscf3WNTbpMoms93f
mfg

Date Sujet#  Auteur
7 Apr 25 * A TclOO question (for experts?)8Helmut Giese
8 Apr 25 +* Re: A TclOO question (for experts?)2rene
9 Apr 25 i`- Re: A TclOO question (for experts?)1Helmut Giese
11 Apr 25 `* Re: A TclOO question (for experts?)5aotto1968
11 Apr 25  `* Re: A TclOO question (for experts?)4Helmut Giese
14 Apr 25   `* Re: A TclOO question (for experts?)3Ralf Fassel
14 Apr 25    `* Re: A TclOO question (for experts?)2abu
14 Apr 25     `- Re: A TclOO question (for experts?)1Ashok

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal