T x
To cast a Macaulay2 pointer to a foreign object with a pointer type, give the type followed by the pointer.
i1 : ptr = address int 0 o1 = 0x7fd872dacc60 o1 : Pointer
i2 : voidstar ptr o2 = 0x7fd872dacc60 o2 : ForeignObject of type void*