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
- icomment:
Short excerpt of a discussion from tclchat: <pre style="padding-left:10pt"> <sebres> shall not [const] with another value as previously throw an error? I mean: <sebres> % const A 5; const A 5; set A; #=> 5; # this is expected (cause can happen by source 2nd time), but... <sebres> - % const A 5; const A 6; set A; #=> 5 <sebres> + % const A 5; const A 6; set A; #=> [e] can't change "A": variable is a constant <sebres> imho, the former (-) is wrong, something like letter (+) shall happen instead <apn> @sebres - see ticket [b108e00ac8] <sebres> thx, Ashok... I'll try to fix it now <apn> @dkf might want to opine <apn> as to the rationale as I think the current behaviour is explicitly stated in the TIP <sebres> then it is wrong anyway <sebres> [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]) <sebres> doing as it would be changed successfully is simply wrong, no matter what TIP says about </pre>
- login: "sebres"
- mimetype: "text/x-fossil-wiki"