Seconded. If you must create lists starting at 1, keep in mind
#\ 'abcdefgh'
1 2 3 4 5 6 7 8
which Roger even supported with special code.
Henry Rich
On 12/29/2018 11:49 PM, Roger Hui wrote:
Why not use >:@i. ?
WRT a 1-origin primitive, don't do it! Even non-APL people know this.
See *Why
numbering should start at zero
<http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF>.*
1-origin *delenda est*.
On Sat, Dec 29, 2018 at 8:22 PM 'Skip Cave' via Programming <
[email protected]> wrote:
I find that I need to use the expression 1+i.x much more often than I use
i.x.
Would it make sense to define the primitive i; as the one-origin version of
i.?
i. 5
0 1 2 3 4
i; 5
1 2 3 4 5
i. 2 3
0 1 2
3 4 5
i; 2 3
1 2 3
4 5 6
This avoids all the side effects of quad IO in APL but provides a handy way
to generate one-based indices.
Skip
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
---
This email has been checked for viruses by AVG.
https://www.avg.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm