Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000469Core InformPhrases and functional programmingpublic2010-12-18 10:162014-05-07 07:33
ReporterEmacsUser 
Assigned Tograham 
PrioritynormalSeveritymildReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSMac OS XOS Version10.6
Product Version6F95 
Target VersionFixed in Version6L02 
Summary0000469: Semantics of ``break'' don't match the description in WI 11.12
DescriptionThe source text

- - - -
There is a room.
When play begins:
    let the counter be one;
    if the counter is:
        -- one:
            break.
- - - -

produces the problem message

- - - -
Problem. 'break' makes sense only inside a 'while' or 'repeat' loop.
 See the manual: 11.12 > Next and break
I was trying to match this phrase: break
- - - -

and WI 11.12 does in fact suggest that break works only for loops:

- - - -
This phrase can only be used inside a "repeat" or "while" block, and causes both the current repetition and the entire loop to finish immediately.
- - - -

Nonetheless, break at the I6 level has different semantics. In http://www.inform-fiction.org/manual/html/s1.html#s1_10: [^]

- - - -
It's neatest to use the statement break, which means “break out of” the current innermost loop or switch statement...
- - - -

So because an I7 break is translated directly to an I6 break, the attached source prints ``12'' rather than the ``1'' that WI 11.2 would suggest.

Minimal Source Text To Reproduce
There is a room.

When play begins:
	repeat with the counter running from one to two:
		say "[the counter]";
		if the counter is:
			-- one:
				break.
Additional InformationThis could be a documentation bug instead.
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
(0002473)
graham (administrator)
2014-02-10 15:02

Fixed. The I7 semantics are indeed that "break" escapes the innermost loop; so it no longer always compiles to I6 "break".

- Issue History
Date Modified Username Field Change
2010-12-18 10:16 EmacsUser New Issue
2010-12-18 15:08 jmcgrew Status new => confirmed
2014-02-10 15:02 graham Note Added: 0002473
2014-02-10 15:02 graham Status confirmed => resolved
2014-02-10 15:02 graham Resolution open => fixed
2014-02-10 15:02 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