Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002098Documentation, Examples, and Web SiteWriting with Informpublic2019-05-04 04:282019-05-04 04:28
Assigned To 
PlatformmacintoshOSMojave?OS Version
Product Version6M62 
Target VersionFixed in Version 
Summary0002098: §21.2 suggests changing the value of a variable with "let"
Description§21.2, which is discussing how it is impossible to create a variable whose value is initially set to the empty list, says:

    On the other hand, writing

let M be { };

    is fine provided that M already exists, and then does the obvious thing - empties M.

This is only fine if M was created as a temporary variable in the same code block. If M is a global, then you’ll run into the usual issue where Inform tries to create a separate temp variable named “M” (and in this case, it will fail because it doesn’t know what kind of value is in the list).

Minimal Source Text To Reproduce
Lab is a room. 

N is a list of numbers that varies. N is {100}.

Every turn: say N.

Carry out jumping: 
	let N be a list of numbers;
	let N be { }.
Additional InformationIt seems like it would probably be less misleading to change the second "let" to "now"--in general I don't think there's any reason to change the values of existing variables with "let," because "now" works for temporary variables, and using "let" for globals leads to nasty and hard-to-find bugs.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2019-05-04 04:28 mattweiner New Issue

Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker