comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Ada 2012 Corrigendum
Date: Fri, 12 Sep 2014 14:51:44 -0400
Date: 2014-09-12T14:51:44-04:00	[thread overview]
Message-ID: <wccmwa4zn7j.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: kFGQv.205472$O13.15633@fx17.iad

Shark8 <OneWingedShark@gmail.com> writes:

> Here's what I have so far; suggestions?
>
> -----------------------------------------------------------------------
> Issue 1:	Private Representation-Clauses and Subtypes Cannot be
>  		Declared Together
>
> !topic		Representation-Clause / Subtype Interaction
> !reference	None [?]

You need at least one reference.

> !from		Edward Fish, 12 Sep 14
> !keywords	Enumeration Representation Freezing Subtypes
>
> Given an enumeration which has values associated with it via a
> representation clause the current freezing rules require that the
> representation-clause appear before a subtype of that type -- it would
> be desirable to be able to 'hide' the representation-clause in the
> private section to prevent exposure to the client systems of what is
> ultimately an implementation-detail.
>
> For this I propose an aspect that would indicate to the compiler that
> there exists a representation-clause [in the private section] and
> therefore does not cause the subtype derivation to freeze that aspect
> (property) of the enumeration: "Delayed_Representation". (This aspect
> would only be needed for enumerations, though there conceivably could be
> reason to apply it to a private type and subtype [i.e. adding a
> Type_Invarient condition on the subtype].)

I'm afraid this isn't going to fly.  If it were feasible, then why would
you need an aspect?  You could just allow the rep clause to come later
than is currently allowed.  But I suspect it's not feasible.

Have you read the AARM annotations in 13.14?  You should, if you're
going to suggest changing the freezing rules.

For one thing, your suggestion violates 13.14(1.n).  You should at least
have an explicit argument as to why you think that's OK.  I don't know
if it violates any other parts 13.14 -- it's a lot of work to study the
freezing rules.

The freezing rules are extremely delicate, so I doubt ARG will want to
change them for a minor stylistic improvement.  Sure, it might be
stylistically better to put rep clauses in the private part, 
but it's hardly an important capability.

Ideally, there would be no freezing rules.  They are a language design
flaw.  Nobody understands them, and yet everybody trips over them.
The solution (decades too late) would be to NOT elaborate package
specs; package specs should be purely compile-time interface
definitions.  In that case, I think freezing rules would be
unnecessary.

One general piece of advice: Language changes are more likely to happen
if the person proposing them shows the exact wording changes to the RM.
But I realise that not everbody is fluent in the strange English-like
language in which the RM is written.  ;-)

- Bob


  reply	other threads:[~2014-09-12 18:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12  3:26 Ada 2012 Corrigendum Shark8
2014-09-12 11:45 ` Peter Chapin
2014-09-12 12:48 ` Dmitry A. Kazakov
2014-09-12 19:09 ` Shark8
2014-09-12 18:51   ` Robert A Duff [this message]
2014-09-12 19:08   ` Robert A Duff
2014-10-04  0:32     ` Randy Brukardt
replies disabled

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