Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000497Core InformRelationspublic2011-01-08 13:502014-05-07 07:35
ReporterErWenn 
Assigned Tograham 
PrioritynormalSeveritycosmeticReproducibilityalways
StatusclosedResolutionfixed 
Platformx86OSWindowsOS VersionXP
Product Version6G60 
Target VersionFixed in Version6L02 
Summary0000497: "number of steps via" does not work for relations involving values
DescriptionAny attempt to use "the number of steps via <relation involving values> from <value> to <value>" returns an error at compile-time stating that the <value> has the wrong type (i.e. that it should be an object, not a value).

I have only tested this with kinds of values that I created myself.
Minimal Source Text To Reproduce
"test" by test

X-type is a kind of value. The X-types are XA, XB, and XC.

X-relating relates various X-types to one X-type.

When play begins:
	showme whether or not the number of steps via the X-relating relation from XA to XB is at least 0.


The lab is a room. 
TagsNo tags attached.
Effect(cosmetic) Error message is badly worded
Attached Files

- Relationships
related to 0000617closedgraham "next step via..." and "number of steps via..." aren't implemented for values (but can be used with buggy results) 

-  Notes
(0000951)
jmcgrew (administrator)
2011-01-08 16:01
edited on: 2011-01-08 16:02

Confirmed, but according to WI 13.11, this is only supported for relations between objects anyway. The error message you received is a reflection of the fact that the "number of steps via" phrase requires its parameters to be objects.

However, the underlying issue is that pathfinding isn't implemented for dynamic relations between any types. Relations involving values are always dynamic, but dynamic relations between objects can be created as follows:

<code>
Home is a room.

A table is here. An apple is on the table. A glass is on the table. Some water is in the glass.

When play begins:
let R be a various-to-various relation of objects to objects;
now R relates the player to the table;
now R relates the table to the glass;
now R relates the glass to the water;
let N be the number of steps via R from the player to the water;
say "[N]."
</code>

That code fails with a misleading runtime error:

<quote>
*** Run-time problem P30: Attempt to find route or count steps through an implicit relation.
</quote>

The lack of pathfinding for these relations is more of a feature request than a bug (and should be reported at inform7.uservoice.com), but the errors and/or documentation could perhaps be improved in the meantime.

(0001379)
graham (administrator)
2011-10-15 09:24

I've tightened up type-checking on these phrases so that clearer problem messages result: in particular Inform now reports

... 'X-relating relation' has the wrong kind of value: a relation of x-types rather than a relation of objects.

- Issue History
Date Modified Username Field Change
2011-01-08 13:50 ErWenn New Issue
2011-01-08 16:01 jmcgrew Effect (serious) Compiler rejects valid code => (cosmetic) Error message is badly worded
2011-01-08 16:01 jmcgrew Note Added: 0000951
2011-01-08 16:01 jmcgrew Priority high => normal
2011-01-08 16:01 jmcgrew Severity serious => cosmetic
2011-01-08 16:01 jmcgrew Status new => confirmed
2011-01-08 16:02 jmcgrew Note Edited: 0000951 View Revisions
2011-08-20 10:35 EmacsUser Relationship added related to 0000617
2011-10-15 09:24 graham Note Added: 0001379
2011-10-15 09:24 graham Status confirmed => resolved
2011-10-15 09:24 graham Resolution open => fixed
2011-10-15 09:24 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