Prev: LIACC moved to LIAAD
Next: Announce: qtada,gprbuil and xmlada for Debian, Ubuntu and Gentoo Linux
From: AdaMagica on 28 Apr 2010 06:58 > 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 28 Apr 2010 07:47 > > 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 28 Apr 2010 09:28 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 28 Apr 2010 09:41 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 28 Apr 2010 10:10 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 ..-)
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 Prev: LIACC moved to LIAAD Next: Announce: qtada,gprbuil and xmlada for Debian, Ubuntu and Gentoo Linux |