Artifact c00cbc427cc1489ddf4c3645b0674fae093fa4d4c0ddd9953354e895533ca7f2:
- File typeparse/tests_tclsh/t82_declaration_compilee.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: 743) [annotate] [blame] [check-ins using]
point : {1.0 2.0} point 1 {point needs 2 values but got 1} compilé 1 défaut : 1 pdef needs 2 values but got 1 double : 1.5 double 1 {expected floating-point number but got "z"} 3 double 1 {expected floating-point number but got "z"} refus : 1 expected floating-point number but got "abc" expected floating-point number but got "abc" (procedure "p4" line 1) invoked from within "p4" partagée : {1.0 2.0} {} {1.0 2.0} point déjà typée : {3.0 4.0} point compacte : {{1.0 2.0} {3.0 4.0}} 1 somme : {cote 2.0} forme.cote {nom carré} forme.nom lien : {5.0 6.0} point 1 {point needs 2 values but got 1} trace : {7.0 8.0} point A qualifié : {1.0 1.0} point compilé 0 global : 2.0 2.0 point boucle : {2 1.0} point type inconnu : 0 1