>>I thought some time ago about the semantics of changes to the array >>while iterating it. >>The only sane solution was to unconditionally copy the array for the >>iteration. Some other toughts? > > Indeed, you have a point. Copying must be avoided if possible if we want > arrays of decent size to function well. A full reference counted > implementation could manage this with minimal copying. Here we could use an > iterator refcount which would allow us to detect a change being made to a > (non-nested) array that's also the subject of iterations, and take action. > Exactly what action, I haven't thought through yet! Yes, in a full reference counted scheme, we could use copy-on-write for the arrays, and therefore the unconditional copy for the iterator is a no-op if the array will not be modified inside the iteration.
How far ist your refcnt patch, do you need any help? Bert > > Tony -- NEdit Develop mailing list - [email protected] http://www.nedit.org/mailman/listinfo/develop
