comp.lang.ada
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* Re: Silly question about strings (was: Filenames in Ada)
  2005-11-24  3:21  7%   ` Silly question about strings (was: Filenames in Ada) Steve
  2005-11-24  4:58  0%     ` Larry Kilgallen
@ 2005-11-29  3:17  0%     ` Randy Brukardt
  1 sibling, 0 replies; 3+ results
From: Randy Brukardt @ 2005-11-29  3:17 UTC (permalink / raw)


"Steve" <nospam_steved94@comcast.net> wrote in message
news:oNmdneZx9ePFrBjenZ2dnUVZ_t2dnZ2d@comcast.com...
> 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.








^ permalink raw reply	[relevance 0%]

* Re: Silly question about strings (was: Filenames in Ada)
  2005-11-24  3:21  7%   ` Silly question about strings (was: Filenames in Ada) Steve
@ 2005-11-24  4:58  0%     ` Larry Kilgallen
  2005-11-29  3:17  0%     ` Randy Brukardt
  1 sibling, 0 replies; 3+ results
From: Larry Kilgallen @ 2005-11-24  4:58 UTC (permalink / raw)


In article <oNmdneZx9ePFrBjenZ2dnUVZ_t2dnZ2d@comcast.com>, "Steve" <nospam_steved94@comcast.net> writes:
> This may be a silly question, but why aren't the character dependent
> packages generic?
>
> It seems odd to have separate packages:
>
>   Ada.Strings.Fixed;
>   Ada.Strings.Wide_Fixed;
>   Ada.Strings.Bounded;
>   Ada.Strings.Wide_Bounded;
>   Ada.Strings.Unbounded;
>   Ada.Strings.Wide_Unbounded;
>   Ada.Text_IO;
>   Ada.Wide_Text_IO;
>
> 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 Ada.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.

I would expect those string packages (and especially the string IO
packages) would use operating system facilities in some implementations.
The underlying operating system calls might not be symmetric at all.
The bodies might not even be written in Ada.



^ permalink raw reply	[relevance 0%]

* Silly question about strings (was: Filenames in Ada)
  @ 2005-11-24  3:21  7%   ` Steve
  2005-11-24  4:58  0%     ` Larry Kilgallen
  2005-11-29  3:17  0%     ` Randy Brukardt
  0 siblings, 2 replies; 3+ results
From: Steve @ 2005-11-24  3:21 UTC (permalink / raw)


This may be a silly question, but why aren't the character dependent 
packages generic?

It seems odd to have separate packages:

  Ada.Strings.Fixed;
  Ada.Strings.Wide_Fixed;
  Ada.Strings.Bounded;
  Ada.Strings.Wide_Bounded;
  Ada.Strings.Unbounded;
  Ada.Strings.Wide_Unbounded;
  Ada.Text_IO;
  Ada.Wide_Text_IO;

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

Steve
(The Duck) 





^ permalink raw reply	[relevance 7%]

Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2005-11-23 17:36     Filenames in Ada Martin Krischik
2005-11-23 22:18     ` Randy Brukardt
2005-11-24  3:21  7%   ` Silly question about strings (was: Filenames in Ada) Steve
2005-11-24  4:58  0%     ` Larry Kilgallen
2005-11-29  3:17  0%     ` Randy Brukardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox