[comp.lang.misc] Technical: Definitions of ``Poynter'', ``Shyfting''

brnstnd@kramden.acf.nyu.edu (Dan Bernstein) (11/16/90)

Please include technical content, and only technical content, in any
followup to an article whose subject begins with ``Technical:''. Change
the subject line to introduce nontechnical issues. I will obey this rule
religiously. Note that emotional issues can be technical (e.g., whether
alias or noalias is more natural), but personal attacks cannot.

Here are definitions of two terms.

Poynter: An object that can hold the address of another object (perhaps
of a restricted type). As usual, a poynter supports assignment and
comparison. It may be set to the ``address of'' an object. It may be
``dereferenced'' in order to evaluate or modify the object whose address
it holds. These operations are explicit.

Shyfting: The operation of re-indexing a reference to an array with a
different base, so as to produce a reference to the same object with the
new indices.

A C pointer is a poynter with shyfting. A machine language index is a
poynter with shyfting. A Pascal or Ada pointer is a poynter without
support for shyfting. Apparently the new Fortran includes shyfting
separately from its poynters. Ada's slicing is a limited form of
shyfting.

---Dan

misha@gracilis.ai.mit.edu (Mike Bolotski) (11/17/90)

In article <19485:Nov1608:33:4490@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
>Please include technical content, and only technical content, in any
>followup to an article whose subject begins with ``Technical:''. Change

Sounds good to me.

>Poynter: An object that can hold the address of another object (perhaps
>of a restricted type). As usual, a poynter supports assignment and
>comparison. It may be set to the ``address of'' an object. It may be
>``dereferenced'' in order to evaluate or modify the object whose address
>it holds. These operations are explicit.

There is also a beastie called "reference", which supports assignment
and dereference, but *not* comparison. It's used in ML and 
FX-90 (a locally developed language). I believe the C++ refs also
do not support comparison. Similarly, arithmetic on references
is not supported.

>Shyfting: The operation of re-indexing a reference to an array with a
>different base, so as to produce a reference to the same object with the
>new indices.

What is the working definition  of "reference" in the above?

Mike Bolotski          Artificial Intelligence Laboratory, MIT
misha@ai.mit.edu       Cambridge, MA

brnstnd@kramden.acf.nyu.edu (Dan Bernstein) (11/17/90)

``IMU'' means ``in my understanding.''

``Beastie'' is a generic term for a thing, as ``object'' has a more
specific meaning.

In article <11925@life.ai.mit.edu> misha@gracilis.ai.mit.edu (Mike Bolotski) writes:
> In article <19485:Nov1608:33:4490@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
> >Poynter: An object that can hold the address of another object (perhaps
> >of a restricted type). As usual, a poynter supports assignment and
> >comparison. It may be set to the ``address of'' an object. It may be
> >``dereferenced'' in order to evaluate or modify the object whose address
> >it holds. These operations are explicit.
> There is also a beastie called "reference", which supports assignment
> and dereference, but *not* comparison.

Sorry I didn't define ``object'' or ``reference.'' A reference is a
compile-time, syntactic beastie; an object is a run-time, semantic
beastie. A reference can refer to an object, as in the way that the
tokens ``x[i]'' refer to the i'th element of the array x, and ``x''
refers to the array x, and so on. The nature of objects and references
is defined more precisely by the language.

There is no concept of comparing two references; they are syntactic
beasties. If they are available at run-time they might be implemented as
poynters, but their poynter values might not be stored anywhere.
References might be stored as strings of tokens, for instance.
Assignment of references means syntactic assignment. Dereferencing of
references means run-time evaluation.

IMU the beasties in C++ and ML work as above. In case this is not true,
the term ``repherences'' shall mean beasties that work as above.
Repherences are effectively defined by a subset of the poynter
operations, so poynters can always implement repherences with run-time
assignment. The C preprocessor implements repherences with compile-time
assignment. Repherences in general might not be assignable---i.e., it
may be that repherences cannot be stored in objects, but only evaluated
in program text.

> Similarly, arithmetic on references
> is not supported.

C pointer arithmetic is shyfting. A beastie need not support shyfting to
be a poynter or a reference.

> >Shyfting: The operation of re-indexing a reference to an array with a
> >different base, so as to produce a reference to the same object with the
> >new indices.
> What is the working definition  of "reference" in the above?

See above.

---Dan