🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #2002

Re: Answers, Chapter 2: to point or not to point

#2002
From: Jim Giles
Date: Fri, 09 Nov 1990 22:07
36 lines
1941 bytes
From article <24487:Nov906:17:2490@kramden.acf.nyu.edu>, by brnstnd@kramden.acf.nyu.edu (Dan Bernstein):
> [... pointers copying one row to another of a two-d array) ...]
> In this case, the compiler does little more than reverse that
> preprocessing. Hardly a lot of work.

Not in this trivial, short, and totally unrealistic example.  But,
when you copy columns in C, the pointers would interleave each other.
If you copy diagonals, it's even worse (yes, array notation makes
this easier to see too).  If the loop is long with a lot of arrays
and a lot of expressions, the task becomes harder still.  In general
it requires the solution of multiple linear Diophantine equations
an proving that none of them have coincident solutions.  Not
impossible, but not the sort of thing you want to do if you don't
_have_ to.

> [...]
>> if the array
>> code were preprocessed into pointers (which you _did_ suggest should
>> be done).
> 
> Did I really? Where? I certainly don't believe that all array code
> should be converted into pointer code.

You did really.  If you didn't believe it, you shouldn't have said
it:

> Jim, nothing in Nemesis that you've described to me requires any
> extensions to implement in C; [...]
> [...]                       The programmer can get all the greatness and
> glory of the Giles Gaggle, with whatever typechecking and constraints
> you want, with at most a C++-like preprocessor. Agreed?

If this doesn't imply converting all higher structures into pointers,
what does it mean?

J. Giles
Technical Details
Message-ID: <5498@lanl.gov>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!lanl!jlg
References: <24487:Nov906:17:2490@kramden.acf.nyu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!lanl!jlg
From: jlg@lanl.gov (Jim Giles)
Newsgroups: comp.lang.misc
Subject: Re: Answers, Chapter 2: to point or not to point
Message-ID: <5498@lanl.gov>
Date: 9 Nov 90 22:07:25 GMT
References: <24487:Nov906:17:2490@kramden.acf.nyu.edu>
Organization: Los Alamos Natl Lab, Los Alamos, N.M.
Lines: 36