>>>>> "DLN" == David L Nicol <[EMAIL PROTECTED]> writes:
DLN> Dan Sugalski wrote:
>>
>> Any variable that has a 'per-thread' component should be self-contained.
>>
>> Dan
DLN> We don't know how many instances of iteration happening in the
DLN> program there will be, or how many there can be. If each instance
DLN> of hash iteration maintained its iterator with the code, that simplifies
DLN> tieing. The opnode for an iterator will need to store a pointer to
DLN> the iterator, rather than a tie interface needing to store an array.
Can't put it into the opcode. It has to stay seperate. You will kill
any sharing of code, if the code is mutable.
An iterator should be a standalone thingee, that knows how to walk
its underlying data. Then all the optree has a hidden variable (where
ever that would be stored) that is the iterator
for (each %hash) {}
becomes
$hidden = iterator->new %hash
while ($_ = $hidden->next) {}
$hidden->done
or something.
<chaim>
--
Chaim Frenkel Nonlinear Knowledge, Inc.
[EMAIL PROTECTED] +1-718-236-0183