* enum.c (inject_i): use rb_yield_values.

* enum.c (each_with_index_i): ditto.

* eval.c (rb_yield_splat): new function to call "yield *values".

* string.c (rb_str_scan): use rb_yield_splat().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2003-08-22 08:09:58 +00:00
parent 7cca6c25f0
commit 7ff7bcbf9d
8 changed files with 41 additions and 14 deletions

View file

@ -95,7 +95,10 @@ class << Singleton
@__instance__ = new
ensure
if @__instance__
def self.instance; @__instance__ end
class <<self
remove_method :instance
def instance; @__instance__ end
end
else
@__instance__ = nil # failed instance creation
end
@ -109,7 +112,10 @@ class << Singleton
@__instance__ = new
ensure
if @__instance__
def self.instance; @__instance__ end
class <<self
remove_method :instance
def instance; @__instance__ end
end
else
@__instance__ = nil
end