Artifact 1be76e1bb048780fda4465e860edff438f5ad4ef6537deef6cfa31d0f58cc413:
- File typeparse/tests_tclsh/t28_type_deref.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: 693) [annotate] [blame] [check-ins using]
liens : ::A ::B ::C valeurs : 1 2 3 (list<int>) le lien suit B (20), l'instantane reste fige : 1 2 3 nouvel instantane : 1 20 3 1 type deref: at 2: can't read "::C": no such variable refs inchange : ::A ::B ::C dict : x 1 y 20 (dict<int>) imbrique: {1 20} {20 1} (list<list<int>>) produit : 1 hello (deref(lien)) sans lien : 1 2 (list<int>) var brut : 1 un niveau : ::A deux fois : 1 1 type deref: at 0: can't access "frame:1:local": the procedure call that owned this variable has returned 1 type deref needs a typed value 1 wrong # args: should be "type deref value" 1 bad subcommand "zz": must be def, alias, cast, convert, deref, export, forget, get, is, proc, variant or binary