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.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS autolearn=no autolearn_force=no version=3.4.4 X-Received: by 10.107.152.202 with SMTP id a193mr79613ioe.138.1513611288909; Mon, 18 Dec 2017 07:34:48 -0800 (PST) X-Received: by 10.157.88.6 with SMTP id r6mr4023oth.9.1513611288778; Mon, 18 Dec 2017 07:34:48 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.kjsl.com!usenet.stanford.edu!g80no980538itg.0!news-out.google.com!b73ni3757ita.0!nntp.google.com!i6no988234itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 18 Dec 2017 07:34:48 -0800 (PST) In-Reply-To: <3c367d8d-351e-4c72-b259-c04a5285d025@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.245.162.244; posting-account=rhqvKAoAAABpikMmPHJSZh4400BboHwT NNTP-Posting-Host: 85.245.162.244 References: <6bedbdee-ca7f-4d2a-83f9-6cc9c53d21cb@googlegroups.com> <3c367d8d-351e-4c72-b259-c04a5285d025@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: how to do things like procedure foo(A: string) is bar: string := A; begin; ...;end; From: Mehdi Saada <00120260a@gmail.com> Injection-Date: Mon, 18 Dec 2017 15:34:48 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:49515 Date: 2017-12-18T07:34:48-08:00 List-Id: I got it pretty early (was clear in the course) that array, and strings for the matter, can have arbitrary bounds. So with unconstrained formal parameters I always use 'LENGHT, 'First and 'Last, and no 'Range in for loop. But your "" & S was mind-boggling... It does have the effect of changings bounds without touching the content. Very useful, thanks ! Not sure about the constrained formal parameter part. What happens when you call something like function FOO(T: String range 5..9) return String; with a parameter whose index subtype's bounds are say, 1..4 ? You say it would raise Constraint_Error ? If so I can see the point. There's never too much facultative checks.