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,1116ece181be1aea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-09 01:09:46 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!yellow.newsread.com!netaxs.com!newsread.com!newsfeed.stueberl.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: Counter-proposal for variable arrays Date: Thu, 09 Oct 2003 10:19:14 +0200 Message-ID: <725aovsqh10dv5p5nh1e7k2qvjjcqustsa@4ax.com> References: <3F7B1076.8060106@comcast.net> <5mknnv4u96qqudrt4bd8n4t1cljp2fjlp8@4ax.com> <1065215180.95094@master.nyc.kbcfp.com> <19p2ovk1jh4krn2h5cql44p37ovf6va99i@4ax.com> <4pe7ov0gsepk8p8cq88ropvq4sookdhatk@4ax.com> <1065635640.270857@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: news.uni-berlin.de 1065686985 18848241 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:520 Date: 2003-10-09T10:19:14+02:00 List-Id: On Wed, 08 Oct 2003 13:54:00 -0400, Hyman Rosen wrote: >Dmitry A. Kazakov wrote: >> Only when you create a concrete instance of the type, an object, > > you have to constrain it, i.e. to say which types are allowed there > > or how many characters it will hold. This is the whole idea. > >So now you will have arrays whose stride as well as bounds >is a runtime property. Exactly. >We should equally allow records with >unconstrained field types, and let the constraints get set >upon creation. It is already possible. Though there should be a work done for the tagged types. My another proposal is to treat the type tag of a class-wide as a discrimant. This would allow a lot of very interesting things to do. To start with, one will be able to assign class-wide objects, intrigued? >Then the field offsets themselves could be >runtime properties too. It is already so. Consider: type Tricky (I, J : Positive) is record X : String (1..I); Y : String (1..J); end record; The offset to Y is variable and depends on the value of I. >Then we could have classwide objects >in records. Right. See above, the tags has to be exposed as discriminants. >It's all doable. I guess the question is whether you get >enough bang for the buck to make it worthwhile to specify >and implement. My inclination is no, but anyone who really >wants it could have a go at the GNAT sources and make a >proof of concept. For good or bad, neither Ada is C++ nor I have Stroustrup's influence on the language design. There should be some consensus reached. And of course, any change undertaken have to be carefully reviewed. So far I observe little interest in further evolving Ada's ADT concept. It is a pity, because in my view Ada has the best potential to become the first of the next generation languages. (:-() --- Regards, Dmitry Kazakov www.dmitry-kazakov.de