Re: Subclassing Struct.new
by Yukihiro Matsumoto other posts by this author
Feb 28 2006 11:45PM messages near this date
Re: Subclassing Struct.new
|
Re: Subclassing Struct.new
Hi,
In message "Re: Subclassing Struct.new"
on Wed, 1 Mar 2006 16:28:37 +0900, "Minkoo Seo" <minkoo.seo@[...].com> writes:
|This make sense, but
|
|> | def baz
|> | n # variable - Do we really need this uninitialized variable access?
|> | n = 3
|> | n
|> | end
For example, in cases like this:
def foobar(ary)
# we need to "declare" a variable here under the current behavior,
# but no longer under the new behavior
ary.each do |elem|
if some_condition_on_elem(elem)
found = elem # "found" will be available during whole #foobar.
break
end
end
some_work_with_found_elem(found)
return found
end
matz.
Thread:
Minkoo Seo
Chiaro Scuro
Minkoo Seo
Yukihiro Matsumoto
Mark Wilden
Markus Werner
Chiaro Scuro
Minkoo Seo
Minkoo Seo
Hal Fulton
mental
Ross Bamford
mental
Ross Bamford
Chiaro Scuro
Ross Bamford
Chiaro Scuro
Minkoo Seo
Chiaro Scuro
mental
Chiaro Scuro
mental
Yukihiro Matsumoto
Caleb Clausen
Yukihiro Matsumoto
Caleb Clausen
MenTaLguY
Yukihiro Matsumoto
gwtmp01
Chiaro Scuro
mental
Chiaro Scuro
mental
Logan Capaldo
Pit Capitain
|