Skip to content

Instantly share code, notes, and snippets.

@ugexe
Created October 16, 2016 16:34
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 ugexe/77ef72a232773ef2ededf5ce74f89e7d to your computer and use it in GitHub Desktop.
Save ugexe/77ef72a232773ef2ededf5ce74f89e7d to your computer and use it in GitHub Desktop.
sub EXPORT(+@a) {
# cw: Implement SELECTIVE loading if necessary.
@color_list = @a.elems > 0 ??
@color_lists_found.grep(@a.any)
!!
@color_lists_found;
#if $color_support {
# require Color;
#}
#for @color_list -> $cl {
# say "L: $cl";
# require ::("Color::Names::{$cl}");
#}
# cw: What we always export.
#
# Is there any way to get EXPORT::DEFAULT from the module block?
{
'&lists_available' => ::('&Color::Names::lists_available'),
'&lists_loaded' => ::('&Color::Names::lists_loaded'),
'&location' => ::('&Color::Names::location'),
'&color' => ::('&Color::Names::color'),
'&hex' => ::('&Color::Names::hex'),
'&rgb' => ::('&Color::Names::rgb'),
@color_list = @a.elems > 0 ??
@color_lists_found.grep(@a.any)
!!
@color_lists_found;
#if $color_support {
# require Color;
#}
#for @color_list -> $cl {
# say "L: $cl";
# require ::("Color::Names::{$cl}");
#}
# Is there any way to get EXPORT::DEFAULT from the module block?
{
'&lists_available' => ::('&Color::Names::lists_available'),
'&lists_loaded' => ::('&Color::Names::lists_loaded'),
'&location' => ::('&Color::Names::location'),
'&color' => ::('&Color::Names::color'),
'&hex' => ::('&Color::Names::hex'),
'&rgb' => ::('&Color::Names::rgb'),
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment