Overview
| Artifact ID: | 5e0d91d4b8bc7aeae439e298d4532532aec90640f6dc78553308bcdb96a2e557 |
|---|---|
| Ticket: | f8a20dff9c1b3259c08f3b8b7539c199a5b8a0ee
Doc: description of command "variable" incomplete |
| User & Date: | oehhar on 2026-06-03 13:51:49 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
The description of the command "variable" [https://www.tcl-lang.org/man/tcl9.0/TclCmd/variable.html] gives the synopsis: <verbatim> variable name variable ?name value...? </verbatim> I don't know what this means. The described form is: <verbatim> variable name ?value? </verbatim> Unfortunately, the command accepts an arbitrary number of arguments, which are ignored: <verbatim> % namespace eval test {variable v1 c1 c2 c3} % set test::v1 c1 </verbatim> This is probably due to the fact, that in OO context, the command has a totally different syntax (Ashoks book, page 394): <verbatim> variable ?SLOTOPERATION? ?VARNAME ...? </verbatim> The same command "variable v1 c1" means different things: * in namespaces, a namespace variable v1 is set to c1 * in OO, the variables v1 and c1 are defined as class variables. Great ! I would love, if the command: * would give a propper error message, if used in the different contextes. * the documentation would document all this strange stuff. Sorry for my OO unskill level, it is all strange. Take care, Harald - foundin changed to: "main"
- is_private changed to: "0"
- login: "oehhar"
- priority changed to: "5 Medium"
- private_contact changed to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "oehhar"
- subsystem changed to: "07. Variables"
- title changed to: "Doc: description of command "variable" incomplete"
- type changed to: "Bug"