comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Formal Subprogram Access
Date: Tue, 13 Feb 2018 18:53:16 -0600
Date: 2018-02-13T18:53:16-06:00	[thread overview]
Message-ID: <p6019s$hmo$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: lyeflpkrh3.fsf@pushface.org

"Simon Wright" <simon@pushface.org> wrote in message 
news:lyeflpkrh3.fsf@pushface.org...
> "Randy Brukardt" <randy@rrsoftware.com> writes:
>
>> There's no such rule in the RM. As Christoph noted, a generic formal
>> subprogram has convention Ada, 'Access is allowed. If you pass an
>> attribute to it, you have to wrap it in a real subprogram for this
>> reason. (There is a lot of code specifically to do this in Janus/Ada,
>> it probably never has been tested outside of a single ACATS test -- I
>> don't think anyone ever has had a reason to pass an attribute like
>> Succ as a formal subprogram.)
>
> In GNAT, I've passed 'Image, 'Value as actuals for corresponding formal
> subprograms.

It should be legal to do that. My point is that I don't think that there are 
many such uses in practice (I've never written one), so it's rather likely 
that the special code to implement those is mostly untested. I'm pretty sure 
that there is a few Ada 83 ACATS tests that do this, but nothing for newer 
attributes (like 'Read).

>   generic
>      type Checked_Type is private;
>      Checked_Type_Name : String;
>      with function "=" (L, R : Checked_Type) return Boolean is <>;
>      with function Value (S : String) return Checked_Type is <>;
>      with function Image (V : Checked_Type) return String is <>;
>   package Check_Passed_Value is
>
> Which ACATS test should have caught that (or any other attribute, of
> course)?

I don't know of any easy way to find that out, and I don't have time to read 
roughly 4000 tests to find one. Sorry.

> I see that the GCC-based tests that I've been working on at
> https://github.com/simonjwright/ACATS wouldn't necessarily catch all the
> errors expected in the B (and L?) tests: for example, BC70009 reports 4
> compilation errors, which counts as a success because of course B tests
> are expected to fail, but doesn't check that all the expected errors
> have in fact been caught. (In this case, 4 was correct.) I should check
> the grading tool, though I'm not sure that complete conformance checks
> are justified in this context - it's more to ensure that some feature
> hasn't been broken.

I  have a set of tools for running the grading tool with GNAT. I've been 
waiting to find some time to finish vetting the results, which I've recently 
done. [Although I really ought to redo it with GNAT 18.1.] So I'll be 
posting them soon as "submitted tests" (since compiler-specific stuff 
doesn't belong in the ACATS proper).

                                         Randy.



  reply	other threads:[~2018-02-14  0:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-09 22:11 Formal Subprogram Access Jeffrey R. Carter
2018-02-10  3:03 ` Randy Brukardt
2018-02-10  9:57   ` Jeffrey R. Carter
2018-02-13  5:51     ` Randy Brukardt
2018-02-13  9:24       ` AdaMagica
2018-02-13  9:41         ` Dmitry A. Kazakov
2018-02-13 10:28           ` AdaMagica
2018-02-14  0:47             ` Randy Brukardt
2018-02-14  8:19               ` Dmitry A. Kazakov
2018-02-14 10:01                 ` Jacob Sparre Andersen
2018-02-14 11:07                   ` Dmitry A. Kazakov
2018-02-13 12:24       ` Simon Wright
2018-02-14  0:53         ` Randy Brukardt [this message]
2018-02-14 14:36           ` Simon Wright
2018-02-15  4:56             ` Randy Brukardt
2018-02-15 13:12               ` Simon Clubley
2018-02-15 16:38                 ` Simon Wright
2018-02-15 18:40                   ` Simon Clubley
2018-02-15 16:19               ` Simon Wright
2018-02-15 23:03               ` Randy Brukardt
2018-02-13 17:34       ` Jeffrey R. Carter
2018-02-13 18:31         ` AdaMagica
2018-02-14  0:57           ` Randy Brukardt
2018-02-10 14:55   ` AdaMagica
2018-02-21 17:51 ` Jeffrey R. Carter
replies disabled

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