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,d0fa2610a6bea4ec X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.astraweb.com!newsrouter-eu.astraweb.com!multikabel.net!newsfeed10.multikabel.net!feeder4.cambrium.nl!feed.tweaknews.nl!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Nested declares, constant size arrays and clarity References: <87641n92tc.fsf@ludovic-brenta.org> Date: Thu, 04 Oct 2007 13:33:10 +0200 Message-ID: <87zlyz6rnt.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:pueKdvNaVjZ0WMJJ2DYQJdsjC20= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tele2 X-Trace: DXC=7a7[m5WSCPn>FWkB1DM[\n6`Y6aWje^YjC3;aoRhE4IeG[aVa>;I7\2^BaPQjEYa Mateusz Papiernik writes: > Ludovic Brenta pisze: >> Yes, it is called an "unconstrained array type". Here is how you >> would do it: > > Thanks! That's something I missed reading docs. Basically, that's > exactly what I want to do. > >> PS. What I described above is exactly how the predefined type String >> works; it is an unconstrained array of Character's. Look at the >> standard subprograms that operate on Strings for more inspiration. > > With strings I also have to work some way. As for now I'm using > Unbounded_Strings, because easy implementations of functions like > split (I'm parsing CSV file). Is it a good practice to use U_S, or > should I fall back to normal strings and fight with implementation? I guess that depends on whether the input lines have a fixed length or not. The main disadvantage of Unbounded_Strings are that they are much slower than regular Strings. A good compromise might be to use Bounded_Strings instead: you would get efficiency and flexibility at the same time at the cost of perhaps consuming more memory than strictly necessary. -- Ludovic Brenta.