class

Field

const class Field : Slot

Field is a slot which models the ability to get and set a value.

methods set

Set the field for the specified instance

get

Get the field for the specified instance

type

Type stored by the field

makeSetFunc

Construct a function which sets zero or more fields on a target object

get virtual Obj? get(Obj? instance)

Get the field for the specified instance. If the field is static, then the instance parameter is ignored. If the getter is non-null, then it is used to get the field.

makeSetFunc static |Obj| makeSetFunc(Field:Obj? vals)

Construct a function which sets zero or more fields on a target object. The function can be passed to a constructor which takes an it-block to reflectively set const fields. Example:

const class Foo
{
  new make(|This|? f := null) { f?.call(this) }
  const Int x
}

f := Field.makeSetFunc([Foo#x: 7])
Foo foo := Foo#.make([f])

set virtual Void set(Obj? instance, Obj? value)

Set the field for the specified instance. If the field is static, then the instance parameter is ignored. If the setter is non-null, then it is used to set the field.

type Type type()

Type stored by the field.

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST