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: backlog1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!goblin3!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Clubley Newsgroups: comp.lang.ada Subject: Re: a new language, designed for safety ! Date: Thu, 12 Jun 2014 22:12:55 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <1402308235.2520.153.camel@pascal.home.net> <85ioo9yukk.fsf@stephe-leake.org> <9qednXOIGNDuLQXORVn_vwA@giganews.com> <1872904482424209024.314619laguest-archeia.com@nntp.aioe.org> <810507a4-427e-42bb-a468-e5939a4470db@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 12 Jun 2014 22:12:55 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="e458ff8b81bc0c159989eb0e36c6e372"; logging-data="17673"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+moNaNnMbB7SuKm3gt5kaLSL30O/2AiT8=" User-Agent: slrn/0.9.8.1 (VMS/Multinet) Cancel-Lock: sha1:qbxp9HVXRC4mR9dA9Mz1yo4tSP0= Xref: number.nntp.dca.giganews.com comp.lang.ada:186874 Date: 2014-06-12T22:12:55+00:00 List-Id: On 2014-06-12, björn lundin wrote: > Den torsdagen den 12:e juni 2014 kl. 13:24:30 UTC+2 skrev Peter Chapin: > >> Consider Ada's arrays. They are fairly primitive and close to the >> machine. > > And simple to use, read and write. A maintainer's dream. > >>Compare them with, say, lists in Haskell which are fully >> dynamic by default and come endowed with a powerful list comprehension >> sublanguage that makes generating and manipulating lists very simple. > > But usually costing a lot in readability. After a couple of years, > the code is difficult to read/maintain. > I've sometimes wondered if it would be a good thing to add associative arrays, including dynamic ones, directly to Ada without having to use containers. To make it clear in the code what is going on and in order to try to avoid the addition of junk keys into the array due to programming errors, I would require an explicit call to add a new key to the array. In Ada code, a simple assignment would not be safe enough for me. 'Range would allow you to iterate over the array very cleanly. Note that it's only the method of referencing array elements here (keyed versus integer index) that I am talking about. The data type of the array elements would still be declared in the usual Ada way. Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world