Next: , Up: slots   [Contents][Index]


4.1 System operations on slots

We can access the internal representation of all the compound Scheme values implemented as “blocks” with the following system operations.

System Operation: ##sys#slot ?block-value ?slot-index

Unsafe slot getter. We can use it when we know that: ?block-value is a reference to a block value; ?slot-index is a valid slot index for ?block-value. Return the undefined value.

System Operation: ##sys#setslot ?block-value ?slot-index ?new-value

Unsafe slot setter. We can use it when we know that: ?block-value is a reference to a block value; ?slot-index is a valid slot index for ?block-value. Return the undefined value.

System Operation: ##sys#setislot ?block-value ?slot-index ?new-immediate-value

Like ##sys#setslot, it is an unsafe slot setter with an additional constraint on the new value. We can use it when we know that: ?block-value is a reference to a block value; ?slot-index is a valid slot index for ?block-value; ?new-immediate-value is any immediate Scheme value (examples: a fixnum, a boolean). Return the undefined value.

NOTE No validation is performed against ?new-immediate-value to check that it is actually an immediate value.

System Operation: ##sys#size ?block-value

Unsafe block length getter: return a fixnum representing the number of slots. We can use it when we know that: ?block-value is a reference to a block value.


Next: , Up: slots   [Contents][Index]