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=2.0 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,859116256d0a7bc2,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.85.226 with SMTP id k2mr2889172paz.34.1343789444815; Tue, 31 Jul 2012 19:50:44 -0700 (PDT) Path: g9ni7686150pbo.0!nntp.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nrc-news.nrc.ca!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Nasser M. Abbasi" Newsgroups: comp.lang.ada Subject: basic question on nested packages Date: Fri, 27 Jul 2012 22:22:57 -0500 Organization: Aioe.org NNTP Server Message-ID: Reply-To: nma@12000.org NNTP-Posting-Host: 9ii5QNw33OfeoTzEH8w9ug.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 X-Notice: Filtered by postfilter v. 0.8.2 X-Received-Bytes: 3180 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-07-27T22:22:57-05:00 List-Id: I'd like to improve the structure of the Ada lapack binding to make it easier to use. The official Fortran lapack is structured as follows lapack + | +----------------+-------------------+ | | | driver routines computational auxiliary The current Ada Lapack binding has the following 4 packages that maps to the above, and a package for IO, like this: labase.ads (provides only data types) ladrv.ads (the drivers API's, WITH labase;) laaux.ads (the auxillary API's, WITH labase;) lacmp.ads (the computional API's, WITH labase;) then an IO package labaseio.ads, labaseio.adb (WITH labase;) provides IO routines for the lapack Ada types. So, a client Ada program that wants to use lapack's driver routine say SGESV() would do ------------------- with labase; use labase; with ladrv; .... A : labase.Fortran_Real_Matrix (1 .. 3, 1 .. 3); ladrv.SGESV(...) ------------------------ What I think would be better is to have ONE lapack package and with the above packages as nested packages. So that a client program would do ------------------- with lapack; .... A : lapack.Fortran_Real_Matrix (1 .. 3, 1 .. 3); lapack.driver.SGESV(...) ------------------------ i.e. a client would only need to WITH one package, and access the other packages using a dot from that one base package. Hence it will be, for the API's lapack.driver.foo() lapack.comp.foo() lapack.aux.foo() lapack.IO.foo() and for the datatypes, it will just be A : lapack.type_name; The 4 ada lapack packages (driver, comp, aux, IO) all do WITH labase; So putting them as nested packages to labase seems to make sense. I do not know much about Ada packaging and such, so wanted to ask the experts what they think. Woukd nested packages be the answer, or some other stucture? or should the API be left as is? There will be no code changes in the packages itself, just a bit of shuffling of the code location in the files to make it easier and more clear to use the binding. I think the client will be more clear this way. Any thoughts? --Nasser