Artifact bb3fbd496fd795988bc3802c785b0c34caf27e6c6f1add98ed64d0a831e2e2b4:
- File typeparse/tests_tclsh/t76_lecture_champ.out — part of check-in [289eebd31b] at 2026-11-06 11:24:44 on branch tip-764_tcl90 — Complete revision of "sums" (sum types). A distinction is now made between two clearly separate categories: "unions," where the specific variant can be reliably inferred from the structure of the data string, and "sums," where the structure of the data string is insufficient to definitively determine the variant. A new syntax for unions has been introduced, now utilizing the `|` symbol. E.g.: `type def matrix {{list(3).list(3)}matrice3x3 | {list(2).list(2)}matrix2x2}` Any ambiguous union will be rejected during construction, triggering an error message. "Sums" now function like "tagged unions" in C—that is, they consist of a union paired with a tag. Consequently, one must reference the tag to identify the specific variant. Sums are always written using commas (`,`). E.g.: `type def Temperature {{double}celsius, {double}farenheit}` (user: Florentis, size: 359) [annotate] [blame] [check-ins using]
point : 1.5 double 3.0 pivot : 8.0 double 16.0 (x à une autre place, même littéral) point : 1.5 double autre type : 3.25 double 6.5 rgb : 350 int(u,8) 100 8 somme : {rayon 2.0} forme.rayon boule string list.any : list<any> int 5.0 lien : 5.0 9.5 intacts : 1.5 double 2.5 {} 1.5 {2.0 3.0} 3.0 4.0 boucle : 44.0 44.0 champ inconnu : point has no field "z"