Artifact ff94ec721d6c93d4cb4c70b98b40bc6c5e351edddabf64588a95266744998c77:
- File typeparse/tests_tclsh/t92_cast_etiquettes.out — part of check-in [f77a502eb6] at 2026-11-04 10:46:42 on branch tip-764_tcl90 — V16o 1. A variant whose type is a product is constructed via its fields. ``` set {segment.lien}s {cible:}$url {contenu:}$segs ;# labeled, order-independent, defaults set {segment.lien}s $url $segs ;# positional set {segment}s(lien.(cible,contenu)) $url $segs ;# your syntax, via the sum set {segment}s($v.($fields)) {*}$values ;# computed ``` The first step of the path selects the variant. All paths must specify the same variant; otherwise, the error "a value of segment has one variant" is raised. A path may also traverse a sum located within a product field: `set {P}r(n.i,m) 4 5`. The messages refer to `segment.lien` rather than `prod<cible:string;…>`. 2. `type def NAME` without a definition returns the definition, using the `type def` syntax: ``` type def segment.lien ;# {string}cible; {list.segment}contenu type def pt ;# {double}x ?= 0; {double}y type def pt.x ;# double ``` The output text can be parsed back in its original form—a property verified by the test suite. Variants of a sum are listed in their internal (sorted) order, and options such as `-strict` are not included in the definition. (user: Florentis, size: 1286) [annotate] [blame] [check-ins using]
--- plus de cast immédiat (v16m) catch {concat {int}$s} r: 0 3.0 s = 3: 3 {} int double typé -> int: 3.0 double int {int}${s}: 4 {} int nom inconnu : note: 3.0 {} zz {}$d retire le type: 3.0 {} {} commande : pas de cast ici: 3 int dans une procédure: 0 abc --- étiquettes de champ littérales: jean 12 substituées: ana 30 ordre libre, défaut: zoe 0 compilé: bob 40 à travers une commande: jo 3 ancienne écriture: ERREUR {nom} is not a type: to name the field "nom" of paire, write {nom:} étiquette inconnue: ERREUR unknown field "taille" in paire type global age : aucun conflit: int {age} est le type age: 12 {} age --- étiquettes de variante {i:}5: S.i {i:}$x: S.i ancienne écriture {i}5: ERREUR {i} is not a type: to name the variant "i" of S, write {i:} {S.s}$n, un type: ana {} S.s contrat : set v {S.s}abc: S.s type cast S {s:}abc: S.s liste {list.S}: S.i S.s variante inconnue: ERREUR label {zz:} names no variant of S --- une étiquette ne se range pas set y {age:}21: ERREUR local annotation {age:} cannot be stored by "set": it only applies between a caller and the command it calls set y [concat {age:}21]: 21 --- variante dont le nom est aussi un type global {elf:}5: exe.elf --- un nom annoté avec une substitution reste un nom set {rect}Q(A, $k): {1 1} {2 2}