Artifact 848e927ac999b3b093cf106481eae2e19718cd31add4eebd94c95e023d950c5d:
- File typeparse/tests_tclsh/t40_profondeur_liens.tcl.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: 953) [annotate] [blame] [check-ins using]
--- Inf (défaut) / Inf (default) 1 {7 8} 1 {7 8} --- 0 : le lien reste une adresse annotée / the link stays an annotated address 1 5 | m=1 r=5 | &*(//,int(u,32,le),null=0).rec --- 1 1 {7 8} --- deref : un pas / one step 7 8 --- réécriture : l'adresse de frontière est écrite telle quelle 0105000000 0905000000 --- un calcul perd l'annotation / arithmetic drops the annotation 1: type binary deref: "5" is not a link left by -linkdepth (its type is "") --- erreurs / errors 1: bad link depth "-2": must be a non-negative integer or Inf 1: bad link depth "abc": must be a non-negative integer or Inf 1: type binary deref: "5" is not a link left by -linkdepth (its type is "") --- liste chaînée / linked list 10 {some {11 {some {12 none}}}} 10 2 10 {some {11 4}} sizeof N = 2 cellule 0 : x=10 cellule 1 : x=11 cellule 2 : x=12 --- un cycle / a cycle 1: type binary: link cycle at offset 2 (field next of N) 10 {some {11 {some {11 {some {11 2}}}}}}