Row

From Mesham
Revision as of 19:18, 10 January 2010 by Polas (talk | contribs) (Created page with ' == Syntax == row[ ] == Semantics == In combination with the array, the programmer can specify whether allocation is row or column major. This allocation information is provid…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Syntax

row[ ]

Semantics

In combination with the array, the programmer can specify whether allocation is row or column major. This allocation information is provided in the allocation type.

Example

var a:array[Int,10,20] :: allocated[col[] :: multiple[]];
((a#1)#2):=23;
(((a :: row[])#1)#2):=23;

Where the array is column major allocation, but the programmer has overridden this (just for the assignment) in line 3. If one array of allocation copies to another array of different allocation then transposition will be performed automatically in order to preserve indexes.