Forum Discussion
EnTerr
11 years agoRoku Guru
"RokuMarkn" wrote:
I'd tentatively suggest the code should be redesigned if you need to check things like that. Perhaps there's a good use case for keeping different types in the same variable but offhand I can't think of one. I certainly have never had the need to check types at run time, except to distinguish messages returned from Wait().
Off the top of my head example: last year i wrote a XML/XHTML parser (because at the time roXML could not parse nor even hold the result of parsing things i was facing, like e.g. "<a> b <c/> d </a>" - and it still cannot do either on fw3). And i needed that there, since when doing recursive walk of the tree, i could either get an array/list, a dictionary or a string (leaf) and had to act accordingly.
PS. NVM - this viewtopic.php?f=34&t=67294 is probably a better/simpler example, a function that when given "something" externalizes it to JSON