How about code like this?
Attribute is_telephone;
[ DialSub;
if (second hasnt is_telephone) "You can't dial on that.";
<<Dial second 0>>;
];
Verb "dial" * number "on" is_telephone -> Dial
* number "on" noun -> Dial;
Object Telephone "telephone"
has is_telephone
with name "telephone" "phone",
before [ i;
Dial:
switch (special_number) {
999: "~We'll be right over,~ says the policeman.";
911: "~We'll be right over,~ says the cop.";
100: "There's no operator service on this phone.";
}
];
The `is_telephone' attribute allows the parser to deduce which object
you mean when you type `dial 100' in a room with a telephone, rather
than having to ask you `what you want to dial that on?'.
-- Gareth Rees