Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000181Core InformPhrases and functional programmingpublic2010-07-06 19:112010-10-28 00:30
Reporterektemple 
Assigned Tograham 
PrioritynormalSeverityseriousReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSMac OS XOS Version10.6
Product Version6E72 
Target VersionFixed in Version6F95 
Summary0000181: "Now X is Y" fails to parse correctly when asked to infer the object to which a property belongs
Description6E72 marks the last build in which the "change X to Y" phrases will be found in the Standard Rules. Now that the "change" syntax is deprecated, we need to use "now X is Y," which is parsed as a condition (i.e., "now [condition]". However, "now" currently does not have full feature parity with "change", because Inform is not able to infer the object to which a property belongs with conditions as it can with the object and value tokens. The provided source text fails to compile, but works just fine if we change the "now X is Y" phrase to "change X to Y".
Minimal Source Text To Reproduce
"Test"

A testing-entity is a kind of thing. A testing-entity has a number called X1.

The test-object is a testing-entity. The X1 is 12.

When play begins:
	follow the testing rules for the test-object.
	
The testing rules are an object-based rulebook.
	
A testing rule for a testing-entity (called the subject):
	let dx be the X1 - 6;
	now the X1 is the X1 - dx;
	say "X1: [X1 of the subject].";
	
Test is a room.
Additional InformationThe text of the compiler error message is:

Problem. In the sentence 'now the X1 is the X1 - dx' , it looks as if you intend 'X1 is the X1 - dx' to be a condition, but that would mean comparing two kinds of value which cannot mix - a numbers valued property and a number - so this must be incorrect.
I was trying to match this phrase:

now (x1 is the x1 - dx - a condition)
This was what I found out:

X1 is the X1 - dx = a condition
TagsNo tags attached.
Effect(serious) Compiler rejects valid code
Attached Files

- Relationships

-  Notes
(0000258)
EmacsUser (manager)
2010-07-07 09:25

Confirmed. Perhaps this is intentional, because

now the X1 of the subject is the X1 - dx;

is clearer. But on the other hand, Inform doesn't make the author write

now the X1 of the subject is the X1 of the subject - dx;
(0000590)
graham (administrator)
2010-09-26 07:57

This turned out to be surprisingly difficult to fix, and I spent a while trying to persuade myself that the language was correctly rejecting this use of "now"; but it didn't wash. The test case now works as intended.

- Issue History
Date Modified Username Field Change
2010-07-06 19:11 ektemple New Issue
2010-07-06 19:50 jmcgrew Severity mild => serious
2010-07-06 19:50 jmcgrew Status new => acknowledged
2010-07-07 09:25 EmacsUser Note Added: 0000258
2010-07-07 09:25 EmacsUser Status acknowledged => confirmed
2010-09-26 07:57 graham Note Added: 0000590
2010-09-26 07:57 graham Status confirmed => resolved
2010-09-26 07:57 graham Resolution open => fixed
2010-09-26 07:57 graham Assigned To => graham
2010-10-25 21:14 jmcgrew Fixed in Version => 6F95
2010-10-28 00:30 jmcgrew Status resolved => closed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker