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,73cb216d191f0fef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.68.161.163 with SMTP id xt3mr4026617pbb.7.1363381470503; Fri, 15 Mar 2013 14:04:30 -0700 (PDT) Path: q9ni18659pba.1!nntp.google.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!backlog2.nntp.ams.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!multikabel.net!newsfeed20.multikabel.net!news.mi.ras.ru!goblin1!goblin2!goblin.stu.neva.ru!feeder.erje.net!us.feeder.erje.net!xmission!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Tue, 12 Mar 2013 13:19:06 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1363108746 4000 192.74.137.71 (12 Mar 2013 17:19:06 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 12 Mar 2013 17:19:06 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:Uco06MXL3L3AddKAemj9JwB2a3Q= X-Original-Bytes: 2256 Content-Type: text/plain; charset=us-ascii Date: 2013-03-12T13:19:06-04:00 List-Id: "Dmitry A. Kazakov" writes: > The semantics of 'Pred and 'Succ shall be properly defined in terms of > convariance of the argument and the result. There are arguments for and > against contravariant results. It goes straight to the circle-ellipse > controversy. The profile of 'Succ is given in RM-3.5(23): function S'Succ (Arg: S'Base) return S'Base; It's neither contravariant nor covariant -- it's invariant. One way to think of it is that S'Succ is just a shorthand for S'Base'Succ. I admit that's somewhat confusing, but it's just like operator "+" -- there's no "+" specific to Positive, nor is there 'Succ specific to Positive -- both operate on Integer'Base, and don't do any range checking on their parameters or result. > As Robert pointed out Ada tends to contravariance for numeric operations. > But it is not a trivial choice for 'Pred, 'Succ, 'Range. Consider > > for I in Prime'Range loop -- What is this supposed to mean? > ... It doesn't mean anything -- it's illegal. - Bob