Hacker News new | past | comments | ask | show | jobs | submit login

Ruby has some of these, too, thanks to its Perl heritage.

    puts "It worked!" unless error
    i = 0; puts "Item: #{i+=1}" while i < 5
Unfortunately foreach didn't survive, but thankfully arrays have methods to achieve similar concision:

    items.each {|i| puts "Item: #{i}"}



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: