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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4bce46ddadaa9806 X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: What is wrong here? (Generic and controlled types) Date: 2000/04/03 Message-ID: <8capmt$kgk$1@nnrp1.deja.com>#1/1 X-Deja-AN: 606173629 References: <38E871E6.8D9EBE71@lufmech.rwth-aachen.de> <8caebe$6us$1@nnrp1.deja.com> <8cahmn$apq$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x41.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Mon Apr 03 18:59:52 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-04-03T00:00:00+00:00 List-Id: In article <8cahmn$apq$1@nnrp1.deja.com>, Robert Dewar wrote: > In article <8caebe$6us$1@nnrp1.deja.com>, > Ted Dennison wrote: > > > I personally feel Ada really falls on its face here. The only > > time I ever felt I needed to create a controlled type was in > > this context. > > It is almost always possible to work around this trivially by > simply including a controlled component in the type instead > of making the entire type controlled. You've said this before, and I still don't quite understand what you are getting at. I see two possibilites. One is that you saying that people who do this are almost always trying to control fields they don't need to control. Thus they could just put off the fields they *do* need to control into some subrecord defined at a higher level. I wouldn't call that a workaround. That's simply proper design. *Given* that the design is proper, such a solution will help in exactly %0 of the time the problem comes up. The other possibility is that there is some other subfield technique that I'm missing and can't puzzle out for myself. The only way for a controlled subrecord to modify its parent record when one of the controlled operations occurs is for it to have some kind of field that refers back to the parent record. This requires knowledge of the structure of that parent record. But such knowledge cannot exist until that parent record is declared. The definition of the subrecord and/or the overloading of the controlled operations needs to have visibility to that parent record. That requires that the controlled subrecord be declared at a level no higher than the parent record. So now we have the exact same problem: The subrecord type must be declared at the library level because its derived from controlled, but it must be declared at a lower level if the type it refers to is declared at a lower level. -- T.E.D. http://www.telepath.com/~dennison/Ted/TED.html Sent via Deja.com http://www.deja.com/ Before you buy.