Adam Beneschan wrote: > ... > At the risk of being taunted a second time, and possibly even having a > cow hurled down on top of me (or perhaps some other unit of > livestock), I feel that I need to respond again. Despite my earlier response, I now agree with you. I hadn't looked at your example closely enough the first time. > ... > Anyway, it seems to me that the procedure call in question *is* > ambiguous, contrary to what everyone else (including someone's > compiler) says, and I'll try to explain in more precise detail why I > think so: > > The relevant declarations are: > > type func_ptr is access function (param : integer) return integer; > function func (y : integer := 4) return func_ptr; > procedure P (x : in integer); > procedure P (x : in func_ptr); > > and my question is about the procedure call: > > P (func (5)); > > Obviously, one acceptable interpretation is that "func" is called with > the parameter 5, returning a func_ptr, and this func_ptr is passed to > the second P. > > I believe the other interpretation is also acceptable, however: "func" > is called with a default parameter, 4. This returns a function > pointer. This function pointer is dereferenced, and the designated > function is called with the parameter 5. This returns an integer, and > the resulting integer is passed to the first P. Yes, I agree with your analysis. > ... Is there an error in my > line of thought? No. (And my favorite Ada front end agrees with you too -- I should have checked with it first!) [I have attached a listing.] > > -- thanks, Adam -- -Tucker Taft stt@avercom.net http://www.avercom.net Chief Technology Officer, AverCom Corporation (A Titan Company) Burlington, MA USA (AverCom was formerly the Commercial Division of AverStar: http://www.averstar.com/~stt)