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-Thread: 103376,c406e0c4a6eb74ed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request Date: Fri, 10 Sep 2004 17:06:58 +0200 Message-ID: <2i17f5mxatiy$.h5ltdonsykzb.dlg@40tude.net> References: <49dc98cf.0408110556.18ae7df@posting.google.com> <6F2Yc.848$8d1.621@newsread2.news.pas.earthlink.net> <413e2fbd$0$30586$626a14ce@news.free.fr> <9snhizowcwg9.16smaxkxhyu67$.dlg@40tude.net> <1m4nnmjq31u5p.1ufrf06w53qsz.dlg@40tude.net> <7aytmncfkoep.1rju9m4v4xl21.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-7" Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de iMAqkP2kjFqaP83g+fysRwI/46aTFh57TLBZ+wTW67rjsRjk8= User-Agent: 40tude_Dialog/2.0.12.1 Xref: g2news1.google.com comp.lang.ada:3564 Date: 2004-09-10T17:06:58+02:00 List-Id: On 09 Sep 2004 21:16:24 -0400, jayessay wrote: > "Dmitry A. Kazakov" writes: > >> On 08 Sep 2004 19:23:40 -0400, jayessay wrote: >> >>> "Dmitry A. Kazakov" writes: >>> >>>> On 08 Sep 2004 12:26:54 -0400, jayessay wrote: >>>> >>> No, I'm not. Simply put variable don't exist at runtime. I'm talking >>> about every value having its type with it. >> >> But that's exactly what a [dynamically] polymorphic object is. > > No, this is just wrong. ARM 3.9(3) reads: "An object of a tagged type has an associated (run-time) tag that identifies the specific tagged type used to create the object originally. The tag of an operand of a class-wide tagged type T�Class controls which subprogram body is to be executed when a primitive subprogram of type T is applied to the operand (see 3.9.2); using a tag to control which body to execute is called dispatching." >>>> As Unchecked_Conversion does. >>> >>> I guess i've forgotten this (never really used it much). So, when >>> 13.9(5) says an instance of this returns a value whose "representation >>> is the same as that of the source, >> >> ARM then continues to the list of conditions to be satisfied to make the >> above true. >> >> In other cases the result might be quite different. For example when you >> convert between a general access and pool specific access types. Former are >> probably fat pointers, latter could be tiny integers, depending on the >> compiler, of course. >> >>> how is that functionally different from a cast? >> >> It is a cast. > > You're contradicting your own explanation. By your own comments above > it is (at least sometimes) _not_ a cast. It depends on what you understand under "cast". Anyway, what should prove [in-]existence of casts? >> How so? Types do exist at run-time. Consider it as if the *unused* type >> information were optimized out. > > No they do not. This is plainly wrong. Statically known information remains known at run time. This is what the word "static" means. > If they did you could create them, query them, change > them, assign them to variables, etc. This has nothing to do with the issue, but also wrong. > Now, you and I both know you > can't do any of this with Ada types at runtime. Again wrong: 1. Dynamic type creation in Ada: procedure Foo (First, Last : Integer) is type Dynamic_Array is array (Integer range First..Last) of Integer; begin ... end Foo; 2. Type querying in Ada: procedure Baz (Object : X'Class) is begin Put_Line ("My type is:" & External_Tag (Object'Tag)); end Baz; 3. Changing types in Ada. Types can be dynamically constrained in Ada. AFAIK, types will be dynamically extensible in the coming release of Ada standard. 4. Type variables. True, Ada does not have types as the first-class objects. So you cannot put type in a variable. For this one should have types types. >>> It's _not_ prevented - it isn't _required_ to! >> >> That's silly. Why not to require to check what could be checked? > > Because it breaks many things in dynamic systems, that's why. It breaks nothing, re-read it carefully: "to check what *could* be checked". Nobody claims that *all* types have to be checked statically. This would exclude dynamic polymorphism. Again, why not to check what can be checked? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de