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-03 08:12:25 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed.r-kom.de!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: Mon, 03 Feb 2003 17:12:24 +0100 Message-ID: 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> 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 1044288744 38068699 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:33727 Date: 2003-02-03T17:12:24+01:00 List-Id: On Mon, 03 Feb 2003 08:26:33 -0500, Hyman Rosen wrote: >Dmitry A. Kazakov wrote: >> Then you should explain what "is a" does mean. It is definitely not >> mathematical =, as memcpy shows. > >Memcpy is not a "mathematical =" but a procedure which copies >a bunch of bytes in memory. You won't like my explanation of >"is a" becuase it's purely practical - "B is a A" means that >a pointer or reference to A may hold a pointer or reference to >an object of type B (or a type which "is a B") and may call >methods of A using that pointer or reference. But this is an unsatisfactory definition. It involves pointers and references, you have to define what they are. You have to admit that your "is a" does not work if there are no pointers. Is an integer in a register "is a" an integer in the memory, on a remote host? What does it mean "may call". In FORTRAN-IV you may call a function passing INTEGER*4 instead of REAL.*4! 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 you define a type, say, "field". > >But we are not talking about defining a type, but about >defining a procedure. But each procedure is related to the type of its parameters. Then a type is a set of values and operations on them. So to define a type is to define these operations as well. >This procedure defines an interface >implicitly by virtue of the operations it uses. This clearly violates DbC principle. The only contract of the procedure is that it takes an object of some known type [+ possibly pre- and postconditions]. The type of the object determines all operations the procedure may use. If you restrict this set of operation and want to expose this fact, then it is *another* type. >You then >claim that this implicit interface needs to be augmented >with operations that the procedure doesn't need, and then >that types upon which the procedure operates need to have >these useless operations, and that this somehow achieves >safety! I am just baffled. They are not useless, they constitute the type. That's the point. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de