chromatic <[EMAIL PROTECTED]> writes: > On Fri, 2004-04-23 at 05: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. > > (hypothetical pre-breakfasty musings) > > Such as a PerlUndef with the 'expected_type' property set to 'Joe'?
PerlUndef's behaviour is one of the Parroty things that makes me rather nervous. It blurs (obliterates) the line between container and value rather spectacularly. ISTM that declaring 'my Joe $foo' should create a PerlScalar with an expected type of Joe and a PerlUndef as its contents. The PerlScalar's definedness test would simply be a test for the definedness of its contents.