Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Properties

A property is a named member of a Type accessed with .name plus a fetch or store affix. Backing may be a stored slot or a computed getter/setter; the API is the same.

Property names and instance method names on one Type are disjoint. Use help TypeName to see which is which.

Fetch and store

FormEffectNotes
cs:.name or cs:.name@( -- value ) cs( obj – obj )read; bare .name implies @
cs:.name!( value -- ) cs( obj – obj )write
TypeName.constProp( -- value )class const; Type receiver is elided

Value in / value out always on DS. The rooted receiver stays on the context stack.

DynamicObject.new^ >ts
"Ada" t:.name!
36 t:.age!
t:.name@ $ sp t:.age@ $ nl    // Ada 36
t:drop

Store paths onto a parked receiver need an explicit context selector (t: / x: / …). A bare store on DS without a prefix is rejected (d: does not help). Ident-rooted paths are allowed without a selector (1 sess.config.paramA!), as are l.field! and pls.field!.

Readonly / const properties (including many class constants) may omit @:

Math.pi $
Int.maxInt $
Float.NaN $
TokenType.TokenEOF $

Const vs ordinary

  • Const / IsConst — fetch returns the value immediately; there is no lasting PropertyRef. Typical for math constants and enum-like class properties.
  • Ordinary — fused .name@ / .name! are one-shot (no ref left on the stack). Mid-path .name also fetches the value and continues the walk with that value as the next focus.

Property refs (~)

When you need the ref itself (for example read–modify–write with separate @ / !), materialize with the ~ affix. ~ must be the last segment of that path token.

// Word on DS; materialize name ref, then Forth-style R-M-W
"dup" find
.name~
dup @          // fetch current name
drop
"fresh" swap ! // store; consumes ref

Standalone @ and ! consume a PropertyRef on the context stack. Fused .name@ / .name! never leave a ref behind.

You cannot fuse ~ with @ in one token (name~@ is illegal). Use .name~ then a separate @ or !.

Nested property walks

Intermediate .prop segments fetch the contained object and continue; intermediates are not parked on a stack:

dc.dict.len $     // DictionaryContext → dict → len

See Compound Path Syntax for the full segment vocabulary.