Macaulay2 » Documentation
Packages » ForeignFunctions :: Pointer
next | previous | forward | backward | up | index | toc

Pointer -- pointer to memory address

Description

Pointer objects are pointers to memory addresses. These make up each ForeignObject.

i1 : x = int 20

o1 = 20

o1 : ForeignObject of type int32
i2 : peek x

o2 = int32{Address => 0x7bdebbcb5c80}

These pointers can be accessed using address.

i3 : ptr = address x

o3 = 0x7bdebbcb5c80

o3 : Pointer

Simple arithmetic can be performed on pointers.

i4 : ptr + 5

o4 = 0x7bdebbcb5c85

o4 : Pointer
i5 : ptr - 3

o5 = 0x7bdebbcb5c7d

o5 : Pointer

Functions and methods returning a pointer :

Methods that use a pointer :

Fixed objects of class Pointer :

For the programmer

The object Pointer is a type, with ancestor class Thing.