Skip to content

Commit

Permalink
Initial implementation of the fetch-library method on the compiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
tene committed May 18, 2009
1 parent ec55f17 commit f77ad8a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions perl6.pir
Expand Up @@ -410,6 +410,26 @@ to the Perl 6 compiler.
.return (list)
.end


.sub 'fetch-library' :method
.param pmc request
.local pmc name, retval, library, inc_hash
name = request['name']
$S0 = join '::', name
retval = 'require'($S0, 'module'=>1)
if null retval goto fail
library = new 'Hash'
library['name'] = name
inc_hash = get_hll_global '%INC'
$S0 = inc_hash[$S0]
library['filename'] = $S0
$P0 = get_hll_global name, 'EXPORT'
library['symbols'] = $P0
.return (library)
fail:
.return (retval)
.end

=back

=item postload()
Expand Down

0 comments on commit f77ad8a

Please sign in to comment.