Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000452Core InformKinds and type checkingpublic2010-12-04 18:592014-05-07 07:33
ReporterRon Newcomb 
Assigned Tograham 
PlatformPPCOSMac OS XOS Version10.4
Product Version6F95 
Target VersionFixed in Version6L02 
Summary0000452: Can't test if two kind variables are equal.
DescriptionThe code

  To decide whether (X - a value of kind K) is sibling to (Y - a value of kind M): if M is K, yes; no.

throws a runtime error about repeating through values.

   *** Run-time problem P59: You can't implicitly repeat through the values of this kind: a problem arising from a description which started out here - "if M is K , yes".

Minimal Source Text To Reproduce
To decide whether (X - a value) is sibling to (Y - a value): no.
To decide whether (X - a value of kind K) is sibling to (Y - a value of kind M): if M is K, yes; no.

A garment is a kind of thing. A tunic and some trousers are kinds of garment. The jersey is a tunic. 
John is wearing the pants and the jersey. 

Instead of jumping: 
   let X be the pants;
   let Y be the jersey;
   if X is sibling to Y, say "Eureka."

The Errea is a room. John is a man in the Errea.

Test me with "jump". 
Additional InformationThread on this: [^]

Generated I6:

! Instead of jumping:
[ R_742
    t_0 ! Local variable e.g. 'X' = object
    t_1 ! Local variable e.g. 'Y' = object
   if ((action ==##Jump) && (actor==player)) { ! Runs only when pattern matches
self = noun;
   if (debug_rules) DB_Rule(R_742, 742);
      ! phrase 1
      ! [1: let x be the pants]
       t_0 = I93_pants;
      ! phrase 2
      ! [2: let y be the jersey]
       t_1 = I91_jersey;
      ! phrase 3
      ! [3: if x is sibling to y , say ~Eureka.~]
       if (((PHR_741_r3 (t_0,t_1)))) { say cetera

! Request 3: phrase (object, object) -> nothing
! To decide whether ( X - a value of kind K ) is sibling to ( Y - a value of kind M ):
[ PHR_741_r3
    t_0 ! Call parameter 'X' = object
    t_1 ! Call parameter 'Y' = object
      ! phrase 1
      ! [1: if m is k , yes]
       if ((Prop_25())) { rtrue; }
      ! phrase 2
      ! [2: no]

! True or false?
! [ Exists x : object(x) ]
[ Prop_25 x x_ix ;
    if (RunTimeProblem(RTP_CANTITERATE, PROP_SRC_25)){

Constant PROP_SRC_25 = "if M is K , yes";

TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
Ron Newcomb (reporter)
2010-12-04 19:04

Hey, why does the To Decide Whether phrase have type "phrase (object, object) -> nothing" rather than "phrase (object, object) -> truth state" or whatever? And, object, not value? ::shrug::
jmcgrew (administrator)
2010-12-04 19:10

The equivalent expression with concrete types ("if thing is tunic") tests whether there exists any thing which is also a tunic, which isn't really what you want but doesn't produce a runtime error.
graham (administrator)
2014-02-02 09:02

This was one bug, and one suggestion, but both are done. The bug was the absurd claim that you can't iterate through objects - you can, of course. The suggestion was that conditions like "M is K" ought to work in some second-order way; well, this isn't allowed (yet, anyway), but Inform now throws a problem if a kind variable is used as if it were a proper noun like this. So it's fine to write "if an M is a K", and that does indeed iterate to find out whether any object is both, but it's not fine to write "if M is K".

- Issue History
Date Modified Username Field Change
2010-12-04 18:59 Ron Newcomb New Issue
2010-12-04 19:04 Ron Newcomb Note Added: 0000880
2010-12-04 19:10 jmcgrew Note Added: 0000881
2010-12-04 19:10 jmcgrew Status new => confirmed
2014-02-02 09:02 graham Note Added: 0002442
2014-02-02 09:02 graham Status confirmed => resolved
2014-02-02 09:02 graham Resolution open => fixed
2014-02-02 09:02 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