Re: Opinion on the MTF mh_n1074 doc

Richard Houldsworth (richardh@prl.research.philips.com)
Fri, 20 Feb 1998 10:03:43 +0000

Colleagues,

Kei Takikawa wrote:
>
> Hello colleagues,
>
> At 17:31 98/02/19 +0100, Andreas Kraft wrote:
> > The question is whether only variables which are passed via the
> > ":IndirectRef" mechanism can be used as "out" variables.
> > One (imho wrong) interpretation could be that if the parameter is an
> > ObjectRefVariable object the value of this variable is taken as an address
> > to the target variable...
>
> For "in" parameters, both direct value assignement and indirect reference
> are fine. However, I would rather vote to an "ObejectRefVariable" solution
> for "out" parameters. The reason is that GenericXXXs are supposed to be
> "data source" and have no sense of "data sink" in all other situation.

I'd just like to point out here that the interpretation of parameters
to Programs depends also on the target language. For those not
totally familiar with MHEG-6, the parameter type conversions to Java
are explicitly stated, like so:

Integer -> java.lang.Integer
ObjectReference -> iso.mheg5.ObjectReference
etc.

As Java does not allow passing by reference, the issue above
does not arise. Indirection though an Variable is resolved before
the call. Output parameters are implemented using a setVariable API
call on Variables passed as ObjectReferences. This method does have
the advantage of eliminating the side-effects of changing a variable
without notifying the MHEG engine.

However, for other languages many different parameters mappings are
possible, and in some circumstances interpreting the :indirectref
token as a pointer-to indicator may be useful. In other cases it
may be appropriate to use a 'handle' system instead of direct
pointers. The point is that we cannot predict all the
possibilities, and that we shouldn't try to impose limits on the
implementation of Program.

The solution to issue 11 seems to make sense to me, but it
shouldn't be interpreted as meaning that :indirectref MUST mean
pass-by-reference. It could also mean dereference and pass-by-
value, depending on the application domain.

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