Issue #4824 has been updated by Rodrigo Rosenfeld Rosas.


Ruby allows a question mark in method names exactly for avoiding writing methods beggining with "is_" like in Java. I don't mind two word methods, but I don't want the first word to be a "is" when it is finished with a question mark. That is redundant.

By the way, among suggestions, I prefer either main? or main_script?. Maybe aliases :)
----------------------------------------
Feature #4824: Provide method Kernel#executed?
http://redmine.ruby-lang.org/issues/4824

Author: Lazaridis Ilias
Status: Open
Priority: Normal
Assignee: 
Category: core
Target version: 


The current construct to execute main code looks not very elegant:

if __FILE__ == $0
  my_main()          # call any method or execute any code
end

With a Kernel#executed? method, this would become more elegant:

if executed?
  #do this
  #do that
  my_main()
end

or

main() if executed?

This addition would not break any existent behaviour.



-- 
http://redmine.ruby-lang.org