chif pacian’s latest code release demonstrates a couple of things worth pointing out.
we’ve previously talked about multiqueries, where a predicate like:
*(item $Obj)
will set up a choice point and repeat until it succeeds (or fail if it ultimately doesn’t succeed).
in this block:
he uses (exhaust).
this will also repeat but, unlike a multiquery, it won’t stop when it succeeds but will continue to perform the operations between { } until it’s exhausted all possibilities. this ensures that everything held by the stranger is evaluated, not just the first item.
this might also be a good time to mention dialog’s linguistic trait predicates, an extensive collection of predicates that take into account an object’s gender and number and markedly simplify pronoun usage.
we’ve already seen (the $Obj) and (The $Obj). there are many others, such as (a $Obj), (An $Obj). some mark possession such as (its $Obj) (expands to ‘its’ ‘their’ or ‘your’), some mark verbs - (is $Obj) will become ‘is’ ‘are’ ‘are’.
so something like:
(That $Obj) (has $Obj) (its $Obj) faults.
will turn into anything from:
‘THAT couch HAS ITS faults’ to ‘THESE lobsters HAVE THEIR faults’ simply based on what $Obj is bound to.
it’s a little thing but cuts down on typos.