/* Make sure that rbe fixed the extrema on WITH_IDS properly. * Same as UTReversebug.sac, except we use the stdlib reverse function. */ /* RESULT: with 1 2 */ use Array: {sum,genarray,iota,sel}; inline int[+] (reverse)( int[+] arr_a) { maxidx0 = _sub_SxS_( _sel_VxA_( [0], _shape_A_( arr_a)), 1); res = with { ( [0] <= iv = [i] <= [maxidx0] ) : arr_a[iv]; } : modarray( arr_a ); return( res); } int main() { A_45=iota( 24); A_46=_reshape_VxA_([2, 3, 4],A_45); A_47=reverse( A_46); /* Can't WLF, due to reshape */ z = sum( A_47); /* Should WLF */ z = _sub_SxS_( z, 276); return(z); }