NAME

shape - returns the shape of a value

SYNOPSIS

arr.shape()

DESCRIPTION

The shape of any array or scalar may be queried vi the shape() method. A new PackInt array is created, regardless of the rank() of the value. The shape of a scalar is the empty PackInt array 0->iterate().

RETURN VALUE

A PackInt array containing the shape of the scalar or array.

ERRORS

ArgCheck if any arguments are passed

EXAMPLE

    a = [2,3].iterate()
    a.shape()
2 3

    a = ""
    a.shape()
0

    // The shape of an array is not a scalar
    a.shape() == 0
false

    // The shape of a scalar is the empty **##PackInt##** array
    a = 3
    a.shape()

    a.shape().shape()
0

SEE ALSO

rank
length
width
stride
sizeof
reshape