Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001936Core InformRules and rulebookspublic2016-07-27 10:492017-04-06 21:40
ReporterDan Efran 
Assigned To 
PrioritynormalSeverityseriousReproducibilityalways
StatusconfirmedResolutionopen 
Platformx86OSMac OS XOS Version10.11
Product Version6M62 
Target VersionFixed in Version 
Summary0001936: Inform 6 chokes on a questionable 'for the Nth turn' construction
DescriptionHere's a little project that gets through the I7 build phase, but fails in the I6 phase. I don't actually know whether the code presented is supposed to be valid or invalid, but presumably I7 and I6 should agree one way or the other.

The context is, I was able to use the "if ... for three turns" concept from "§9.15. How many turns?" to react to the player loitering in a room for too long. I wanted to extend this behavior to every room in a region - but individually, so that you would provoke the reaction by lingering in any room for too long, but could stay longer in the region as a whole by moving periodically from room to room within it.

So I wanted to generalize the if, by writing something like "if the location has been the location for 3 turns". But that sounds very much like it wouldn't work properly. There's a caveat in §9.15. that says:

    A warning: we must be careful when writing something like
        if the noun has been open ...
    since this tests whether it has ever been true that the noun of the then action was open: not whether the current noun-object has ever been open.

I figured that warning was relevant to my task. I don't know the proper idiom to use, if this behavior is even possible. So I started experimenting wildly, to see if I could discover a workable idiom. Along the way, the present experiment failed to either compile or produce an I7 problem message.

This is using the latest build of Inform; the result is the same under Mac OS 10.11 and Windows 7.

(As an aside, I ultimately gave up and implemented the desired behavior with a custom timer variable, but I'm still curious what the proper idiom would be to use "Nth turn" for this, if it's possible.)
Minimal Source Text To Reproduce
"translating the source - failed!" by Dan Efran

The Lobby is a room.

Every turn:
	let hereabouts be the location;
	If hereabouts is the location for the third turn:
		say "The guard is suspicious."
Additional InformationLaunching: ni "-internal" "/Volumes/Brain_Silo/Applications_games/Inform.app/Contents/Resources/Internal" "-external" "/Users/dan/Library/Inform" "-project" "/Volumes/Brain_Silo/Users/Dan/hacking-silo/src/Inform/FunWorld/hereabouts bug experiment.inform" "-format=ulx"
Inform 7 build 6M62 has started.
++ 0% (Reading text)
++ 5% (Analysing sentences)
I've now read your source text, which is 34 words long.
I've also read Standard Rules by Graham Nelson, which is 42655 words long.
I've also read English Language by Graham Nelson, which is 2297 words long.
++ 15% (Drawing inferences)
++ 20% (Binding rulebooks)
++ 23% (Binding rulebooks)
++ 26% (Binding rulebooks)
++ 29% (Binding rulebooks)
++ 32% (Binding rulebooks)
++ 35% (Binding rulebooks)
++ 38% (Binding rulebooks)
++ 41% (Generating code)
++ 44% (Generating code)
++ 47% (Generating code)
++ 50% (Generating code)
++ 53% (Generating code)
++ 56% (Generating code)
++ 59% (Generating code)
++ 62% (Generating code)
++ 65% (Generating code)
++ 68% (Generating code)
++ 71% (Generating code)
++ 74% (Generating code)
++ 77% (Generating code)
++ 80% (Generating code)
++ 83% (Generating code)
++ 86% (Generating code)
++ 89% (Generating code)
++ 92% (Generating code)
++ 95% (Generating code)
++ 98% (Generating code)
++ 100% (Finishing work)
++ Ended: Translation succeeded: 1 room, 1 thing

  The 34-word source text has successfully been translated into an intermediate
    description which can be run through Inform 6 to complete compilation.
    There were 1 room and 1 thing.
