Created
February 3, 2020 15:01
-
-
Save dakkar/cd146eb3f4fa0a80e23e7a5eebce8b03 to your computer and use it in GitHub Desktop.
manual loading of Raku modules (e.g. plugins)
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
#!/usr/bin/env raku | |
use v6.d; | |
# we want to load modules from the same directory as this file | |
my $repo = CompUnit::Repository::FileSystem.new(prefix=> $?FILE.IO.parent); | |
my $c = $repo.need(CompUnit::DependencySpecification.new(:short-name<Foo>)); | |
say $c; | |
say $c.handle.globalish-package<Foo>.new(:1thing).thing; | |
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
use v6.d; | |
unit class Foo; | |
has $.thing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment