From: adam@irvine.com
Subject: Calling through function pointer--syntax question
Date: 5 Jun 2001 17:43:18 GMT
Date: 2001-06-05T17:43:18+00:00 [thread overview]
Message-ID: <9fj5nm$sg0$1@news.netmar.com> (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
next reply other threads:[~2001-06-05 17:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-05 17:43 adam [this message]
2001-06-05 19:39 ` Calling through function pointer--syntax question 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
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox