KScript 文档
ZH

变更内容

语句与运算符

之前 现在
if $n lt 10、ge、eq、ne 在 .kscript 文件中 if $n < 10、>=、==、!=(XML 保留这些词;and、or 和 not 在两者中都保持原词) fix (KS6012)
} else if $b { } elif $b { fix (KS6012)
input(into = name) input(into: name) fix (KS6012)
catch NotFound, Conflict as e catch NotFound | Conflict as e fix (KS6012)
catch err when $err.type == 'NotFound' catch NotFound as err(when 仍会添加测试)
match $n { case 1 { } default { } } match $n { 1 => { } _ => { } },与 match 表达式中的分支相同
test(name: "x", each: n, in: [1, 2], index: i) { } for n at i in [1, 2] { test(name: "x {$n}") { } }
KScript.Window(title: "Hi") { }, KScript.input(...) import KScript.UI,然后是 Window(title: "Hi") { }:包只能在 import 中被引用,不会静默导入任何内容