🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #1129

Re: Pointers as 3-tuples (Re: JLG's flogging of horses (was Re: Relationship between C and C++))

#1129
From: Peter da Silva
Date: Mon, 09 Apr 1990 11:28
42 lines
2087 bytes
> Under your proposed 3-tuple
> idea, the distinction between pointers and arrays is further narrowed.

Not at all. The *semantics* of pointers as addresses, and pointers as
3-tuples, are identical. A legal ANSI C program should operate identically
under either implementation. It's just a safety net... not a new concept.

[ And it's not my concept, either... much as I'd like to claim authorship,
  I didn't originate it. ]

> In
> fact, because of the way you've constructed it, the two concepts are now
> nearly identical since the aliasing can only be within the _same_ bounded
> object.

That was always true, it was just unchecked.

> For recursive data structures, either pointers or some other mechanism is
> still required.

And this is an important point. C can be implemented with a certain set of
minimal constructs. It's really a very low-level language. And at this level
pointers and arrays are the same... and the internals of recursive data
structures are visible. If you don't like that, use a higher-level language.
Treat C as a fancy assembler.

> (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.

> 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.
-- 
 _--_|\  `-_-' Peter da Silva. +1 713 274 5180. <peter@ficc.uu.net>.
/      \  'U`
\_.--._/
      v
Technical Details
Message-ID: <1BT2FU7ggpc2@ficc.uu.net>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ficc!peter
References: <ZZR2:M4xds13@ficc.uu.net> <14313@lambda.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ficc!peter
From: peter@ficc.uu.net (Peter da Silva)
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: <1BT2FU7ggpc2@ficc.uu.net>
Date: 9 Apr 90 11:28:12 GMT
References: <ZZR2:M4xds13@ficc.uu.net> <14313@lambda.UUCP>
Reply-To: peter@ficc.uu.net (Peter da Silva)
Organization: Xenix Support, FICC
Lines: 37