Re: Clarification for ObjectReferenceVariabl

Richard Houldsworth (richardh@prl.research.philips.com)
Thu, 12 Mar 1998 15:36:00 +0000

Andreas,

Andreas Kraft wrote:
>
> Some time ago I complained about the (inconsistent) usage of NULL. It suggests
> an implementation method, but imho it should be read as "the internal
> representation of the null-value". This could be, for example, encoded as
> '( "" 0)'. The usage of 'NULL' somehow suggests the usage of a null-pointer
> representation ('char * 0').
> So, it should be at least a valid ObjectReference. This way, there would be
> no problem with the TestVariable action.
>
> What do you think?

The way I see it, there are two alternatives:

1. Define an explicit value for the NULL ObjectReference. ( "" 0 )
seems the obvious choice. Developers can then test against this known,
reserved value.

2. Let ObjectRefVariables contain NULL (meaning a value with no type),
and provide some way of comparing ObjectRefVariables with this
undefined value.

I don't actually mind which alternative we go for, but the current
situation doesn't work.

Currently, we seem to be halfway between the two options, where we
don't have a value for NULL, and there is no way to test for NULL.
We also have the inconsistent situation where variables don't seem
to be able to store NULL, but GetCellItem can put a NULL in a
variable anwyay!

This is bad, because not only is the storage of NULL ObjectReferences
ambiguous, but the author no way of preventing undefined behaviour
happening when a ObjectRefVariable containing NULL is used.

Andreas Kraft wrote:
> After thinking about it, I would like to suggest to explicitly allow
> Applications to have ObjectRefVariables pointing to Ingredients in a Scene.

I don't think this needs to be explicitly stated. There are no
limitations on the contents of ObjectRefVariables, merely rules about
how an ObjectReference is dereferenced. If the ObjectReference cannot
be dereferenced at any time, then the action simply fails.

>
> One example: I want to activate a specific bitmap in a scene during the startup
> of the scene. Which bitmap is activated depends on some other things done
> before in another scene. I can store the calculated ObjectReference in a shared
> variable in the application which is used in the started scene to activate
> the bitmap.
> Here, I need a variable in the Application which points to an Ingredient in
> a Scene.
>
> What do think? Is there really a reason to disallow this?

Provided that the ObjectReference group ID refers to the active Scene,
this example seems valid to me.

Regards,

Richard

-- 
-----------------------------------------------------------------
Richard Houldsworth, Software Engineer,
Philips Research Laboratories,				  
Redhill,                Daytime phone number:  +44 (0)1293 815052    
RH1 5HA			E-mail: richardh@prl.research.philips.com