Re: Inform: Scope problem


17 Oct 1995 13:09:15 GMT

"Sam Hulick" <shulick@raisin.ucs.indiana.edu> wrote:
> The manual SAYS that ChooseObjects is called when trying to pick an
> item that may be ambiguous.. but it does not get called. I inserted a
> print statement into my ChooseObjects, and did "get apple" and
> apparently the ChooseObjects routine wasn't called.

I guess that what's going on is this: the apples are completely
identical as far as the parser is concerned (because they have the same
`name' properties and because they have no parse_name routine). So
there's no need to call ChooseObjects at all, because the parser thinks
that it doesn't matter which apple the it picks.

One solution, involving changing the libraries, would be to force the
parser to ask the ChooseObjects routine even when it believes the
objects are identical, just in case the programmer happens to know
better.

Possible solutions in the meantime: (1) give the apples a `parse_name'
routine that returns -2 when `parser_action' is `##TheSame'. Then the
parser will think the apples are different, and call ChooseObjects. But
now it's up to ChooseObjects to make sure that one apple scores better
than the rest, otherwise the parser will ask something like

Which do you mean, the apple, the apple, the apple or the apple?

(2) For every verb which you want held objects to take precedence over
non-held objects, extend it with a new clause, for example:

Extend "eat" first * held -> Eat;
Extend "smell" first * held -> Smell;

and so on.

--
Gareth Rees