comp.lang.ada
 help / color / mirror / Atom feed
From: "chris.danx" <chris.danx@ntlworld.com>
Subject: Re: Help: Tagged Types
Date: Fri, 16 Nov 2001 18:02:53 -0000
Date: 2001-11-16T18:02:53+00:00	[thread overview]
Message-ID: <TzcJ7.1737$7e3.576882@news2-win.server.ntlworld.com> (raw)
In-Reply-To: un11mty85.fsf@gsfc.nasa.gov

> > Hi,
> >
> > If we have a decendant of type gwindows.windows.window_type,
gl_window_type,
> > and override it's create procedure, does the following call the create
> > procedure for gwindows.windows.window_type?
>
> No, it dispatches.
>
> You want:
>
>        gwindows.windows.create (gwindows.windows.window_type(window));

Ok.


> Critique of GWindows:
>
> In general, it's best if "create" functions are _not_ primitive
> operations of the type, for precisely this reason. The derived types
> should have a different "create" function, because they will normally
> have additional parameters, and the compiler should help the user call
> the correct one.
>
> One way to do this is to put the Create functions in a local nested
> package.


There were two options:  override create proper or the event on_create.  The
reason for using create was simple, I forgot that on_create could be used
for this.  I'm going to use on_create instead, it's simpler and closer to
what I intend.


Thanks,
Chris




      reply	other threads:[~2001-11-16 18:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-16 17:07 Help: Tagged Types chris.danx
2001-11-16 17:35 ` Stephen Leake
2001-11-16 18:02   ` chris.danx [this message]
replies disabled

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