Grabbing a categorized list of powers

Here’s the code I am trying to get to work:

Lab is a room.

A power is a kind of an object.

A category is a kind of value.
The categories are cat-a, cat-b and cat-c.

A power has a category.

pow001 is a power. The category of pow001 is cat-a.
pow002 is a power. The category of pow002 is cat-a.
pow003 is a power. The category of pow003 is cat-a.

pow004 is a power. The category of pow004 is cat-b.
pow005 is a power. The category of pow005 is cat-b.
pow006 is a power. The category of pow006 is cat-b.

pow007 is a power. The category of pow007 is cat-c.
pow008 is a power. The category of pow008 is cat-c.
pow009 is a power. The category of pow009 is cat-c.

To decide which list of powers is the list of powers in category (c - a category):
  decide on the list of c powers.

Fooing is an action applying to nothing.
Understand "foo" as fooing.
Instead of fooing:
	let L be the list of powers in category cat-c;
	showme L.

Test me with "foo".

Note that the phrase: decide on the list of cat-c powers. does work, but I can’t figure out how to make it work with an argument being provided.

This is a job for verbs.

The verb to be of category means the category property.

to decide what list of powers is the list of powers with category (c - a category):
  decide on the list of powers that are of category c.

of course, you don’t really need a phrase at that point.

4 Likes

So many things I don’t know… thanks, Zed.

Easy to miss, the only reference to it in WI lurks within the discussion of units (specified kinds of value, i.e., units) in WI 15.12 where it’s described in passing and sounds like just a little bit of syntactic sugar rather than something that enables important functionality you can’t get otherwise.

1 Like

I might be overlooking something, but it seems that in this particular case you can also get away with

[...] the list of powers which are c;

out of the box, without introducing a new verb.

2 Likes

You’re right, for anonymous enumerated kind of value properties you don’t need the verb, you’d only need it to do things like that with properties that don’t automatically become adjectives.

1 Like

Yup, that did it, thanks.

Zed, the verb solution is interesting as well. I’ll put it in my cheat sheet :).

2 Likes