File
typeparse/VERSION
— 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: 5)
[annotate]
[blame][check-ins using]