jsource icon indicating copy to clipboard operation
jsource copied to clipboard

Refactor `GAT0` and friends

Open codereport opened this issue 4 years ago • 0 comments

In jsrc/verbs/monadic/tally.cpp:

[[nodiscard]] auto
make_scalar_integer(J jt, int64_t k) -> array {
    if (xor_replicate_sign(k) <= NUMMAX) {
        return !zero_or_one(k) ? refactorme_num(k) : zeroionei(k);
    }
    array z;
    GAT0(z, INT, 1, 0);          // TODO: GA -> make_array refactoring
    pointer_to_ravel(z)[0] = k;  // TODO: set_value(..)
    return z;
}

codereport avatar Jan 31 '21 00:01 codereport