From: witmer <witmer@averagesoftware.org>
Subject: Re: How to extend packages
Date: Fri, 6 Jun 2008 10:24:49 -0700 (PDT)
Date: 2008-06-06T10:24:49-07:00 [thread overview]
Message-ID: <670dac85-c816-45d3-8652-ba2540028282@z66g2000hsc.googlegroups.com> (raw)
In-Reply-To: 8d94d993-4807-4356-b1ab-1f2bb3f96b98@56g2000hsm.googlegroups.com
On Jun 6, 1:00 pm, "snoopysal...@googlemail.com"
<snoopysal...@googlemail.com> wrote:
> Hi, Ada-folks!
>
> I'd like to extend the GNAT.Regpat a little bit, so that it contains
> additional operations like Split (the same as in Perl or Ruby) or Join
> (dito).
>
> When speaking of "extending" I mean it in the sense of e.g. Java where
> extending a class means that the child class contains all the public
> or protected operations and attributes as the super class. Perhaps you
> know now, what I want to achieve. I want to have an extended "child"
> package of GNAT.Regpat. In the end it should have an own name like
> e.g. "Mine.Regex" and contain all operation etc. of its "super"
> package plus the operations I'll additionally implement.
>
> I've been trying for hours now, so I'm passing this question to you.
> How to extend package?
>
> Thanks,
> Matthias
I don't there's a way to directly do what you want, but if I'm
understanding you correctly, this should do it:
--"Parent" spec
package Parent is
procedure Proc_1;
procedure Proc_2;
--etc...
end Parent;
--"Child" spec
with Parent;
package Child is
procedure Proc_1 renames Parent.Proc1;
procedure Proc_2 renames Parent.Proc2;
--and so on...
--Child members go here
end Child;
next prev parent reply other threads:[~2008-06-06 17:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-06 17:00 How to extend packages snoopysalive
2008-06-06 17:24 ` witmer [this message]
2008-06-06 17:45 ` Sébastien Morand
2008-06-07 14:21 ` Stephen Leake
2008-06-07 16:04 ` Simon Wright
2008-06-07 21:50 ` snoopysalive
2008-06-08 11:09 ` Simon Wright
2008-06-09 22:38 ` snoopysalive
2008-06-10 5:40 ` Simon Wright
2008-06-14 8:45 ` snoopysalive
2008-06-06 18:16 ` Georg Bauhaus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox