Yes, I agree that's slightly disturbing, but I'm not sure I find it disturbing enough to matter. Anyway, it can be avoided by using restricted pointer values instead of iterators.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-04-16 01:53: Subject: Pointers/lvalues
Well, how about this:
void foo(pointer(int) x) { *--x = 7; }
void bar() { array(int) q = ({ 47, 11 }); foo(&q[1]); }
I think this is slightly disturbing. bar has not shared a reference to q[0] with anybody, and yet the value of q[0] gets changed under its feet.
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)