comp.lang.ada
 help / color / mirror / Atom feed
* Calling through function pointer--syntax question
@ 2001-06-05 17:43 adam
  2001-06-05 19:39 ` tmoran
  2001-06-06 16:00 ` Tucker Taft
  0 siblings, 2 replies; 10+ messages in thread
From: adam @ 2001-06-05 17:43 UTC (permalink / raw)



Is the last procedure call in the program ambiguous?

If this is a legal program, what should it do?

                                -- thanks, Adam


with text_io;  use text_io;
procedure test is
    
    type func_ptr is access function (param : integer) return integer;
    
    procedure P (x : in integer);
    procedure P (x : in func_ptr);
    function func1 (param : integer) return integer;
    
    function func (y : integer := 4) return func_ptr is
    begin
        text_io.put_line ("func parameter is " & integer'image (y));
        return func1'access;
    end func;

    procedure P (x : in integer) is
    begin
        text_io.put_line ("P with integer parameter called: " &
                          integer'image (x));
    end P;

    procedure P (x : in func_ptr) is
    begin
        text_io.put_line ("P with function parameter called");
    end P;

    function func1 (param : integer) return integer is
    begin
        text_io.put_line ("func1 parameter is " & integer'image (param));
        return param * 2;
    end func1;

begin
    P (func (5));       -- IS THIS AMBIGUOUS?
end test;

 -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web  -----
  http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
   NewsOne.Net prohibits users from posting spam.  If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2001-06-11 17:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-05 17:43 Calling through function pointer--syntax question adam
2001-06-05 19:39 ` tmoran
2001-06-06 16:17   ` Adam Beneschan
2001-06-06 16:00 ` Tucker Taft
2001-06-06 22:06   ` Adam Beneschan
2001-06-07  1:22     ` Jeffrey Carter
2001-06-08 21:34       ` Adam Beneschan
2001-06-09  6:29         ` Simon Wright
2001-06-11 13:08           ` Philip Anderson
2001-06-11 17:34         ` Tucker Taft

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