Inform - Support - Patches

About Patches  

Compiler  
Library  

DM4 Errata  

Issue C62120

(X in nothing) objectloop fails
Submitted by: Eric Schmidt     Appeared in: Compiler 6.21 or before     Fixed in: -
Problem

Consider this sample routine:

  [ Initialise x;
    location = livingroom;
    objectloop (x in nothing) give x light;
    "What a mess is it here after that party!
     And your relatives arrive in just a few
     hours...";
  ];

(Yes, there are better ways of making it light everywhere. This is just for example.) The code generates an error message at run time, but there is no reason it should. The correct behavior is to give every object without a parent light. (Yes, this causes problems if there are items out-of-play. Maybe there aren't.)

Workaround

The compiler is using an optimized version of objectloop where the loop follows the eldest child and proceeds through the siblings. It is illegal to find the child of nothing, and that is why an error occurs. If this is a problem, modify the control expression so it is not in the "x in y" form, such as objectloop (x && x in nothing).


Last updated 17 April 2013. This web site has not been fully supported since April 2008. Information may be out of date. This page was originally managed by Roger Firth.