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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,103b407e8b68350b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-05 04:53:59 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.ems.psu.edu!news.litech.org!eurocyber.net!newsfeed.muc.eurocyber.net!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Anybody in US using ADA ? One silly idea.. Date: Wed, 05 Feb 2003 13:53:50 +0100 Message-ID: References: <1043949507.331484@master.nyc.kbcfp.com> <1044025336.3067@master.nyc.kbcfp.com> <1044033063.693737@master.nyc.kbcfp.com> <2b9s3vo3bbnaikqd6d4jpppfflfq2kbgfu@4ax.com> <1044278793.419261@master.nyc.kbcfp.com> <1044371424.691675@master.nyc.kbcfp.com> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1044449631 39841616 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:33807 Date: 2003-02-05T13:53:50+01:00 List-Id: On Tue, 04 Feb 2003 10:10:24 -0500, Hyman Rosen wrote: >Dmitry A. Kazakov wrote: >> Do you remember the last time you used Arccoth? Is it useless? Should >> an Ada compiler implement it as exp, because the program I am writing >> at the moment does not use it? >> >> Useless for a particular program /= useless for any possible program. > >I repeat - I am writing a procedure, not a type. That procedure takes >a parameter, and the procedure requires that the parameter supports a >certain set of operations. That's called precondition. However the above statement is partially incomplete and partially wrong. It is incomplete, because it should be "the procedure takes a parameter of the type X". It is wrong, because parameters support no operations. It is the type X which has a set of operations, which can be applied to parameters of the type. Returning to the precondition, to require a subset of operations of X <= to require X. So your precondition is automatically satisfied by the requirement that the parameter is of X. >You want me to force that parameter to have >more operations than the procedure needs. The parameter can be used in the operations of its type. No more no less. It is irrelevant which particular operations or values of the type the procedure uses. >I *still* don't understand why. >To answer your question, I have never created a type that was >required to have an Arccoth operation. I would be annoyed if, for >example, the vector class template that I use required that the type >of the held object must support Arccoth. This does not make the >Arccoth operation useless. Right, unused operations are still useful. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de