From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,68e7fcc642995ece X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-06 09:17:39 PST Path: archiver1.google.com!newsfeed.google.com!postnews1.google.com!not-for-mail From: adam@irvine.com (Adam Beneschan) Newsgroups: comp.lang.ada Subject: Re: Calling through function pointer--syntax question Date: 6 Jun 2001 09:17:39 -0700 Organization: http://groups.google.com/ Message-ID: References: <9fj5nm$sg0$1@news.netmar.com> NNTP-Posting-Host: 63.206.153.98 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 991844259 22122 127.0.0.1 (6 Jun 2001 16:17:39 GMT) X-Complaints-To: groups-support@google.com NNTP-Posting-Date: 6 Jun 2001 16:17:39 GMT Xref: archiver1.google.com comp.lang.ada:8239 Date: 2001-06-06T16:17:39+00:00 List-Id: tmoran@acm.org (Tom Moran) wrote in message news:... > > P (func (5)); -- IS THIS AMBIGUOUS? > It looks quite clear to me. func(5) should print > func parameter is 5 > and return a func_ptr, namely func1'access. Then P(func_ptr) should print > P with function parameter called > Indeed, when I compile and execute that's what I get. Why did you worry? Because there's another possible interpretation of the last call: "func" is called with the default parameter, 4, and returns a func_ptr; the function designated by func_ptr is called with one parameter, 5 [no .all is necessary on the function access since there is a parameter list], and returns an integer (10); and then the P that takes an integer parameter is called with the parameter 10. I wanted to find out whether this was ambiguous because there are two legal interpretations, or whether there's a language rule I'm missing that makes one of the two interpretations impossible, or gives precedence to one over the other. -- thanks, Adam