Skip to content
Tcl Source Code Check-in [43c57f18b6]
Login

Check-in [43c57f18b6]

Overview
Comment:What v16n introduces: `type is {disjoint?}S` returns the pairs of variants that can accept the same value; it returns nothing if the sum is disjoint. `type is {strict?}S` is also available. `type def {-strict}S`: the variant is never inferred (guessed). A "bare" value is rejected: "value 5 names no variant of the strict sum S: write `{i:}value` or `{S.i}value`." Accepted forms include: an already-typed value, a label such as `{i:}` or `{S.i}`, or a type cast like `S.i`. A variant literal is identified by its value, and when stored in a typed variable, the current variant is preserved. `type def {-deduce}S` retains the previous behavior: the strictest variant takes precedence. Warning: An overlapping sum defined without any options will trigger a message on `stderr` suggesting either `{-deduce}` or `{-strict}`. A disjoint sum will not trigger such a message. Multiple options: `{-compact, -strict}` can be used within the annotation syntax. The structure is flattened (e.g., `{-a.(b=1, c=2)}` becomes `-a.b=1` and `-a.c=2`), meaning sub-option syntax is supported. Currently, no `type def` options utilize this; for instance, `{-strict.x=1}` will result in a clear error message.
Timelines: family | ancestors | descendants | both | tip-764_tcl90
Files: files | file ages | folders
SHA3-256: 43c57f18b659ba01ce443923054d31cae9032d893a61adf5e9bcf2665752339b
User & Date: Florentis on 2026-11-04 08:32:02.095
Other Links: branch diff | manifest | tags
Context
2026-11-04
10:46
V16o 1. A variant whose type is a product is constructed via its fields. ``` set {segment.lien}s {c... check-in: f77a502eb6 user: Florentis tags: tip-764_tcl90
08:32
What v16n introduces: `type is {disjoint?}S` returns the pairs of variants that can accept the same ... check-in: 43c57f18b6 user: Florentis tags: tip-764_tcl90
05:30
remove immediate casting of values, be more strict in choosing variant of sum check-in: 317a8a44ce user: Florentis tags: tip-764_tcl90
Changes