Message-ID: <3D073EA7.9040604@csi.com>
Date: Wed, 12 Jun 2002 08:29:27 -0400
From: John Colagioia <JColagioia@csi.com>
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4.1) Gecko/20020314 Netscape6/6.2.2
X-Accept-Language: en-us
MIME-Version: 1.0
Newsgroups: rec.arts.int-fiction
Subject: Re: [Inform] Good old lock and key, disambiguation problem
References: <l6pcgu8m2ive5shq995k8703fnfl38iihn@4ax.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: ool-182f30fa.dyn.optonline.net
X-Original-NNTP-Posting-Host: ool-182f30fa.dyn.optonline.net
X-Trace: excalibur.gbmtech.net 1023884581 ool-182f30fa.dyn.optonline.net (12 Jun 2002 08:23:01 -0400)
Organization: ProNet USA Inc.
Lines: 37
X-Authenticated-User: jnc
Path: news.duke.edu!newsgate.duke.edu!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!ihug.co.nz!cox.net!news-xfer.siscom.net!uunet!dca.uu.net!excalibur.gbmtech.net
Xref: news.duke.edu rec.arts.int-fiction:104916

I've been planning to get back into the swing of things, around here.
 This looks like a good opportunity.

Jaap van der Velde wrote:
[...]

>>unlock 311
>>
>(with the door 311)
>(first taking the door 311)
>That's hardly portable.
>
>How can I know in ChooseObjects that the 'locked object position'
>in the unlock verb has already been filled? (in other words, how
>do I know ChooseObjects is trying to fill the 'second' position)
>
>I checked the DM, but can't find the answer to this one...
>

It can be done.  It's ugly.  It's undocumented (everyplace I've looked),
but some digging into the library files found me a gem when I was trying
to do almost exactly the same thing.

As it turns out, there's a global variable used deep within the parser,
called "parameters."  The comment (in parserm.h) says, "Parameters
(objects) entered so far."  When you're filling "noun," it's set to
zero.  When you're filling "second," it's set to one.  The fact that
it's not documented suggests that you're not supposed to monkey with it,
and that it's not intended to be reliable, but as long as nobody makes a
wholesale change to the library, it should work.

There's also params_wanted ("Number of parameters needed (which may
change in parsing)," according to the comment), in case that's of interest.

Between this and Mr. Brakhane's more "native" suggestion of extending
the verb(s), you should be set.

