Skip to content

Instantly share code, notes, and snippets.

@Xliff
Last active May 17, 2023 14:46
Show Gist options
  • Save Xliff/e0101d427fb6f2cd2eed361b402cb2b2 to your computer and use it in GitHub Desktop.
Save Xliff/e0101d427fb6f2cd2eed361b402cb2b2 to your computer and use it in GitHub Desktop.
The need for ::Need
raku -Ilib -e 'use experimental :rakuast; use MONKEY-SEE-NO-EVAL; my $ast = RakuAST::Statement::Need.new( module-names => [ RakuAST::Name.from-identifier(RakuAST::Name.from-identifier("GLib::Raw::Definitions")) ] ); EVAL $ast; import ::("GLib::Raw::Definitions"); glib.say'

This is the exact testing data. It's execution ready if you clone p6-GLib, you should only need to change into the project directory and run the above. Otherwise you will have to create a .rakumod file with a constant declaration and replace the glib in the above script with the name of that constant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment