[I7] Telling I7 how to compare an adjective


Is it possible to tell Inform 7 what the correct comparative and superlative forms of an adjective are? Maybe using some arcane I6 voodoo?

With this:

A thing has a number called importance. 

Definition: a thing is important if its importance is 10 or more.

… you end up having to use “importantest” in your code, which is not very elegant. It would be neat if you could do something like

Definition: a thing is important (more important, most important) it its importance is 10 or more.

Or even if you could always use “more” and “most” for comparative/superlative forms of an adjective. I guess remembering to use adjectives with regular forms is another way of doing it…

I made a uservoice suggestion for this (and no one told me “You can already do that, dummy!”) You should give it a couple votes!

You have my vote, sir.

I don’t think that’s going to be enough. The condition, ‘if importance is more than 10’, could really be anything. It’s obvious to us that the game should use the ‘importance’ property, but does the syntax work with things that aren’t this obvious?

Currently I’d just write a ‘To decide which X is the most important X…’ phrase, but how about something like this:

A thing has a number called _importance.

Importance compares a thing with a thing. [Borrowing syntax from relations]
The verb to be important (least important, less important, important, more important, most important) implies the importance comparison.
The measure the importance of (item - a thing): [This must decide on a numerical value that is used to compare things]
   Decide on the _importance of item.

This would allow things like ‘the most important door’, ‘if X is less important than Y’, etc, while giving you a nice rule (measuring the [comparison name] of) to customize if you want to do complicated things.

It should be enough. When you define an adjective with something like “A thing has a number called size. A thing is big if its size is greater than 2,” then Inform automagically defines a comparative and superlative for it (I think it knows enough morphology to make it “bigger” and “biggest” in this case.) That gets you “the biggest door” and “If Y is bigger than X.”

I guess maybe the issue you’re raising is that the opposite relation isn’t defined – you can’t directly define “less important” – but that’s not built in in the current syntax and is easy enough to work around if you want to. The complaint here is just that Inform sometimes autogenerates funny-looking names for the comparative and superlative and doesn’t give you any control over them.