Newsgroups: rec.arts.int-fiction
Path: gmd.de!xlink.net!sol.ctr.columbia.edu!math.ohio-state.edu!cs.utexas.edu!uunet!spool.mu.edu!umn.edu!news
From: TPro0001@tebbs.mn.org
Subject: Re: Let's design a better language
Message-ID: <CFn4HF.4wr@news.cis.umn.edu>
Sender: news@news.cis.umn.edu (Usenet News Administration)
Nntp-Posting-Host: gold1.tc.umn.edu
Organization: University of Minnesota, Twin Cities
References:  <CFn0GA.GoA@cantua.canterbury.ac.nz>
Date: Fri, 29 Oct 1993 03:58:11 GMT
Lines: 42

In article  <CFn0GA.GoA@cantua.canterbury.ac.nz> 
greg@huia.canterbury.ac.nz (Greg Ewing) writes: 
> Name Scoping
> ------------
> 
> Often there are mundane objects of which instances appear in
> many places, e.g. chairs, paintings on walls, etc. Now, I don't
> want to have to invent a globally unique name for every single
> chair in every room of the whole game.
> 
> What I would like to be able to do is declare such objects
> *within* the room where they belong, with the name being local
> to that room. For example (choosing a syntax at random):
> 
>         location livingRoom {
>                 ldesc "This seems to be somebody's living room.
>                         There is a sofa, a chair and a TV set here."
>                 object sofa
>                         ldesc "It looks very comfortable."
>                 object chair
>                         ldesc "It's well upholstered."
>                 object tv
>                         ldesc "It's a Philips K9."
>         }
> 
> If the furniture needed to be referred to outside the room, it
> could be called livingRoom.chair, etc.
> 
> An extension of this would allow a large adventure to be split up
> into modules, with control over name visibility between modules.
> 
> What do you think of this idea?

<grin>  I'm using it.  I'm currently working on an adventure design
language.  In addition to this, I also allow multiple instances of
the same named object in the same room.  (For example, 3 orcs in one
room.)  You refer to each one with array-like syntax, ie. 
"dungeon.orc[1], dungeon.orc[2]", etc.  The reason this is necessary is 
because this is a "real time" game, and who knows when another orc is 
going to wander into the room?  (Yes, there's a wandering monster 
generator; but it's not as bad as it sounds... :)

