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!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Comments requested for a couple of Ada-Comments submissions Date: Thu, 10 Jul 2014 17:30:28 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 11 Jul 2014 00:30:30 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="ec00b5351686c67721798cbf9cd968b0"; logging-data="21202"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+dLUJLe5HxTkGWyc69+Lh/RT7GgRhoPtA=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:s8zzTowk7LxzK+GrzIM+xj2L3Sg= Xref: news.eternal-september.org comp.lang.ada:20855 Date: 2014-07-10T17:30:28-07:00 List-Id: On 07/10/2014 05:02 PM, Simon Clubley wrote: > > This, to put it mildly, is ugly. It seems to me that Ada's way of doing this is the least ugly of most languages. Turn_On : declare T : Register_Info := Register; begin -- Turn_On T.On := True; Register := T; end Turn_On; Show me any commonly used language that is less ugly than that. I don't see that there is anything here that the ARG would want to take action on, especially given that Randy said they're only interested in things that are hard or impossible to do in Ada. This is clearly not hard or impossible. Sometimes these devices have fields that have to have zero written to them, but might be non-zero when read. For those cases, Ada looks even better: Turn_On : declare T : Register_Info := Register; begin -- Turn_On Register := (On => True, Zork => T.Piffle, Elffip => T.Kroz, others => 0); end Turn_On; -- Jeff Carter "Spam! Spam! Spam! Spam! Spam! Spam! Spam! Spam!" Monty Python's Flying Circus 53