I started Python, but I was a little impressed with the following notation.
hoge.py
print u"failed." * 5 # 結果:failed.failed.failed.failed.failed.
So I was wondering if I could get the same result with the same notation in other languages, so I tried it.
hoge.rb
puts "failed." * 5 # 結果:failed.failed.failed.failed.failed.
hoge.exs
IO.puts "failed." * 5 #Result: warning: this expression will fail with ArithmeticError
hoge.pl
print "failed." * 5; #Result: 0
hoge.php
print "failed." * 5; //Result: 0
hoge.playground
println("failed." * 5) //Result: Not executable
It's surprisingly useless, isn't it? If I have a chance to touch a language I haven't tried this time, I'd like to try the same notation!
Recommended Posts