From: Donald G P. <don...@ni...> - 2024-09-24 19:29:48
|
On 9/24/24 15:21, Jan Nijtmans wrote: > Op di 24 sep 2024 om 21:02 schreef Andreas Kupries <and...@gm...>: > > Well, as I said in my initial mail, for extensions providing > full-fledged Tcl_ObjTypes, i.e. full conversion to/from a string rep > this is indeed not a problem. The next extension command will shimmer > the value back to the type it wants. Just a bit of a performance-loss > due to the additional shimmer. > > > Thinking about it, there is a way out. The only reason for converting to > a Tcl list because I want to know whether it can be represented as > a list with length > 1. We can also check that by verifying the > string representation for spaces, tabs \n or \r (not counting the ones > at the beginning or end). A complication is that we should > not count spaces preceded by '\'. So, a little string trickery, > but this is cheaper than converting to a Tcl list, so worth > the trouble. Take note of the existing internal utility routine TclMaxListLength(). -- | Don Porter Applied and Computational Mathematics Division | | don...@ni... Information Technology Laboratory | | http://math.nist.gov/~DPorter/ NIST | |______________________________________________________________________| |