Look the below code

(arup~>~)$ pry --simple-prompt
>> x = 1
=> 1
>> puts "x is 1" if x == 1
x is 1
=> nil
>> puts "x is 1" if x != 1
=> nil

The above code is telling, first checking the conditions, then execute
the body `puts ...`. I agree this, why then error from the below code ?

>> puts a if a = 0.zero?
NameError: undefined local variable or method `a' for main:Object
from (pry):4:in `__pry__'

-- 
Posted via http://www.ruby-forum.com/.