Get drink from sink - cooling or not?

<< < (4/4)

Inge:
Isn't the temperature controller one of those global objects (simtype SimPe calls it) that lives on every lot all the time?   And if Temp 0 and 1 are just going to hold the GUID you just specified in the Test Object call anyway, why doesn't the coder simply stuff the GUID into them in the first place?  Why was the test necessary?   I have never met such a bizarre programming langiage in my life.

J. M. Pescado:
Quote from: Inge on 2007 September 18, 22:45:47

Isn't the temperature controller one of those global objects (simtype SimPe calls it) that lives on every lot all the time?
No, this is a new trick that was introduced around the time of OFB or so, at least when I started seeing it, where an object's code can be invoked by RTBN without the physical presence of the object on the lot, using RTBN 3, instead of the traditional method of invoking code on an existing object with RTBN 1 or 2, which requires that the stack object be the physical object. RTBN 3 does not require this, only that the object's GUID be in temp0/1, and does not require it to physically exist in the object list. This technique has begun to see increasingly heavy use, and I exploit this in my various macro-things as well.

Quote from: Inge on 2007 September 18, 22:45:47

And if Temp 0 and 1 are just going to hold the GUID you just specified in the Test Object call anyway, why doesn't the coder simply stuff the GUID into them in the first place?  Why was the test necessary?   I have never met such a bizarre programming langiage in my life.
Well, presumably, it is done because it allows the GUID to be jammed into T0/T1 without the author of the code having to understand endian-ness, or use two instructions to load the low and high bits of the GUID into two temps. There is no evidence that Edith makes the coder at all aware of the endian-ness of loading GUIDs at all. And when used as such, it is not a "test". As far as I can tell, the test result always returns true, even if the object GUID in question does not exist, although the code seems to consistently make an exception for false-return, as opposed to the typical behavior of simply leaving it as a dangling FFFC tail.

Inge:
So what does actually happen if you look for an object by a non-existent GUID?  For example you type the GUID in wrong and there never has been an object with such a GUID?  Doesn't it lead to massive explosions?  How can RTBN handle that?

J. M. Pescado:
I believe that it will simply False, but you might Error instead. I've never tried it.

Navigation

[0] Message Index

[*] Previous page