Article View: comp.lang.modula2
Article #205opaque types
From: Pat Terry
Date: Sat, 05 Aug 1989 17:52
Date: Sat, 05 Aug 1989 17:52
47 lines
1683 bytes
1683 bytes
(* SEMI OPAQUE TYPES
The following silly program tests to see whether compilers will provide
for semi-opaque types - namely ones in which exporting an alias for
a record type will forbid access to the fields of the "original" type.
It is not suspected that any compilers would reject this code. It
is suggested that, were the language to be slightly changed, this
would give a way of coding "limited private" types with no new syntax.
I would be curious to know whether any compilers to which I do not have
access would reject the code as it appears here.
*)
MODULE Test;
MODULE Inner;
EXPORT X (* but not Y*);
TYPE
Y = RECORD a : INTEGER END;
X = Y;
END Inner;
VAR b : X;
BEGIN
b.a := b.a
END Test.
(*
Collier V2 | Accepted
FST | Accepted
FTL | Accepted
Logitech (MS-DOS 3.03) | Accepted
Stonybrook (Quickmod) | Accepted
TopSpeed | Accepted
Volition Sage/Stride | Accepted
*)
--
uucp: {mcvax!uunet,tektronix,sun!nosun}!oresoft!dawggon!2!490!19.101!Pat.Terry
Internet: Pat.Terry@p101.f19.n490.z2.fidonet.org
Technical Details
Message-ID:
<2907.24DBFE03@dawggon.fidonet.org>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!pacbell!ames!ncar!unmvax!indri!caesar!blake!ogccse!cvedc!nosun!qiclab!m2xenix!dawggon!p101.f19.n490.z2.fidonet.org!Pat.TerryShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!pacbell!ames!ncar!unmvax!indri!caesar!blake!ogccse!cvedc!nosun!qiclab!m2xenix!dawggon!p101.f19.n490.z2.fidonet.org!Pat.Terry From: Pat.Terry@p101.f19.n490.z2.fidonet.org (Pat Terry) Newsgroups: comp.lang.modula2 Subject: opaque types Message-ID: <2907.24DBFE03@dawggon.fidonet.org> Date: 5 Aug 89 17:52:20 GMT Sender: ufgate@dawggon.fidonet.org (newsout1.26) Organization: FidoNet node 2:490/19.101 - Settler City Fido, Grahamstown RSA Lines: 47