comp.lang.ada
 help / color / mirror / Atom feed
From: jsa@alexandria (Jon S Anthony)
Subject: Re: Allocating "initialized" limited types...
Date: 1996/09/02
Date: 1996-09-02T00:00:00+00:00	[thread overview]
Message-ID: <JSA.96Sep2183857@alexandria> (raw)
In-Reply-To: Dx0q2E.2Bw@world.std.com


In article <JSA.96Sep1205656@alexandria> jsa@alexandria (Jon S Anthony) writes:

> In article <Dx0q2E.2Bw@world.std.com> bobduff@world.std.com (Robert A Duff) writes:
> 
> > In article <JSA.96Aug30173704@alexandria>,
> > Jon S Anthony <jsa@alexandria> 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





  reply	other threads:[~1996-09-02  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-30  0:00 Allocating "initialized" limited types Jon S Anthony
1996-08-31  0:00 ` Robert A Duff
1996-09-02  0:00   ` Jon S Anthony [this message]
1996-09-04  0:00     ` Joel VanLaven
1996-09-05  0:00       ` Robert A Duff
1996-09-06  0:00     ` Jon S Anthony
1996-09-02  0:00   ` Jon S Anthony
1996-09-03  0:00     ` Robert A Duff
1996-09-06  0:00     ` Jon S Anthony
1996-09-04  0:00   ` Jon S Anthony
1996-09-05  0:00     ` Robert A Duff
1996-09-05  0:00   ` Jon S Anthony
1996-09-05  0:00     ` Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox