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 01:59:43 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!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 10:59:41 +0100 Message-ID: <0c9s3vgk6hrt4t65sasn2jcr02jdjaspef@4ax.com> References: <1043773909.385612@master.nyc.kbcfp.com> <1043855067.848326@master.nyc.kbcfp.com> <1043938878.313737@master.nyc.kbcfp.com> <1043949677.919365@master.nyc.kbcfp.com> <1044025904.464559@master.nyc.kbcfp.com> <1044033916.943076@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 1044266381 38294565 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:33715 Date: 2003-02-03T10:59:41+01:00 List-Id: On Fri, 31 Jan 2003 12:25:16 -0500, Hyman Rosen wrote: >Dmitry A. Kazakov wrote: >> Do you know, an integer is definitely a real number. So you should >> clarify whether you are talking about mathematical objects or their >> computer models. > >Computer models. As I said, the main mistake of OO is confusing >the computer objects with the things they are partially modelling. People make mistakes. It is a result of trying to find a philosophy behind OO. >> This why the representation of a particular type should be no issue, >> when subtyping is considered. > >Perhaps for your concept of subtyping, but not for mine. But why? Why do you want to fix reperesentations, instead of letting a programmer to say what he wants. Note, I am not against inheriting representations when it is feasible, but sometimes it is not. >If you want Ada-style view conversions, that does not have >anything to do with subtyping, just interconvertability. >To quote the Ada RM: > "In a view conversion for an untagged type, the target type > shall be convertible (back) to the operand type." > >> However I see no sense in appealing to authority. If in your view to >> say that an object has a type is not feasible, then please, show why. > >I should apologize for my unfamiliarity with Ada. An Ada subtype >is a restricted subset of its parent type. [+ having exactly same representation as the parent] >But the conventional >OO term subtype used for derived types is not such a restriction, >and indeed Ada calls that a derived type, not a subtype. Yes, but in my why all this is same thing. Whether I write subtype X is Y ; or type X is new Y with ; I produce a new type Y substitutable for X. How do we call it is no matter. Also no matter is how the substitutability is ensured: either by preserving the representation, or by inheriting the representation or by replacing the representation. Observe similarity in how new methods are constructed. You can 1. inherit a method as-is [same representation] 2. extend a method (constructors, destructors in C++, aggregates in Ada) [extended representation] 3. override a method [replace representation] Isn't it strange, that 3 is available for methods, but not for data? >Anyway, I don't say that an object doesn't have a type, but that >it can simultaneously have many types. Applying the Ada definition >works perfectly well in this context. If my object is simultaneously >an A and a B and a C, then it is a run-time entity which contains a >value of the set of values of A, and a value of the set of values of >B, and a value of the set of values of C. Consider a simplier approach. An object has exactly one [specific] type. Either A, B or C. If you want an object looking as if it had several specific types, then its type is none of them. Its type is a *set* of types {A, B, C}. This is *another* type and its representation may differ form one of A, B, C. For example it may consist of a type tag to distinguish which specific object it mimics right now + the specific object value. In Ada such types are called class-wide. One could pack the tag into the specific objects (as C++ does), but this would conceptually change nothing. I can always say that a given object as a type [exactly one]. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de