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: 103376,5606d8433901738c X-Google-Attributes: gid103376,public From: jsa@alexandria (Jon S Anthony) Subject: Re: Allocating "initialized" limited types... Date: 1996/09/02 Message-ID: #1/1 X-Deja-AN: 178056629 sender: news@organon.com (news) references: organization: Organon Motives, Inc. newsgroups: comp.lang.ada Date: 1996-09-02T00:00:00+00:00 List-Id: In article jsa@alexandria (Jon S Anthony) writes: > In article bobduff@world.std.com (Robert A Duff) writes: > > > In article , > > Jon S Anthony wrote: [...] > > > type C is new T with private; -- Extends with new fields... > > >... > > > A_List : Car_Cdr_List_Where_Car_Is_T_Ref; > > > Obj_Ref : T_Ref; > > > > > > loop > > > ... > > >(1) Obj_Ref := new C'(....); -- ILLEGAL, assignment to limited type! > > > > It's not clear to me what you plan to put in the "....", since T and C > > are both private. > > Not to the _BODY_. So, it is TRIVIAL to put _NON COPY THINGS_ in the > '(...) Actually, this is probably more to the point. If you could > have had public limited views of _tagged_ types with their private > views being _NON_limited, this would solve the problem nicely. So, I > guess the question should have been why was this disallowed. > Actually, I seem to recall a reason for this, but can't recall what it > was (seemed to make sense at the time...) OK, went back and checked this and it definitely makes sense to disallow public limited tagged types from being completed as non-limited tagged types. If this were allowed, it would be possible to violate limited semantics on public type extensions involving limited components. So, this clearly makes sense the way it is (disallowed). > > >Doesn't help and is much more prone to errors (forget one of those fields???> > > Maybe you're really asking why limited types don't allow aggregates? > > The "don't forget fields" feature is a property of aggregates, not > > allocators. It's not clear how one could deal with access discrims in > > an aggregate. > > No, I really think what I was after is the above bit about limited > public and non limited private views of tagged types. To me, not > allowing an aggregate is obvious: it is an assignment to the object > (not to its separate fields!) and thus illegal for limited types. Well, here I'm just in the weeds, having become side tracked by the public/private limited/non-limited tagged type issue. This really has nothing to do with what I had in mind, which is really captured by the notion of "in place" creation. /Jon -- Jon Anthony Organon Motives, Inc. 1 Williston Road, Suite 4 Belmont, MA 02178 617.484.3383 jsa@organon.com