Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000998Core InformPhrases and functional programmingpublic2012-08-21 10:112014-05-07 07:33
Reporterzarf 
Assigned Tograham 
PrioritynormalSeveritymildReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version6G60 
Target VersionFixed in Version6L02 
Summary0000998: "Instead phrase..." fails to rtrue for resolver phrases
Description"west" behaves wrong; the error message is printed, but fails to stop the action.

It looks like the problem appears whenever a Resolver() function appears inline. The compiler fails to append an "rtrue".

(In this sample, the "east" rule has no Resolver(), because the dispatch can be inferred from the type of the player variable. In contrast, the "west" rule has to resolve at run-time.)
Minimal Source Text To Reproduce
"Test Case" by Andrew Plotkin

The Kitchen is a room.

To complain:
	say "Complaint, no argument."

Check going north:
	instead complain.

The thing-variable is a thing that varies.
To complain about (T - thing):
	say "Complaint about [T]."
To complain about (P - person):
	say "Complaint about person [P]."
	
Check going east:
	instead complain about the player.

Check going west:
	instead complain about the thing-variable.

[Output:

>n
Complaint, no argument.

>e
Complaint about person yourself.

>w
Complaint about person yourself.

You can't go that way.

]
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
(0001824)
zarf (developer)
2012-08-21 10:13

Generated I6:


! Check going north:
[ R_741 ;
   if ( (actor==player) && ((noun == I46_north) && (true))) { ! Runs only when pattern matches
self = noun;
   if (debug_rules) DB_Rule(R_741, 741);
      ! phrase 1
      ! [1: instead complain]
      (PHR_740_r4 ()); rtrue;
   } ! Runs only when pattern matches
   else if (debug_rules > 1) DB_Rule(R_741, 741, true);
   rfalse;
];


! Check going east:
[ R_744 ;
   if ( (actor==player) && ((noun == I52_east) && (true))) { ! Runs only when pattern matches
self = noun;
   if (debug_rules) DB_Rule(R_744, 744);
      ! phrase 1
      ! [1: instead complain about the player]
      (PHR_743_r5 (player)); rtrue;
   } ! Runs only when pattern matches
   else if (debug_rules > 1) DB_Rule(R_744, 744, true);
   rfalse;
];


! Check going west:
[ R_745 ;
   if ( (actor==player) && ((noun == I53_west) && (true))) { ! Runs only when pattern matches
self = noun;
   if (debug_rules) DB_Rule(R_745, 745);
      ! phrase 1
      ! [1: instead complain about the thing-variable]
      (Resolver_2((Global_Vars-->9),"source", 21));
   } ! Runs only when pattern matches
   else if (debug_rules > 1) DB_Rule(R_745, 745, true);
   rfalse;
];
(0002456)
graham (administrator)
2014-02-09 06:52

This is one of several reasons Resolver() routines were abolished; Inform now performs dynamic dispatch inline, rather than calling out for it.

- Issue History
Date Modified Username Field Change
2012-08-21 10:11 zarf New Issue
2012-08-21 10:13 zarf Note Added: 0001824
2012-08-22 06:46 EmacsUser Status new => confirmed
2014-02-09 06:52 graham Note Added: 0002456
2014-02-09 06:52 graham Status confirmed => resolved
2014-02-09 06:52 graham Resolution open => fixed
2014-02-09 06:52 graham Assigned To => graham
2014-05-07 07:32 jmcgrew Fixed in Version => 6L02
2014-05-07 07:33 jmcgrew Status resolved => closed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker