Newsgroups: rec.arts.int-fiction
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!howland.erols.net!portc.blue.aol.com.MISMATCH!portc03.blue.aol.com!newsfeed.skycache.com.MISMATCH!newsfeed1.cidera.com!news-reader.ntrnet.net!uunet!ash.uu.net!world!buzzard
From: buzzard@world.std.com (Sean T Barrett)
Subject: Re: [Inform] Newbie has-a question
Message-ID: <GFnvE8.KHt@world.std.com>
Date: Thu, 28 Jun 2001 22:20:32 GMT
References: <328b5b3b.0106280334.4feb813f@posting.google.com>
Organization: The World Public Access UNIX, Brookline, MA
Lines: 29
Xref: news.duke.edu rec.arts.int-fiction:89347

dorky_brat_pack_kid <ex_nihil@hotmail.com> wrote:
>Is this tricky or am I just being dumb?
>(c) I want a 'has-a' relationship between X and Y: each X will have a
>Y.
>(d) I don't want a 'contained-in' relationship - X's are not
>containers.

One possibility for (c) and (d), look in the DM4 about using
"transparent" to add components to objects. This may not be
what you want if you want the Ys to appear "next to" the X's
in room descriptions etc.

>(a) Is there a library variable or routine I can refer to in "IsOwned"
>instead of having to use the ugly MYVAR_Owner global? I know there is
>an <action_to_be> variable but there does not seem to a <noun_to_be>.

I don't know the answer to your actual question (I assume you've
checked 'noun' and it doesn't have the right thing?), but the need
to use ugly global variables is basic to Inform parsing; see,
for instance, the DM4's example about how to create a verb
with a third object called 'third'--by stuffing it in a global
variable. So I wouldn't worry about your example approach.

On the other hand, if all of your Ys have the same short name,
maybe you should just use a grammar that says

   'touch' * noun 'y-name' -> TouchY

SeanB
