Artifact 57283c217e20ca5b3ef1963712edbfd7acf37cbeaf2a7664b9e28f70eeaa4b95:
- File typeparse/tests_tclsh/t29_deref_arbres_sommes.tcl.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: 682) [annotate] [blame] [check-ins using]
somme : ::A -> 1 (deref(mix).b) b=1 variante a : 5 (deref(mix).a) variante s : hello (deref(mix).s) liste de sommes : 1 7 2 deref(mix).b deref(mix).a deref(mix).b bt : ::A ::B -> 1 2 (deref(bt).node) premiere feuille : deref(bt).leaf = 1 arbre : 1 {{2 {}} {3 {}}} (deref(tree(var))) racine=1 enfants=2,3 apres A=100 : instantane=1 lien=100 nouvel instantane=100 ; meme type : 1 1 type deref: at children.1.value: can't read "::C": no such variable graphe : A {{B ::nc} {C ::na}} (deref(node)) voisins de A : B C ; voisins de B vus depuis A : ::nc un niveau de plus : B {{C ::na}} ; voisin de B : C 1 type deref: at next.0: can't read "::nb": no such variable