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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.glorb.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Variable initialized to <> Date: Tue, 14 Oct 2014 22:45:09 +0200 Organization: A noiseless patient Spider Message-ID: References: <0660a64b-cbd1-4fee-a454-3231351b622c@googlegroups.com> Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 14 Oct 2014 20:45:10 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="33eb4fa6dee6352619e7606729ff5489"; logging-data="2052"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19+O461BHZ30bI3hTXS4br9s29K5iDysXs=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: <0660a64b-cbd1-4fee-a454-3231351b622c@googlegroups.com> Cancel-Lock: sha1:X+g5OQd6UXpnGEPRVtgNoKnVC2U= Xref: number.nntp.giganews.com comp.lang.ada:189782 Date: 2014-10-14T22:45:09+02:00 List-Id: On 14.10.14 20:02, Mab wrote: > I'm aware of <> used in an array definition to indicate unspecified range but not sure what it means to initialize to a variable "<>" is also known as a "box". Where you see "<>", you'll typically get what's in a box for whatever the context is indicating. A black box, of sorts. Others have given pointers to the specifics. The box can also appear with type and with generic formals, e.g., to mean "hidden", or "automatically chosen" when instantiating. The latter means that something in the context matches a generic formal that is somehow marked with "<>". The former could mean hidden discriminants only written in the private part (including none at all), thus making the type publicly indefinite. There is also a formal enumeration type, which I like to think of as a parenthesized list of names that runs from here ("<...") to there ("...>"), and is therefore written "(<>)" in generics. generic type T is private; type I is (<>); type Seq is array (I range <>) of T; with function "+" (X, Y : T) return T is <>; function Sum (A : Seq; Surplus : T) return T; If there is a type Xyz that has "+" definied as one of its operations, then the box at the end of the last generic formal, i.e. of "+", indicates that the "+" of Xyz needs not be mentioned when instantiating generic Sum with Xyz for T: type Line is array (Positive range <>) of Xyz; function My_Sum is new Sum (T => Xyz, I => Positive, Seq => Line);