User Tools

Site Tools


type-proposal

This is an old revision of the document!


Type proposal

There's a bunch of informal types in folk, such as quads, spaces, libraries, etc. It would be useful to have a standard representation between different parts of the system, to aid in introspection and consistency.

Goals:

  • Automatic visualization (á la Glamorous Toolkit)
  • Type descriptions
  • Automatic preconditions and verification
  • Extensible (don't want to be locked in with a bad design)
  • Flexible (this is tcl after all)

Non goals:

  • Complex types
  • Soundness
  • One Unified Type System

Types will be tagged with their type name, and optionally with type parameters.

Postfix or prefix?

I'm not sure which way to go.

Pros of postfix:

  • Types like “10 mm” are automatically a two item list, and as such are a full type

Cons of postfix:

  • If the value is long, it will exceed the text boundaries, and as such the tag won't be rendered. (Somewhat mitigated by having something like `[typeof $foo]`)

Pros of prefix:

  • A lot of current types are already in the prefix form

Cons of prefix:

  • Makes constructing some types harder (like “10 mm”)
type-proposal.1754512905.txt.gz · Last modified: 2025/08/06 20:41 by smj-edison

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki