comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: ANN: Ada 2005 Math Extensions, 20100810 release
Date: Sat, 14 Aug 2010 00:28:48 +0200
Date: 2010-08-14T00:28:48+02:00	[thread overview]
Message-ID: <op.vhed2aabule2fv@garhos> (raw)
In-Reply-To: m28w4aw4ny.fsf@pushface.org

Le Sat, 14 Aug 2010 00:04:17 +0200, Simon Wright <simon@pushface.org> a  
écrit:
>> Le Fri, 13 Aug 2010 21:50:07 +0200, Simon Wright <simon@pushface.org>
> Well, I couldn't see how Dmitry's "Foo_Of" would make sense as it was
> being read.
>
>    procedure P (Q : Generic_S.Foo_Of);   -- huh?
>
> I suppose one could say
>
>    generic
>       type Foo is ...
>    package Generic_S is
>       subtype Actual_Foo is Foo;

I said too much less, sorry, so you could not understand what I was to say

I would rather write

generic
    type Foo is ...
package Generic_S is
    subtype Formal_Foo is Foo;

The name is not the same as the one Dmitry suggested, while the principle  
is the same : name formal parameter after the name their should have, and  
use renamed subtype in the package (just the name vary, and indeed it  
should be expressive and clear enough).

>    procedure P (Q : Generic_S.Foo_Of);   -- huh?

This would turn this into

    procedure P (Q : Generic_S.Foo_Of);

which is also not so much used for me (do not know for others who live  
with other cases in mind). The count of generic instantiations is bigger  
than the one reference to this Package_Name.Formal_Subtype, which by the  
way, mainly appears as generic parameters when needed, like “package  
Blabla_Instance is new Generic_Blabla (Blabla_Base_Type =>  
Instantiated_Package.Formal_Type);”

These Formal_Subtype_Name are most of time not part of what is provided by  
the package (otherwise, it would simply provide nothing except what  
already exists), so as most of time not referenced when what the package  
provided is referenced (from the client side). But this may be required to  
make reference to a package's formal parameters with mixins (if I am not  
wrong, I had this requirement with some kind mixins).

Pretty sure this is not so much referenced by clients, for the reason  
given above, that this is not what a package mainly provides. This is most  
needed to link generic packages each others. So (providing the latter  
assumption is OK), giving a proper name to formal parameters and only give  
special names to subtype of these formals, is likely to avoid to have to  
deal with obfuscated names as much as possible.



  reply	other threads:[~2010-08-13 22:28 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-10 21:38 ANN: Ada 2005 Math Extensions, 20100810 release Simon Wright
2010-08-11 11:40 ` Ada novice
2010-08-11 21:38 ` Simon Wright
2010-08-12  5:57   ` Dmitry A. Kazakov
2010-08-12 19:45     ` Simon Wright
2010-08-13  6:27       ` Dmitry A. Kazakov
2010-08-13  6:54         ` Ludovic Brenta
2010-08-13 13:36           ` Yannick Duchêne (Hibou57)
2010-08-13  7:42         ` Georg Bauhaus
2010-08-13  8:40           ` Dmitry A. Kazakov
2010-08-13 13:41             ` Yannick Duchêne (Hibou57)
2010-08-13 13:57               ` Dmitry A. Kazakov
2010-08-13 13:31         ` Yannick Duchêne (Hibou57)
2010-08-13 13:48           ` Dmitry A. Kazakov
2010-08-13 19:50         ` Simon Wright
2010-08-13 20:17           ` Yannick Duchêne (Hibou57)
2010-08-13 22:04             ` Simon Wright
2010-08-13 22:28               ` Yannick Duchêne (Hibou57) [this message]
2010-08-13 22:30                 ` Yannick Duchêne (Hibou57)
2010-08-14 16:12                 ` Simon Wright
2010-08-14 17:16                   ` Dmitry A. Kazakov
2010-08-14 17:34                     ` Jeffrey Carter
2010-08-14 19:18                       ` Simon Wright
2010-08-14 23:51                         ` Georg Bauhaus
2010-08-15  0:57                           ` Yannick Duchêne (Hibou57)
2010-08-15  2:27                           ` Jeffrey Carter
2010-08-12 10:36   ` Stephen Leake
2010-08-12 12:48     ` sjw
2010-08-14  1:05       ` Stephen Leake
2010-08-14 16:26         ` Simon Wright
2010-08-14 17:24           ` Dmitry A. Kazakov
2010-08-14 19:16             ` Simon Wright
2010-08-14 20:48               ` Dmitry A. Kazakov
2010-08-14 21:55                 ` Simon Wright
2010-08-15  6:14                   ` Dmitry A. Kazakov
2010-08-15 17:06                     ` Simon Wright
2010-08-15 18:18                       ` Dmitry A. Kazakov
replies disabled

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