|Anonymous | Login | Signup for a new account||2018-03-19 03:42 PDT|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000399||Core Inform||Equations, units, arithmetic||public||2010-11-07 22:52||2014-05-07 07:33|
|Platform||PPC||OS||Mac OS X||OS Version||10.4|
|Target Version||Fixed in Version||6L02|
|Summary||0000399: "let m be given by...." followed by "say m" produces absolutely nothing|
|Description||I'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 y=mx+b 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.
|Tags||No tags attached.|
|Effect||(serious/mild) Game compiles but misbehaves|
Ron Newcomb (reporter)
|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?)|
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.
|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.|
|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|