문제

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?

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top