Skip to content

Structures and Memory

Sami Zeinelabdin edited this page Sep 1, 2010 · 2 revisions

Structures

Array

The fundamental structure in J is the array, everything is expressed as a subclass of an array. The structure of the array is as follows:

Type Name
Integer Type
Integer Reference Count
Integer Number of Elements
Integer Rank
Integer Array Shape
Pointer to Array Data Value

In C this would be:

typedef struct {
    int type;
    int count;
    int num;
    int rank;
    int *shape;
    void *value;
} *A

An array can have one of several primitive types:

Category Class Type
Noun Numeric Bool
Integer
Float
Complex
Boxed
Extended Integer
Rational
Literal Char
Symbol Symbol
Function Verb
Adverb
Conjunction
Clone this wiki locally