[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

"forEach:" and manual deletion

I advocate that the loop that Smalltalk's "forEach:" translates to
delete (or destroy?) the "while_Stepper" after the close of the loop.
By the time you exit the loop, the stepper is necessarily exhausted,
so it's hard to see what use it would be to anyone.  This would not be
a strictly upwards compatable change, but I strongly suspect it would
actually be compatable with all the code we actually have.  Does
anyone know of any examples where a stepper is used (or even held
onto) after being stepped to exhaustion?

If we do this, then we need to say that part of the meaning of
"forEach:" is to delete/destroy the stepper on loop exit, and we
should also arrange for the Smalltalk "forEach:" to do likewise.

(Whether I mean "delete" or "destroy" above must wait until we
understand better what we want each to mean.)