digitalmars.D - Re: Entry (main) method inside a class?
- Dejan Lekic <dejan.lekic gmail.com> Mar 18 2007
- Bill Baxter <dnewsgroup billbaxter.com> Mar 18 2007
Well, I think it is very good to have main _inside_ a class I am currently "playing with" during the development process (of the class). Sure I can have a main() function in the same module and play with the class there, but somehow I "feel" it belongs to the class block. Obviously this is a matter of taste, so it does not really matter whether we will have this "feature" in D or not. I just started this thread because I thought it is somehow possible to do it... :)
Mar 18 2007
Dejan Lekic wrote:Well, I think it is very good to have main _inside_ a class I am currently "playing with" during the development process (of the class). Sure I can have a main() function in the same module and play with the class there, but somehow I "feel" it belongs to the class block. Obviously this is a matter of taste, so it does not really matter whether we will have this "feature" in D or not. I just started this thread because I thought it is somehow possible to do it... :)
I don't get it. If you like having main in a class so much just put it there and call it. If you like Java, then apparently you like typing and this way you get to do even more of it! :-) class MyClass { public static void main(char[][] args) { writefln("Whee I'm main now!"); } } void main(char[][] args) { MyClass.main(); }
Mar 18 2007