Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/containers/array.hfa

    r997324c ra5e26821  
    99
    1010
    11 //
    12 // The `array` macro is the public interface.
    13 // It computes the type of a dense (trivially strided) array.
    14 // All user-declared objects are dense arrays.
    15 //
    16 // The `arpk` (ARray with PacKing info explicit) type is, generally, a slice with _any_ striding.
    17 // This type is meant for internal use.
    18 // CFA programmers should not instantiate it directly, nor access its field.
    19 // CFA programmers should call ?[?] on it.
    20 // Yet user-given `array(stuff)` expands to `arpk(stuff')`.
    21 // The comments here explain the resulting internals.
    22 //
    23 // Just as a plain-C "multidimesional" array is really array-of-array-of-...,
    24 // so does arpk generally show up as arpk-of-arpk-of...
    25 //
    26 // In the example of `array(float, 3, 4, 5) a;`,
    27 // `typeof(a)` is an `arpk` instantiation.
    28 // These comments explain _its_ arguments, i.e. those of the topmost `arpk` level.
    29 //
    30 // [N]    : the number of elements in `a`; 3 in the example
    31 // S      : carries the stride size (distance in bytes between &myA[0] and &myA[1]), in sizeof(S);
    32 //          same as Timmed when striding is trivial, same as Timmed in the example
    33 // Timmed : (T-immediate) the inner type; conceptually, `typeof(a)` is "arpk of Timmed";
    34 //          array(float, 4, 5) in the example
    35 // Tbase  : (T-base) the deepest element type that is not arpk; float in the example
    36 //
     11//
     12// Single-dim array sruct (with explicit packing and atom)
     13//
     14
    3715forall( [N], S & | sized(S), Timmed &, Tbase & ) {
    38 
    39     //
    40     // Single-dim array sruct (with explicit packing and atom)
    41     //
    4216    struct arpk {
    4317        S strides[N];
Note: See TracChangeset for help on using the changeset viewer.