comp.lang.ada
 help / color / mirror / Atom feed
From: "J-P. Rosen" <rosen@adalog.fr>
Subject: Re: Basic issue with dotted notation and tagged types
Date: Mon, 22 Oct 2012 09:46:49 +0200
Date: 2012-10-22T09:46:49+02:00	[thread overview]
Message-ID: <k62tl7$cro$1@dont-email.me> (raw)
In-Reply-To: <op.wmjwl6mdule2fv@cardamome>

Le 22/10/2012 00:55, Yannick Duchêne (Hibou57) a écrit :
> [Snip]
> Will this display `A` or `B`? Actually, the program compiled with GNAT
> 4.6, displays `A`. It displays the same even when the two commented
> lines are commented‑out and thus the function `F` is declared before the
> field `F`. I can't remember if the RM have special wordings about it,
> but I feel this does not honour the principle of least surprise. May be
> this should be disallowed, to access any one of the two, when both are
> together visible from a scope?
> 
> 
RM2005 4.1.3 (9.2/2): "The designator of the subprogram shall not be the
same as that of a component of the tagged type visible at the point of
the selected_component."

BTW, this corresponds to /my/ view of least surprise: a prefixed view is
merely a writing simplification, and you are always free not to use it
without losing any functionality. OTOH, you would have no other way to
access a subcomponent. Therefore, it makes sense that the subcomponent
is "stronger".
-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr



  reply	other threads:[~2012-10-28  2:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-21 22:55 Basic issue with dotted notation and tagged types Yannick Duchêne (Hibou57)
2012-10-22  7:46 ` J-P. Rosen [this message]
2012-10-22  8:02   ` Dmitry A. Kazakov
2012-10-22 13:46     ` Yannick Duchêne (Hibou57)
2012-10-22 10:52   ` Marius Amado-Alves
2012-10-22 11:18     ` Georg Bauhaus
2012-10-22 11:37       ` Marius Amado-Alves
2012-10-22 14:11       ` Yannick Duchêne (Hibou57)
2012-10-22 11:45     ` Niklas Holsti
2012-10-22 14:17       ` Maciej Sobczak
2012-10-22 13:50     ` Yannick Duchêne (Hibou57)
2012-10-22 10:41 ` AdaMagica
replies disabled

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