"EnTerr" wrote:
Certainly if you are debug dumping roPath or roUniversalEvent, printing their true type() is desirable. But what else can you externalize from them, when saying "I want to serialize the entire object, not just roInt or roString"?
I'm not sure if you're being so literal just to mess with me, or if you're truly confused by this. I have checks for Type(), because I want to know the object, not what interfaces it may implement. When dealing with intrinsics, checking for the interface is fine, but when working with objects, it's not always a simple as that. If you're just wanting to be type-safe, then checking for the interface is all you need to do, but that's not the only situation you'd ever want to check the type of an object. Let's say, for example, in 7.0 Roku decided to add the ifInt interface to an roDateTime object, so it could be natively treated like a timestamp. Without checking the type, my serialization code would have to be sure to check for an roDateTime
before it checked for an ifInt, otherwise it would serialize the data incorrectly. If I have a Type() check in there as well, then a change like that wouldn't be an issue.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)