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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a0c:b521:: with SMTP id d33mr30421215qve.239.1565617481760; Mon, 12 Aug 2019 06:44:41 -0700 (PDT) X-Received: by 2002:aca:d552:: with SMTP id m79mr6101116oig.157.1565617481454; Mon, 12 Aug 2019 06:44:41 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!b26no1967034qtq.0!news-out.google.com!d29ni1220qtg.1!nntp.google.com!b26no1967023qtq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 12 Aug 2019 06:44:41 -0700 (PDT) In-Reply-To: <50918b3d-cc75-4375-8735-8c007287f357@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=146.5.2.29; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 146.5.2.29 References: <50918b3d-cc75-4375-8735-8c007287f357@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: What is the difference? From: Shark8 Injection-Date: Mon, 12 Aug 2019 13:44:41 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:57039 Date: 2019-08-12T06:44:41-07:00 List-Id: > What is here the meaning of: is <>? That is a default; if there is a matching subprogram (name, parameters) then it can use that without being specified. Example: Generic Type Element(<>) is private; Unity : Element; with Function "*"(Left, Right : Element) return Element is <>; Function Generic_Exponent( Left : Element; Right : Natural ) return Element; --... Function Generic_Exponent( Left : Element; Right : Natural ) return Element is (case Right is when 0 => Unity, when 1 => Left, when 2 => Left * Left, when others => (if Right mod 2 = 0 then (Left ** (Right/2) ** 2 else ((Left ** (Right/2) ** 2) * Left ) ); Now you can say something like Procedure Test is Type X is 1..8; Function Exp is new Generic_Exponent(X, 1, others => <>); Function "**"(Left : X; Right : Natural) Return X renames Exp; Begin --Testing procedures End Test;