On Wed, Aug 17, 2005 at 11:45:52PM -0500, Dave Rolsky wrote:
> And another question.  How will I make Perl6 not do automatic coercion for 
> me.  If I have this sub:
> 
>  sub date (Int +$year is required, +$month, +$day)

BTW, Pugs supports the ++ syntax, which iirc is said to be back in favour
during the Oscon design meeting:

    sub date (Int ++$year, +$month, +$day)

> and someone does this:
> 
>  date('this year', 12, 1);
> 
> I'd prefer for this to fail, rather than giving me 0000-12-01!  I vaguely 
> remember a mention of "use strict 'types'" either on this list or hanging 
> out with some pugs folks at YAPC.

You will probably get:

    1. a compile time warning of unsafe coercion, possibly made fatal.
and 
    2. a NaN at runtime if you ignore the warning.

Thanks,
/Autrijus/

Attachment: pgpHXV9csSalC.pgp
Description: PGP signature

Reply via email to