From: Hibou57 (Yannick Duchêne) on
On 8 fév, 21:39, Robert A Duff <bobd...(a)shell01.TheWorld.com> wrote:
> Jean-Pierre Rosen <ro...(a)adalog.fr> writes:
> > That it is nice to have singletons that are clearly singletons, with a
> > syntax close to the syntax for types.
>
> Why on earth would you want an object decl to look like
> a type decl?
You may want to have a protected singleton or task singleton, the same
way you may want an entity to be aliased or constant.

You do Aliased or Constant on selective entities, you can do Protected
or Task on selective entities the same way.

By the way, although this construct may seems strange to one who never
use it (I use it, at least, I'm experiencing with it, so it does not
seems strange to me), no troubles at all comes with it. This
particular construct does not brake any language design principle.

From: Hibou57 (Yannick Duchêne) on
On 8 fév, 21:44, Robert A Duff <bobd...(a)shell01.TheWorld.com> wrote:
> "(see below)" <yaldni...(a)blueyonder.co.uk> writes:
> > I wonder what the rationale was for merging the first two. I suspect
> > compiler efficiency worries, valid at the time, that now are obsolete.
>
> I wonder, too.  I don't buy the "compiler efficiency" worries.
> That might explain why private parts exist, but it doesn't
> explain why they can't be separately compiled (i.e. stored
> in separate source files).
This point is funny, because before I knew enough on Ada (and before I
started to experiment its tasking capabilities), I use to think tasks
was probably separate compilation units (I've understood it was not
when I've checked the syntax rules about it).

If it would have been, then this would also have seems intuitive.
But there again, this does not really break anything (IMHO)
From: Hibou57 (Yannick Duchêne) on
On 8 fév, 15:56, Robert A Duff <bobd...(a)shell01.TheWorld.com> wrote:
> "Hibou57 (Yannick Duchêne)" <yannick_duch...(a)yahoo.fr> writes:
>
> > So, with absolute majority, the Gang Of Three voted there is a flaw
> > here
>
> Make that four.  ;-)
Robert, ... you forget to give it a Capital Letter ;)
From: Randy Brukardt on
"Dmitry A. Kazakov" <mailbox(a)dmitry-kazakov.de> wrote in message
news:1v2la97s2yyvd.1rcy0ana8mver.dlg(a)40tude.net...
> On Mon, 8 Feb 2010 00:30:12 -0800 (PST), Martin wrote:
>
>> This is true of task types too.
>
> I don't think so. The task specification does not expose barriers and
> local
> variables of its body. But the protected type specification does its
> private operations and components:
>
> package P is
> protected type T is
> ...
> private
> ... -- Why is it here? Is it C++ or Ada?
> end T;
> private
> ... -- It belongs here! Or better to the package body
> end P;
>
> Obviously to me, the syntax should have been like:

For what it's worth, the Ada 95 Rationale says
(http://www.adaic.com/standards/95rat/RAThtml/rat95-p2-9.html#1):

The other data components of a protected object must be declared in the
specification of the type to ensure that the size is known to the compiler
when the type is used by a caller. However these components are only
accessible from protected operations defined in the body of the protected
type and thus are declared in the private part of the protected type.
(And I have no intent of trying to defend this!)

Randy.




From: AdaMagica on
> I wonder, too.  I don't buy the "compiler efficiency" worries.
> That might explain why private parts exist, but it doesn't
> explain why they can't be separately compiled (i.e. stored
> in separate source files).
>
> I'd eliminate them altogether, though.

OK, but then you have a similar problem to Ada83's syntactically
unneeded bodies which Ada95 solved with a pragma.

How would you specify that there is a syntactically unneeded private
part (i.e. when there is no private type in the spec)?

I guess your ideas about specs, bodies, child packages and visibility
are very different from Ada as she is. You'd like a different girl,
wouldn't you;-)