comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Comments requested for a couple of Ada-Comments submissions
Date: Thu, 10 Jul 2014 17:30:28 -0700
Date: 2014-07-10T17:30:28-07:00	[thread overview]
Message-ID: <lpnb74$kmi$1@dont-email.me> (raw)
In-Reply-To: <lpn9ic$acs$1@dont-email.me>

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


  reply	other threads:[~2014-07-11  0:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11  0:02 Comments requested for a couple of Ada-Comments submissions Simon Clubley
2014-07-11  0:30 ` Jeffrey Carter [this message]
2014-07-11  4:16   ` Randy Brukardt
2014-07-11 16:04     ` Niklas Holsti
2014-07-11 16:24       ` Dan'l Miller
2014-07-11 20:02       ` Simon Clubley
2014-07-12  5:52         ` Niklas Holsti
2014-07-11  4:26 ` Randy Brukardt
2014-07-11  7:05   ` Simon Clubley
2014-07-11  4:56 ` Shark8
2014-07-11 15:35   ` Adam Beneschan
2014-07-11 17:26     ` Niklas Holsti
2014-07-11 17:55       ` Adam Beneschan
2014-07-11 18:00         ` Simon Wright
2014-07-11 19:07           ` Georg Bauhaus
2014-07-11 19:10           ` Dmitry A. Kazakov
2014-07-11 19:16             ` Niklas Holsti
2014-07-11 19:35               ` Dmitry A. Kazakov
2014-07-11 21:24             ` Randy Brukardt
2014-07-11 21:46               ` Shark8
2014-07-11 19:30       ` Simon Clubley
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox