From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: fac41,9a0ff0bffdf63657 X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Software landmines (loops) Date: 1998/09/06 Message-ID: #1/1 X-Deja-AN: 388352462 Sender: matt@mheaney.ni.net References: <6qfhri$gs7$1@nnrp1.dejanews.com> <35cb8058.645630787@news.ne.mediaone.net> <902934874.2099.0.nnrp-10.c246a717@news.demon.co.uk> <6r1glm$bvh$1@nnrp1.dejanews.com> <6r9f8h$jtm$1@nnrp1.dejanews.com> <6renh8$ga7$1@nnrp1.dejanews.com> <6rf59b$2ud$1@nnrp1.dejanews.com> <6rfra4$rul$1@nnrp1.dejanews.com> <35DBDD24.D003404D@calfp.co.uk> <6sbuod$fra$1@hirame.wwa.com> <6sebjr$b69$1@nnrp1.dejanews.com> <6sfcse$78h$1@hirame.wwa.com> <35F238F7.F57D3EC7@earthlink.net> NNTP-Posting-Date: Sun, 06 Sep 1998 00:51:48 PDT Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-09-06T00:00:00+00:00 List-Id: Charles Hixson writes: > I just feel that a tightly coupled class that doesn't really have any > use outside the context of another class should be declared internal > to that class... Yes. > ... (Ada can manage this by appropriate use of Private, but, to me, > it's a rather tricky thing to handle this properly [I'm not sure if > one can completely declare a class within the code body of an Ada > file, and if you did, I think that it would have full access to the > locally declared variables, thus expanding the bandwidth of the > interface]). I don't understand what you think is "tricky" about declaring one type in the same module as another: package P is type T is private; ... private type U is ...; type T is record O : U; ... end record; end P; Do you object to T being able to see the representation of U? Then just make U private: private package Q is type U is private; ... private type U is ...; end Q; type T is record O : U; ... end record; end P; Do you not like that U can see the representation of T? Then make T's representation type private: private type U is ...; package Q is type T_Rep is private; ... private type T_Rep is ...; end Q; type T is new Q.T_Rep; end P; There's nothing hard or tricky going on here. Just normal scope rules.