From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Advent of Code Day 7 Date: Wed, 9 Dec 2020 00:25:56 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <5de252c8-844b-4d1e-9c08-e8ae18b6b043n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 8 Dec 2020 23:25:56 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="eeed6c09caf015270621b606e8862e3c"; logging-data="19314"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Fox9KoCOH4Lt7vhYMQ0XUSBSgHf1LNMs=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 Cancel-Lock: sha1:ycvxzSBxiD4lwIlx/uyCZU2z/Z0= In-Reply-To: <5de252c8-844b-4d1e-9c08-e8ae18b6b043n@googlegroups.com> Content-Language: en-US X-Mozilla-News-Host: news://news.eternal-september.org Xref: reader02.eternal-september.org comp.lang.ada:60765 List-Id: > > Very much appreciated! I was aware of "others =>" for arrays and records but didn't think to try it with strings. "Bag_Description'range =>" is entirely new to me. A string type is just a 1D array type with a character type for components. The definition of type String in pkg Standard is given in ARM A.1 as type String is array (Positive range <>) of Character with Pack; (http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-A-1.html) A string literal is a special kind of array aggregate for string types, but normal array aggregates also work. Bag_Description is clearly a constrained string subtype, and S'range is defined for all constrained array subtypes. -- Jeff Carter "Violence is the last refuge of the incompetent." Foundation 151