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=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 07:35:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newshosting.com!news-xfer1.atl.newshosting.com!uunet!dca.uu.net!ash.uu.net!spool0902.news.uu.net!not-for-mail Date: Wed, 05 Feb 2003 10:35:38 -0500 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030130 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Anybody in US using ADA ? One silly idea.. 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> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1044459338.831005@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1044459339 4881 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:33814 Date: 2003-02-05T10:35:38-05:00 List-Id: Dmitry A. Kazakov wrote: >>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. Again, not in the same sense that most people use for this term. When I've seen precondition used, it's always referred to a runtime property of the object, such as "> 5" or "is sorted". > It is incomplete, because it should be > "the procedure takes a parameter of the type X". But I am writing a generic procedure, so the procedure does not specify the type of its parameter in any way other than by a "placeholder" type name. > 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. I find this to be a completely vacuous distinction. > 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 seem to refuse to face the fact that there is no "X" other than as a placeholder name. There is no "subset of operations of X", and there is no "set of operations of X" other than that specified by the implementation of the procedure. When the generic is instantiated with an actual type, the compiler compares the set of operations required by the procedure with the set of operations supported by the type, and if they conform, the instantiation succeeds. If they do not, the compiler issues an error message and fails to compile the code. > Right, unused operations are still useful. So you are saying that the vector *should* require that any object type that it can hold must support an Arccoth operation? You are making absolutely no sense.