Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001063Core InformKinds and type checkingpublic2013-01-05 15:092014-05-07 07:33
Assigned Tograham 
Platformx86OSWindowsOS Version7
Product Version6G60 
Target VersionFixed in Version6L02 
Summary0001063: Adjectives defined with "if its <property>" don't work for block values
DescriptionWhen an adjective is defined with "if its <property> is <value>" instead of "if the <property> of it is <value>", Inform implements it with a simple value comparison even for block values.

The code below prints "goose" for every person, even though three of their properties contain the indexed text "duck". The comparison fails because the properties point to a different copy of the same text.
Minimal Source Text To Reproduce
Schoolyard is a room.

A person has indexed text called the animal type. The animal type of a person is usually "duck".

Stan, Kyle, Eric, and Kenny are people in Schoolyard. The animal type of Kenny is "goose".

Definition: a person is ducky if its animal type is "duck".

After printing the name of someone ducky, say " (duck)".
After printing the name of someone not ducky, say " (goose)".
Additional InformationThis is what Inform generates:

[ Adj_31_t1_v9 ! meaning of "ducky"

    t_0 ! Call parameter 'it' = person
  if (t_0 ofclass K8_person) return (t_0.p13_animal_type == SC_2);

Changing the property from indexed text to text solves the problem, as does changing the definition to "if the animal type of it is...".

When this type of definition is used with a list property, Inform also mishandles list constants. For example, "a thing is fooey if its foo is {28, 34}" compares the property to the last entry in the list:

[ Adj_32_t1_v9 ! meaning of "fooey"

    t_0 ! Call parameter 'it' = thing
  if (t_0 ofclass K2_thing) return (t_0.p14_foo == 34);
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
graham (administrator)
2014-02-01 06:22

Fixed. The original code here was so old that it was actually compiling the comparison by hand, and dated to a time when all values were stored in a single VM word. The new version properly sets up the comparison as a logical proposition.

- Issue History
Date Modified Username Field Change
2013-01-05 15:09 jmcgrew New Issue
2013-01-05 15:12 jmcgrew Additional Information Updated View Revisions
2013-01-05 15:15 jmcgrew Description Updated View Revisions
2013-01-05 15:17 jmcgrew Status new => acknowledged
2013-01-06 18:42 EmacsUser Status acknowledged => confirmed
2014-02-01 06:22 graham Note Added: 0002420
2014-02-01 06:22 graham Status confirmed => resolved
2014-02-01 06:22 graham Resolution open => fixed
2014-02-01 06:22 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