Skip to content
Tcl Source Code History Of Ticket f8a20dff9c1b3259
Login

History Of Ticket f8a20dff9c1b3259

Artifacts Associated With Ticket f8a20dff9c1b3259

  1. Ticket change [5e0d91d4b8] (rid 254188) by oehhar on 2026-06-03 13:51:49:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized 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
      
    5. foundin initialized to: "main"
    6. is_private initialized to: "0"
    7. login: "oehhar"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "oehhar"
    14. subsystem initialized to: "07. Variables"
    15. title initialized to: "Doc: description of command "variable" incomplete"
    16. type initialized to: "Bug"
  2. Ticket change [ae9d0a3b94] (rid 254189) by oehhar on 2026-06-03 13:54:01:

    1. 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 0 to infinite arguments. Only 1 or 2 arguments do something:
      
      <verbatim>
      % namespace eval test {variable v1 c1 c2 c3}
      % set test::v1
      c1
      </verbatim>
      
      What is this for:
      <verbatim>
      % namespace eval test {variable}
      </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
      
    2. login: "oehhar"
    3. mimetype: "text/plain"
  3. Ticket change [4a91d05e4b] (rid 254195) by apnadkarni on 2026-06-04 05:25:12:

    1. icomment:
      The use of `variable` within a class definition (`oo::define`) has different syntax and is described in the `oo::define` manpage. (It is also not a "class variable" as that term has a different meaning.)
      
      I agree it is confusing to have a different syntax for commands of the same name and with similar, but not identical function, even though in different scopes but not sure much can be done about it now.
      
    2. login: "apnadkarni"
    3. mimetype: "text/x-markdown"
  4. Ticket change [5aad166024] (rid 254199) by sbron on 2026-06-04 12:30:32:

    1. icomment:
      I frequently use the `variable` command  with more than 2 arguments. I'm not sure why you claim that "[o]nly 1 or 2 arguments do something". Here's proof to the contrary:
      
      ```
      % namespace eval test {variable v1 c1 v2 c2}
      % set test::v1
      c1
      % set test::v2
      c2
      ```
      
    2. login: "sbron"
    3. mimetype: "text/x-markdown"
  5. Ticket change [c6d3297683] (rid 254200) by oehhar on 2026-06-04 12:41:18:

    1. closedate changed to: "2461196.0286846873"
    2. closer changed to: "oehhar"
    3. icomment:
      A, thanks. That makes sense.
      
      That is what the syntax in the man page eans:
      
      <verbatim>
      variable ?name value...?
      </verbatim>
      
      arbitrary number of variable name and value.
      
      If that is the interpretation, why does this not raise an error:
      
      <verbatim>
      namespace eval test {variable v1 c1 v2}
      </verbatim>
      
      This would be the syntax:
      
      <verbatim>
      variable ?name value...? ?name?
      </verbatim>
      
      Anyway, thanks for all, noise for nothing but a big dump stupid user...
      
      Sorry,
      bug closed.
      
      THanks,
      Harald
      
    4. login: "oehhar"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"
    8. username: "oehhar"