Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000399Core InformEquations, units, arithmeticpublic2010-11-07 22:522014-05-07 07:33
ReporterRon Newcomb 
Assigned Tograham 
PlatformPPCOSMac OS XOS Version10.4
Product Version6F95 
Target VersionFixed in Version6L02 
Summary0000399: "let m be given by...." followed by "say m" produces absolutely nothing
DescriptionI'm almost certainly using the equation wrong, but even if so I'm asking for something to change here. The answer is correctly put into the global variable, but I was surprised that not only did the explicit "let m be" not also put the resulting slope into it, but that the following "say m" not print anything at all -- not a default 0, not an <not a number> placeholder, not a runtime error, nothing.

If it won't use the local, why is "given by" a to-decide function? Why not a stand-alone to-phrase?

My primary reason for using globals here was to give meaningful names like "slope" and "y-intercept" to what is otherwise a list of dimensionless numbers. (Attempts to use a coordinate unit, or even horizontal and vertical coordinate units, didn't pan out.)

Minimal Source Text To Reproduce
Slope is a number that varies.

Equation - Slope-Intercept Formula
where y is a number, x is a number, m is the slope, and b is a number. 

when play begins:
	let m be given by the Slope-Intercept Formula where x is 1, y is 0, and b is 3;
	say m.

There is a room.
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
Ron Newcomb (reporter)
2010-11-07 22:58

I should add that the behavior I'm looking for in this case would be for both the global and the local to be filled in with the answer, as a safeguard against sloppy coding like the above. (Hey, we're all sloppy coders at first, yes?)
jmcgrew (administrator)
2010-11-08 09:31

I'm not sure how the code is supposed to be interpreted: it may be a "compiler accepts invalid code" issue instead.

The generated code assigns the result to the global "slope" but does not assign anything to the local "m". It doesn't even get a type beyond "value", so it's printed as (empty) text instead of a number, although "showme m" does print it as a number.
graham (administrator)
2014-04-02 14:19

This source text was illegal, since m had been given a value and couldn't be varied, but Inform wasn't catching that. There's now a problem message.

- Issue History
Date Modified Username Field Change
2010-11-07 22:52 Ron Newcomb New Issue
2010-11-07 22:58 Ron Newcomb Note Added: 0000799
2010-11-08 09:31 jmcgrew Note Added: 0000801
2010-11-08 09:31 jmcgrew Status new => confirmed
2014-04-02 14:19 graham Note Added: 0002606
2014-04-02 14:19 graham Status confirmed => resolved
2014-04-02 14:19 graham Resolution open => fixed
2014-04-02 14:19 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