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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7178c15dc3019a0d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!z66g2000hsc.googlegroups.com!not-for-mail From: witmer Newsgroups: comp.lang.ada Subject: Re: How to extend packages Date: Fri, 6 Jun 2008 10:24:49 -0700 (PDT) Organization: http://groups.google.com Message-ID: <670dac85-c816-45d3-8652-ba2540028282@z66g2000hsc.googlegroups.com> References: <8d94d993-4807-4356-b1ab-1f2bb3f96b98@56g2000hsm.googlegroups.com> NNTP-Posting-Host: 192.68.108.22 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1212773089 14464 127.0.0.1 (6 Jun 2008 17:24:49 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 6 Jun 2008 17:24:49 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z66g2000hsc.googlegroups.com; posting-host=192.68.108.22; posting-account=SUeCrwoAAADrp-mqxk6aBEmxaIRQduq9 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) X-HTTP-Via: 1.0 wall:801 (squid/2.5.STABLE14) Xref: g2news1.google.com comp.lang.ada:591 Date: 2008-06-06T10:24:49-07:00 List-Id: On Jun 6, 1:00 pm, "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;