Python's if __name__=="__main__": main() in other languages
Ruby: if __FILE__ == $0 then main end
Perl: unless(caller) { main; }
...
https://github.com/mcandre/scriptedmain
Does anyone know the syntax for this in GNU Smalltalk?
Ruby: if __FILE__ == $0 then main end
Perl: unless(caller) { main; }
...
https://github.com/mcandre/scriptedmain
Does anyone know the syntax for this in GNU Smalltalk?
[+] [-] damncabbage|14 years ago|reply
(Presuming you've gone and defined the main() function somewhere. No module conventions like with Python here.)
[+] [-] booz|14 years ago|reply
if (!module.parent) { // your main here }
[+] [-] mcandre|14 years ago|reply