type
methods
get |
Get the field for the specified instance. |
---|---|
makeSetFunc |
Construct a function which sets zero or more fields on a target object. |
set |
Set the field for the specified instance. |
type |
Type stored by the field. |
Slot Details
get
makeSetFunc
src
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])