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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: class wide iterable (and indexable) Date: Mon, 21 Jan 2019 17:15:03 -0600 Organization: JSA Research & Innovation Message-ID: References: <2a6929c5-72fa-4d84-953a-44ea4597ab38@googlegroups.com> <75328dc5-fc59-4228-b77e-77ba6e5101c3@googlegroups.com> Injection-Date: Mon, 21 Jan 2019 23:15:03 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="19966"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader01.eternal-september.org comp.lang.ada:55320 Date: 2019-01-21T17:15:03-06:00 List-Id: "Olivier Henley" wrote in message news:75328dc5-fc59-4228-b77e-77ba6e5101c3@googlegroups.com... > >> > The people doing that like a lot of about C already (why the mass >> > hysteria >> > on that, I don't know. Perhaps they don't even know that you can do >> > better?). If I personally redesigned Ada, it would be a lot like the >> > current >> > Ada with some warts removed (strings and arrays in particular). >> >> See, that is the same mindset! (:-)) > > What are the warts for strings and arrays? A string is not really an array. That idea made some sense in Ada 83, when the only portable character set was 7-bit ASCII. But today there are many representations, and treating each one of them as a different unrelated type leads to Wide_Wide_ nonsense, and even that doesn't have a decent solution for UTF-8 and UTF-16 encoded text. Moreover, if you view an array as a basic building block, not something of interest by itself, you don't need fancy array operations that are mainly useful for strings (ordering operators, slices, etc.). For Ada, of course, these things are a sunk cost, but in a new Ada-like language, they would be impedements to getting an implementation built. Moreover, in a new Ada-like language, it would make the most sense to completely unify containers and arrays, which would mean that arrays would be more like Vectors than like Ada arrays. For instance, in a Vector, the lower bound is fixed for all values of a particular type. That would eliminate a lot of programming errors that happen in Ada programs (many programs fail to deal with unusual lower bounds, because it's hard to get right). Randy.