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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.129.85.80 with SMTP id j77mr4124474ywb.33.1449596912487; Tue, 08 Dec 2015 09:48:32 -0800 (PST) X-Received: by 10.182.148.165 with SMTP id tt5mr15874obb.20.1449596912455; Tue, 08 Dec 2015 09:48:32 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!b51no7256097qgf.0!news-out.google.com!l1ni629igd.0!nntp.google.com!mv3no10582837igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 8 Dec 2015 09:48:32 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=94.107.233.114; posting-account=6m7axgkAAADBKh082FfZLdYsJ24CXYi5 NNTP-Posting-Host: 94.107.233.114 References: <8bc7fd76-f00a-4eea-9715-470af028fc84@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: I'm facing an issue with: call to abstract procedure must be dispatching From: Serge Robyns Injection-Date: Tue, 08 Dec 2015 17:48:32 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 2866 X-Received-Body-CRC: 3947528446 Xref: news.eternal-september.org comp.lang.ada:28713 Date: 2015-12-08T09:48:32-08:00 List-Id: On Tuesday, 8 December 2015 18:30:59 UTC+1, Jeffrey R. Carter wrote: > with T1_Ops; > with T2_Ops; > ... > package Storage is > procedure Put (Item : in T1_Ops.T1); >=20 > procedure Put (Item : in T2_Ops.T2); >=20 > ... > end Storage; >=20 > The bodies of the Put procedures correspond to your Insert procedures. (Y= ou can > call them Insert, too, if you like, but I once heard it asserted that a > correctly designed Ada program has 90% of its operations named Put or Get= .) >=20 > This is then used as >=20 > with Storage; >=20 > ... >=20 > Storage.Put (Item =3D> Current_Item); >=20 > which is the same regardless of the type of the item being stored. To cha= nge the > storage method, you change the body of Storage. This seems indeed a workable solution. Actually, in my initial version I h= ad one big package for the implementation. I found this "ugly" and wanted = to decimate them as per package under the form of child packages. This als= o allows me to use private types, as children can access private elements. My question is then, how can I easily manage this from a source management = perspective. As I said in a prior post, changing the "with/use" everywhere= or use some file system "tricks" to fool the compiler to pick the "right" = version. Maybe there is some Ada "feature" to do this nicely. As I said in a prior = post, in C and C++ I would use the pre-processor to pick the "right" one. > Note that programming by extension is neither necessary nor desirable for= this. I've noticed from your papers you generally disapproves "programming by ext= ension". Serge