Changeset 63f42a8 for libcfa


Ignore:
Timestamp:
May 18, 2021, 4:12:02 PM (3 years ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
78ea291
Parents:
d286e94d
Message:

Re-worked new array declarations to avoid suggestion that a type-system managed value needs to appear in type position. The arpk S parameter is now clearly a type, not a length.

File:
1 edited

Legend:

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

    rd286e94d r63f42a8  
    1616//
    1717
    18 forall( [N], [S], Timmed &, Tbase & ) {
     18forall( [N], S & | sized(S), Timmed &, Tbase & ) {
    1919    struct arpk {
    2020        S strides[z(N)];
     
    142142
    143143// Base
    144 forall( [Nq], [Sq], Tbase & )
     144forall( [Nq], Sq & | sized(Sq), Tbase & )
    145145static inline tag(arpk(Nq, Sq, Tbase, Tbase)) enq_( tag(Tbase), tag(Nq), tag(Sq), tag(Tbase) ) {}
    146146
    147147// Rec
    148 forall( [Nq], [Sq], [N], [S], recq &, recr &, Tbase & | { tag(recr) enq_( tag(Tbase), tag(Nq), tag(Sq), tag(recq) ); } )
     148forall( [Nq], Sq & | sized(Sq), [N], S & | sized(S), recq &, recr &, Tbase & | { tag(recr) enq_( tag(Tbase), tag(Nq), tag(Sq), tag(recq) ); } )
    149149static inline tag(arpk(N, S, recr, Tbase)) enq_( tag(Tbase), tag(Nq), tag(Sq), tag(arpk(N, S, recq, Tbase)) ) {}
    150150
    151151// Wrapper
    152152struct all_t {} all;
    153 forall( [N], [S], Te &, result &, Tbase & | { tag(result) enq_( tag(Tbase), tag(N), tag(S), tag(Te) ); } )
     153forall( [N], S & | sized(S), Te &, result &, Tbase & | { tag(result) enq_( tag(Tbase), tag(N), tag(S), tag(Te) ); } )
    154154static inline result & ?[?]( arpk(N, S, Te, Tbase) & this, all_t ) {
    155155    return (result&) this;
Note: See TracChangeset for help on using the changeset viewer.