You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the following (somewhat unusual) file layout:
-- lib/Program.pm6 --
use Vector; # included in lib/Java
class Program { }
-- cut here --
-- lib/Java/Vector.pm6 --
use String; # Included in lib/Java
class Vector { }
-- cut here --
-- lib/Java/String.pm6 --
class String { }
-- cut here --
invoke with:
perl6 -c -Ilib -Ilib/Java lib/Program.pm6
Resolution order *should* go something like this (though I'm aware that
@INC is an old-fashioned notion):
read lib/Program.pm, attempt to resolve Vector.
readdir lib/, find no Vector.pm or .pm6
readdir lib/Java, find Vector.pm6
Read lib/Java/Vector.pm6, attempt to resolve String.
readdir lib/, find no String.pm or .pm6
readdir lib/Java, find String.pm6
Compile.
I'd accept OOM or looping (I've seen both behaviors while playing with
this) if I were foolish enough to create mutually-recursive includes,
although I would be surprised. There is no recursion, mutual or
otherwise, going on here though. lib/Java is a subdirectory of lib/ and
I'm well aware that could be playing havoc with file includes. I'm also
aware that ordinarily lib/Java/Vector.pm6 would contain a class called
'class Java::Vector { }', but I wanted to experiment with a slightly
different kind of include style and ran across what appears to me to be
a quirk.
Migrated from rt.perl.org#127329 (status was 'new')
Searchable as RT127329$
The text was updated successfully, but these errors were encountered: