I've found three ways to write the same condition in Ruby:
#1
if 1==1
puts "true"
end
#2
puts "true" if 1==1
#3
if 1==1 then puts "true" end
Why can't I do this?
#4
if 1==1 puts "true"
I don't understand:
(1) Why then and end are needed in #3, and,
(2) Why I need to change the order to get #2 to work.
Statement #4 seems like the most natural way to write this. I don't understand why it's not possible.