Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Should all opaque types be pointers? No.

1 view
Skip to first unread message

Richard Pattis

unread,
Oct 21, 1986, 4:04:50 PM10/21/86
to

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

ra...@oresoft.uucp

unread,
Oct 22, 1986, 10:36:19 PM10/22/86
to
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.

0 new messages