From: "Jesús Gabriel y Galán" Date: 2011-06-03T03:55:00+09:00 Subject: Re: CORE - Replace "if __FILE__ == $0" with "executed?" 011/6/2 Jesús Gabriel y Galán : > Not really, I just defined the default value just in case, but it's true > that in this case it doesn't make much sense. > El 02/06/2011 20:09, "Chad Perrin" escribió: Sorry for the top post and the bad quote, I was using my phone there. What I wanted to say is that usually I try to think if there's an appropriate default value for a method parameter. And I just wrote that, but obviously that default value is not very useful, and I can't come up with any other one. So I would write: #executed.rb module Kernel def executed? file file == $0 end end #main.rb require 'executed' if executed? __FILE__ puts "Executed" else puts "Loaded" end Jesus.