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=0.1 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM,FREEMAIL_REPLY autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7178c15dc3019a0d X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!eweka.nl!lightspeed.eweka.nl!feeder.erje.net!news.motzarella.org!motzarella.org!not-for-mail From: =?ISO-8859-1?Q?S=E9bastien_Morand?= Newsgroups: comp.lang.ada Subject: Re: How to extend packages Date: Fri, 06 Jun 2008 17:45:15 +0000 Organization: A noiseless patient Spider Message-ID: <484977AB.20002@gmail.com> References: <8d94d993-4807-4356-b1ab-1f2bb3f96b98@56g2000hsm.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: feeder.motzarella.org U2FsdGVkX19LMlC9M/iWbUtx2cNOPdP9dMVQlt+lIODByhFh65dr0C/QngV90YoQoYIDJaQlOluo1cQ8uf1t0++VCazWEhU+drnqZoTfUCFiFzn30NQjENejkkDgB0fUGsMEN/hqsmuGNat9RrauaA== X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers NNTP-Posting-Date: Fri, 6 Jun 2008 17:45:18 +0000 (UTC) In-Reply-To: X-Auth-Sender: U2FsdGVkX1+XlTiFuFkIxOQLsSKKeXCdbCm3Yww1FafT1l8ajUkQ7g== Cancel-Lock: sha1:UzpZ4kKaPd2WcgZ27vtUMzi+kp0= User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) X-Enigmail-Version: 0.95.6 Xref: g2news1.google.com comp.lang.ada:593 Date: 2008-06-06T17:45:15+00:00 List-Id: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 snoopysalive@googlemail.com a �crit : > 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? Try this: with GNAT.Regpat; use GNAT.Regpat; package GNAT.Regpat.Extended is end GNAT.Regpat.Extended; Then when you use GNAT.Regpat.Extended, GNAT.Regpat is available too. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) iD8DBQFISXer+zV9xm4PlDQRAg3JAJ9C0PKClnt6uc1Tjl85b1zvZfQrmgCfcQgm 1tLnIgHiSGjifzvMyBvwOgc= =JX0R -----END PGP SIGNATURE-----