From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Nested declares, constant size arrays and clarity
Date: Thu, 04 Oct 2007 13:33:10 +0200
Date: 2007-10-04T13:33:10+02:00 [thread overview]
Message-ID: <87zlyz6rnt.fsf@ludovic-brenta.org> (raw)
In-Reply-To: fe29fv$ocg$3@atlantis.news.tpi.pl
Mateusz Papiernik <mati@maticomp.net> 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.
next prev parent reply other threads:[~2007-10-04 11:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-03 22:58 Nested declares, constant size arrays and clarity Mateusz Papiernik
2007-10-03 23:49 ` Ludovic Brenta
2007-10-04 8:49 ` Mateusz Papiernik
2007-10-04 11:33 ` Ludovic Brenta [this message]
2007-10-04 12:45 ` Dmitry A. Kazakov
2007-10-04 13:11 ` Mateusz Papiernik
2007-10-05 5:00 ` Jeffrey R. Carter
2007-10-05 4:58 ` Jeffrey R. Carter
2007-10-05 7:38 ` Dmitry A. Kazakov
2007-10-05 17:08 ` Jeffrey R. Carter
2007-10-05 4:54 ` Jeffrey R. Carter
2007-10-04 0:20 ` Jeffrey R. Carter
2007-10-04 8:51 ` Mateusz Papiernik
2007-10-05 2:45 ` Steve Whalen
2007-10-04 0:23 ` anon
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox