comp.lang.ada
 help / color / mirror / Atom feed
From: "REH" <spamjunk@stny.rr.com>
Subject: Re: generics in Ada 83
Date: 13 Sep 2005 09:30:46 -0700
Date: 2005-09-13T09:30:46-07:00	[thread overview]
Message-ID: <1126629046.328151.40970@g47g2000cwa.googlegroups.com> (raw)
In-Reply-To: <4326d73a$1_1@glkas0286.greenlnk.net>


Martin Dowie wrote:
> REH wrote:
> > Is there a way to define a default for the with'd procedure in the
> > following example in Ada 83:
> >
> > generic
> >     type X is private;
> >     with procedure Y(Z : in X);
> > package Foo;
> >
> > I want to define a default for Y, but how can I without knowing X?
> >
> > I have a generic package that has several with'd procedures, but
> > depending on what services the package provides are use, only a few of
> > the procedures may need to be defined.  I'd like to just default the
> > unused ones to stubs.
>
> Same as Ada95:
>
> generic
>    type X is private;
>    with procedure Y (Z : X) is <>;
> package Foo is
> end Foo;
>
> Or do you mean you want the compiler to magically insert a 'null' procedure
> if there isn't a matching procedure Y for whatever type X happens to be? If
> that's the case you can't do that. There has to be some procedure (even one
> that's only 'begin null end;') for each type.
>
> Cheers
>
> -- Martin

defining it with a box won't work.  There would have to a procedure
already defined.  What I want is something like:

generic
    type X is private;
    with procedure Y(Z : in X) is P;
package Foo


but of course P must already take into account X.  With '95 I think I
could just with a generic package containing the stubs, but I can
figure out a way in '83.

Thanks.




  reply	other threads:[~2005-09-13 16:30 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-13 13:26 generics in Ada 83 REH
2005-09-13 13:30 ` Georg Bauhaus
2005-09-13 16:25   ` REH
2005-09-13 19:23     ` Georg Bauhaus
2005-09-13 13:50 ` Martin Dowie
2005-09-13 16:30   ` REH [this message]
2005-09-13 16:41     ` Martin Dowie
2005-09-13 18:43       ` REH
2005-09-13 19:37         ` Ludovic Brenta
2005-09-13 19:53           ` REH
2005-09-13 16:56 ` Jeffrey Carter
2005-09-13 18:53   ` REH
2005-09-13 22:16     ` Jeffrey Carter
2005-09-13 22:44       ` REH
2005-09-14  8:14   ` Jean-Pierre Rosen
2005-09-14 12:40     ` REH
2005-09-14 13:15     ` Hyman Rosen
2005-09-14 14:08       ` Jean-Pierre Rosen
2005-09-14 15:23         ` Hyman Rosen
2005-09-14 15:41           ` Robert A Duff
2005-09-19 17:58             ` REH
2005-09-20  4:58               ` Hyman Rosen
2005-09-20 12:36                 ` REH
2005-09-20  1:34             ` adaworks
2005-09-20  4:14               ` Jim Rogers
2005-09-21 22:58               ` Robert A Duff
2005-09-22 15:18                 ` adaworks
replies disabled

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