Today I added a first spatial query to &babbler. You can detect if a card p
points at another card q
in a given direction d
with a query of the form (when p points d at q)
. p
, q
, d
can also be placeholders so you can react to several spatial relationships at once. The query itself triggers the drawing of "pointing whiskers" so you can visualize how cards point to each other.
Since it's impractical to precompute all possible spatial relationships, I introduced a notion of "responders" to the facts database, ie callbacks that can generate new facts on demand when a query matches a specific pattern. Next step is to add new spatial responders (ie proximity, clustering, etc) and hopefully allow such responders to be defined in user-code.