Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!lanl!lambda!jlg From: jlg@lambda.UUCP (Jim Giles) Newsgroups: comp.lang.misc Subject: Re: Pointers as 3-tuples (Re: JLG's flogging of horses (was Re: Relationship between C and C++)) Message-ID: <14316@lambda.UUCP> Date: 9 Apr 90 23:03:22 GMT References: <1BT2FU7ggpc2@ficc.uu.net> Lines: 27 From article <1BT2FU7ggpc2@ficc.uu.net>, by peter@ficc.uu.net (Peter da Silva): > [...] >> (Actually, even recursive data structures may be implemented >> with arrays, but it is less elegant in the general case.) > > Exactly. Pointers are more general than arrays. Pointers are more general than arrays in that they are free from bounds checking and allow arbitrary aliasing. Arrays are more general than pointers in that they can be multiply dimensioned. Arrays also tend to be more legible and easier to optimize. Neither should be used to perform tasks better suited to the other. > [...] >> The point of this discussion is >> that pointers are not, and should not be treated, as a useful method of >> implementing arrays. > > Not at all. Since pointers and arrays are isomorphic, that pointers are a > useful method of implementing arrays becomes a tautology. Pointers are only isomorphic to _one_dimensional_arrays_, and only if their aliasing and freedom from bounds are both curtailed. Having now removed the only features that made pointers even remotely interesting (as an array-like mechanism) I see no reason for them to remain. J. Giles