Last active
August 29, 2015 14:19
-
-
Save lizmat/a10b3e6b659cfe7dd762 to your computer and use it in GitHub Desktop.
Diff for lazy @*INC initialization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/Inc.pm b/src/core/Inc.pm | |
index 3d6f07f..5b246f4 100644 | |
--- a/src/core/Inc.pm | |
+++ b/src/core/Inc.pm | |
@@ -1,4 +1,4 @@ | |
-{ | |
+sub INIT-INC-CUSTOM_LIB($inc) { | |
my @INC; | |
my %CUSTOM_LIB; | |
@@ -177,6 +177,16 @@ | |
PROCESS::<%CUSTOM_LIB> := %CUSTOM_LIB; | |
nqp::bindhllsym('perl6', 'ModuleLoader', CompUnitRepo); | |
+ | |
+ $inc ?? @INC !! %CUSTOM_LIB; | |
+} | |
+ | |
+multi sub INITIALIZE_DYNAMIC('@*INC') { | |
+ INIT-INC-CUSTOM_LIB(1); | |
+ | |
+} | |
+multi sub INITIALIZE_DYNAMIC('%*CUSTOM_LIB') { | |
+ INIT-INC-CUSTOM_LIB(0); | |
} | |
# vim: ft=perl6 expandtab sw=4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment