Artifact b6591ebe485fa7d66cf5f7a79433726219859aa87eb06523c375eb731cd721e3:
- File typeparse/tests_tclsh/t99_produits_ouverts.out — part of check-in [eacc36058b] at 2026-11-27 09:47:31 on branch tip-764_tcl90 — v17z Review of sum type notation. - A variant of a sum is metadata, it must not appeat into the value : If there is ambiguity to choose a variant of a sum, it must be an error. - New commands to request variants of a sum type, or of a litteral sum : type variant $v ?NAME? : empty for a litteral ; NAME select the variant of the value. type variant -of T ?NAME? type literal -of T ; type is {sum?}T type is {enum?}T - New command to compare the type of a value : type eq T1 T2 : true is types T1 and T2 are equal type include T1 T2 : true if type T2 is included into T1 - New type 'num' (user: Florentis, size: 944) [annotate] [blame] [check-ins using]
--- produit : la vue liste de ses champs llength : 2 2 lindex : 1.0 double lassign : 1.0 2.0 foreach x y : 1.0 2.0 {*} : 2 concat : 1.0 2.0 1.0 2.0 / 1 2 1 2 join : 1.0,2.0 lmap : 2.0 4.0 même structure après la chaîne : 2 2 2 --- écritures par la vue liste (sous contrat) lset : 5.0 2.0 point lappend : 1 point needs 2 values but got 3 P : 5.0 2.0 --- chaînes atomiques list.string : <hello world> 1 string list.string : <coucou> 1 string imbriquée : <hello world> 1 imbriquée : <a> 1 imbriquée : <b> 1 imbriquée : <c> 1 string : 1 --- champ chaîne d'un produit llength : 2 1 string champ : <hello world> 1 champ : <3> 1 --- sommes, listes de produits somme : 2 1 double list.point : 2 point 2 concat {*} : 1.0 2.0 3.0 4.0 produit mixte: 2 3 1 --- retour typé vers un appelant non typé lassign : 3.0 4.0