Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我看到了一个带有“when”而不是“if”的代码片段的演示文稿。代码看起来像一种基于 JVM 的脚本语言,使用缩进而不是“{}”,并且并非每一行都以“;”结尾
你能给我一个线索,它可能是哪种语言?
Ruby 有 case-when 语句。我的猜测是“JRuby”。
case x when User === x puts "Constant" when "User" === x puts "string" else puts "nothing" end