On Friday 16 December 2005 18:15, Darren Duncan wrote:

> Therefore, I propose that the default behaviour of Perl 6 be changed
> or maintained such that:
> 0. An undefined value should never magically change into a defined
> value, at least by default.

This is fairly well at odds with the principle that users shouldn't have to 
bear the burden of static typing if they don't want it.

It sounds like you want to override the coercion of undef to fail, at least in 
a lexical scope.  Go for it.

I can't see it as a default behavior though.  Sure, the literal expression "6 
+ undef" is pretty silly, but I don't really want to write "6 + Maybe 
$variable" (sorry, Haskellers) everywhere when the compiler is perfectly 
capable of DWIMming in the 98% of cases where $variable is undefined because 
I like being so lazy as not to initialize explicitly every possible variable 
I could ever declare, being very careful to distinguish between 0, '', and 
undef in boolean context.

I suspect the remaining two percent of cases, I won't write "6 + undef" 

-- c

Reply via email to