flightaware / Tcl-bounties

Bounty program for improvements to Tcl and certain Tcl packages
104 stars 8 forks source link

Clarification of 'A reasonable C API for enumerating an array' #15

Open schlenk opened 7 years ago

schlenk commented 7 years ago

Is this just asking to get a nicer C-level access to the already available 'array startsearch', 'array nextelement' etc., which is currently only accessible via Tcl_eval?

Those are mentioned as 'will probably be removed in 9.0', in the wiki, so probably needs some sorting out what direction things go with array iteration anyway.

lehenbauer commented 7 years ago

In C it is easy to get the value of an element of an array but it is difficult to enumerate the elements of the array without using Tcl_Eval... a C equivalent to "foreach var [array names myArray]"

resuna commented 7 years ago

Implementing a C API that is functionally equivalent to the "array *search" commands is the general idea here.

See also https://github.com/flightaware/Tcl-bounties/issues/18