Newsgroups: rec.arts.int-fiction
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!news.maxwell.syr.edu!newsfeed.wirehub.nl!news.stealth.net!newsfeed.nyc.globix.net!uunet!ash.uu.net!world!buzzard
From: buzzard@world.std.com (Sean T Barrett)
Subject: [Inform] indef_mode and attribute 'proper'
Message-ID: <GH2Hzu.6L7@world.std.com>
Date: Thu, 26 Jul 2001 06:28:42 GMT
Organization: The World Public Access UNIX, Brookline, MA
Lines: 58
Xref: news.duke.edu rec.arts.int-fiction:90235

Goal:

   I want to have an object which appears without articles,
   but prints differently in definite and indefinite contexts.
   (It's a character, I want last-name-only in definite context
   and first-name last-name in indefinite contexts.)

Intended approach:

   Inform provides a 'short_name_indef' that allows you
   to use a different name in the indefinite context.

   Unfortunately it doesn't work right in this situation.

How it works:

   Inform sets an internal flag "indef_mode" which you can
   test inside of 'short_name'. In the library routine that
   calls short_name and prints the internal name if short_name
   isn't defined, the routine first checks if 'indef_mode' is
   non-zero, and calls 'short_name_indef' if it's defined.

Strange library design:

   In each of the routines that print flavors of names (e.g. 'defart',
   'indefart', i.e. the routines called by 'print (the) obj'),
   a check is made to see if the object has the 'proper'
   attribute, and if so, the article is not printed. Simultaneously,
   the indef_mode flag is stomped to one particular value
   regardless of the (a) vs. (the); so a short_name routine
   for a proper object can no longer determine this context.

Gratuitous library bug (I think):

   The particular value 'indef_mode' is stomped to is 'NULL',
   not false--NULL is -1. I'm not sure if this is a bug or not--
   it may be intended to communicate that it's neither definite
   nor indefinite, although I don't know where the library makes
   use of this. But even if it's intentional, there's still a
   bug: the test to dispatch to short_name_indef checks if
   indef_mode is non-zero; so actually short_name_indef
   ALWAYS gets called for an object with the 'proper' attribute.

Unworkable alternate solution:

   There does not seem to be any other way to suppress the
   articles besides 'proper'. The 'articles' property lets
   you explicitly specify the "the/The/a" articles, but you
   cannot make them empty strings ("") because the library will
   still output a space between the empty article string and
   the name, producing an extra space everywhere.

Is there anywhere else I can hook this? Does anyone know why
indef_mode gets stomped to NULL? The DM mentions that it is
necessary for the player object to be 'proper', so I don't know
if maybe this is somehow used for that or what.

SeanB
