Skip to content

Instantly share code, notes, and snippets.

@dakkar
Created February 3, 2020 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dakkar/cd146eb3f4fa0a80e23e7a5eebce8b03 to your computer and use it in GitHub Desktop.
Save dakkar/cd146eb3f4fa0a80e23e7a5eebce8b03 to your computer and use it in GitHub Desktop.
manual loading of Raku modules (e.g. plugins)
#!/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;
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