Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

:NEW

source files: x01v.[ch] xflv.[ch] x32v.[ch] xcsy.[ch] xgrl.[ch]

SYNTAX

(SEND CLASS-BIT-ARRAY :NEW
 { NIL | <fix> | '( ... ) }    ; Array dimension(s)
 [ { :INITIAL-ELEMENT <val>
   | :INITIAL-CONTENTS '((0 0) (1 2) ...)
   | :INITIALIZE-FROM-FILE <inputfile> } ]
 [ :FILL-POINTER { NIL | T | <fix> } ] ) 

(SEND CLASS-INT32-ARRAY :NEW  <etc> )       ; Same syntax as above
(SEND CLASS-FLOAT-ARRAY :NEW  <etc> )       ; Same syntax as above
(SEND CLASS-GRAPHIC-RELATION :NEW  <etc> )  ; Similar syntax to above

DESCRIPTION

Create a new instance of the given array type. The syntax is based fairly closely on CommonLisp, except for being message-based.

An array dimension of NIL means a rank-zero array with one entry.

A <fix> array dimension means a one-dimensional array with given number of entries.

A list of array dimensions defines a multidimensional array. Currently, arrays of up to seven dimensions are supported.

One way to initialize an array or relation is with the :INITIAL-ELEMENT keyword, whose argument specifies the initial value for all elements in the array.

A second way is with the :INITIAL-CONTENTS keyword, which allows you to specify the initial array contents one by one. The :INITIAL-CONTENTS list must match the dimension in shape.

A third way is with the :INITIALIZE-FROM-FILE keyword, which initializes the contents of the array by reading from the specified file. The file must have been created using the :WRITE-TO-FILE message. This is the preferred way of reading in large binary arrays.

A lisp fill pointer is sort of a builtin stack pointer that can be used for treating an array somewhat like a stream or stack. A :FILL-POINTER argument of NIL sets the fill pointer to zero, a T argument sets it to the maximum, and numeric arguments set it as specified. :FILL-POINTERS are only supported on one-dimensional arrays.

A graphic relation is initialized slightly differently.

If :INITIAL-CONTENTS is specified, its argument consists of a list '(:NAME1 array1 :NAME2 array2 ...) of arrays to be placed in the relation. Naturally, all arrays supplied must be the same shape as the graphics relation itself.

If :INITIAL-ELEMENT is specified, its argument consists of a list '(:NAME1 val1 :NAME2 val2 ...) specifying element values for all arrays in the relation. This will only make sense if :INITIAL-CONTENTS alreay provided appropriate arrays to initialize!


Go to the first, previous, next, last section, table of contents.