|Anonymous | Login | Signup for a new account||2018-07-16 18:56 PDT|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0002034||Core Inform||Phrases and functional programming||public||2017-10-12 22:56||2017-10-13 08:38|
|Target Version||Fixed in Version|
|Summary||0002034: Sayable values using temporary value cause failure of text in "end the story saying" phrase?|
|Description||Placing certain sayable values in the text of an "end the story saying..." phrase causes the entire text string to be evaluated as empty. Specifically, the issue seems to be with sayable values that are temporary values. (At least, that's how it seems.)|
|Minimal Source Text To Reproduce|
"Bug Report" Place is a room. After waving hands: let C be the actor; say "<[C] is the actor>[line break]"; if we have jumped: end the story saying "Yay! [C] jumped!"; otherwise: end the story saying "Yay!" Test me with "jump / wave".
|Additional Information||As you can see, C is set correctly and can be used as a sayable value. Note that the issue seems to be linked to trying to say a temporary value in the "end the story saying..." text, as replacing the line with|
end the story saying "Yay! [regarding the actor][They] jumped!";
works as would be naively expected.
(Also: Yes, I realize that even if the minimal source example submitted worked as intended, it would function poorly. It was just the quickest demonstration of the issue.)
Filed under "phrases and functional programming" because "end the story..." is a built-in phrase. Feel free to recategorize.
|Tags||No tags attached.|
|Effect||(serious/mild) Game compiles but misbehaves|
I think what's going on is that "end the story saying T" implicitly assigns T to an I6 global variable. If it were an I7 global variable, then it would be kept alive by reference counting or whatever the block handling system uses. (I'm not super clear on that.)
So this works:
TT is a text that varies. After jumping: let C be the actor; now TT is "Yay! [C] jumped!"; say "<[C] is the actor>[line break]"; end the story saying TT;
But this does not:
After jumping: let C be the actor; let T be "Yay! [C] jumped!"; say "<[C] is the actor>[line break]"; end the story saying T;
Because (I think) the text object gets deallocated at the end of the function.
Not sure what the fix is, but you can use the global variable as a workaround.
|2017-10-12 22:56||otistdog||New Issue|
|2017-10-13 08:38||zarf||Note Added: 0004734|
|Copyright © 2000 - 2010 MantisBT Group|