UFCS for D
bls
bizprac at orange.fr
Fri Mar 30 05:25:35 PDT 2012
On 03/30/2012 05:06 AM, deadalnix wrote:
> Le 30/03/2012 11:40, bls a écrit :
>> On 03/30/2012 02:15 AM, Nick Sabalausky wrote:
>>> Eh? Other people have voiced concerns over that since waaay back in even
>>> pre-D1 times. In particular, many people have argued for allowing
>>> modules
>>> with the same name as a package. Ie: you could have both module "foo"
>>> and
>>> module "foo.bar".
>>
>> This is afaik similar to ADA child packages.
>> Quote :
>> Ada allows one to extend the functionality of a unit (package) with
>> so-called children (child packages). With certain exceptions, all the
>> functionality of the parent is available to a child. This means that all
>> public and private declarations of the parent package are visible to all
>> child packages.
>
> This sound interesting. And why not use public import for that ? It
> wouldn't break any existing code, because it enlarge the field of
> possibles.
Asking Nick or me ?
Anyway, you can't really compare the D module- and ADA package concept.
A D-ified ADA package could like like :
module Shelf {
module Disks {
}
module Books {
}
}
I am not an active ADA user but instead of having a single file you
could use the D-ified Ada way...
module Shelf;
module Shelf.Disks;
module Shelf.Books;
instead. And I think this what Nick is talking about.
Having the same scoping rules.
http://en.wikibooks.org/wiki/Ada_Programming/Packages
More information about the Digitalmars-d-announce
mailing list