intfiction.org

The Interactive Fiction Community Forum
It is currently Sat Feb 23, 2019 4:55 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sat Feb 09, 2019 3:49 am 
Offline
User avatar

Joined: Fri Aug 14, 2009 10:01 pm
Posts: 22
So when I run this code:

Code:
The Library is a room.

A book is a kind of thing. A DVD is a kind of thing. A CD is a kind of thing.

In the Library are 2 books, 2 DVDs, and 1 CD.

Before listing contents:
   group things together.
   
Rule for grouping together things:
   say "[listing group size in words] items".


I get this erroneous output:

Quote:
Library
You can see three items here.


I can halfway see what's gone wrong here (it's counting 3 kinds of things, instead of 5 actual things, presumably because the things have been created as duplicates instead of things in their own right - even though I can act on them individually so it clearly "knows" they're all there) but it's rather inconvenient and doesn't seem like desirable behaviour.

Does anyone know of a way around this, and/or should I log it as a bug?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Feb 09, 2019 11:51 am 
Offline

Joined: Sat Oct 27, 2018 6:35 pm
Posts: 67
What is your desired output - "You can see 5 items here"?


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Feb 09, 2019 2:30 pm 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 428
It may be slightly inconvenient, but I wouldn't say this was a bug. Listing group size is an I6 global (listing_size) which is used in the list-writer routine; it presumably behaves as needed by that routine.

You can do something like this:
Code:
Definition: a thing is impersonal if it is not a person.
Before listing contents:
   group things together.   
Rule for grouping together something (called A):
   let N be the number of impersonal things in the holder of A;
   say "[N] things".


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Feb 09, 2019 4:52 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5568
Location: Burlington, VT
I'd say it's a bug. The documentation (Writing with Inform ยง18.14) says:

Code:
The variable "listing group size" gives the number of items grouped together in this way.


which seems to mean that if five things are being grouped together, the listing group size ought to be 5.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Feb 09, 2019 5:27 pm 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 428
Well, "item" doesn't necessarily mean "thing". I read it as "list entry": what would usually be listed as three items is being grouped as one.

But I guess it might as well be reported; it's either a bug, or a documentation error, or maybe just an ambiguity.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sun Feb 10, 2019 2:25 am 
Offline
User avatar

Joined: Fri Aug 14, 2009 10:01 pm
Posts: 22
Thanks all - the workaround works perfectly in the meantime, but I'll report it anyway: either it's an oversight that can be fixed, or it's done that way for some back-end reason, so the documentation should be clarified.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group