[J3] Ada contract model for generic packages

Bill Long longb at cray.com
Thu Mar 11 22:18:27 UTC 2021


Hi Ondrej,

I’m not sure what the example is trying to accomplish.  If it is to print out a section of an array, that capability is already built into Fortran.   And example that actually did something would be more illuminating.  Perhaps some mathematical computation that is not already covered by one of the Fortran intrinsics. 

Cheers,
Bill


> On Mar 11, 2021, at 2:25 PM, Ondřej Čertík via J3 <j3 at mailman.j3-fortran.org> wrote:
> 
> Hi Van,
> 
> On Thu, Mar 11, 2021, at 12:09 PM, Van Snyder via J3 wrote:
>> I received this recently from Randy Brukardt, a denizen of WG9:
>> 
>> Ada's contract model for generics requires that a generic body be legal 
>> without knowing any details of the actual parameters of any instance; 
>> this makes it possible to determine the correctness of a generic body 
>> itself, without needing to know of it's instantiation.
>> 
>> This was done in 1995.
>> 
>> The Ada 2012 standard is online.
> 
> If you know Ada, can you please add a section "Ada" here:
> 
> https://github.com/j3-fortran/generics/blob/main/theory/comparison/comparison.md
> 
> And do the example there in Ada? That would help clarify this issue on a concrete problem. If you send me the code I am happy to put it in.
> 
> Ondrej

Bill Long                                                                       longb at hpe.com
Engineer/Master , Fortran Technical Support &   voice:  651-605-9024
Bioinformatics Software Development                      fax:  651-605-9143
Hewlett Packard Enterprise/ 2131 Lindau Lane/  Suite 1000/  Bloomington, MN  55425






More information about the J3 mailing list