| … | … | @@ -28,15 +28,16 @@ |
| 28 | 28 | (define cvp (PredicateNode "*-CountingKey-*")) |
| 29 | 29 | (define one (NumberNode 0 0 1)) |
| 30 | 30 | |
| 31 | ; The TriggerLink will execute, in sequential order, whatever it wraps. |
| 32 | ; It will return the result of the last thing that was executed; here, |
| 33 | ; the total count, providing visual confirmation that it's working. |
| 31 | 34 | (define (incr-counts THING-A THING-B) |
| 32 | | (Trigger (IncrementValue |
| 33 | | (List THING-A THING-B) cvp one)) |
| 34 | | (Trigger (IncrementValue |
| 35 | | (List (AnyNode "left wildcard") THING-B) cvp one)) |
| 36 | | (Trigger (IncrementValue |
| 37 | | (List THING-A (AnyNode "right wildcard")) cvp one)) |
| 38 | | (Trigger (IncrementValue |
| 39 | | (List (Any "left wildcard") (Any "right wildcard")) cvp one))) |
| 35 | (Trigger |
| 36 | (IncrementValue (List THING-A THING-B) cvp one) |
| 37 | (IncrementValue (List (AnyNode "left wildcard") THING-B) cvp one) |
| 38 | (IncrementValue (List THING-A (AnyNode "right wildcard")) cvp one) |
| 39 | (IncrementValue |
| 40 | (List (Any "left wildcard") (Any "right wildcard")) cvp one))) |
| 40 | 41 | |
| 41 | 42 | ; Same as above, but works with strings. It counts how often a pair |
| 42 | 43 | ; was "observed". |