dakkar-raku-opts-handling-idiom

From IRC #raku on 2021-01-21: https://colabti.org/irclogger/irclogger_log/raku?date=2021-01-21#l396

Also help by @elcaro and @moritz

1616: dakkar: ============

tbrowder: if you have a `sub something($thing, $:named, $:other)` and you want to wrap it so it ignores named arguments with undefined values, you could do:

1617: dakkar: ============

tbrowder: `sub something_wrapped($thing, *%named) { my %args = %named.pairs.grep(*.value.defined); return something($thing, |%args) }`


#= a sub to be wrapped
sub some-foreign-sub($thing, :$named, :$other, ...) {
...
}

#= the
sub some-wrapper-sub($thing, *%named) {
    my %args = %named.pairs.grep(*.value.defined);
    return some-foreign-sub($thing, |%args)
}

PDF::Document v0.0.10

Provides higher level classes and routines to create PDF documents

Authors

  • Tom Browder

License

Artistic-2.0

Dependencies

MacOS::NativeLibFont::FreeType:ver<0.5.14>FontFactory::Type1:ver<1.1.1+>Proc::EasierPod::To::MarkdownPDF::Content:ver<0.8.6+>PDF::Font::LoaderFile::TempFile::FindConfig::TOMLText::UtilsFont::AFM:ver<1.24.4+>PDF:ver<0.4.5+>FontFactory::Type1PDF::Lite

Test Dependencies

Provides

  • PDF::Document
  • PDF::Document::Role

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.