gisle / tcl.pm

Tcl extension module for Perl
http://search.cpan.org/dist/Tcl
9 stars 8 forks source link

Tcl::Var: allow iterating Tcl array containing element with empty string as its name #39

Closed chrstphrchvz closed 3 years ago

chrstphrchvz commented 3 years ago

Tcl::Var FIRSTKEY/NEXTKEY currently assume that receiving an empty string from array nextelement … means the last element name was already returned, which does not accommodate a Tcl array containing an element with the empty string as its name. I suggest instead checking array anymore … to tell whether there are additional element names to return.

vadrer commented 3 years ago

I pretty much like it however I do not like _nextElement name of subroutine. if this is "hidden" name which user should never use - probably better name is _next_element

you know that we interpret this call: $interp->_arrayNextelement(...) as this call: $interp->invoke("array","nextelement",...)

vadrer commented 3 years ago

I am merging, but please change _nextElement by next commit/pull request!