public
Description: a Scheme written in Ruby, but implemented on the bus!
Homepage: http://bus-scheme.rubyforge.org
Clone URL: git://github.com/technomancy/bus-scheme.git
use ensure instead of rescue+re-raise
technomancy (author)
Sat May 31 14:55:55 -0700 2008
commit  cb3b80fc532d1228a9c5bc59c099aed8f8814722
tree    e195c1019013f18b6bcd559a07ea5222fc1b64a5
parent  1d4301c103d0369e3c13a38fb880c0c617035388
...
57
58
59
60
61
62
63
64
65
66
67
68
 
 
 
 
 
 
69
70
71
...
57
58
59
 
 
 
 
 
 
 
 
 
60
61
62
63
64
65
66
67
68
0
@@ -57,15 +57,12 @@ module BusScheme
0
 
0
   # Load a file if on the load path or absolute
0
   def self.load(filename)
0
- begin
0
- loaded_files.push filename
0
- eval_string File.read(add_load_path(filename))
0
- loaded_files.pop
0
- rescue
0
- puts BusScheme.stacktrace.join("\n ")
0
- loaded_files.pop
0
- raise
0
- end
0
+ loaded_files.push filename
0
+ eval_string File.read(add_load_path(filename))
0
+ rescue
0
+ puts BusScheme.stacktrace.join("\n ")
0
+ ensure
0
+ loaded_files.pop
0
   end
0
 
0
   def self.add_load_path(filename, load_path = BusScheme['load-path'.sym])
...
30
31
32
33
34
 
35
36
37
38
39
40
...
30
31
32
 
 
33
34
35
 
36
37
38
0
@@ -30,11 +30,9 @@ module BusScheme
0
       BusScheme.stack.push @frame
0
       begin
0
         val = @body.map{ |form| BusScheme.eval(form) }.last
0
- rescue => e # TODO: ensure?
0
- raise e
0
+ ensure
0
         BusScheme.stack.pop
0
       end
0
- BusScheme.stack.pop
0
       return val
0
     end
0
 

Comments

    No one has commented yet.