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-03 09:00:58 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed.news.nacamar.de!newsfeed.freenet.de!news2.euro.net!ash.uu.net!spool0902.news.uu.net!not-for-mail Date: Mon, 03 Feb 2003 12:00:55 -0500 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030202 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: <1043880843.44251@master.nyc.kbcfp.com> <1043938782.244443@master.nyc.kbcfp.com> <25ji3v8n915cnnnaqpjvm4f7i01a66r9pf@4ax.com> <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> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1044291655.564852@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@fixedcost.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1044291656 25773 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:33734 Date: 2003-02-03T12:00:55-05:00 List-Id: Dmitry A. Kazakov wrote: > But this is an unsatisfactory definition. It satisfies me, so it is not unsatisfactory for everyone. > It involves pointers and references, you have to define what they are. A (data) pointer is an object which holds the address of another object, where "address" is an implementation-defined value which identifies one particular object and no other. A reference is an alternate name for an object. References and pointers are declared with a type which limits the objects to which they may refer. > You have to admit that your "is a" does not work if there are no pointers. Fortunately, the programming language which I use has pointers. > Is an integer in a register "is a" an integer in the memory, on a remote host? I don't care, as C++ regards integers as primitive types. I have no interest at all in philosophical "is a", only in methods of programming. > What does it mean "may call". In C++, it means that the pointer may appear to the left of a '->' and the reference to the left of a '.', with the right-hand side looking like a call - that is, a method name defined in the class which is the static type of the pointer or reference or one of its base classes, followed by parenthesized arguments. > In FORTRAN-IV you may call a function passing > INTEGER*4 instead of REAL.*4! How nice for FORTRAN-IV. > It is much simplier just to say an instance of B is substitutable for > a parameter where A is required. With further clarification what > "substitutable" means. If it was much simpler we wouldn't be having this little chat. > But each procedure is related to the type of its parameters. Not for generics. > This clearly violates DbC principle. If I attempt to instantiate a generic procedure with a type which does not support the operations used, the code will not even compile. How in the world can this be construed as violating DbC? > The only contract of the procedure is that it takes > an object of some known type Who made you God of what a contract is? Why is a set of required operations a worse contract than a type? > If you restrict this set of operation and want to expose > this fact, then it is *another* type. Correct. But it would be mind-numbingly tedious to have to name these types, and modify all the used types to adopt the new interface, and to make adapters for the fundamental types, and fortunately C++ doesn't require it. In Ada, because of lack of MI, it wouldn't work at all. > They are not useless, they constitute the type. That's the point. They are useless because the procedure doesn't need them. Why must the procedure specify that its parameters are required to have operations that won't be used? What is to limit this infinite set of possible but unused operations?