On Tue Jul 20 11:36:38 2010, ash_gti wrote:
> Autovivifcation works in a single file, but if you try to do it across files
> and use 'use Name' to import an object it doesn't work:
>
> john@Strudel /tmp $ cat t.pm
> class foo::a {
> };
>
> class foo {
> };
>
> say 'done'
>
> john@Strudel /tmp $ perl6 t.pm
> > done
>
> That worked as expected:
>
> john@Strudel /tmp $ cat foo.pm
> use foo::a;
> class foo {
> }
> john@Strudel /tmp $ cat foo/a.pm
> class foo::a {
> };
> john@Strudel /tmp $ perl6 -e 'use foo'
> ===SORRY!===
> Illegal redeclaration of symbol 'foo'
>
>
> if you change foo.pm to be:
> class foo {...};
> use foo::a;
> class foo {
> }
>
> it will work fine, no illegal redeclaration of symbol error.
>
>
> --
> John Harrison
This works now:
$ cat foo/a.pm
class foo::a {
};
$ cat foo.pm
use foo::a;
class foo {
}
say "alive";
$ ./perl6 foo.pm
alive
Closable with tests.
--
Will "Coke" Coleda