Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001231Core InformListspublic2014-05-06 10:172015-05-10 17:46
Assigned Tograham 
Platformx86OSMac OS XOS Version10.7
Product Version6G60 
Target VersionFixed in Version 
Summary0001231: "[A list of...]" does not capitalize numbers
DescriptionAccording to WI 5.5, the "[A list of...]" formulation produces a list of objects with their indefinite articles, the first one capitalized for use at the beginning of a sentence. But if a numbered collection of items appears first, the number will remain in lowercase.
Minimal Source Text To Reproduce
Lab is a room. A box is a container in the Lab. A rock is a kind of thing. Four rocks are in the 

Instead of examining the open box when something is in the box:
	say "[A list of things in the box]; that's what's in the box!"

Test me with "x box".
Additional InformationOutput:

>[1] x box
four rocks; that's what's in the box!

I imagine the new Inform 7 will make this moot, but in case it doesn't I'm reporting it while I still remember it.
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
zarf (developer)
2014-05-06 14:41
edited on: 2014-05-06 14:42

This is messier than it looks. The problem is that the group term might come from user code. For example

Before listing contents: group cards together.
Rule for grouping together cards: say "a group of [listing group size in words] cards".

Obviously no library fix can capitalize this without resorting to indexed text. Or you might have

Rule for grouping together cards: say "[listing group size in words] cards".

There's no library facility for printing "One", "Two", "Three", etc in capitalized words.

I came up with a workaround, which is to store the capitalization flag early in WriteMultiClassGroup(), before the BeginActivity() call. Thus:

    capitalize_class_group = ((cl == 1) && (c_style & CFIRSTART_BIT));

Then I can write rules like

Rule for grouping together cards: say "[if capitalize_class_group is true]A[else]a[end if] group of [listing group size in words] cards".

To make the original example work, you'd need to define a function to print a number in capitalized words, and then call it at the appropriate point if capitalize_class_group is set.

Like I said, messy.

zarf (developer)
2014-05-06 19:29

Hours later it occurs to me that WriteMultiClassGroup() is recursive, through WriteListR(). So the global capitalize_class_group will have to be pushed/pulled at the appropriate point.
zarf (developer)
2014-05-07 09:39

Confirmed still in 6L02.
mattweiner (reporter)
2014-05-07 17:54

A workaround in 6G60 is to add:

To say A list of (OS - description of objects):
let T be indexed text;
now T is "[a list of OS]";
replace character number 1 in T with character number 1 in T in upper case;
say T.

(And presumably similarly for "To say The list of...")
graham (administrator)
2014-07-26 04:41

It's tricky to decide what's really the best thing here, but I've essentially reimplemented A list... and The list... with a variation on this:

To say A list of (OS - description of objects):
let T be indexed text;
now T is "[a list of OS]";
replace character number 1 in T with character number 1 in T in upper case;
say T.

...which gives slightly better performance and is compiled inline, so that OS can contain references to values which wouldn't be captured by the implied closure. I have left the CFIRSTART_BIT code in the template's list-manager for the moment, but the above changes mean that Inform makes no use of it.
jmcgrew (administrator)
2015-05-10 17:46

Closing all resolved issues from 2014 and earlier.

- Issue History
Date Modified Username Field Change
2014-05-06 10:17 mattweiner New Issue
2014-05-06 13:00 EmacsUser Status new => confirmed
2014-05-06 14:41 zarf Note Added: 0002680
2014-05-06 14:42 zarf Note Edited: 0002680 View Revisions
2014-05-06 19:29 zarf Note Added: 0002681
2014-05-07 09:39 zarf Note Added: 0002685
2014-05-07 17:54 mattweiner Note Added: 0002696
2014-07-26 04:41 graham Note Added: 0002978
2014-07-26 04:41 graham Status confirmed => resolved
2014-07-26 04:41 graham Resolution open => fixed
2014-07-26 04:41 graham Assigned To => graham
2015-05-10 17:46 jmcgrew Note Added: 0003582
2015-05-10 17:46 jmcgrew Status resolved => closed

Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker