type-proposal
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| type-proposal [2025/08/06 21:08] – [Postfix or prefix?] smj-edison | type-proposal [2025/08/06 21:24] (current) – [Types are reactive] smj-edison | ||
|---|---|---|---|
| Line 24: | Line 24: | ||
| To check if a type is a certain type, use `[$is:: | To check if a type is a certain type, use `[$is:: | ||
| + | To get details of a type, use `[$details $typeName]`. It should return a doc string or similar. | ||
| ===== Type names ===== | ===== Type names ===== | ||
| Type names come in two forms: canonical and inline. Canonical type names are either a name, or a list with the first parameter as its name. For example, a type name for meters could be " | Type names come in two forms: canonical and inline. Canonical type names are either a name, or a list with the first parameter as its name. For example, a type name for meters could be " | ||
| Inline type names are a mixture of wildcards and symbol/ | Inline type names are a mixture of wildcards and symbol/ | ||
| + | |||
| + | ===== Types are reactive ===== | ||
| + | To get the type list (or any type list, lists can coexist), use < | ||
| + | When the types are /types/ { | ||
| + | lassign $types box unbox is typeName details | ||
| + | | ||
| + | # example using the newly imported types | ||
| + | puts [$unbox::mm "10 mm"] | ||
| + | } | ||
| + | </ | ||
| ===== Postfix or prefix? ===== | ===== Postfix or prefix? ===== | ||
type-proposal.1754514497.txt.gz · Last modified: by smj-edison
