Talk:Modulinos: Difference between revisions

(Fixed nametag)
Line 10:
:: This current examples are an awful way to use Python's <tt>__name__ == "__main__"</tt> or Ruby's <tt>__FILE__ == $0</tt>. The Python code exports <tt>scriptedmain.main()</tt> and the Ruby code actually defines a global function <tt>main</tt>, which replaces my global function <tt>main</tt> if I defined one before I required the library. I would like to change the Python and Ruby examples to look like <tt>if __name__ == "main": print "It is %s" % meaning_of_life()</tt>, but I am not sure if the task allows me to do this. --[[User:Kernigh|Kernigh]] 22:40, 6 March 2011 (UTC)
 
::: Kernigh, requires go at the top of files, not after you've declared a main() method. If you deviate from standard programming layouts, you circumvent the language's built-in capabilities, and you're sure to get strange results.
 
==Name change?==
Anonymous user