Re: Silly question about strings (was: Filenames in Ada)
- From: "Randy Brukardt" <randy@xxxxxxxxxxxxxx>
- Date: Mon, 28 Nov 2005 21:17:50 -0600
"Steve" <nospam_steved94@xxxxxxxxxxx> wrote in message
news:oNmdneZx9ePFrBjenZ2dnUVZ_t2dnZ2d@xxxxxxxxxxxxxx
> This may be a silly question, but why aren't the character dependent
> packages generic?
....
> Instead of generic packages that use the character type as a parameter,
with
> predefined instatiations for character and wide_character similar to what
is
> done with numerics. Perhaps something along the lines of:
>
> package Ada.Strings.Fixed is new Ada.Strings.String_Base( Character );
> package Ada.Strings.Wide_Fixed is new
..Strings.String_Base(
> Wide_Character );
>
> and so on...
>
> It seems like this would eliminate issues with different character sets, and
> avoid the need for a language revision when a 64 bit (or 128 bit) version of
> Unicode arrives.
Something like this was proposed as an 11th hour suggestion (this year). But it was thought to be just too late to design it properly, thus nothing was done with that.
For Janus/Ada, such a generic would have terrible performance. Since we share all generic bodies, the code would have to deal with arrays of unknown size elements. Yuck. The predefined instantiations would help that some (as they wouldn't necessarily need to be implemented as generic instantiations), but user-defined string types would use real instantiations and probably would be unusable.
Randy Brukardt.
.
- Follow-Ups:
- References:
- Filenames in Ada
- From: Martin Krischik
- Re: Filenames in Ada
- From: Randy Brukardt
- Silly question about strings (was: Filenames in Ada)
- From: Steve
- Filenames in Ada
- Prev by Date: Re: Tasking and wxWidgets
- Next by Date: Re: Silly question about strings (was: Filenames in Ada)
- Previous by thread: Re: Silly question about strings (was: Filenames in Ada)
- Next by thread: Re: Silly question about strings (was: Filenames in Ada)
- Index(es):
Relevant Pages
|