Skip to content

Commit

Permalink
[builtins/globals.pir] preload $HOME/.perl6lib and languages/perl6/li…
Browse files Browse the repository at this point in the history
…b in @*INC
  • Loading branch information
mberends committed Sep 5, 2009
1 parent 8566a62 commit e8b631c
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions src/builtins/globals.pir
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e8b631c

Please sign in to comment.