I’m trying to figure out a way to write a “decide on” phrase to return:
- a number N
- that is the property of an object of kind X1
- which is one of several distinct but related objects with varying kinds (X1, X2, X3, etc.)
a) each of said kinds being a subkind of a parent X kind
b) and each of said objects being the only instance of that subkind in the related group - the whole group of which are related to a thing (call it Z)
and I would like the phrase to be expressible with something like: “intensity of X1 for Z”
That’s a bit complicated in the abstract, so, as an example:
A) rock kind is the equivalent of kind X, and all rocks have a numeric beauty property (which is the N value)
B) slate, marble, and flint are the equivalents of kinds X1, X2, X3
C) Z might be a person named Bob
D) a collection of a slate and a marble and a flint might all be desired by Bob using a new “desires” relation
I want to be able to say something like:
say "[beauty of flint* wanted by Bob*]"
where I can substitute the asterisked items with any combination of a subkind of rock and a person.
Is this possible? It seems like it should be, but I can’t quite seem to make it work. If I’m reading the documentation correctly, this would be along the lines of a phrase (description of things, person)->number but I’m having trouble translating that back into a working phrase.
Note that a construction like “list of rocks that are flints that are desired by Bob” works OK… I just can’t figure out how to get a parameterized equivalent. I assumed it would be along the lines of:
To decide which number is the beauty of (rocktype - description of rocks) for (X - a person):
...
decide on N.
In the middle part, it seems OK to write something like:
let possibilities be the list of rocktype; [sets it to a list of all flints, marbles, etc. as specified]
or
let possibilities be the list of rocks desired by X; [sets it to a list of all rocks desired by person specified]
but I want to be able to combine the two filters to get it down to just the one rock of the right type desired by the right person, and I can’t figure out a phrase acceptable to the compiler along the lines of:
let possibilities be the list of rocks that are rocktype that are desired by X;
Note that I realize I could use the working bits above to create the two short lists and then iterate through one of them looking for the item listed in the other, but that doesn’t seem very elegant.