1

I saw a presentation with a code-snippet with "when" instead of "if". The code saw like a JVM-based scripting language, used indentation instead of "{}" and not each line was finished with ';'

Could you give me a clue, which language it could be?

Péter Török
  • 114,404
  • 31
  • 268
  • 329
Valentin H
  • 7,240
  • 12
  • 61
  • 111

1 Answers1

7

Ruby had the case-when statements. My guess would be "JRuby".

case x
when User === x 
    puts "Constant"
when "User" === x
    puts "string"
else 
    puts "nothing"
end
Erhan Bagdemir
  • 5,231
  • 6
  • 34
  • 40