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 => 0x7fde96bce9c0}

These pointers can be accessed using address.

i3 : ptr = address x

o3 = 0x7fde96bce9c0

o3 : Pointer

Simple arithmetic can be performed on pointers.

i4 : ptr + 5

o4 = 0x7fde96bce9c5

o4 : Pointer
i5 : ptr - 3

o5 = 0x7fde96bce9bd

o5 : Pointer

Menu

Functions and methods returning a pointer:

  • address -- pointer to type or object

Methods that use a pointer:

For the programmer

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


The source of this document is in ForeignFunctions.m2:782:0.