Artifact 004b96a4bab1d3ac53e68728e00cc417b50a9f8879b72866f5f0445bafbb1a5b:
- File typeparse/tests_tclsh/t60_construction_liste.out — part of check-in [a04ace5134] at 2026-10-23 09:26:11 on branch tip-764_tcl90 — The bug has been fixed (v15h). I went a bit further than what was noted in the schedule: instead of rejecting AB(0,1), I made it functional. My response from October 22nd (“0,1 is not a path”) was incorrect: `set {pt}Q(x,y) 1 2` works for a product, so (0,1) is indeed a valid construction path. It simply didn’t work for a list. The root cause Construction via a path—`set {T}v(a,b) x y`—was previously only implemented for products and sums. For any other type, the identifier `AB(0,1)` was treated as an array element; Tcl would create the array `AB` and then fail with a “no such element in array” error. The empty array would remain, causing the subsequent `set {segment}AB $A $B` command to fail as well. The fix A list is constructed by specifying its indices. All indices—from 0 to N-1—must be provided, in any order, as lists have no default values: tcl set {segment}AB(0,1) $A $B ;# {0 0} {4 4} set {segment}S(1,0) {4 4} {0 0} ;# same result set {segment}S(0.x,0.y,1.x,1.y) 1 2 3 4 ;# {1 2} {3 4} Each error now triggers a clear, descriptive message: a missing index: “element 1 of poly is not given: … needs all of them, from 0 to 2”; a duplicate index: “element '0' of poly is assigned more than once”; an invalid index name: “'a' is not an index of poly”; Incorrect number of elements: a segment requires exactly 2 elements, but 3 were provided. A dictionary is constructed via its keys: `set {dict.int}D(a,b) 1 2` results in `a=1, b=2`. Other types are rejected before any variable lookup occurs, meaning nothing is created: `set {int}A(k) 5` -> `can't set "A(k)": a typed variable is a scalar, not an array element;` `a constructor path (k) names fields of products, indices of lists, or` `keys of dictionaries, and 'int' is none of these.` Verifications Compared to v15, the project’s tests and examples remain unchanged, with one exception: the error message for `t52` now mentions lists and dictionaries. Tests `t35` and `t37`, as well as `t55` through `t59`, continue to yield their expected results. On the Tcl side, I ran 12 test files (covering variables, arrays, `set`, `upvar`, `incr`, dictionaries, etc.), totaling 1,515 tests; the only failure—found in `execute.test`—is already among the known failures from v15. Update Two type-related source files, `tclTypePath.c` and `tclTypedVar.c`, with no kernel patch required. Then, `maj.sh` was run. I added the `t60_construction_liste` test and regenerated `t52`. The `v15h` section can be found in `noyau/LISEZMOI.md`, the French documentation includes a paragraph in section 7.1, and the item has been marked as complete in the project schedule. (user: Florentis, size: 1645) [annotate] [blame] [check-ins using]
set {segment}AB(0,1) $A $B 0 {0 0} {4 4} array exists AB 0 0 info exists AB 0 1 set {segment}AB $A $B 0 {0 0} {4 4} array exists R 0 0 list.int : set {list.int}L(0,1) 5 6 0 5 6 array exists L 0 0 dans une procédure 0 {{0 0} {1 1}} 0 1 segment ordre inverse AB(1,0) 0 {{0 0} {4 4}} segment trou L(0,2) 1 element 1 of poly is not given: a list built by its indices needs all of them, from 0 to 2 S2 créé ? 0 0 doublon L(0,0) 1 element "0" of poly is assigned more than once pas un indice L(a,b) 1 a list is built by its indices: "a" is not an index of poly segment de 3 : S5(0,1,2) 1 segment needs exactly 2 elements but got 3 S5 créé ? 0 0 chemin profond 0.x,0.y,1.x,1.y 0 {{1 2} {3 4}} point élément invalide 1 point needs 2 values but got 1 dict.int D(a,b) 0 {a 1 b 2} dict<int> dict.int invalide 1 expected integer but got "x" {int}I(k) refusé 1 can't set "I(k)": a typed variable is a scalar, not an array element; a constructor path (k) names fields of products, indices of lists or keys of dicts, and int is none of these I créé ? 0 0 nombre de valeurs 1 point needs 2 values but got 1