manpagez: man pages & more
info guile
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

10.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-int8 value

Push value, an 8-bit integer, onto the stack.

Instruction: make-int8:0

Push the immediate value 0 onto the stack.

Instruction: make-int8:1

Push the immediate value 1 onto the stack.

Instruction: make-int16 value

Push value, a 16-bit integer, onto 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-false

Push #f onto the stack.

Instruction: make-true

Push #t onto the stack.

Instruction: make-nil

Push #nil onto the stack.

Instruction: make-eol

Push '() onto the stack.

Instruction: make-char8 value

Push value, an 8-bit character, onto the stack.

Instruction: make-char32 value

Push value, an 32-bit character, onto the stack. The value is encoded in big-endian order.

Instruction: make-symbol

Pops a string off the stack, and pushes a symbol.

Instruction: make-keyword value

Pops a symbol off the stack, and pushes a keyword.

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 February 3, 2012 using texi2html 5.0.

© manpagez.com 2000-2017
Individual documents may contain additional copyright information.