Xref: utzoo comp.lang.modula2:682 comp.lang.misc:1161 Path: utzoo!utgpu!water!watmath!clyde!att-cb!att-ih!pacbell!ptsfa!ames!nrl-cmf!mailrus!umix!uunet!mcvax!ukc!its63b!csnjr From: csnjr@its63b.ed.ac.uk (Nick Rothwell) Newsgroups: comp.lang.modula2,comp.lang.misc Subject: Re: 0-based/1-based arrays Message-ID: <1049@its63b.ed.ac.uk> Date: 7 Mar 88 13:49:42 GMT References: <7161@sol.ARPA> <2740@mmintl.UUCP> <4343@june.cs.washington.edu> <2851@haddock.ISC.COM> <726@sandino.quintus. Reply-To: nick%ed.lfcs@uk.ac.ucl.cs.nss (Nick Rothwell) Organization: LFCS, University of Edinburgh Lines: 16 In article <726@sandino.quintus.UUCP> pds@quintus.UUCP (Peter Schachte) writes: >As someone said, one-based arrays often seem more natural. I want to >store 10 of these things. So I allocate a ten element array. Now, >quick, which is the last element? Number NINE? Huh? Yes. 'fraid so! The "9" popped into my head straight away. I'm an ML hacker. I'm used to traversing lists. If I have a list of 10 elements, I have to take its tail 9 times. If I want the first element, I do 0 operations. So, I think from 0 upwards... -- Nick Rothwell, Laboratory for Foundations of Computer Science, Edinburgh. nick%lfcs.ed.ac.uk@nss.cs.ucl.ac.uk !mcvax!ukc!lfcs!nick ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ...while the builders of the cages sleep with bullets bars and stone, they do not see your road to freedom that you build with flesh and bone.