Re: How to exclude function from being imported in D language?

2022-03-20 Thread Salih Dincer via Digitalmars-d-learn
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)

Re: How to exclude function from being imported in D language?

2022-03-18 Thread bauss via Digitalmars-d-learn
On Friday, 18 March 2022 at 03:24:10 UTC, Era Scarecrow wrote: On Tuesday, 8 March 2022 at 22:28:27 UTC, bauss wrote: What D just needs is a way to specify the entry point, in which it just defaults to the first main function found, but could be any function given. Which is similar to what

Re: How to exclude function from being imported in D language?

2022-03-17 Thread Era Scarecrow via Digitalmars-d-learn
On Tuesday, 8 March 2022 at 22:28:27 UTC, bauss wrote: What D just needs is a way to specify the entry point, in which it just defaults to the first main function found, but could be any function given. Which is similar to what Java does. When i was first learning Java in a company i would

Re: How to exclude function from being imported in D language?

2022-03-14 Thread oculussaw via Digitalmars-d-learn
How can I import and use functions without importing the main(){} function? https://get-vidmateapp.com https://get-mobdroapk.com

Re: How to exclude function from being imported in D language?

2022-03-09 Thread Ali Çehreli via Digitalmars-d-learn
On 3/9/22 05:24, oculussaw wrote: > I think D Language needs and lacks conditional compilation condition That statement is misleading in isolation without qualifications because D has powerful conditional compilation features. Ali

Re: How to exclude function from being imported in D language?

2022-03-09 Thread oculussaw via Digitalmars-d-learn
I think D Language needs and lacks conditional compilation condition

Re: How to exclude function from being imported in D language?

2022-03-09 Thread Anonymouse via Digitalmars-d-learn
On Tuesday, 8 March 2022 at 22:28:27 UTC, bauss wrote: On Tuesday, 8 March 2022 at 20:12:40 UTC, BoQsc wrote: I think D Language needs and lacks conditional compilation condition and attribute of "exclude". The exclude keyword or code block in the exclude, would be made sure to not be

Re: How to exclude function from being imported in D language?

2022-03-09 Thread BoQsc via Digitalmars-d-learn
On Tuesday, 8 March 2022 at 22:28:27 UTC, bauss wrote: On Tuesday, 8 March 2022 at 20:12:40 UTC, BoQsc wrote: I think D Language needs and lacks conditional compilation condition and attribute of "exclude". The exclude keyword or code block in the exclude, would be made sure to not be

Re: How to exclude function from being imported in D language?

2022-03-08 Thread bauss via Digitalmars-d-learn
On Tuesday, 8 March 2022 at 20:12:40 UTC, BoQsc wrote: I think D Language needs and lacks conditional compilation condition and attribute of "exclude". The exclude keyword or code block in the exclude, would be made sure to not be imported by any means. Now it seems all to be only workarounds.

Re: How to exclude function from being imported in D language?

2022-03-08 Thread Ali Çehreli via Digitalmars-d-learn
On 3/8/22 12:12, BoQsc wrote: > I think D Language needs and lacks conditional compilation condition and > attribute of "exclude". It may be so but this need wouldn't exist if either the first program were written in a modular way to begin with or have been refactored to be so as needed (at

Re: How to exclude function from being imported in D language?

2022-03-08 Thread BoQsc via Digitalmars-d-learn
I think D Language needs and lacks conditional compilation condition and attribute of "exclude". The exclude keyword or code block in the exclude, would be made sure to not be imported by any means. Now it seems all to be only workarounds.

Re: How to exclude function from being imported in D language?

2022-03-08 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 8 March 2022 at 17:47:47 UTC, BoQsc wrote: Premise: In D language, only one main(){} function can exist in a program. Having two `main()` functions throws an error. Let's say I want to use some functionality of another program, but it has a `main(){}` function. How can I import