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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,73cb216d191f0fef X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.24.132 with SMTP id u4mr1241189wif.6.1364344255643; Tue, 26 Mar 2013 17:30:55 -0700 (PDT) Path: p18ni19766wiv.0!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border2.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsgate.cuhk.edu.hk!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Is this expected behavior or not Date: Wed, 20 Mar 2013 12:21:55 +0100 Organization: cbb software GmbH Message-ID: <1raubw1sk48ca$.69rdgczvnnf.dlg@40tude.net> References: <51408e81$0$6577$9b4e6d93@newsspool3.arcor-online.net> <11rcs3gg4taww$.bylek8fsshyz$.dlg@40tude.net> <99929f93-b80f-47c3-8a37-c81002733754@googlegroups.com> <87ec4b1d-f7cd-49a4-8cff-d44aeb76a1ad@googlegroups.com> <78103a2f-5d19-4378-b211-1917175d5694@googlegroups.com> <3p6p8k0yfly7.ctazdw7fc5so$.dlg@40tude.net> <1jtvzi1v65aqm.1k5ejsveno59f.dlg@40tude.net> <1hvv2kd9smnfx.6spgz9thd1mh$.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2013-03-20T12:21:55+01:00 List-Id: On Tue, 19 Mar 2013 16:19:54 -0500, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:vo941i7imo8t$.1jjjox9r1hkqa.dlg@40tude.net... >> It is well possible. Consider tag a constraint as array bounds are. Allow >> constraints (=discriminants) passed independently as compilers already do >> for array bounds. This gives you array interfaces while keeping arrays as >> they are, plain arrays. > > No, it's not possible. In order to solve the string problem, we have to > decouple the representation and the interface. But for slices, you have to > know the representation in order to be able to pass it meaningfully. You pass dope and reference. > Moreover, the representation is not necessarily an array (UTF-8 encoding is > not a normal array if you are using the character interface). In the dope you have type tag to handle class-wide instances. You will dispatch to the body which implements indexing for UTF-8 encoded arrays of characters. >>> My rough proposed Root_String_Type would be an abstract tagged type, >> >> I definitely don't want strings tagged. > > Then forget it. All composite types ought to be tagged; the root of the > existing problem is that arrays aren't tagged. If you use "tagged" in RM sense as a class of types which a tag embedded into the representation, then no. That is not the problem and I don't want arrays to have tag. I want array interfaces and an ability to have objects of the type A'Class where A is an array type. The representation of A'Class will have tag. The representation of A will not. >>> but it >>> wouldn't provide slices directly (it would provide functions for that >>> purpose). But that's OK, because such a construct would have to be >>> alongside >>> the existing string types; we can't replace or change them in any >>> significant way and I think that means we'll have to start over. >> >> But we can. The point is that the existing type system of Ada is fully >> compatible with the system I am talking about. There is no compatibility >> issues. > > You're dreaming - it's not possible. As soon as you change the inheritance > rules (which you have to do), you'll break the semantics of derived types > (they'll inherit different operations). I won't change these rules. Remember, in my model they already inherit, they will keep on doing that, just explicitly rather than implicitly like now. > I don't think we > need 'Class for access types, You need them because access types shall implement "access interface." We need access interface for user-defined referential types. > because the effect is essentially the same as > what we already have for anonymous access types I don't see why. I want to be able to declare my own type as an access type: type Handle is private access T; private type Handle is record Connection : DB_Connection_Handle; Table : Unbounded_String; ... -- etc end record; with the semantics of new, Free, dereferencing defined as I wish. And I want to be able to write a class-wide subprogram which would take both Handle and some plain access type as a parameter. This is well possible in the T'Class is constructed by adding type tag. >> Presently, I am unable to compile my project under any 32-bit system >> because GNAT compiler needs 3GB an more to instantiate all generics, apart >> from that this takes 3-4 hours on an i7, and the project has hundreds of >> meaningless packages which only purpose is to instantiate. > > For someone that hates generics, why would you have so many? I have: 1. I/O modes of input, output, duplex; 2. Specific values of types: Integer_n, Unsigned_n, String, Wide_String, IEEE_Float_n; 3. Devices responsible to handle "registers" holding values; 4. Handles to registers; 5. Publishing value change events and monitors of; 6. Much whished, but practically impossible to do, bounded values. Here you are. On top of that there exist immense problems with explicit conversions which needed between, say, a handle to a duplex register, when an output one is expected. It is not just N instances it is also 2**N combinations of cross operations. > Maybe you're trying too hard to be Object-Oriented; I am trying to have it type-safe. It would be just impossible to do in Ada 95. In Ada 2005, which has Java interfaces, it gives what I described. Lack of MI, which is worked around using generics. I guess that MI would slash the amount of code by ten. MD would do another tenth. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de