I7 syntax question--understand a kind as.

What is the the correct syntax I need to make this work?

a magic-spell is a kind of thing.
A magicScroll is a kind of thing. A magicScroll has a magic-spell called recordedSpell. understand “scroll” as magicScroll. understand “scrolls” as the plural of a magicScroll.
understand “[recordedSpell of magicScroll]” as magicScroll.

it’s the last part that’s not working. I want any scroll to be understood by the name(s) of the spell written on that scroll.

A scroll is a kind of thing. 

Inscription relates a spell to a scroll. The verb to be inscribed on implies the inscription relation. The verb to bear implies the reversed inscription relation.
Understand "[something related by reversed inscription]" as a scroll.
Understand "scroll of/-- [something related by reversed inscription]" as a scroll.
Understand "blank scroll" as a scroll when there is nothing inscribed on the item described.

Rule for printing the name of a scroll (called item):
	if something (called magic) is inscribed on the item, say "scroll of [the magic]";
	otherwise say "blank scroll".

The Withered Hand is a spell.

Home is a room.
There is a scroll bearing the Withered Hand. It is in Home.

This could probably be made tidier, but it’s a starting point, and since I’m coming down with a cold, others on the forum would probably be able to assist in improving the syntax.

(In particular, since the scrolls themselves are nameless duplicates as far as the code is concerned, and the code therefore doesn’t understand what “scroll of the Withered Hand” means outside of the Understanding phase, placing them where you want them could become tricky.)

If you make magic-spells into a kind of value, you can use understanding by properties. You can even just say

A magicscroll has a magic-spell.

instead of giving it a named property, and that lets you define scrolls by saying “A Withered Hand magicscroll is in Test Lab.” See the example “Early Childhood 4” in the documentation. (When I had “A magicscroll has a magic-spell called recordedSpell” that stopped working, and getting the scrolls to have the right spells got very annoying.)

So:

a magic-spell is a kind of value. The magic-spells are Withered Hand and Finger of Death.
A magicScroll is a kind of thing. A magicScroll has a magic-spell. understand "scroll" as magicScroll. understand "scrolls" as the plural of a magicScroll. Understand "scroll of" as a magicScroll.
Understand the magic-spell property as describing a magicScroll.

Test Lab is a room.

For printing the name of a magicScroll: say "scroll of [magic-Spell of the item described]".

There is a Finger of Death magicscroll in Test Lab. 
There is a Withered Hand magicScroll in Test Lab.

test me with "take scroll/finger of death/i/l/take scroll".

This has some advantages over understanding by relations–in particular, I think that if the only difference between two scrolls is the things that they’re related to, Inform will treat them as indistinguishable objects even if the player can in fact distinguish them by referring to the related objects. This means that it will just list two different scrolls as “two scrolls,” and if you type “take scroll” will just pick the first-defined scroll rather than disambiguating. So if we try Björn’s code with another scroll:

A spell is a kind of thing.
A scroll is a kind of thing. 

Inscription relates a spell to a scroll. The verb to be inscribed on implies the inscription relation. The verb to bear implies the reversed inscription relation.
Understand "[something related by reversed inscription]" as a scroll.
Understand "scroll of/-- [something related by reversed inscription]" as a scroll.
Understand "blank scroll" as a scroll when there is nothing inscribed on the item described.

Rule for printing the name of a scroll (called item):
	if something (called magic) is inscribed on the item, say "scroll of [the magic]";
	otherwise say "blank scroll".

The Withered Hand is a spell. Finger of Death is a spell.

Home is a room.
There is a scroll bearing the Withered Hand. It is in Home.
There is a scroll bearing Finger of Death. It is in Home.

we run into some trouble:

Home
You can see two scrolls here.

>take scroll
Taken.

>i
You are carrying:
  a scroll of the Withered Hand

>l
Home
You can see a scroll of Finger of Death here.

>

…so if you don’t need spells to be tangible objects, I’d advise making them into values and using understanding by properties.

1 Like