Re: Lost in Ashok's teachings

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Lost in Ashok's teachings
De : apnmbx-public (at) *nospam* yahoo.com (Ashok)
Groupes : comp.lang.tcl
Date : 26. Sep 2024, 17:47:46
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vd437i$8hp5$1@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 9/26/2024 6:45 PM, Luc wrote:
On Thu, 26 Sep 2024 11:21:14 +0200, Ralf Fassel wrote:
 
You have ommitted the constructor from Ashoks example which initializes
the 'Balance' variable.  In your class, this variable is simply not
initialized, which leads to the error.
 True. Thanks.
 What about that plus sign? Where is it defined?
 
Replace it with tcl::mathop::+
Somewhere earlier in the book, I think I mention that the rest of the book assumes a "namespace path tcl::mathop" which is why there is that standalone "+". Was a bad idea in hindsight just to save the clutter of tcl::mathop:: prefixes everywhere.
Regarding the code testing, the book build process runs every snippet of code and the output generated in the book is actually from running each example at book build time. Very few exceptions to that. Any errors abort the build process. The OO code should therefore run without errors (in the book, not sure of the online version which was an earlier draft).
As for the rest of your comments, fair enough that you do not like the approach. You might try the other books in this space, like the one from Clif Flynt, or the online tutorial at https://wiki.tcl-lang.org/page/Tcl+Tutorial+Lesson+OOP1
/Ashok

Date Sujet#  Auteur
26 Sep 24 * Lost in Ashok's teachings8Luc
26 Sep 24 `* Re: Lost in Ashok's teachings7Ralf Fassel
26 Sep 24  `* Re: Lost in Ashok's teachings6Luc
26 Sep 24   +- Re: Lost in Ashok's teachings1Ashok
26 Sep 24   +- Re: Lost in Ashok's teachings1Ralf Fassel
26 Sep 24   `* Re: Lost in Ashok's teachings3Rich
27 Sep 24    `* Re: Lost in Ashok's teachings2Luc
27 Sep 24     `- Re: Lost in Ashok's teachings1Rich

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal