4 ms·
I think iota in APL can start at zero if you set the index origin (⎕IO) to 0.
by ceautery 8y ago
I think iota in APL can start at zero if you set the index origin (⎕IO) to 0.
- 4thaccount 8y agoYes it can. I ran into an issue with one of the APL examples once because the index had been changed and it wasn't documented. The Dyalog folks answered my email on the weekend (I'm not a customer).
- kbenson 8y agoThat sounds like one of those super useful features that's easy to shoot yourself in the foot with. Perl has a few of those (cribbed from AWK, I believe): $, : The output field separator $ perl -E 'my @data = (11,22,33); say 11,22,33; say "@data"; say @data; $,="|"; say 11,22,33; say "@data"; say @data;' 112233 11 22 33 112233 11|22|33 11 22 33 11|22|33 $" : Interpolated list separator $ perl -E 'my @data = (11,22,33); say 11,22,33; say "@data"; say @data; $"="|"; say 11,22,33; say "@data"; say @data;' 112233 11 22 33 112233 112233 11|22|33 112233 And a bunch more, including input line/record separators (so you can slurp a whole file into a buffer at once instead of line by line), etc.