Created
March 22, 2011 21:28
-
-
Save redsquirrel/882117 to your computer and use it in GitHub Desktop.
It's annoying that this is valid Ruby and prints "hi mom"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if false | |
elsif | |
print "hi " | |
else | |
puts "mom" | |
end |
does arranging it this way help you see what it's doing?
if false
elsif print "hi "
else
puts "mom"
end
I know what it's doing. It's just annoying.
don't do that
Give in to your anger. With each passing moment you make yourself more Clojure's servant.
(cond false nil
(print "hi ") nil
:else (println "mom"))
Let the parens flow through you.
this should annoy you more then...
only works in RUBY_VERSION < 1.9.x
unless(puts "hi"): puts "mom" end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
:) thinking of switching to python?