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-Thread: 103376,86d58622defcc2b3 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Why is Function Defined Twice? Date: Sun, 14 May 2006 20:51:33 +0100 Organization: Pushface Message-ID: References: <126erl3o7kb1p1a@corp.supernews.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1147636294 22724 62.49.19.209 (14 May 2006 19:51:34 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sun, 14 May 2006 19:51:34 +0000 (UTC) Cancel-Lock: sha1:OzrJFDyqXuZTYufwP4b2cJr17EA= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news2.google.com comp.lang.ada:4255 Date: 2006-05-14T20:51:33+01:00 List-Id: "Jason C. Wells" writes: > I don't understand why the function ASUM is defined twice in the > following example. Which version gets called when I use ASUM? How does > Ada determine precedence on which gets called? What is the big concept > that I need to associate with this practice so I can go do more studying? It depends on how you call them. You might get more enlightenment from looking at the package spec? but -- at a guess -- > function ASUM ( > N : Natural; > X : Vector_Type; > INCX : Natural > ) return Float_Type'Base is processes the first N elements of X using (an increment?? every INCX'th element??) and will be called when you say F := ASUM (5, V, 2); > function ASUM (X : Vector_Type) return Float_Type'Base is processes every element of X with an increment of 1 and will be called when you say F := ASUM (V);