git @ Cat's Eye Technologies Samovar / cb8c444
Test that ?_ cannot be used in text or consequences of a rule. Chris Pressey 6 years ago
1 changed file(s) with 18 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
221221 facts.
222222
223223 A special "wildcard" variable, `?_`, matches any term, and does not unify.
224 It cannot appear in the text or the consequent of a rule.
225224
226225 scenario UntilHoldBrick {
227226 [actor(?_),item(?_)] There was an actor and an item. [~actor(Ignatz)]
230229 goal [].
231230 }
232231 ===> There was an actor and an item.
232
233 `?_` cannot appear in the text or the consequent of a rule.
234
235 scenario UntilHoldBrick {
236 [actor(?_),item(?_)] There was ?_ and ?_. [~actor(Ignatz)]
237 actor(Ignatz).
238 item(brick).
239 goal [].
240 }
241 ???> KeyError
242
243 scenario UntilHoldBrick {
244 [actor(?_),item(?_)] There was an actor and an item. [~actor(?_)]
245 actor(Ignatz).
246 item(brick).
247 goal [].
248 }
249 ???> KeyError
233250
234251 The text inside the event rule is typically expanded with the values
235252 that the pattern variables matched.