Compiling a .d file both as library and executable

Shriramana Sharma via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Oct 17 08:36:01 PDT 2015


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 #395953


More information about the Digitalmars-d-learn mailing list