Re: Type safety, C++ and code generation
- From: "Randy Brukardt" <randy@xxxxxxxxxxxxxx>
- Date: Fri, 28 Apr 2006 14:07:31 -0500
"Jeffrey R. Carter" <spam.not.jrcarter@xxxxxxxxxxxxxxxx> wrote in message
news:7ut4g.921904$x96.7750@xxxxxxxxxxxx
brian.b.mcguinness@xxxxxxxx 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.
.
- Follow-Ups:
- Re: Type safety, C++ and code generation
- From: Robert A Duff
- Re: Type safety, C++ and code generation
- References:
- Type safety, C++ and code generation
- From: Maciej Sobczak
- Re: Type safety, C++ and code generation
- From: REH
- Re: Type safety, C++ and code generation
- From: Maciej Sobczak
- Re: Type safety, C++ and code generation
- From: REH
- Re: Type safety, C++ and code generation
- From: Maciej Sobczak
- Re: Type safety, C++ and code generation
- From: Georg Bauhaus
- Re: Type safety, C++ and code generation
- From: Maciej Sobczak
- Re: Type safety, C++ and code generation
- From: Georg Bauhaus
- Re: Type safety, C++ and code generation
- From: brian . b . mcguinness
- Re: Type safety, C++ and code generation
- From: Jeffrey R. Carter
- Type safety, C++ and code generation
- Prev by Date: Re: Type safety, C++ and code generation
- Next by Date: Re: New home for the Debian Ada Policy
- Previous by thread: Re: Type safety, C++ and code generation
- Next by thread: Re: Type safety, C++ and code generation
- Index(es):
Relevant Pages
|