Project

General

Profile

Feature #4824

Updated by nobu (Nobuyoshi Nakada) about 5 years ago

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

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

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

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

 or 

 ~~~ruby 
 main() if executed? 
 ~~~ 

 This addition would not break any existent behaviour. 

Back