Inform 7 has finished.
/Volumes/Brain_Silo/Applications_games/Inform.app/Contents/MacOS/inform6 \
-kE2SDwG +include_path=/Volumes/Brain_Silo/Applications_games/Inform.app/Contents/Resources/Library/6.11,.,../Source /Volumes/Brain_Silo/Users/Dan/hacking-silo/src/Inform/FunWorld/hereabouts bug experiment.inform/Build/auto.inf /Volumes/Brain_Silo/Users/Dan/hacking-silo/src/Inform/FunWorld/hereabouts bug experiment.inform/Build/output.ulx
Launching: inform6 "-kE2SDwG" "+include_path=/Volumes/Brain_Silo/Applications_games/Inform.app/Contents/Resources/Library/6.11,.,../Source" "/Volumes/Brain_Silo/Users/Dan/hacking-silo/src/Inform/FunWorld/hereabouts bug experiment.inform/Build/auto.inf" "/Volumes/Brain_Silo/Users/Dan/hacking-silo/src/Inform/FunWorld/hereabouts bug experiment.inform/Build/output.ulx"
Inform 6.33N for Mac OS X (30th August 2015)
In: 1 source code files 66464 syntactic lines
 56111 textual lines 2054373 characters (ISO 8859-1 Latin1)
Allocated:
  8066 symbols (maximum 20000) 18133650 bytes of memory
Out: Glulx story file 1.160726 (586K long):
    21 classes (maximum 200) 42 objects (maximum 512)
   230 global vars (maximum 512) 85107 variable/array space (maximum 180000)
    96 verbs (maximum 255) 316 dictionary entries (maximum 1300)
   179 grammar lines (version 2) 251 grammar tokens (unlimited)
   101 actions (maximum 200) 37 attributes (maximum 56)
    40 common props (maximum 256) 18 individual props (unlimited)
108996 characters used in text 85431 bytes compressed (rate 0.783)
     0 abbreviations (maximum 64) 2887 routines (unlimited)
 69562 instructions of code 39307 sequence points
105472 bytes writable memory used 494336 bytes read-only memory used
599808 bytes used in machine 1073142016 bytes free in machine
File "/Volumes/Brain_Silo/Users/Dan/hacking-silo/src/Inform/FunWorld/hereabouts bug experiment.inform/Build/auto.inf"; Line 47446 # Error: No such constant as "tmp_0"
Compiled with 1 error and 1650 suppressed warnings
Completed in 0 seconds

Compiler finished with code 1
TagsNo tags attached.
Effect(critical) Inform 6 compiler reports errors for valid code
Attached Files

- Relationships

-  Notes
(0004498)
Dan Efran (reporter)
2016-07-27 10:51
edited on: 2016-07-27 10:52

I marked this as "(critical) Inform 6 compiler reports errors for valid code" but for all I know, it might really be "(mild) Inform 6 reports errors for invalid code". Adjust to taste.

(0004503)
zarf (developer)
2016-07-28 08:49

Confirmed.

I think the code is invalid. If you write "If hereabouts was the location: ..." then you get an error message:

"...conditions written in the past tense cannot refer to temporary values, because they have no past."

I think that error applies to your code as well.

The "for N turns" system tracks the history of boolean conditions, not variables. So I think you can't use it for this; you need your own timer.
(0004674)
travm1 (reporter)
2017-04-06 21:40
edited on: 2017-04-06 21:44

More info about Glulx:

[EDIT: deleted spam link. Do we have a procedure for this or should we just nuke spam comments on sight? --Z]


- Issue History
Date Modified Username Field Change
2016-07-27 10:49 Dan Efran New Issue
2016-07-27 10:51 Dan Efran Note Added: 0004498
2016-07-27 10:52 Dan Efran Note Edited: 0004498 View Revisions
2016-07-27 10:53 Dan Efran Issue Monitored: Dan Efran
2016-07-28 08:49 zarf Note Added: 0004503
2016-07-28 08:49 zarf Status new => confirmed
2017-04-06 21:40 travm1 Note Added: 0004674
2017-04-06 21:44 zarf Note Edited: 0004674 View Revisions
2017-04-06 21:44 zarf Note Edited: 0004674 View Revisions


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker