Documentation enhancement of var::toString


#1

A small request here:
I needed to know what var::toString will return for various types of vars. Sadly there is no documentation for this member function, so I had to got through the source code to find out what it does in the various cases. A quick enumeration of what the string returned will contain for the various types of vars would be a great enhancement for the documentations in my opinion.

Side question: As there is no documentation of that function, can I still expect it’s implementation to stay as it is so that I can rely the current behaviour in my code?


#2

What types of thing are you converting to a string? If the formatting of those strings is important then I would suggest doing those conversions explicitly. Relying on the current behaviour is risky.


#3

Thanks for you answer Tom. I’m building some generic GUI components that display values in a tree structure that it takes from some sort of tree structure containing vars to hold a various set of possible value types.

However, most likely those values will be numerical or string values but it might be possible to store other stuff (binary data or arrays) in the vars so I just wanted to be sure what display values I would expect in that case and if they were senseful for the use case. I’m fine with the current implementation but I get that I should roll out my own conversion functions to do the conversion if I want to rely on the conversion behaviour.