How do you calculate the length of the string that would be returned by Array::pack? Is there something like Python's calcsize?
A:
By making an interpreter complying to the specifications found in Array::pack.
Or, reusing the existing implementation to count the number of characters instead of appending them to a string.
Mikael Jansson
2008-09-29 06:25:50
+1
A:
array.pack("").count I would say. Not really the fastest method, but it works.
ChaosR
2009-08-26 09:42:19