Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002103Core InformPhrases and functional programmingpublic2019-07-09 09:132019-07-11 10:48
Reporternightpool 
Assigned To 
PrioritynormalSeverityseriousReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version6M62 
Target VersionFixed in Version 
Summary0002103: Condition code generated as self == self
DescriptionI managed to write a condition, "if the number of things the actor is touching is greater than the number of arms of the actor" that Inform compiled into i6 as (self == self). "The number of arms" is a property of people, and "touching" is a various-to-various relation. A minimal reproduction is attached.

I was able, after consulting with a friend, to rewrite the condition into "if the number of things touched by the actor is the number of arms of the actor:" but I believe the original statement should either work or be a parser error—the current behavior, always being true, seems like a pretty definite bug.
Minimal Source Text To Reproduce
"2019-07-08 cond bug" by nightpool

The Example room is a room. In the example room is a candle, a book, and a bell.

A person has a number called the number of arms. The number of arms of a person is usually two.

Touching relates various people to various things. The verb to touch means the touching relation.

Carry out an actor touching: now the actor touches the noun.
Check an actor touching (this is the can't touch more things then hands rule):
	[if the number of things touched by the actor is the number of arms of the actor:]
	if the number of things the actor is touching is greater than the number of arms of the actor:
		If the actor is the player, say "You only have [number of arms of the actor] hands! You're currently 
touching [(list of things that the actor relates to by the touching relation) with definite articles]";
		
stop the action.
		
test me with "touch the candle / touch the bell / touch the book / relations"
Additional InformationThis is the snippet of relevant i6 output:

    ! [2: if the number of things the actor is touching is greater than the number of arms of the actor]
    if (((self == self)))


P.S. If anyone knows a better way to write "[(list of things that the actor relates to by the touching relation) with definite articles]", I'm all ears, the current phrasing seems very clunky to me.
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
(0004872)
zarf (developer)
2019-07-11 10:48

I believe the problem is that "the number of things the actor is touching" is not a meaningful expression. The compiler must be going down some garden path trying to parse it.

- Issue History
Date Modified Username Field Change
2019-07-09 09:13 nightpool New Issue
2019-07-11 10:48 zarf Note Added: 0004872


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker