From: 7stud -- Date: 2007-09-19T05:21:25+09:00 Subject: Re: Variable / Method Ambiguity 7stud -- wrote: >David Black wrote: >The second time through >the loop, there's no assignment to a, and the first variable a has >gone out of scope. > Wait a minute. 'a' has gone out of scope? for i in 1..2 if i == 1 a = 10 print "a=", a, "\n" else puts a end end puts "*#{a}" puts a --output:-- a=10 10 *10 In ruby, for loops and if clauses don't create a scope. -- Posted via http://www.ruby-forum.com/.