Artifact 7b2b6349663611fc78fb2238a2b368d951f46dd2bcb1258af04e6c5a2aea9c70:
- File typeparse/tests_tclsh/t100_espaces_types.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: 1599) [annotate] [blame] [check-ins using]
trois point {{double}x; {double}y} {{int}r; {int}g; {int}b} {{string}nom} dans geom ::geom::point {1 2} global point qualifié relatif ::geom::point qualifié absolu ::rgb::point list. qualifié list<::geom::point> ::geom::point relire le nom affiché list<::geom::point> nominal: deux formes égales ERREUR: unknown way to cast the value from ::rgb2::point to ::geom::point seg utilise geom::point ::geom::point {{::geom::point}a; {::geom::point}b} inconnu ERREUR: unknown type "nowhere::point" espace inconnu (def) ERREUR: type "nowhere::x": unknown namespace "nowhere" réservé dans un espace ERREUR: type "int" is reserved: a built-in type cannot be redefined in a namespace namespace path ::geom::point proc dans geom ::geom::point proc args 5.0 famille dans geom ::geom::grille(2) ::geom::point somme ::geom::S.at {at {1 2}} type forget unknown type "::geom::S" après namespace delete ::geom::point {1 2} 1 {unknown type "geom::point"} redéfini ::geom::point {{int}i} ::geom::point convert ::geom2::p interp supprimé ::k::kp {1 2} 2 TclOO (espace de l'objet) 1 type export : nom C cp export, même nom C cp ce2_cp