Mantis Bug Tracker

View Revisions: Issue #1208 All Revisions ] Back to Issue ]
Summary 0001208: Repeat with precomputes the next iteration's value and is sometimes unsafe
Revision 2014-04-15 20:16 by curiousdannii
Description This is filed as a documentation issue because we figure you have good reasons for implementing it as you have, though if that's not the case please consider changing the implementation too!

So in Kerkerkruip we've run into a nasty bug which was very hard to diagnose: https://github.com/i7/kerkerkruip/issues/258#issuecomment-38198215 [^]

The core of the problem is that repeat with loops precompute the next iteration's value. This causes problems if the code for the current iteration alters the next object so that it no longer qualifies.

The docs should be updated to make authors aware of this potential problem, and to suggest how to safely perform these loops. "while there is (description) (called H):" is a safe alternative.
Revision 2014-03-27 14:27 by curiousdannii
Description This is filed as a documentation issue because we figure you have good reasons for implementing it as you have, though if that's not the case please consider changing the implementation too!

So in Kerkerkruip we've run into a nasty bug which was very hard to diagnose: https://github.com/i7/kerkerkruip/issues/258#issuecomment-38198215 [^]

The core of the problem is that repeat with loops precompute the next iteration's value. This causes problems if the code for the current iteration alters the next object so that it no longer qualifies.

The docs should be updated to make authors aware of this potential problem, and to suggest how to safely perform these loops.


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker