🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #1686

Re: C's sins of commission

#1686
From: Richard A. O'Keefe
Date: Fri, 12 Oct 1990 01:52
23 lines
1597 bytes
In article <65265@lanl.gov>, jlg@lanl.gov (Jim Giles) writes:
> Yes!  Because, a[i] and b[j] are guaranteed _not_ to be aliased.  Whereas
> *p and *q might be or, then again, might not be.

That's an argument against *C* pointers.  It is not at all an argument
against pointers qua pointers.  Remember Euclid?  You declare pointers
into ZONES.  Pointers into different zones cannot possibly be aliased,
and when a zone's lifetime expires the entire zone can be reclaimed,
because a pointer can't outlive its zone.

> The pointer syatax _may_ be used to simulate arrays, but
> you might be planning to use it for dynamic memory, strings, recursive
> data structures, run-tim equivalencing, etc..  How does the reader know
> that the pointer will not be used in any of those ways - he knows the
> array won't be.

The reader certainly doesn't know anything of the kind.  Of course you
*can* use arrays to hold strings, recursive data structures, and do
run-time equivalencing.  (It's quite common to overlay two logical arrays
onto one in Pascal, just think of straight insertion sort.)

-- 
Fear most of all to be in error.	-- Kierkegaard, quoting Socrates.
Technical Details
Message-ID: <3960@goanna.cs.rmit.oz.au>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!samsung!munnari.oz.au!goanna!ok
References: <14972@cbmvax.commodore.com> <65265@lanl.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!samsung!munnari.oz.au!goanna!ok
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.lang.misc
Subject: Re: C's sins of commission
Message-ID: <3960@goanna.cs.rmit.oz.au>
Date: 12 Oct 90 01:52:59 GMT
References: <14972@cbmvax.commodore.com> <65265@lanl.gov>
Organization: Comp Sci, RMIT, Melbourne, Australia
Lines: 23