Artifact ebcacf31806703449fbd122e087c4ff05fb2d0a5b2e77d66fae82dc9d22e060a:
- File typeparse/tests_tclsh/t102_retour_etiquette.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: 831) [annotate] [blame] [check-ins using]
compilé 1 K.a eval 1 K.a uplevel 0 1 K.a uplevel 1 1 K.a switch -matchvar a5 5 K.a switch -matchvar zz 0 K.b foreach puis eval 7 K.b eval imbriqué 2 K.a en clair, eval ERREUR: return value {K}: value "a 1" matches no variant of K en clair, switch ERREUR: return value {K}: value "a 3" matches no variant of K --- ce qui ne change pas procédure classique 1 {} retour qui n'est pas une somme ERREUR: label {a:} on a return value: the return type int is not a sum catch, puis return -options 1 K.a variante inconnue ERREUR: label {z:} on a return value: K has no variant "z"