Artifact 4ff6eb244702be4bc629a94286cc8b3dc276350d8924cda487b3f5743bcd8068:
- File typeparse/tests_tclsh/t80_lappend_contrat.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: 631) [annotate] [blame] [check-ins using]
boucle : 1000 {999 1} list<point> point copie : L={0 0} {1 1} M={0 0} refus : 1 expected floating-point number but got "a" ; L={0 0} {1 1} refus 2 : 1 point needs 2 values but got 3 plusieurs : {0 0} {1 1} {2 2} {3 3} 4 défaut absent : 1 pdef needs 2 values but got 1 ; D={1 2} compacte : {{0.5 1.5} {2.5 3.5} {4.5 5.5}} 1 1 {expected floating-point number but got "x"} {{0.5 1.5} {2.5 3.5} {4.5 5.5}} somme : {cote 2.0} {nom carré} forme.cote forme.nom list.any : int string list(2) : 1 list(2)<point> needs exactly 2 elements but got 3 pendant foreach : 4 {{0 0} {1 1} {9 9} {9 9}} élément typé : 7 8 point chaîne : 29 1 1