Some questions
bearophile
bearophileHUGS at mailas.com
Fri Aug 3 00:30:00 PDT 2007
Thank you Bill Baxter, your suggestions regarding unittests look a bit better than what I am doing now. But I think I'll keep commenting out the main (using a static if(0){}).
D developers may be interested to know how Python (and ShedSkin) solve the problem with main() I was talking about:
if __name__ == '__main__':
...
The *main* module compile has __name__ = "__main__", so what the stuff inside that 'if' doesn't become executed if the module is being imported. I agree that Python syntax is ugly (there are people that are pushing for its change) but it actually solves the problem I was talking about.
Hugs,
bearophile
More information about the Digitalmars-d-learn
mailing list