3 ms·
Your intuition is largely correct, but it is rarely a practical problem. The k language, including the ngn/k dialect has some lazy constructions for example !10
by DrDroop 3y ago
Your intuition is largely correct, but it is rarely a practical problem. The k language, including the ngn/k dialect has some lazy constructions for example !10000000 (iota of 10 million), will not create an array of with 10 million ints but a simple range from 0 to 10 million. Depending on the operator you will of course end up with such an array. There are also certain optimisations (I think they are called colloquialisms) where things like +|x, reverse x and take the first element, is translated into just take the last element.
- omaranto 3y ago> I think they are called colloquialisms Close, they are called "idioms". > +|x The plus should be an asterisk, but yes, that is an idiom the ngn/k interpreter recognizes.