comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Quantified expressions: no support for restriction predicates
Date: Mon, 30 Apr 2012 21:48:59 -0500
Date: 2012-04-30T21:48:59-05:00	[thread overview]
Message-ID: <jnniuv$2f2$1@munin.nbi.dk> (raw)
In-Reply-To: wcc7gwywcuh.fsf@shell01.TheWorld.com

"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message 
news:wcc7gwywcuh.fsf@shell01.TheWorld.com...
> phil.clayton@lineone.net writes:
>
>> Is that actually possible for a Dynamic_Predicate?  Section 3.2.4 Subtype 
>> Predicates, para 27/3 says:
>>
>>   The discrete_subtype_definition of a loop_parameter_specification
>>   shall not denote ... or any subtype to which Dynamic_Predicate
>>   specifications apply.
>
> Yeah, I think you're right.  The idea is that we didn't want hidden
> inefficiencies.
>
>    type T is new Integer with
>        Dynamic_Predicate => T mod 10_000 = 0;
>    for X in T loop -- Illegal!
>
> If that were legal, it would probably be grossly inefficient.

Especially if Integer is a 64-bit type in this implementation. :-) My 
examples of this problem always used Long_Integer for this reason:

    type T is new Long_Integer with
        Dynamic_Predicate => T mod 2**30 = 0;
    for X in T loop -- Illegal!

                                        Randy.






  reply	other threads:[~2012-05-01  2:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-27  0:29 Quantified expressions: no support for restriction predicates phil.clayton
2012-04-27 23:43 ` Randy Brukardt
2012-04-28 11:30   ` phil.clayton
2012-04-29 14:03     ` Robert A Duff
2012-04-29 18:37       ` phil.clayton
2012-04-29 19:35         ` Robert A Duff
2012-05-01  2:48           ` Randy Brukardt [this message]
2012-05-01 11:35           ` phil.clayton
2012-04-30 15:57     ` Adam Beneschan
2012-05-01 11:14       ` phil.clayton
replies disabled

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