On Sat Sep 06 18:26:02 2008, cotto wrote: > On Tue Feb 05 06:50:24 2008, coke wrote: > > On Wed Aug 16 23:09:16 2006, mdiep wrote: > > > I don't know how to write a test for this off the top of my head, but > > > Iterator and DynLexPad don't play well together atm. When I tried, I > > > got this error: > > > > > > elements() not implemented in class 'DynLexPad' > > > > > > Is there an easy way to make an arbitrary hash-like PMC (DynLexPad, > > > NameSpace, etc.) play well with iterator? > > > > > > Tcl needs to be able to iterate over the keys to return a list of all > > > the variables in the current procedure/lexpad. (See [info vars]) > > > > > > -- > > > Matt Diephouse > > > > > > > A nice cage task would be to write a test demonstrating the use of an > > iterator in this case. > > As of r30844 there's a TODO'd test for this, but some work will need to > be done to make DynLexPads (and LexPads, incidentally) iterable. Since > DynLexPads are based on Hashes, I imagine most of the work will be in > adapting get_iter and get_*_keyed.
Since this ticket was opened, a lot of work was done on Iterators; presumably this will need to be revisited. In the meantime, I've updated the test to be more likely to pass once the iteration is available, and this issue is now tracked at: https://trac.parrot.org/parrot/ticket/1028 -- Will "Coke" Coleda _______________________________________________ http://lists.parrot.org/mailman/listinfo/parrot-dev
