Re: Silly question about strings (was: Filenames in Ada)



"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.





.



Relevant Pages

  • Re: apt-listbugs behavior (was libpangocairo and gimp...)
    ... within apt-listbugs allows you to pin the packages, ... I meant 'some character I can't remember' will pin the ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: automatic number plate recognition
    ... I am not sure about the robustness of edge detection. ... I am not aware of java packages that are available. ... entire character segmentation and recognition. ...
    (sci.image.processing)
  • Re: apt-listbugs behavior (was libpangocairo and gimp...)
    ... within apt-listbugs allows you to pin the packages, ... That is a bit confusing because '?' ... I meant 'some character I can't remember' will pin the ...
    (Debian-User)
  • Re: Non-latin characters for LaTeX
    ... > I mean, I may need to write some Greek letters, or a cyrillic name, or a ... > (packages and fonts) to get this? ... For Chinese, Japanese, Korean, Thai or Vietnamese, I'd suggest the CJK ... If it's just one single Chinese character, ...
    (comp.text.tex)
  • Re: Tentative MAG Update
    ... a stronger recommendation on the starting character ... I've come up with the following recommendation. ... any character type. ... ascensions on that server. ...
    (rec.games.roguelike.nethack)