[net.lang.mod2] Should all opaque types be pointers? No.

PATTIS@WARD.CS.WASHINGTON.EDU (Richard Pattis) (10/21/86)

  I would like to complain about opaque types being pointers only. When I teach
ADTs, I teach a Table, with a few operations that manipulate cursors (a unifi-
cation of indexes and pointers).  One can locate an element and get a cursor;
one can use the cursor to retrieve/update information from/to a table.  The
definition module of the Table ADT exports opaquely the cursor type.  One
implementation of Table uses arrays, where the cursor type is integer.  Another
implementation uses pointers for cursors.

  This example will be impossible with the new standard.  Couldn't one say
that opaque types must allow for the largest of all the primitive (so called,
one-word) types?  What is the rationale for restricting it to pointers only?

Rich
-------

randy@oresoft.UUCP (10/23/86)

If one allows assignment and in/equality test of opaques, and one allows non-
pointers to be opaques, then a program may become dependent on whether a
particular implementation stuffs an integer into those n bytes, or a pointer.
The other approach would be to disallow comparison or assignment.  The latter
has its proponents among the ADT community.

An aside: Having received two strange phone calls, it should be explained
          that Charles and I know eachother, and no one was actually slurring
          the other's parent.