Hey guys. I started using a relationship between things, and then I wanted to iterate over all things that are part of such a relationship. I figured it would be easy… and I’m sure it is.
Here’s what I’ve got:
Section - Partnering
Partnering relates one thing to another (called partner).
The verb to partner with implies the partnering relation.
[there is probably something neater than this]
to decide whether (T - a thing) is partnered:
if the partner of T is not nothing, yes;
no;
[And this?]
definition: a thing is partnered if it is partnered;
Section - demo
the demo is a room.
Foo, Bar, Quux and Zop are things.
Foo partners with Bar. Quux partners with Zop.
statting is an action out of world applying to nothing.
Understand "stat" as statting.
carry out statting:
repeat with T running through the list of partnered things:
say "[T] - [the partner of T].".
test me with "stat".
I mean, it works, but I have a feeling I am doing things in a very circuitous fashion. I mean - “definition: a thing is partnered if it is partnered;”. Really? Anybody want to show me a more elegant way to do it?