Project

General

Profile

Feature #16684

Updated by sawa (Tsuyoshi Sawada) 9 months ago

The most-recent-call-last order of backtrace introduced by #8661: 

 ```ruby 
 def a; raise end 
 def b; a end 
 def c; b end 
 c 
 ``` 

 ``` 
 Traceback (most recent call last): 
	 3: from foo.rb:4:in `<main>' 
	 2: from foo.rb:3:in `c' 
	 1: from foo.rb:2:in `b' 
 foo.rb:1:in `a': unhandled exception 
 ``` 

 is intuitive, and I hope it is retained. However, there are people complaining that it is confusing. I believe the unnaturalness is (at least partly) due to the fact that the word "from" is used, which made sense when backtrace was displayed in most-recent-call-first order, 

 ``` 
 foo.rb:1:in `a': unhandled exception 
	 1: from foo.rb:2:in `b' 
	 2: from foo.rb:3:in `c' 
	 3: from foo.rb:4:in `<main>' 
 ``` 

 but not any more. Here, my understanding is that "from" means that the previous that line was called **from** that line. the next line displayed in the backtrace. 

 I propose that, so long as the most-recent-call-last order is adopted, the word "to" should be used rather than "from": 

 ``` 
 Traceback (most recent call last): 
	 3: to foo.rb:4:in `<main>' 
	 2: to foo.rb:3:in `c' 
	 1: to foo.rb:2:in `b' 
 foo.rb:1:in `a': unhandled exception 
 ``` 

 By using different words, it would become easier to understand the display order at a glance, and even by just looking at a single line. 

Back