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,2a3157e5254b8223 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!1g2000pre.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Array slices and types Date: Wed, 20 Aug 2008 13:45:39 -0700 (PDT) Organization: http://groups.google.com Message-ID: <1eb141ff-82f8-4969-a525-5e931419d631@1g2000pre.googlegroups.com> References: <5886ab95-8744-4b72-b911-e4cb8889c7e7@d1g2000hsg.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1219265139 7768 127.0.0.1 (20 Aug 2008 20:45:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 20 Aug 2008 20:45:39 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: 1g2000pre.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7423 Date: 2008-08-20T13:45:39-07:00 List-Id: On Aug 20, 7:51 am, Maciej Sobczak wrote: > Consider this: > > type Name is new String (1 .. 10); > > N : Name; > > Some_String : String := "abc"; > > How can I assign Some_String to the beginning slice (ie. to the first > three characters) of N? > Everything that I can think of (short of copying characters > individually) hits the type compatibility problem. Do you really need a new *type*, as opposed to: subtype Name is String (1 .. 10); ??? (The answer may be yes. But I would not declare Name to be a new *type*, rather than a subtype, unless there's a reason for this---such as Name being declared earlier as a private type. I just wanted to make sure that you were aware that declaring a subtype is a possibility.) -- Adam