Article View: comp.lang.misc
Article #5245Re: 0-based/1-based arrays
From: Erland Sommarskog
Date: Tue, 08 Mar 1988 15:14
Date: Tue, 08 Mar 1988 15:14
23 lines
1445 bytes
1445 bytes
My critics against Oberon seems to have set of some discussion
about the base on arrays. Just a few more comments.
I have full respect for those prefer zero-based arrays, and there
are certainly occasions I would use one or two myself, but the
occasions are rare. As I said in my original post, removing the
freedoom to choose the lower limit is bad thing.
Some have said that if one wants one-based arrays, when only zero-based
arrays are available, one could just simply declare the array one
element too large, and waste the one at index zero. This method does
not always work. As I recall from Modula-2 you can have dynamic arrays
in procedures. (Both as parameters and local variables? Doesn't matter.)
They are always zero based. If I call such a procedure with a string
the first character will be at index zero, unless I do any strange
tricks with a leading blank or so.
--
Erland Sommarskog
ENEA Data, Stockholm
sommar@enea.UUCP "Souvent pour s'amuser les hommes d'equipages
and it's like talking to a stranger" -- H&C.
Technical Details
Message-ID:
<2811@enea.se>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!mcvax!enea!sommarShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!mcvax!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.lang.misc Subject: Re: 0-based/1-based arrays Message-ID: <2811@enea.se> Date: 8 Mar 88 15:14:40 GMT Reply-To: sommar@enea.UUCP(Erland Sommarskog) Followup-To: comp.lang.misc Organization: ENEA DATA AB, Sweden Lines: 23