Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000568Core InformRelationspublic2011-02-17 00:382014-05-07 07:35
ReporterFuchsia tude 
Assigned Tograham 
PrioritynormalSeverityseriousReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSWindowsOS Version7
Product Version6G60 
Target VersionFixed in Version6L02 
Summary0000568: "Let V be the <kind> that relates to <an object> by <a relation of objects to objects>" triggers a programming error
DescriptionNot sure exactly what's going on here, but V's not actually being set. On waiting, the game only produces "Your heart longs to see your nothing."

The relation itself is clearly set upon initialization, as typing "relations" can prove; otherwise that every turn rule wouldn't fine at all. And the player indeed has the property in question, unlike the car, as reversing the phrase results in a run-time error instead.
Minimal Source Text To Reproduce
The Park is a room. The Volkswagen is a vehicle.

Infatuation relates various people to one thing. The verb to be infatuated with implies the infatuation 
relation.

The player is infatuated with the Volkswagen.

Every turn when the player is infatuated with something:
	let V be the thing that relates to the player by the infatuation relation;
	say "Your heart longs to see your [V]."
Additional InformationIf the first or last (or both) instance of the word "thing" is replaced with "vehicle", the game refuses to compile at all:

"Problem. You wrote 'let V be the vehicle that relates to the player by the infatuation relation' , but 'vehicle' seems to be a vehicle, whereas I was expecting to find a value there.

I was trying to match this phrase:

(vehicle - name of kind) that/which/who relates to (player - value) by (infatuation relation - relation of values to values)

This was what I found out:

vehicle = a description of vehicles

player = a non-temporary variable, holding a person

infatuation relation = a relation of people to vehicles"
 
For some reason, just by changing "thing" to a more specific kind, Inform requires the entire relation to become values to values, even though in the source above it happily accepts a relation of people to one thing.
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships
related to 0000160closedgraham "the _ which _ relates to by _" and related phrases don't work with static relations 
has duplicate 0000581closed "the <value> that relates to <thing> by the <relation>" will not compile 
has duplicate 0001113closed "Relates to" seems to work backwards 

-  Notes
(0001038)
Fuchsia tude (reporter)
2011-02-18 12:06

On a related note, trying to obtain the "the _ which _ relates to by _" result from any relation of kinds of objects (such as people) to kinds of values (such as numbers) refuses to compile at all, with the same "values to values" message as in the additional information above. Is that worth reporting separately in a new issue, or is that intended behavior?
(0001043)
jmcgrew (administrator)
2011-02-22 16:30

That sounds worth opening a new issue for.
(0001045)
EmacsUser (manager)
2011-02-24 14:55

Confirmed. Looks like the phrase is iterating over a linked list of objects having the relation's first kind rather than its second; a workaround is to make both of the relation's kinds the same:

- - - -
The Park is a room. The Volkswagen is a vehicle.

Infatuation relates various things to one thing. The verb to be infatuated with implies the infatuation relation.

The player is infatuated with the Volkswagen.

Every turn when the player is infatuated with something:
    let V be the thing that relates to the player by the infatuation relation;
    say "Your heart longs to see your [V]."

Test me with "z".
- - - -
(0001048)
EmacsUser (manager)
2011-02-24 16:21
edited on: 2011-02-24 16:33

Ah, no. According to WI 13.13, the source text should read

- - - -
The Park is a room. The Volkswagen is a vehicle.

Infatuation relates various people to one thing. The verb to be infatuated with implies the infatuation relation.

The player is infatuated with the Volkswagen.

Every turn when the player is infatuated with something:
    let V be the thing that the player relates to by the infatuation relation;
    say "Your heart longs to see your [V]."
- - - -

The real bug is the runtime error.

It looks to me like the relation handler has the arguments X and Z1 swapped on the line marked below. At least, I get the correct behavior when they are changed around.

- - - -
[ Rel_Handler_67 rr task X Y Z1 Z2 Z3 Z4;
    switch (task) {
        RELS_TEST: if (Y == (X.p57_infatuation)) rtrue; rfalse;
        RELS_LOOKUP_ANY: if (Y == RLANY_GET_X or RLANY_CAN_GET_X) {
            for (Z1=IK8_First: Z1: Z1=Z1.IK8_Link) {
                if (Rel_Handler_67(rr, RELS_TEST, X, Z1)) {
                    if (Y == RLANY_CAN_GET_X or RLANY_CAN_GET_Y) rtrue;
                    return Z1;
                }
            }
            if (Y == RLANY_CAN_GET_X or RLANY_CAN_GET_Y) rfalse;
            return DefaultValueOfKOV(9);
        } else {
            for (Z1=IK2_First: Z1: Z1=Z1.IK2_Link) {
                if (Rel_Handler_67(rr, RELS_TEST, Z1, X)) { ! This line
     ! ...
- - - -

(0002050)
EmacsUser (manager)
2013-04-26 18:58

More discussion under the duplicate 0001113.
(0002287)
graham (administrator)
2014-01-12 16:23

Fixed. I concur with the discussion below and at 0001113.

- Issue History
Date Modified Username Field Change
2011-02-17 00:38 Fuchsia tude New Issue
2011-02-18 06:03 Eleas Note Added: 0001037
2011-02-18 06:05 Eleas Note Deleted: 0001037
2011-02-18 10:58 jmcgrew Relationship added related to 0000160
2011-02-18 12:06 Fuchsia tude Note Added: 0001038
2011-02-22 16:30 jmcgrew Note Added: 0001043
2011-02-22 16:30 jmcgrew Assigned To => jmcgrew
2011-02-22 16:30 jmcgrew Status new => acknowledged
2011-02-22 16:31 jmcgrew Assigned To jmcgrew =>
2011-02-24 14:55 EmacsUser Note Added: 0001045
2011-02-24 14:55 EmacsUser Status acknowledged => confirmed
2011-02-24 16:21 EmacsUser Note Added: 0001048
2011-02-24 16:33 EmacsUser Note Edited: 0001048 View Revisions
2011-02-24 16:35 EmacsUser Summary "Let V be the <kind> that relates to <an object> by <a relation of objects to objects>" returns "nothing" => "Let V be the <kind> that relates to <an object> by <a relation of objects to objects>" triggers a programming error
2011-02-24 16:40 EmacsUser Relationship added has duplicate 0000581
2013-04-26 18:57 EmacsUser Relationship added has duplicate 0001113
2013-04-26 18:58 EmacsUser Note Added: 0002050
2013-04-27 02:59 Victor Gijsbers Issue Monitored: Victor Gijsbers
2014-01-12 16:23 graham Note Added: 0002287
2014-01-12 16:23 graham Status confirmed => resolved
2014-01-12 16:23 graham Resolution open => fixed
2014-01-12 16:23 graham Assigned To => graham
2014-05-07 07:34 jmcgrew Fixed in Version => 6L02
2014-05-07 07:35 jmcgrew Status resolved => closed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker