This doesn't work. #i.8 3 1 2 3 4 5 6 7 8
Linda Sent from my Verizon, Samsung Galaxy smartphone -------- Original message -------- From: Henry Rich <[email protected]> Date: 12/30/18 12:08 AM (GMT-05:00) To: [email protected] Subject: Re: [Jprogramming] One-based indices 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 > <https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.cs.utexas.edu%2Fusers%2FEWD%2Fewd08xx%2FEWD831.PDF&data=02%7C01%7C%7C35ec15728f7840b77e2e08d66e14d253%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636817433039799431&sdata=Toyif7pFhs1o1x3lmxpkq4%2FDZmczxuaia3b4fLrxH8I%3D&reserved=0>.* > > 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 >> https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&data=02%7C01%7C%7C35ec15728f7840b77e2e08d66e14d253%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636817433039799431&sdata=wFlC4m0av4ARCT%2FJCHYz08wAIi3x1HuV1tjEsmsltI4%3D&reserved=0 > ---------------------------------------------------------------------- > For information about J forums see > https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&data=02%7C01%7C%7C35ec15728f7840b77e2e08d66e14d253%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636817433039799431&sdata=wFlC4m0av4ARCT%2FJCHYz08wAIi3x1HuV1tjEsmsltI4%3D&reserved=0 --- This email has been checked for viruses by AVG. https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.avg.com&data=02%7C01%7C%7C35ec15728f7840b77e2e08d66e14d253%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636817433039799431&sdata=6BFAijj66hPF1N0ZR0BSmMx37pAmu6nVPCOpBQmYWE8%3D&reserved=0 ---------------------------------------------------------------------- For information about J forums see https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.jsoftware.com%2Fforums.htm&data=02%7C01%7C%7C35ec15728f7840b77e2e08d66e14d253%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636817433039799431&sdata=wFlC4m0av4ARCT%2FJCHYz08wAIi3x1HuV1tjEsmsltI4%3D&reserved=0 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
