From: AdaMagica on
> I think you all missed my point: allowing the programmer to specify a
> constraint in situations where the constraint will not be enforced

But the prefix of an attribute reference does not specify a
constraint.

Integer'Min, Positive'Min, Natural'Min are all the same.
From: AdaMagica on
> > But the prefix of an attribute reference does not specify a
> > constraint.
>
> > Integer'Min, Positive'Min, Natural'Min are all the same.
>
> But it should, at least in the case of Min/Max.
> Integer'Min, Positive'Min, Natural'Min being all the same breaches the
> spirit of the Ada language (what you see is what it means).
> A topic for Ada 201z...

We could have had is thus and unconstrained Min as Positive'Base'Min
when Min was introduced...

But it is as it is, and your proposal would be a severe
incompatibility, so it won't fly.

From: Martin on
On Apr 28, 12:47 pm, AdaMagica <christoph.gr...(a)eurocopter.com> wrote:
> > > But the prefix of an attribute reference does not specify a
> > > constraint.
>
> > > Integer'Min, Positive'Min, Natural'Min are all the same.
>
> > But it should, at least in the case of Min/Max.
> > Integer'Min, Positive'Min, Natural'Min being all the same breaches the
> > spirit of the Ada language (what you see is what it means).
> > A topic for Ada 201z...
>
> We could have had is thus and unconstrained Min as Positive'Base'Min
> when Min was introduced...
>
> But it is as it is, and your proposal would be a severe
> incompatibility, so it won't fly.

How about new attributes 'Safe_Min / ''Safe_Max?

-- Martin
From: Dmitry A. Kazakov on
On Wed, 28 Apr 2010 04:47:42 -0700 (PDT), AdaMagica wrote:

>>> But the prefix of an attribute reference does not specify a
>>> constraint.
>>
>>> Integer'Min, Positive'Min, Natural'Min are all the same.
>>
>> But it should, at least in the case of Min/Max.
>> Integer'Min, Positive'Min, Natural'Min being all the same breaches the
>> spirit of the Ada language (what you see is what it means).
>> A topic for Ada 201z...
>
> We could have had is thus and unconstrained Min as Positive'Base'Min
> when Min was introduced...
>
> But it is as it is, and your proposal would be a severe
> incompatibility, so it won't fly.

Well, the proposal might be to fix rather the issue of the superfluous
subtype specification. Obviously Max (and many other attributes) are
primitive operations and need no subtype to specify. So:

X'Succ, X'Pred, X'Image

Specifically max and min should be a dyadic operations:

function "max" (Left, Right : T) return T'Base;

(and, please, no new reserved keywords!)

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
From: Georg Bauhaus on
On 28.04.10 15:41, Dmitry A. Kazakov wrote:

> Well, the proposal might be to fix rather the issue of the superfluous
> subtype specification. Obviously Max (and many other attributes) are
> primitive operations and need no subtype to specify. So:
>
> X'Succ, X'Pred, X'Image

That'll be fun:

C'Succ'Succ

'C'&'&''Succ

''''Succ

(M + N)'Succ


..-)