Issue 1646: DynAny assignment (port-rtf) Source: (, ) Nature: Uncategorized Issue Severity: Summary: Summary: The text for the assign operation says: If an invalid DynAny object is passed (it has a different typecode or doesn"t contain a meaningful value), the Invalid exception is raised. Two problems with this: - What"s a "meaningful" value, or more pertinently, what"s a value that isn"t meaningful? I think this needs to be defined a lot more clearly. - More seriously, why can"t I assign a DynAny containing a string to a DynAny containing, say, a structure? I would have expected assignment to simply do a proper deep copy of all the components, including the type code. As defined, I can assign a DynAny to another DynAny only if the target does not have "a different type code". Was this intentional? If so, what"s the motivation? Resolution: Revised Text: Actions taken: July 8, 1998: received issue February 22, 1999: closed issue Discussion: End of Annotations:===== Return-Path: X-Authentication-Warning: tigger.dstc.edu.au: michi owned process doing -bs Date: Wed, 8 Jul 1998 11:48:37 +1000 (EST) From: Michi Henning To: issues@omg.org, port-rtf@omg.org Subject: DynAny assignment The text for the assign operation says: If an invalid DynAny object is passed (it has a different typecode or doesn't contain a meaningful value), the Invalid exception is raised. Two problems with this: - What's a "meaningful" value, or more pertinently, what's a value that isn't meaningful? I think this needs to be defined a lot more clearly. - More seriously, why can't I assign a DynAny containing a string to a DynAny containing, say, a structure? I would have expected assignment to simply do a proper deep copy of all the components, including the type code. As defined, I can assign a DynAny to another DynAny only if the target does not have "a different type code". Was this intentional? If so, what's the motivation? Also, what is a "different type code"? (Here we go again...) For example, can I assign a DynAny with a type code that's an alias for string to a DynAny with a type code for string? Thanks, Michi. -- Michi Henning +61 7 33654310 DSTC Pty Ltd +61 7 33654311 (fax) University of Qld 4072 michi@dstc.edu.au AUSTRALIA http://www.dstc.edu.au/BDU/staff/michi-henning.html Return-Path: Sender: jon@floorboard.com Date: Tue, 07 Jul 1998 21:24:55 -0700 From: Jonathan Biggar To: Michi Henning CC: issues@omg.org, port-rtf@omg.org Subject: Re: DynAny assignment References: Michi Henning wrote: > > The text for the assign operation says: > > If an invalid DynAny object is passed (it has a different > typecode > or doesn't contain a meaningful value), the Invalid > exception > is raised. > > Two problems with this: > > - What's a "meaningful" value, or more pertinently, what's a > value that isn't meaningful? > > I think this needs to be defined a lot more clearly. > > - More seriously, why can't I assign a DynAny containing a > string to a DynAny containing, say, a structure? I would > have expected assignment to simply do a proper deep copy > of all the components, including the type code. As > defined, > I can assign a DynAny to another DynAny only if the target > does not have "a different type code". > > Was this intentional? If so, what's the motivation? > > Also, what is a "different type code"? (Here we go > again...) > For example, can I assign a DynAny with a type code that's > an alias for string to a DynAny with a type code for > string? The assumption appears to be that once a DynAny gets a TypeCode, which it only does when it is created, either explicitly via create_dyn_*() or by the various DynAny operations that return components, that the TypeCode is immutable. This generally allows the DynAny implementation to allocate its memory buffer once, at creation time, and it never has to reallocate it again (at least the top level buffer). -- Jon Biggar Floorboard Software jon@floorboard.com jon@biggar.org