From c67251edb478509b4abd9910e0b499a116112a3c Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 7 Aug 2000 05:05:04 +0000 Subject: matz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/complex.rb | 12 ++++++------ lib/debug.rb | 4 ++-- lib/thread.rb | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'lib') diff --git a/lib/complex.rb b/lib/complex.rb index 733e4530e3..cb0a3dc564 100644 --- a/lib/complex.rb +++ b/lib/complex.rb @@ -125,12 +125,12 @@ class Complex < Numeric def / (other) if other.kind_of?(Complex) - self * other.conjugate / other.abs2 + self*other.conjugate/other.abs2 elsif Complex.generic?(other) - Complex(@real / other, @image / other) + Complex(@real/other, @image/other) else - x , y = other.coerce(self) - x / y + x, y = other.coerce(self) + x/y end end @@ -171,8 +171,8 @@ class Complex < Numeric r, theta = polar Complex.polar(r.power!(other), theta * other) else - x , y = other.coerce(self) - x / y + x, y = other.coerce(self) + x/y end end diff --git a/lib/debug.rb b/lib/debug.rb index 71fe830475..f8c0e4e408 100644 --- a/lib/debug.rb +++ b/lib/debug.rb @@ -10,7 +10,7 @@ SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__ require 'tracer' class Tracer def Tracer.trace_func(*vars) - Single.trace_func *vars + Single.trace_func(*vars) end end @@ -216,7 +216,7 @@ class DEBUGGER__ @frames[0] = [binding, file, line, id] display_expressions(binding) while input = readline("(rdb:%d) "%thnum(), true) - catch (:debug_error) do + catch(:debug_error) do if input == "" input = DEBUG_LAST_CMD[0] stdout.print input, "\n" diff --git a/lib/thread.rb b/lib/thread.rb index fd51d6d562..12fe81c542 100644 --- a/lib/thread.rb +++ b/lib/thread.rb @@ -21,13 +21,13 @@ if $DEBUG end def Thread.exclusive + _old = Thread.critical begin Thread.critical = true - r = yield + return yield ensure - Thread.critical = false + Thread.critical = _old end - r end class Mutex -- cgit v1.2.3