comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Type safety, C++ and code generation
Date: Fri, 28 Apr 2006 14:07:31 -0500
Date: 2006-04-28T14:07:31-05:00	[thread overview]
Message-ID: <oMCdna3xxMR6-s_ZRVn-vw@megapath.net> (raw)
In-Reply-To: 7ut4g.921904$x96.7750@attbi_s72

"Jeffrey R. Carter" <spam.not.jrcarter@acm.not.spam.org> wrote in message
news:7ut4g.921904$x96.7750@attbi_s72...
> brian.b.mcguinness@lmco.com wrote:
> >
> > One solution to the problem would be to provide a new keyword for
> > defining types with no default operations.  Only the operations you
> > explicitly defined would be available.
>
> You mean like "limited private"?

Right. The problem with "limited private" is the loss of numeric literals
(and string literals in another use). Usually, it's been thought that the
solution is to somehow provide literals for private types. OTOH, no one has
ever made that work out well enough to get it into Ada, so perhaps a
radically different approach is needed.

But careful: the operators come with generic formal types, so there would
have to be restrictions on formals that are similar to whatever is defined
for types:

    type Int is range 1 .. 10 without operators;

could not match

   type An_Int is range <>;

since An_Int has the usual operators. (And for compatibility reasons, that
couldn't change.)

there would have to be new formal kinds like

   type An_Int is range <> without operators;

to support matching for these types. (If you wanted to import the operators
defined for Int, you'd need to use a generic derived type.)

                         Randy.





  reply	other threads:[~2006-04-28 19:07 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-27 10:35 Type safety, C++ and code generation Maciej Sobczak
2006-04-27 13:19 ` REH
2006-04-27 14:08   ` Maciej Sobczak
2006-04-27 14:33     ` REH
2006-04-27 15:16       ` Maciej Sobczak
2006-04-27 15:39         ` Georg Bauhaus
2006-04-28  5:57           ` Maciej Sobczak
2006-04-28 12:16             ` Georg Bauhaus
2006-04-28 12:37               ` brian.b.mcguinness
2006-04-28 17:04                 ` Georg Bauhaus
2006-04-28 18:50                 ` Jeffrey R. Carter
2006-04-28 19:07                   ` Randy Brukardt [this message]
2006-04-28 19:46                     ` Robert A Duff
2006-04-28 19:55                   ` Dmitry A. Kazakov
2006-04-29 21:28               ` Florian Weimer
2006-04-27 16:05         ` REH
2006-04-28  6:17           ` Maciej Sobczak
2006-04-30 14:40         ` adaworks
2006-04-30 15:23           ` REH
2006-04-30 18:14         ` Martin Krischik
2006-05-02  6:27           ` Maciej Sobczak
2006-05-02 13:33             ` REH
2006-05-02 15:05               ` Maciej Sobczak
2006-05-02 15:54                 ` REH
2006-05-02 16:50               ` Martin Krischik
2006-05-02 19:50                 ` REH
2006-04-27 14:47     ` REH
2006-04-27 15:10     ` REH
2006-04-28  6:22       ` Maciej Sobczak
replies disabled

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