Compiling a .d file both as library and executable

2015-10-17 Thread Shriramana Sharma via Digitalmars-d-learn
In Python there is: if __name__ == "__main__": to allow the same source file to be treated as both an importable library and as an executable script. In D is there any such mechanism to make a main() compiled selectively, i.e. by some compile-time flag or such? -- Shriramana Sharma, Penguin

Re: Compiling a .d file both as library and executable

2015-10-17 Thread anonymous via Digitalmars-d-learn
On Saturday, October 17, 2015 05:36 PM, Shriramana Sharma wrote: > In Python there is: > > if __name__ == "__main__": > > to allow the same source file to be treated as both an importable library > and as an executable script. In D is there any such mechanism to make a > main() compiled