> DynamicAny da1 = 1;
> da1 = "abc"; // what to do ?
I've suggested a special, "preserve type" ptassign() function, not the change of
the assignment operator. So, one can choose this option..
In the above example, it should throw bad cast exception.. IMHO.
Alex Fabijanic wrote:
> On Fri, Feb 1, 2008 at 10:19 PM, Alex Fabijanic <aleskx@...> wrote:
>> On Jan 28, 2008 6:02 AM, Keresztfalvi Laszlo <lkereszt@...> wrote:
>>> Alex Fabijanic wrote:
>>>> On Jan 23, 2008 10:27 AM, Keresztfalvi Laszlo
>>>> I know DynamicAny is quite finished. One little idea is a "type
>>>> assignment".. when the DynamicAny assigned keeps its original type
>>>> converts the assigned value and not itself. Just an idea..
>>>> Laszlo, I'm not sure what the benefits of this modification would be
>>>> ? Alex
>>> Lost of speaking about POCO and scripts are around :) I use DynamicAny
>>> value like in a sciprt, eg. PHP.. and provide value-string
>>> representation transparency. However, usually on some end of a data
>>> flow there is
>>> who are subtle about types. Currently, this is the database. I fetch
>>> types, represent them on the web without types (string), then they come
>>> and again require types.
>> Sounds like it could make sense. I'm too busy right now with 1.3.2 so I
>> did not look into details of how (and whether at all) to do it, but I'll
>> look into it for 1.4.
> After some thinking, I decided that this is not really a good idea. When
> you assign some other type then the one that DynamicAny currently holds, it
> is intuitive to expect it to internally transforms itself into that type.
> Not respecting that leads to complications such as in following example:
> DynamicAny da1 = 1; da1 = "abc"; // what to do ?