[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.3.6.7 Data Constructor Instructions
These instructions push simple immediate values onto the stack, or construct compound data structures from values on the stack.
- Instruction: make-uint64 value
Push value, an unsigned 64-bit integer, onto the stack. The value is encoded in 8 bytes, most significant byte first (big-endian).
- Instruction: make-int64 value
Push value, a signed 64-bit integer, onto the stack. The value is encoded in 8 bytes, most significant byte first (big-endian), in twos-complement arithmetic.
- Instruction: make-char32 value
Push value, an 32-bit character, onto the stack. The value is encoded in big-endian order.
- Instruction: list n
Pops off the top n values off of the stack, consing them up into a list, then pushes that list on the stack. What was the topmost value will be the last element in the list. n is a two-byte value, most significant byte first.
- Instruction: vector n
Create and fill a vector with the top n values from the stack, popping off those values and pushing on the resulting vector. n is a two-byte value, like in
vector
.
- Instruction: make-struct n
Make a new struct from the top n values on the stack. The values are popped, and the new struct is pushed.
The deepest value is used as the vtable for the struct, and the rest are used in order as the field initializers. Tail arrays are not supported by this instruction.
- Instruction: make-array n
Pop an array shape from the stack, then pop the remaining n values, pushing a new array. n is encoded over three bytes.
The array shape should be appropriate to store n values. See section Array Procedures, for more information on array shapes.
Many of these data structures are constant, never changing over the course of the different invocations of the procedure. In that case it is often advantageous to make them once when the procedure is created, and just reference them from the object table thereafter. See section Variables and the VM, for more information on the object table.
- Instruction: object-ref n
- Instruction: long-object-ref n
Push nth value from the current program’s object vector. The “long” variant has a 16-bit index instead of an 8-bit index.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 20, 2013 using texi2html 5.0.