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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a6b:8e83:: with SMTP id q125mr55126831iod.9.1546811896620; Sun, 06 Jan 2019 13:58:16 -0800 (PST) X-Received: by 2002:a9d:bd5:: with SMTP id 79mr1195439oth.7.1546811896460; Sun, 06 Jan 2019 13:58:16 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.166.215.MISMATCH!k10no594691itk.0!news-out.google.com!v71ni566ita.0!nntp.google.com!q69no593604itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 6 Jan 2019 13:58:16 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.168.19.89; posting-account=O_NgcgoAAABs6pgCjroQBmOBL5ZZGPUc NNTP-Posting-Host: 85.168.19.89 References: <2a6929c5-72fa-4d84-953a-44ea4597ab38@googlegroups.com> <9e6b4219-d6ba-4c89-814d-5ea6e48ed8ea@googlegroups.com> <9179093f-4765-47a9-9dc6-147c9d7d6c56@googlegroups.com> <809a445d-cf73-4525-a732-67dbf24e8394@googlegroups.com> <1e4f3e15-afe4-4ca3-b039-11c6918f9977@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: class wide iterable (and indexable) From: George Shapovalov Injection-Date: Sun, 06 Jan 2019 21:58:16 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:55231 Date: 2019-01-06T13:58:16-08:00 List-Id: Just on a small specifics here. On Sunday, January 6, 2019 at 9:18:09 PM UTC+1, Dmitry A. Kazakov wrote: > You override getter and/or setter. Whatever representation of inherited= =20 > bases stay unless overridden as a whole. The similar approach is used=20 > for discriminants: either extension or overhaul. (The latter case may=20 > not be limited, it must be strictly by-value) So, out of 3 variants, you select the first one - to keep all things around= and accumulate as you go, which *is* the safest, and probably the most sen= sible, way to do it. But this will not fly universally - what about situati= ons where you have billions of copies of your record (all with different da= ta). Wasting even small amounts per entry (and as stuff accumulates over ye= ars, that waste may become the majority of space taken) is a big no-no for = some scenarios. So, for a "universal language" you must have a provision of= data layout control (which Ada has) extended to such situations. Which mea= ns a more complex field handling. Which, in turn, leads either to exposing = this to developers, thus augmenting abuse and insanity, or a really tricky = and complex "garbage collection" working on dynamic type hierarchies. I am = afraid there is no easy solution to that. And that compromise of treating "= data" and "code" separately seems an acceptable tradeoff (even if yes, math= ematically, it is possible to handle them in a universal way).. But then it is true, with discriminants it is already violated. So I guess = treating data the same way is the next natural step. Oh well, most develope= rs will either be too scared to use that or will do nonsemsical things with= out proper understanding, leading to failed software and more possibilities= for the rest of us to do things properly :).