Difference between holding and carrying relations

Apologies if this is laid out clearly someplace, but I dug around and couldn’t find a clear difference between the holding and carrying relations.

I do see that the taking action establishes a carrying relation

Carry out an actor taking (this is the standard taking rule):
	now the actor carries the noun;
	if the actor is the player, now the noun is handled.

But “holds” and “carries” seem to be used interchangeably. Once something is taken, both relations are set. Are they just synonyms?

I think the holding relation includes the carrying and wearing and incorporation relations. I.e. a player holds something if the player either carries it, wears it, or has it as part of the player (e.g. body parts).

4 Likes

Yep! that’s exactly it! I’ve found it in the docs. Thanks!

1 Like

Since we’re all here… how is the holding relation set? Is it a relation expressing a condition?

Also… does something preferably held refer to something held? Or rather carrried?

For instance, here the parser seems to prefer something in the location over something that is part of the player. For instance:

lab is a room.

jill is a person.
the player is jill.

the head is part of jill.
the wallet is in lab.

kleeshing is an action applying to one thing.
understand "kleesh [something preferably held]" as kleeshing.

Here, kleeshing prefers a wallet on the ground over something that is part of the player.

>>kleesh
(the wallet)

preferably held sets a grammar line flag held, which goes way back to the I6 days. I believe it does an I6-level parent(n) == actor check. This is approximately a holder of... check, in I7 terms; it’s not a relation check at all.

EDIT: Whoops, forgot that the I7 “holding” relation uses the same logic as holder of.... So it is that, except not exactly, because the grammar flag predates components. So it won’t pick up things that are part of the player. (Which counts as “holding”.)

1 Like

Ah, nice. The part of bit was really tripping me up. Thanks!

Pretty much! But at the I6 level, not the I7 level. That’s why you can set it (“now the wallet is held by the player”), which you can’t normally do with computed relations. Setting it actually sets “carried”, “in”, or “on”, depending on the type of the parent (since those three are all actually equivalent at the I6 level).

Currently it means “carried or worn”, because for the most part the parser doesn’t understand “part of” (that one’s implemented differently in I6 from all the others, and postdates the parser). There’s an enhancement request to change this in some parts of the parser and that might extend to the [something preferably held] grammar token, or it might not. The parser is a complicated thing!

Also note that if you say “something held” in a condition or description without specifying who, you’re not querying the relation (at least, not directly) – that’s defined as an adjective. I think it’s equivalent to “held by the player” but not 100% sure. (This is entirely separate from the “something preferably held” grammar token.)

The Standard Rules are straightforward:

Definition: a thing is worn if the player is wearing it.
Definition: a thing is carried if the player is carrying it.
Definition: a thing is held if the player is holding it.

Correct.

2 Likes

The best reference is Elegant way to test whether something is in a location (even if in a container) - #7 by drpeterbatesuk and its follow-up a few comments further down in that thread, linked as “Spatial and other relations between objects” in the I7 Docs and Resources post.

The assertion X holds Y is identical to X carries Y. The compiler can and will infer from it that X is a person, so that will be X’s kind unless something more specific is asserted. The same applies to imperative sentences (i.e., X holds Y within now X holds Y in a code block).

As noted above, for the holding relation, the thing that is meant by the verb to hold in conditional sentences, X holds Y is true if X supports Y, X contains Y, X carries Y, X wears Y, or X incorporates Y (i.e., Y is a part of X).

There are some weird details surrounding rooms, regions, doors, and backdrops that Peter’s post goes into.

Unless you go looking for weird details the holder of phrase returns what you’d expect given the above meaning of holding, but first thing held by... and next thing held after... do not recognize incorporation.

It’s a special-case that the compiler does a bunch of finagling to handle.

3 Likes

Oops, I forgot another case worth mentioning with still yet another appearance of a form of the English verb “to hold” in Inform code. to be held in or to be held inside means the reversed containment relation. to be held by means the reversed holding relation, as usual.

1 Like