Function xsSet

Set a property or item of an instance.

void xsSet (
  scope xs.bindings.xsMachineRecord* the,
  const(xs.bindings.xsSlotRecord) this_,
  short id,
  const(xs.bindings.xsSlotRecord) slot
);

Parameters

NameDescription
theA machine
this_A reference to the instance that will have the property or item
idThe identifier of the property or item to set
slotThe value of the property or item to set

Examples

In ECMAScript:

foo = 0
this.foo = 1
this[0] = 2

In D:

xsSet(xsGlobal, xsID_foo, xsInteger(0));
xsSet(xsThis, xsID_foo, xsInteger(1));
xsSet(xsThis, 0, xsInteger(2));