Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 1f31df1a518566b3a74ece90b5f3c05e6e0c8744506c6d9e817feb670ace793e
Ticket: b108e00ac8b1b6e449ea7843ea605ed27cc68c7c
Defining const with a different value should raise an error
User & Date: sebres on 2026-06-18 17:23:54
Changes

  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"