comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: IBM 437 encoded String to UTF-16 Wide_String
Date: Thu, 29 Nov 2012 10:51:27 +0100
Date: 2012-11-29T10:51:15+01:00	[thread overview]
Message-ID: <50b73013$0$6576$9b4e6d93@newsspool3.arcor-online.net> (raw)
In-Reply-To: <1e9k8c3tgm89w$.v1ty0n5ucjqv.dlg@40tude.net>

On 28.11.12 19:00, Dmitry A. Kazakov wrote:

>> That is, is there a set difference between string operations
>> and "vector" operations such that, from a user's perspective,
>> nothing could turn vectors into objects of type String, or
>> Wide_String, or Wide_Wide_String?
>
> Irrelevant, so far Ada's type system was nominal. T1 /= T2 even if there is
> no difference between them in terms you described.

I have not wanted to suggest structural equivalence or duck typing.
Neither will generic formals allow circumventing name equivalence.
Matching works (at the not so recent Ada level at least, with GNAT).

It's just that

- if Ada does not get a complete apparatus for handling
   all string types in some Root_String'Class, and

- if I want my subprograms to work with different
   types of strings,

this particular kind of problem can be solved with the help of a
generic formal package that a user of my programs has instantiated,
substituting his or her types for its formals.  The formal contract
of the formal generic package describes a string type whatsoever and
this description is sufficient for the subprograms of my generic,
and is good enough for the compiler as well.

It is not nice, it works in one direction, and it does not cover
the same cases that Root_String'Class could cover, but it does
solve the problem of making one algorithm work with objects of
different types.

Propose something better, have it replace current language,
and I will switch.




  reply	other threads:[~2012-11-29  9:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27 21:02 IBM 437 encoded String to UTF-16 Wide_String gautier_niouzes
2012-11-27 21:38 ` J-P. Rosen
2012-11-27 22:12 ` gautier_niouzes
2012-11-27 22:14 ` Dmitry A. Kazakov
2012-11-27 23:13   ` gautier_niouzes
2012-11-27 23:41 ` Vadim Godunko
2012-11-28  8:34   ` briot.emmanuel
2012-11-28  8:52     ` Dmitry A. Kazakov
2012-11-28  9:43       ` Georg Bauhaus
2012-11-28  9:58         ` Dmitry A. Kazakov
2012-11-28 11:31           ` Georg Bauhaus
2012-11-28 13:36             ` Dmitry A. Kazakov
2012-11-28 13:47               ` Georg Bauhaus
2012-11-28 14:23                 ` Dmitry A. Kazakov
2012-11-28 17:35                   ` Georg Bauhaus
2012-11-28 18:00                     ` Dmitry A. Kazakov
2012-11-29  9:51                       ` Georg Bauhaus [this message]
2012-11-29 10:52                         ` Dmitry A. Kazakov
2012-11-29 14:05                           ` Georg Bauhaus
2012-11-29 21:03                             ` Dmitry A. Kazakov
2012-11-29  3:18             ` Randy Brukardt
2012-11-28 13:51     ` gautier_niouzes
replies disabled

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