當我在KRL規則中編寫條件操作塊時,我總是忘記'then'關鍵字。這是正確的語法:爲什麼在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";
}
}
爲什麼'然後'?如果沒有它,它會不會很明顯?
標籤SO拒絕:奶酪,小東西,驅動你堅果。 – 2011-05-31 01:08:31
對於什麼是值得的,我會使用+1來增加學習的方便性。當我第一次開始編程時,我討厭那個時候很容易閱讀的Python腳本。 – 2011-06-02 01:06:17
猜猜我很習慣沒有'then'的語言(javascript,python),它總是讓我出差。 – 2011-06-02 03:49:05