At 10:36 AM +0200 8/28/02, [EMAIL PROTECTED] wrote:
> >> Will there be automatic calling of the deserialization method
>>> for objects, so that code like this DWIMs...
>
>>> my Date $bday = 'June 25, 2002';
>
>> Err... what do you mean it to do?
>
>Wow, this is nice. He means (I think) that this will be translated into
>
>my Date $bday = Date->new('June 25, 2002');
That's really unlikely. More likely what'll happen is:
my Date $bday;
$bday = 'June 25, 2002';
and it'll be up to $bday's string assignment code to decide what to
do when handed a string that looks like a date.
That should work OK for a variety of reasons. $bday is strongly typed
since you told perl what type it was in the my declaration. Date can
also override string assignment, thus Doing The Right Thing (pitching
a fit or taking a date) when you assign to it.
I can see downsides to it, though--it means you lose the compile-time
type checking, since just because we're getting the wrong type
doesn't mean it's really an error. OTOH it's not like we have strong
compile-time type checking now...
--
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk