comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Formal Subprogram Access
Date: Tue, 13 Feb 2018 12:24:08 +0000
Date: 2018-02-13T12:24:08+00:00	[thread overview]
Message-ID: <lyeflpkrh3.fsf@pushface.org> (raw)
In-Reply-To: p5tudq$5eb$1@franka.jacob-sparre.dk

"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.

   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 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.


  parent reply	other threads:[~2018-02-13 12:24 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 [this message]
2018-02-14  0:53         ` Randy Brukardt
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