为什么KRL需要关键字'then'

时间:2011-05-31 01:07:46

标签: grammar krl

当我在KRL规则中编写条件操作块时,我总是忘记'then'关键字。这是正确的语法:

rule with_conditions {
  select when pageview ".*"
  pre {
    cheese = "Camembert";
  }
  if (cheese like re/bert/) then {
    notify("Odd Cheese", "#{cheese} is unusual.");
  }
  fired {
    raise explicit event "odd_cheese";
  }
}

为什么'那么'?没有它,这不是很清楚吗?

1 个答案:

答案 0 :(得分:2)

可能是因为该语言的作者认为添加then更自然。

相关问题