Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ralf Fassel Newsgroups: comp.lang.tcl Subject: Re: A TclOO question (for experts?) Date: Mon, 14 Apr 2025 11:08:05 +0200 Lines: 26 Message-ID: References: <7jrivj1hfem1uisvg1no2o5q5qralnaii7@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net CPgcKb0KeB7T1zD/yFci/w1s2WWrLxPDPGiibD6OK3zNaHq0k= Cancel-Lock: sha1:Iry4NXp0lNHfvkWDDajKYVcgo+g= sha1:nmhUdqKvDKwy3S7rFTMx01W2suM= sha256:L9k+CLGE3ULUhhZgF6U/Lhq5s1A/k0P682FDrMbnH9M= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) * Helmut Giese | | → https://x.com/i/grok/share/Wo4XKUycnscf3WNTbpMoms93f | that's really cool: a complete, detailed analysis which even I | understood. Many thanks for this link The text created by the AI contains a subtle error: it makes a difference between "variable foo" at class level and "my variable foo" at method level as the former being a "class-wide" variable (shared across instances, 'static' in C++, 'common' in itcl) and the latter "instance-specific" ones (specific to one object): [Complex situations, p2] ... ["my variable classVar" in method without previous "variable classVar" at class level] ... In this case, classVar becomes an instance-specific variable, not a class-wide one, which could lead to unexpected behavior if the intent was to share classVar across instances. As far as I understand it, this is not the case. Also the code you posted cleary shows that classVar is *not* shared between instances (each object has it's own value). Maybe someone with more knowlegde on this can share some insight? R'