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,FREEMAIL_FROM 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 Path: g2news1.google.com!news2.google.com!postnews.google.com!z66g2000hsc.googlegroups.com!not-for-mail From: "snoopysalive@googlemail.com" Newsgroups: comp.lang.ada Subject: Re: How to extend packages Date: Sat, 7 Jun 2008 14:50:07 -0700 (PDT) Organization: http://groups.google.com Message-ID: <8d5d38c0-8a7a-4e74-8e4f-da3276864ad7@z66g2000hsc.googlegroups.com> References: <8d94d993-4807-4356-b1ab-1f2bb3f96b98@56g2000hsm.googlegroups.com> <484977AB.20002@gmail.com> NNTP-Posting-Host: 217.227.10.51 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1212875407 10333 127.0.0.1 (7 Jun 2008 21:50:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 7 Jun 2008 21:50:07 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z66g2000hsc.googlegroups.com; posting-host=217.227.10.51; posting-account=b7G67QoAAABjwLRYV73fYo_8iKCvB0IZ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_3; de-de) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.1 Safari/525.20,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:602 Date: 2008-06-07T14:50:07-07:00 List-Id: Ok, I've tried out S=E9bastien Morand's solution but it's still not working. To be honest, it's possible that I'm just using the compiler in a wrong way. Here's my code: ------------------ -- s-regext.ads -- ------------------ with System.Regpat; package System.Regpat.Extended is end System.Regpat.Extended; ------------------ -- s-regext.adb -- ------------------ pragma No_Body; ------------- -- rex.adb -- ------------- with System.Regpat.Extended; procedure Rex is begin null; end Rex; When compiling I get this messages: $ gnatmake rex.adb gnatbind -x rex.ali error: "s-regext.ali" not found, "s-regext.ads" must be compiled gnatmake: *** bind failed. So, I try to comile s-regext.ads first and get this message: $ gnatmake s-regext.ads gnatmake: not allowed to compile "s-regext.ads"; use -a switch, or compile file with "-gnatg" switch When trying the -a switch: $ gnatmake -a s-regext.ads gcc -gnatpg -c s-regext.ads s-regext.ads:1:12: warning: no entities of "Regpat" are referenced gnatmake: "s-regext.ads" compilation error When trying the -gnatg switch: $ gnatmake -gnatg s-regext.ads gnatmake: not allowed to compile "s-regext.ads"; use -a switch, or compile file with "-gnatg" switch I don't really understand what's happening here because when simulating this kind of "inheritance" with packages written by myself, it is working. Here's the example code: -------------- -- test.ads -- -------------- with Ada.Text_IO; package Test is procedure Say_Hello; end Test; -------------- -- test.adb -- -------------- package body Test is procedure Say_Hello is begin Ada.Text_IO.Put_Line ("Say_Hello"); end Say_Hello; end Test; ------------------ -- test-run.ads -- ------------------ with Test; package Test.Run is procedure Say_Something; end Test.Run; ------------------ -- test-run.adb -- ------------------ package body Test.Run is use Test; procedure Say_Something is begin Ada.Text_IO.Put_Line ("Say_Something"); end Say_Something; end Test.Run; -------------- -- main.adb -- -------------- with Test.Run; procedure Main is begin Test.Say_Hello; Test.Run.Say_Something; end Main; $ gnatmake main.adb gcc -c main.adb gnatbind -x main.ali gnatlink main.ali $ ./main Say_Hello Say_Something So, it seems as if it's not possible to extend packages of the standard library. Or am I interpreting this in a wrong way? Last but not least: Thanks for all your answers to my question. Thanks, Matthias