comp.lang.ada
 help / color / mirror / Atom feed
From: reinert <reinkor@gmail.com>
Subject: Re: How to make tasks to run in parallel
Date: Tue, 17 Oct 2017 02:06:19 -0700 (PDT)
Date: 2017-10-17T02:06:19-07:00	[thread overview]
Message-ID: <73fc1d87-09fc-49fb-be48-121969a9cecd@googlegroups.com> (raw)
In-Reply-To: <os4chu$v6m$1@gioia.aioe.org>

On Tuesday, October 17, 2017 at 9:47:11 AM UTC+2, Dmitry A. Kazakov wrote:
> On 17/10/2017 09:32, reinert wrote:
> 
> > It sometimes use:
> > "type Real is Digits 18;"
> > 
> > I see the point (sometimes) using "substype" here. But I also like to
> > avoid to add meter and seconds :-) I.e. to be "clean" with respect
> > to  dimensions/units.
> 
> GNAT has a non-standard dimension aspect which does that.
> 
> But that is a wrong approach. Dimension cannot be made a part of the 
> type. Because that would preclude major use cases where dimensioned 
> values are actually used. Dimension should be subtype constraint.
> 
> -- 
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de

I may have learned several thing before the evening :-) 

My current understanding of Ada is mainly from John Barnes, "Programming in Ada 2012".  On page 243 he introduces new (derived) types for number of apples and oranges, so one can write:

No_Of_Apples := No_Of_Apples + 1;
No_Of_Oranges := No_Of_Oranges + 1;

But one cannot write:

No_Of_Apples := No_Of_Oranges + 1; -- error

Using derived types here seems "clean" to me and contributing to avoid future errors.

reinert



  parent reply	other threads:[~2017-10-17  9:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17  4:58 How to make tasks to run in parallel reinert
2017-10-17  6:08 ` gautier_niouzes
2017-10-17  7:25   ` reinert
2017-10-17 15:36   ` Jeffrey R. Carter
2017-10-21 12:32   ` Jacob Sparre Andersen
2017-10-17  6:17 ` Per Sandberg
2017-10-17  6:30   ` gautier_niouzes
2017-10-17  7:32     ` reinert
2017-10-17  7:47       ` Dmitry A. Kazakov
2017-10-17  8:06         ` Niklas Holsti
2017-10-17  8:48           ` Dmitry A. Kazakov
2017-10-17 11:13             ` Simon Wright
2017-10-17 12:11               ` Dmitry A. Kazakov
2017-10-17 14:23                 ` AdaMagica
2017-10-17  9:06         ` reinert [this message]
2017-10-17 10:04           ` Dmitry A. Kazakov
2017-10-17  7:29 ` Dmitry A. Kazakov
2017-10-17  7:36   ` reinert
replies disabled

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