On Fri, 2004-04-23 at 08:42, Dan Sugalski wrote:

> Since any type potentially has assignment behaviour, it has to be a 
> constructor. For example, if you've got the Joe class set such that 
> assigning to it prints the contents to stderr, this:
> 
>     my Joe $foo;
>     $foo = 12;
> 
> should print 12 to stderr. Can't do that if you've not put at least a 
> minimally constructed thing in the slot.

Yes, and to make that statement a bit more generic, I would suggest
that:

        my X $y;

is, as far as I can tell:

        my X $y = undef;

except that the explicit assignment might have a different signature
(being as you are providing a parameter to the constructor, even if it's
undef). There was a long thread a LONG time ago on what passing undef
meant for signature matching and how that interacted with default
arguments. I'm sorry, but I'm not able to recall the result at this
point. If I have time, I'll chase it down.

-- 
Aaron Sherman <[EMAIL PROTECTED]>
Senior Systems Engineer and Toolsmith
"It's the sound of a satellite saying, 'get me down!'" -Shriekback


Reply via email to