Sujet : Re: Are class consts possible?
De : rich (at) *nospam* example.invalid (Rich)
Groupes : comp.lang.tclDate : 20. Jun 2025, 21:28:25
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <1034g98$82fd$1@dont-email.me>
References : 1 2 3
User-Agent : tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Mark Summerfield <
m.n.summerfield@gmail.com> wrote:
On Fri, 20 Jun 2025 13:28:13 -0000 (UTC), Rich wrote:
Mark Summerfield <m.n.summerfield@gmail.com> wrote:
Is it possible to create class-specific consts i.e., consts that exist
inside a class's namespace?
Tcl does not have "constants" in the vien of other languages
"constants".
However, there are several ways to "roll your own":
https://wiki.tcl-lang.org/page/constants
According to https://www.tcl-lang.org/man/tcl9.0/TclCmd/const.html
"const — create and initialize a constant"
And I use them quite a lot since I'm using Tcl 9.
Ah, it seems Tcl 9 added "const" capabilities.
Perhaps the wiki needs updating?
Indeed, that would seem to be the case.