Future of export

solidstate1991 via Digitalmars-d digitalmars-d at puremagic.com
Wed Aug 23 17:31:26 PDT 2017


On Wednesday, 23 August 2017 at 03:19:55 UTC, Nicholas Wilson 
wrote:
> I have as part of DIP 1012
>
> ```
> enum SymbolExport
> {
>     neither,
>     dynamicImport,
>     dynamicExport
> }
>
> alias dynamicImport = SymbolExport .dynamicImport;
> alias dynamicExport = SymbolExport .dynamicExport;
> ```
>
> to replace the `export` storage visibility, So that one can do
>
> ```
> version(MyLib_Build)
>     enum MyLibExport = dynamicExport;
> else
>     enum MyLibExport = dynamicImport;
>
> // Exported when building the shared object,
> //imported when linking against the shared object.
> @MyLibExport void foo(int x) { ... }
> ```
>
> However Martin said in 
> https://github.com/dlang/DIPs/pull/89/files#diff-26bf588c0174e6cd0fe3d4af615bebdaR120 that "That's not what is planned for export"
>
> Last I heard (from Benjamins Thaut's DConf 2016 talk) was that 
> nobody was using export because there was no corresponding 
> import and no way to switch between them. Benjamin suggested 
> that making it an attribute would fix that, hence it is part of 
> DIP 1012.
>
> What is planned for export?

There's already a DIP on the subject 
(https://github.com/dlang/DIPs/blob/master/DIPs/archive/DIP45.md), but it's pretty much abandoned. I however would like to see it becoming a subject of discussion. DIP45 should be done as soon as possible, so the D will be able to have a much better DLL support, which in turn will help both our development, both the adoption of the language.


More information about the Digitalmars-d mailing list