4 ms·
this is wrong! >> a = 1 => 1 >> b = 2 => 2 >> a = 3 unless b==2 => nil >> a => 1 >> a = unless b==2 >> 2 >> end => nil >> a => nil
by aaronblohowiak 17y ago
this is wrong!
>> a = 1
=> 1
>> b = 2
=> 2
>> a = 3 unless b==2
=> nil
>> a
=> 1
>> a = unless b==2
>> 2
>> end
=> nil
>> a
=> nil
The difference is in the variable definition semantics, not in the assignment semantics. Please do not spread this misinformation.
- figgs 17y agoMy bad. Thanks for clarifying that.