Deutsch English Français Italiano |
<vd4n61$d3p6$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Rich <rich@example.invalid> Newsgroups: comp.lang.tcl Subject: Re: Lost in Ashok's teachings Date: Thu, 26 Sep 2024 22:28:17 -0000 (UTC) Organization: A noiseless patient Spider Lines: 40 Message-ID: <vd4n61$d3p6$1@dont-email.me> References: <20240926050422.1458aed9@lud1.home> <ygabk0ahit1.fsf@akutech.de> <20240926101500.51d7520f@lud1.home> Injection-Date: Fri, 27 Sep 2024 00:28:17 +0200 (CEST) Injection-Info: dont-email.me; posting-host="dcce1bb59e982dc772b78d51c33e5b9d"; logging-data="429862"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+OHjjH79HjCREiLLnacPYl" User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64)) Cancel-Lock: sha1:VlKfSW2TKgIsLWQ8LhKtsciPzRA= Luc <luc@sep.invalid> wrote: > On Thu, 26 Sep 2024 11:21:14 +0200, Ralf Fassel wrote: > What about that plus sign? Where is it defined? A bit of 'context' would help us in actually knowing to what you are referring. I'm assuming you mean this construct from your original post: [+ $var $var] That + is the "proc" version of the addition operator. It is accessible as either: $ rlwrap tclsh % ::tcl::mathop::+ 1 2 3 % Or by setting up a namespace path within your current namespace, which then allows you to call the proc without the absolute namespace names: % namespace path {::tcl::mathop} % + 3 4 7 You can also access the math functions (i.e., sin(), abs() etc) in a similar way (they exist in ::tcl::mathfunc::) % namespace path {::tcl::mathop ::tcl::mathfunc} % sin .2 0.19866933079506122 % abs -4 4 Presumably, somewhere in an earlier chapter of Ashok's book, he detailed the above little setting to be able to call the math operators (and/or functions) as procs. But as the full book is not on the web, you would not have had the benefit of having read that material prior to reading the OO chapter that is available.