What's the diff -- my code and the documentation?

I have what I think is equivalent to code in the documentation, except it contains one level more of “kind of”. The docs show how to put a pocket in a jacket; I want to put a pocket in a backpacket. What the diff?
Here’s the doc code:

> A jacket is a kind of thing. A jacket is always wearable.
A pocket is a kind of container. A pocket is part of every jacket. 

Here’s my code:

A backpack is equipment. [Equipment is a kind of thing.] 
A backpack is always wearable. A backpack is openable and open.
A pocket is a kind of container. A pocket is part of every backpack. 

I get the following error:
You wrote ‘A pocket is part of every backpack’ but something described only by its kind should not be given a specific place or role in the world, to avoid ambiguity. For instance, suppose ‘car’ is a kind. Then we are not allowed to say ‘a car is in the garage’: there’s too much risk of confusion between whether an individual (but nameless) car is referred to, or whether cars are generically to be found there. Sentences of this form are therefore prohibited, though more specific ones like ‘a car called Genevieve is in the garage’ are fine, as is the reverse, ‘In the garage is a car.’

A backpack is equipment. creates a single backpack. Try A backpack is a kind of equipment.

2 Likes

But equipment is a kind of thing. Shouldn’t that make backpack a kind of?
Thing → Equipment → backpack (class hierarchy)

If you write “X is a Y” you get one instance of the Y kind. If you say “X is a kind of Y” you get a subkind.

1 Like

Saying backpack is an equipment doesn’t make backpack a **kind of** equipment any more than saying Lab is a room makes Lab a **kind of** room.

There are kinds, which are abstract, and there are things, which are objects of kind thing. They’re expected to correspond to concrete things in your game world. Kinds will never correspond to concrete things in your game world: they are always an abstraction.

backpack is an equipment makes backpack a specific object, an object of kind equipment.

Inform muddies the water by allowing you to create a kind and create an object of that kind with the same name and it trips people up until they get used to it.

3 Likes

Sometimes it’s confusing and difficult when you’re trying to make a thing behave as a container. I think you can grant it all the properties, but the alternative is to make an assembly.

Lab is a room.

equipment is a kind of thing.

A backpack is a kind of equipment. A backpack is wearable. The description is usually "[The noun] has a small external pocket and a larger main compartment."

A main compartment is a kind of container. A main compartment is openable. One main compartment is part of every backpack. 

Instead of inserting something into a backpack (called B): try inserting the noun into a random main compartment incorporated by B. 

Instead of opening a backpack (called B): try opening a random main compartment incorporated by B.

Instead of closing a backpack (called B): try closing a random main compartment incorporated by B.

An external pocket is a kind of container. An external pocket is open. One external pocket is part of every backpack. 

A red backpack is a backpack in Lab. A gray backpack is a backpack in lab.

A textbook is in lab. 

A thing can be pocketable. 

A pencil is in lab. it is pocketable.

Check inserting something into an external pocket: 
	If the noun is not pocketable: 
		say "That's too big to fit in [the second noun]." instead.

Lab
You can see a red backpack, a gray backpack, a textbook and a pencil here.

wear red

(the red backpack) (first taking the red backpack) You put on the red backpack.

put textbook in pocket

Which do you mean, the gray backpack’s external pocket or the red backpack’s external pocket?

red

That’s too big to fit in the red backpack’s external pocket.

put textbook in red

(the red backpack) (first taking the textbook) You put the textbook into the red backpack’s main compartment.

put pencil in pocket

Which do you mean, the gray backpack’s external pocket or the red backpack’s external pocket?

red

(first taking the pencil) You put the pencil into the red backpack’s external pocket.

Thanks. On that is what I tripped.

That was a good help. I want to create several backpacks, but I don’t want to give them some arbitrary identifier. (In some cases, I want to create 100 arrows, etc.) I’ve had some success with Five backpacks are in the Lab.. Inform seems to handle multiples well once the correct definitions are in place.