Custom Array's would solve a lot of these problems...
PHP Code:
for ( element: array )
maps to:
while ( element = array.getNextIndex() )
// Array Class
publc function delete( index )
{
if ( index < this.curr_index )
this.curr_index --;
for ( i = 0; i < this.size(); i++)
if ( i > index )
this.element.(@ i ) = this.element.(@ i + 1);
}
public function size()
{
while ( this.element.(@temp.count) != false ) temp.count ++;
return temp.count;
}
public function getNextIndex()
{
this.curr_index ++;
if ( this.size() < this.curr_index )
return false;
return this[ this.curr_index ];
}
That would fix it... But that would require something like new TGraalArray();
NOTE: This would also have to remap array[ index ] to array.element.(@ index )