From: Kazuo Saito Date: 2003-02-19T04:22:22+09:00 Subject: Re: ruby-dev summary 19540-19582 Paul Brannan wrote: > On Mon, Feb 17, 2003 at 11:57:33PM +0900, Takaaki Tateishi wrote: > >> Matz answered that a file loaded by 'require' is added $" after >> compilation to solve this problem. However, we should reconsider >> what the best exception behavior while executing the loaded file. > > > I don't understand this statement. What did Matz mean by "best > exception behavior?" The sentence wanted to indicate the expected behavior for exceptions raised during evaluation of the script itself. For instance according to the summary: $ cat a.rb puts "a1" require 'a' <--- (1) puts "a2" $ ruby a.rb <--- (2) If "a.rb" is treated as "already require"d in evaluation (2), the evaluation *must be finished successfully with no exceptions raised*. But the results cannot be decided during the evaluation (2) itself, because any exceptions might be raised by further statements in "a.rb". So ruby in current version does not deal the evaluation (2) with "already required a.rb" status at require statement at (1) in the evaluation (2). However, as you know by the summary, this function also gives us unexpected behavior in requiring the script itself. Kazuo Saito