Skip to content
Tcl Source Code History Of Ticket b108e00ac8b1b6e4
Login

History Of Ticket b108e00ac8b1b6e4

Artifacts Associated With Ticket b108e00ac8b1b6e4

  1. Ticket change [b76c2174c0] (rid 250171) by apnadkarni on 2026-01-05 16:48:39:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-plain"
    4. comment initialized to:
      In my opinion, the second line below should raise an error as the value being assigned does not match the existing value.
      
      ```
      % const v 2
      % const v 3; # Should raise an error
      ```
      
    5. is_private initialized to: "0"
    6. login: "apnadkarni"
    7. priority initialized to: "5 Medium"
    8. private_contact initialized to: "9546e9877f1a8899e25a89082561ee694e7fb402"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "apnadkarni"
    13. subsystem initialized to: "- New Builtin Commands"
    14. title initialized to:
      Defining const with a different value should raise an error
      
    15. type initialized to: "Bug"
  2. Ticket change [c65f0cd80a] (rid 250300) by juliannoble2 on 2026-01-11 01:35:41:

    1. icomment:
      I would find const more useful if it raised an error in this case. Intuitively it's what I initially expected.
      
      Tip 677's statement:
      
      "The variable must not exist prior to const creating a constant variable (unless it is a constant variable; in that case, const silently does nothing)."
      
      makes no mention of value checking in this case - so I assumed it was deliberate.
      
    2. login: "juliannoble2"
    3. mimetype: "text/plain"
  3. Ticket change [1f31df1a51] (rid 254430) by sebres on 2026-06-18 17:23:54:

    1. icomment:
      Short excerpt of a discussion from tclchat:
      <pre style="padding-left:10pt">
      &lt;sebres&gt; shall not [const] with another value as previously throw an error? I mean:
      &lt;sebres&gt;   % const A 5; const A 5; set A; #=> 5; # this is expected (cause can happen by source 2nd time), but...
      &lt;sebres&gt; - % const A 5; const A 6; set A; #=> 5
      &lt;sebres&gt; + % const A 5; const A 6; set A; #=> [e] can't change "A": variable is a constant
      &lt;sebres&gt; imho, the former (-) is wrong, something like letter (+) shall happen instead
      &lt;apn&gt; @sebres - see ticket [b108e00ac8]
      &lt;sebres&gt; thx, Ashok... I'll try to fix it now
      &lt;apn&gt; @dkf might want to opine
      &lt;apn&gt; as to the rationale as I think the current behaviour is explicitly stated in the TIP
      &lt;sebres&gt; then it is wrong anyway
      &lt;sebres&gt; [set A 6] is prohibited, but "change" using [const] is allowed (however it's not changed)... either it shall be RO completely... or it must be changeable (with [const])
      &lt;sebres&gt; doing as it would be changed successfully is simply wrong, no matter what TIP says about
      </pre>
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  4. Ticket change [597d100e1a] (rid 254442) by apnadkarni on 2026-06-19 04:57:58:

    1. icomment:
      Further from the chat:
      
      
      DonalFellows (via ischain) 2026-06-18 20:14:51 UTC – 2026-06-18 20:15:43 UTC
      
      The problem is how to handle someone putting [const X [expr {...}] inside a loop.
      
      I'm uncertain which way to go there.
      
      apn (via ijchain) 2026-06-19 04:22:26 UTC – 2026-06-19 04:22:48 UTC
      
      A loop does not introduce a new scope so I would say it should behave like anywhere else - const c $X; const c $Y should raise an error unless $X == $Y
      
      Or to be more precise, $X eq $Y
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"