Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site pokey.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!qantel!hplabs!pesnta!amd!amdcad!lll-crg!seismo!uwvax!pokey!dan From: dan@pokey.UUCP Newsgroups: net.lang Subject: Re: C++ and Modula-2 (and something about data abstraction) Message-ID: <275@pokey.UUCP> Date: Wed, 6-Nov-85 09:40:17 EST Article-I.D.: pokey.275 Posted: Wed Nov 6 09:40:17 1985 Date-Received: Mon, 11-Nov-85 05:21:14 EST References: <2958@sun.uucp> Distribution: net Organization: U of Wisconsin CS Dept Lines: 20 > The fact that, in the > current implementations of Modula-2, variables of an opaque type are > typically restricted to a size of 1 or 2 words which forces you to use > a POINTER TO RECORD ... representation is just that: An implementation > restriction. > Much as I like Modula-2, I can't agree with this statement. The reason such a type is restricted is because, given the current syntax and semantics of the language, the compiler has no way to obtain size information about an opaque object. Such objects are named in the definition module, but declared in the implementation module. A program importing them may only read the definition module (of course), where no information is available. By making the internal definition of an opaque object a part of the implementation, Wirth has made its size unavailable, by definition, to any other code. See by contrast Ada private types, whose details must be declared, but may not be used by any but the owning package, or C++ class variables, which behave in a similar way.