How to exclude function from being imported in D language?
Salih Dincer
salihdb at hotmail.com
Sun Mar 20 05:58:06 UTC 2022
On Tuesday, 8 March 2022 at 18:38:47 UTC, Paul Backus wrote:
> On Tuesday, 8 March 2022 at 17:47:47 UTC, BoQsc wrote:
> For example, you could use a [`version` condition][1]:
>
> ```d
> module otherprogram;
>
> version (Otherprogram_NoMain)
> {
> // no main function
> }
> else
> {
> void main(string[] args)
> {
> // ...
> }
> }
>
> // other functions...
> ```
There is no need for extra features when there is a version
feature in D. Moreover, you can abstract the libraries it depends
on, as I did
[here](https://forum.dlang.org/post/dcfkmssxbzgbkkparfuv@forum.dlang.org).
SDB at 79
More information about the Digitalmars-d-learn
mailing list