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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,585fd78267abd80c X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!newsfeed00.sul.t-online.de!t-online.de!storethat.news.telefonica.de!telefonica.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: On pragma Precondition etc. Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4889886d$0$18827$9b4e6d93@newsspool2.arcor-online.net> <6etsi6F8mbmbU2@mid.individual.net> <488efc8d$1@news.post.ch> <488f26e8$0$20705$9b4e6d93@newsspool4.arcor-online.net> <1668bcqbkwlun$.mzzrx5m5ug2t$.dlg@40tude.net> <488f3d67$0$20703$9b4e6d93@newsspool4.arcor-online.net> <13nqxvysv2w75.bpxxsup39g9u$.dlg@40tude.net> <48902f08$0$1064$9b4e6d93@newsspool3.arcor-online.net> Date: Wed, 30 Jul 2008 15:47:30 +0200 Message-ID: <1lt840f6z5lva.8rilgn0ds47u$.dlg@40tude.net> NNTP-Posting-Date: 30 Jul 2008 15:47:30 CEST NNTP-Posting-Host: 07e33552.newsspool4.arcor-online.net X-Trace: DXC=50U>R0[BX[RU6b:FjPaGjQ4IUK\BH3YRNHnmVf8:^][DNcfSJ;bb[UFCTGGVUmh?TLK[5LiR>kgRikoKXoK On Wed, 30 Jul 2008 11:06:16 +0200, Georg Bauhaus wrote: > Dmitry A. Kazakov schrieb: >> On Tue, 29 Jul 2008 17:55:18 +0200, Georg Bauhaus wrote: > >>> What if one precondition states a relation between two suprogram >>> parameters, or between properties of two suprogram parameters? >> >> This case is equivalent to full multiple dispatch. Ada does not have it. If >> it had multiple dispatch then it would clearer how to deal with the >> corresponding contracts (=conditions). > > How about this: For the purpose of expressing the contract > of a subprogram, dream up its "contract-type". This type is obviously a tuple of the parameters of Foo. > Base this type on > > (1) the precursor's contract-type (up the derivation hierarchy) > (2) the profile > > So given > > function Foo(X, Y: Integer) return Whatever; > > denote the precondition of its "contract-type" by something like > > Foo'Precondition; Naming does not solve the problem. In presence of: subtype My_Integer is Integer range 1..500; type My_Whatever is new Whatever with private; what are the preconditions of Foo defined on the tuples: Integer x My_Integer x Whatever My_Integer x Integer x Whatever Integer x My_Integer x Whatever My_Integer x My_Integer x Whatever Integer x My_Integer x My_Whatever My_Integer x Integer x My_Whatever Integer x My_Integer x My_Whatever My_Integer x My_Integer x My_Whatever -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de