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: a07f3367d7,dbbbb21ed7f581b X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder.news-service.com!feeder.news-service.com!de-l.enfer-du-nord.net!gegeweb.org!aioe.org!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Operation can be dispatching in only one type Date: Thu, 19 Nov 2009 02:23:07 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: <691d6892-bc5e-4d81-8025-c36556bf2593@13g2000prl.googlegroups.com> NNTP-Posting-Host: +ERTOT2Y9KJRZ8n+NpAZGA.user.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.0 X-Newsreader: Tom's custom newsreader Cancel-Lock: sha1:Bhh9tBFhUcgs+PWU88Xma/VAPW8= Xref: g2news1.google.com comp.lang.ada:8151 Date: 2009-11-19T02:23:07+00:00 List-Id: > package Documents is > > type Document is abstract tagged private; > type Text_Region is abstract tagged private; > type Marker is abstract tagged private; > ... > procedure Move_Text (Doc : in out Document; > From : in Text_Region; > To : in Marker) > is abstract; There's really no way at compile time to require a particular relationship between two (or more) arbitrary parameters to a procedure. If that's necessary, you usually combine them into a single object that's a single parameter. Thus if a Document could have up to 10 defined Text_Regions and 20 Markers one could say type Document is abstract tagged private; -- Presumably includes an array or list of appropriate Text_Region -- descriptors and of Marker descriptors. type Text_Region_Ids is range 1 .. 10; type Marker_Ids is range 1 .. 20; procedure Move_Text (Doc : in out Document; From : in Text_Region_Ids; To : in Marker_Ids) is abstract;