Permalink
Browse files

[builtins/globals.pir] preload $HOME/.perl6lib and languages/perl6/li…

…b in @*INC
  • Loading branch information...
1 parent 8566a62 commit e8b631cd86ffeaeae8cf930c72ffd4a449e5d521 @mberends mberends committed Sep 5, 2009
Showing with 21 additions and 12 deletions.
  1. +21 −12 src/builtins/globals.pir
@@ -24,18 +24,6 @@ src/builtins/globals.pir - initialize miscellaneous global variables
env = root_new ['parrot';'Env']
set_hll_global ['PROCESS'], '%ENV', env
- ## set up @*INC
- $S0 = env['PERL6LIB']
- $P0 = split ':', $S0
- push $P0, '.'
- $P0 = 'list'($P0)
- $P0 = $P0.'Array'()
- set_hll_global ['PROCESS'], '@INC', $P0
-
- ## set up %*INC
- $P0 = new ['Perl6Hash']
- set_hll_global ['PROCESS'], '%INC', $P0
-
## set up $*OS, $*OSVER $*EXECUTABLE_NAME
.local string info
info = sysinfo .SYSINFO_PARROT_OS
@@ -87,6 +75,27 @@ src/builtins/globals.pir - initialize miscellaneous global variables
vm['config'] = config
set_hll_global ['PROCESS'], "%VM", vm
+ ## set up @*INC
+ $S0 = env['PERL6LIB']
+ $P0 = split ':', $S0
+ config = interp[.IGLOBALS_CONFIG_HASH]
+ $S0 = config['libdir']
+ $S1 = config['versiondir']
+ concat $S0, $S1
+ concat $S0, '/languages/perl6/lib'
+ unshift $P0, $S0
+ $S0 = env['HOME']
+ concat $S0, '/.perl6lib'
+ unshift $P0, $S0
+ push $P0, '.'
+ $P0 = 'list'($P0)
+ $P0 = $P0.'Array'()
+ set_hll_global ['PROCESS'], '@INC', $P0
+
+ ## set up %*INC
+ $P0 = new ['Perl6Hash']
+ set_hll_global ['PROCESS'], '%INC', $P0
+
## the default value for new ObjectRefs
$P0 = 'undef'()
set_hll_global '$!OBJECTREF', $P0

0 comments on commit e8b631c

Please sign in to comment.