On Fri, Oct 07, 2005 at 12:50:09 -0700, chromatic wrote:
> On Fri, 2005-10-07 at 12:49 +0200, Juerd wrote:
> > Ashley Winters skribis 2005-10-06 19:30 (-0700):
> > > >     my Array $a = 97;      # dies eventually, but when?
> > > Runtime -- cannot coerce Int value to Array
> > It is fully determinable at compile time. 97 will never be compatible
> > with Array, so I see no reason to wait.
> If I added a multisub for Array assignment so that assigning an integer
> value set the length of the array, would 97 be compatible with Array?

That's a compile time reachable analysis. If the compiler finds out

        a. no code will be evaled (due to 'use optimize' or just plain
        lack of require, eval etc in the code)

        b. there is no compatbile multisub

then it should throw an error

> How about in unreachable code (which I do actually believe compilers can
> detect some of the time)?

These errors should probably still persist, even if dead code is
subsequently removed from the bytecode, because dead code can
become undead code if certain things change (compile time foldable
conditionals over e.g. $*OS are such a scenario) and the same
program should be typed the same way everywhere for a given version
of Perl.

 ()  Yuval Kogman <[EMAIL PROTECTED]> 0xEBD27418  perl hacker &
 /\  kung foo master: /me does a karate-chop-flip: neeyah!!!!!!!!!!!!!!

Attachment: pgpdHU54ECTW7.pgp
Description: PGP signature

Reply via email to