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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.ams.giganews.com!nntp.giganews.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Curious function signature issue Date: Thu, 24 Oct 2013 15:03:09 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 24 Oct 2013 22:03:11 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="2e9c11742c535983d44654e10bd1b13c"; logging-data="20025"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/wYdmgMUM38Rk5KfXaOEcMSW7pf1A939s=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: Cancel-Lock: sha1:GliQEntd/GATAolvSzOKQUKt98Q= Xref: number.nntp.dca.giganews.com comp.lang.ada:183724 Date: 2013-10-24T15:03:09-07:00 List-Id: On 10/24/2013 02:12 PM, RasikaSrinivasan@gmail.com wrote: > > package P is > type Person_Type is private ; > function Create( targetsfile : String := "targets.dat" ; > basalfile : String := "basal.dat" ; > isffile : String := "isf.dat" ; > icrfile : String := "icr.dat" ) > return Person_Type ; > function Create return Person_Type ; > > I am curious how gnat (2013 if it matters) can distinguish between the two overloaded "Create" functions? One has parameters; the other doesn't. It's at the point of a call to one of these that the compiler has to be able to determine which is being called. I can't see how you could successfully call the Create without parameters, or the Create with parameters using all the defaults, so I suspect you must have only called the version with parameters, and supplied an actual parameter. -- Jeff Carter "My mind is a raging torrent, flooded with rivulets of thought, cascading into a waterfall of creative alternatives." Blazing Saddles 89