User Tools

Site Tools


type-proposal

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
type-proposal [2025/08/06 21:13] smj-edisontype-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::typeName $type]` or `[expr {[$typeName $type] == typeLookingFor}]`. To check if a type is a certain type, use `[$is::typeName $type]` or `[expr {[$typeName $type] == typeLookingFor}]`.
  
 +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 "m", and a type name for acceleration could be "{accel m s}" (note meters and seconds as type parameters). All the type parameters specific to the type, and should not be assumed to be referencing an existing type. 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 "m", and a type name for acceleration could be "{accel m s}" (note meters and seconds as type parameters). All the type parameters specific to the type, and should not be assumed to be referencing an existing type.
Line 32: Line 33:
 To get the type list (or any type list, lists can coexist), use <code> To get the type list (or any type list, lists can coexist), use <code>
 When the types are /types/ { When the types are /types/ {
-  lassign $types box unbox is typeName+  lassign $types box unbox is typeName details
      
   # example using the newly imported types   # example using the newly imported types
type-proposal.1754514819.txt.gz · Last modified: 2025/08/06 21:13 by smj-edison

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki