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 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,103b407e8b68350b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-15 16:10:38 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn14feed!worldnet.att.net!207.217.77.102!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: Anybody in US using ADA ? One silly idea.. Date: Wed, 15 Jan 2003 16:19:39 -0800 Organization: AdaWorks Software Engineering Message-ID: <3E25FA9A.2549C263@adaworks.com> References: <1041908422.928308@master.nyc.kbcfp.com> <1041997309.165001@master.nyc.kbcfp.com> <1042086217.253468@master.nyc.kbcfp.com> <1042477504.547640@master.nyc.kbcfp.com> <1042651417.215661@master.nyc.kbcfp.com> Reply-To: richard@adaworks.com NNTP-Posting-Host: 41.b2.60.6c Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 16 Jan 2003 00:10:38 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:33059 Date: 2003-01-16T00:10:38+00:00 List-Id: Bill Findlay wrote: > I've noticed you say something like this before, Hyman, and I wonder if I'm > mistaking your meaning. Ada ranged types are NOT fixed at compile-time, they > may be fully dynamic. Bill, Great example. I have modified it slightly to emphasize the point. Hope you don't mind. Here is the altered version. -- modified from example submitted to cla by Bill Findlay with Ada.Integer_Text_IO; with Ada.Text_IO; use Ada; procedure try is function read return integer is n : integer; begin Integer_Text_IO.get(n); return n; end read; begin -- Try loop Dynamic_Array: declare SUBTYPE S IS INTEGER RANGE READ .. READ; A : array(S) of Integer := (others => 0); begin -- Dynamic_Array exit when S'Last = S'First; for I in A'Range loop Integer_Text_IO.Get(A(I)); end loop; Text_IO.put_line(integer'image(s'first) & " .. " & integer'image(s'last)); end Dynamic_Array; end loop; end try;