When I'm writing a conditional action block in a KRL rule I always forget the 'then' keyword. Here is the correct syntax:
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";
}
}
Why 'then'? Wouldn't it be just as clear without it?
Probably because the writers of the language felt that adding then
was more natural.