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

ForeignArrayType -- foreign array type

Description

This is the class for array types. There are no built-in types. They must be constructed using foreignArrayType.

i1 : x = (3 * int) {3, 5, 7}

o1 = {3, 5, 7}

o1 : ForeignObject of type int32[3]

Foreign arrays may be subscripted using _.

i2 : x_1

o2 = 5

o2 : ForeignObject of type int32
i3 : x_(-1)

o3 = 7

o3 : ForeignObject of type int32

Their lengths may be found using length.

i4 : length x

o4 = 3

They are also iterable.

i5 : i = iterator x;
i6 : next i

o6 = 3

o6 : ForeignObject of type int32
i7 : next i

o7 = 5

o7 : ForeignObject of type int32
i8 : for y in x list value y + 1

o8 = {4, 6, 8}

o8 : List

They may also be modified using subscripted assignment.

i9 : x_0 = 9

o9 = 9

o9 : ForeignObject of type int32
i10 : x

o10 = {9, 5, 7}

o10 : ForeignObject of type int32[3]

Functions and methods returning a foreign array type :

Methods that use a foreign array type :

For the programmer

The object ForeignArrayType is a type, with ancestor classes ForeignType < Type < MutableHashTable < HashTable < Thing.