## dist_zef-dwarring-HarfBuzz-Shaper-Cairo.md
[[Raku HarfBuzz Project]](https://harfbuzz-raku.github.io)
/ [[HarfBuzz-Shaper-Cairo Module]](https://harfbuzz-raku.github.io/HarfBuzz-Shaper-Cairo-raku)

## class HarfBuzz::Shaper::Cairo

HarfBuzz / Cairo shaping integration

## Synopsis

```
use HarfBuzz::Shaper::Cairo :&cairo-glyphs;
use HarfBuzz::Shaper;
use Cairo;
my Cairo::Glyphs $glyphs;
my $file = 't/fonts/NimbusRoman-Regular.otf';
my $text = 'Hell€!';
# -- functional interface --
my HarfBuzz::Shaper $shaper .= new: :font{:$file}, :buf{:$text};
$glyphs = cairo-glyphs($shaper);
# -- OO interface --
my HarfBuzz::Shaper::Cairo $shaper2 .= new: :font{:$file}, :buf{:$text};
$glyphs = $shaper2.cairo-glyphs;
# -- FreeType integration --
use Font::FreeType;
use Font::FreeType::Face;
use Harfbuzz::Shaper::Cairo::Font;
my Font::FreeType::Face $ft-face = Font::FreeType.face: $file;
my Harfbuzz::Shaper::Cairo::Font $font .= new: :$file;
my HarfBuzz::Shaper::Cairo $shaper3 .= $font.shaper: {:$text};
$glyphs = $shaper3.cairo-glyphs;

```

### Description

This module compiles a set of shaped glyphs into a Cairo::Glyphs object; suitable for use by the Cairo::Context `show_glyphs()` and `glyph_path()` methods.

This module also includes the [HarfBuzz::Font::Cairo](https://harfbuzz-raku.github.io/HarfBuzz-Shaper-Cairo-raku/HarfBuzz/Font/Cairo) class.

Please see the `examples/` folder, for a full working example.

## Methods

### method cairo-glyphs

```
method cairo-glyphs(
    Numeric :x($x0) = 0e0,
    Numeric :y($y0) = 0e0,
    |c
) returns Cairo::Glyphs

```

Return a set of Cairo compatible shaped glyphs

The returned object is typically passed to either the Cairo::Context show\_glyphs() or glyph\_path() methods


## dist_zef-lancew-Scientist.md
# DESCRIPTION

Raku module inspired by <https://github.com/github/scientist> ( <http://githubengineering.com/scientist/> )

See also: <https://github.com/MadcapJake/Test-Lab> For a different take on the same idea.

[![test](https://github.com/lancew/ScientistP6/actions/workflows/test.yml/badge.svg)](https://github.com/lancew/ScientistP6/actions/workflows/test.yml)

# SYNOPSIS

```
flowchart LR
    raku[$exp.run]
         -->|execute| use(Control Code)
         --> compare(Compare Result)

    raku -->|execute| try(Candidate Code)
         --> compare(Compare Result)

    use --> return[Return Result]

    compare -->|publish| Metrics

```

```
use Scientist;

my $experiment = Scientist.new(
    experiment => 'Tree',
    try => sub {return 99},
    use => sub {return 10},
);

my $answer = $experiment.run;

say "The number ten is $answer";
warn 'There was a mismatch between control and candidate'
    if $test.result{'mismatched'};

```

# Introduction

This module is inspired by the Scientist ruby code released by GitHub under the MIT license in 2015/2016.

In February 2016 I started writing the Perl5 module to bring similar ideas to Perl. Later I started this module to apply same ideas in Raku.

Please get involved in this module; contact [lancew@cpan.org](mailto:lancew@cpan.org) with ideas, suggestions; support, etc.

This code is also released under the MIT license to match the original Ruby implementation.

# Methods / Attributes

## context()

Provide contextual information for the experiment; will be returned in the result set.

Should be a hashref

## enabled(|)

DEFAULT : TRUE
Boolean switch to enable or disable the experiment. If disabled the experiment will only return
the control code (use) result. The candidate code (try) will NOT be executed. The results set will
not be populated.

## experiment()

Simply the name of the experiment included in the result set.

## publish

Publish is a method called by ->run().

Scientist is design so that you create your own personalised My::Scientist module and extend publish to do what you want/need.
For example push timing and mismathc information to Statsd.

## use()

Control code to be included in the experiment.
This code will be executed and returned when the experiment is run.
NB: This code is run and returned even if experiment enabed=false.

## run()

This method executes the control (use) code and if experiment enabled will also run the candidate (try)
code. The control and candidate code is run in random order.

## try()

Candidate code to be included in the experiment.
This code will be executed and discarded when the experiment is run.

# Extending Publish

To automate reporting of experiement results, you will want to write your own .publish() method. Publish is called by .run().

A typical example would be to push timing information to Statsd or a database.

```
use Scientist;

class MyScientist is Scientist {
    has $.test_value is rw;
    method publish {
        # Do Stuff...
    }
}

my $experiment = MyScientist.new(
    experiment => 'Tree',
    enabled => True,
    try => sub {return 99},
    use => sub {return 88},
);

```

# AUTHOR

Lance Wicks [lancew@cpan.org](mailto:lancew@cpan.org)

# COPYRIGHT AND LICENSE

This software is Copyright (c) 2016 by Lance Wicks.

This is free software, licensed under:

The MIT (X11) License

The MIT License

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to
whom the Software is furnished to do so, subject to the
following conditions:

The above copyright notice and this permission notice shall
be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT
WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

# SEE ALSO

<http://www.infoq.com/news/2016/02/github-scientist-refactoring>

<http://githubengineering.com/scientist/>

<https://news.ycombinator.com/item?id=11104781>

<https://github.com/ziyasal/scientist.js>

<http://tech-blog.cv-library.co.uk/2016/03/03/introducing-scientist/>


## dist_zef-tbrowder-File-file.md
[![Actions Status](https://github.com/tbrowder/File-file/actions/workflows/linux.yml/badge.svg)](https://github.com/tbrowder/File-file/actions) [![Actions Status](https://github.com/tbrowder/File-file/actions/workflows/macos.yml/badge.svg)](https://github.com/tbrowder/File-file/actions) [![Actions Status](https://github.com/tbrowder/File-file/actions/workflows/windows.yml/badge.svg)](https://github.com/tbrowder/File-file/actions)

# NAME

**File::file** - Provides a Raku wrapper for the system 'file' command

# SYNOPSIS

```
use File::file;
my $o = File::file.new;
say $o.file: ".."; # OUTPUT: «..: directory␤»

```

# DESCRIPTION

**File::file** is a convenience wrapper around the system 'file' command.

# AUTHOR

Tom Browder [tbrowder@acm.org](mailto:tbrowder@acm.org)

# COPYRIGHT AND LICENSE

© 2023 Tom Browder

This library is free software; you may redistribute it or modify it under the Artistic License 2.0.


## dist_cpan-AKIYM-JSON-Hjson.md
[![Build Status](https://travis-ci.org/akiym/JSON-Hjson.svg?branch=master)](https://travis-ci.org/akiym/JSON-Hjson)

# NAME

JSON::Hjson - Human JSON (Hjson) deserializer

# SYNOPSIS

```
use JSON::Hjson;

my $text = q:to'...';
{
  // specify delay in
  // seconds
  delay: 1
  message: wake up!
}
...
say from-hjson($text).raku;

```

# DESCRIPTION

JSON::Hjson implements Human JSON (Hjson) in Raku grammar.

# SEE ALSO

JSON::Tiny

<https://hjson.org/rfc.html>

# AUTHOR

Takumi Akiyama [t.akiym@gmail.com](mailto:t.akiym@gmail.com)

# COPYRIGHT AND LICENSE

Copyright 2016 Takumi Akiyama

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-raku-community-modules-GlotIO.md
[![Actions Status](https://github.com/raku-community-modules/GlotIO/workflows/test/badge.svg)](https://github.com/raku-community-modules/GlotIO/actions)

# NAME

GlotIO - use glot.io API via Raku

# SYNOPSIS

```
use GlotIO;
my GlotIO $glot .= new: :key<89xxxx9f-a3ec-4445-9f14-6xxxe6ff3846>;

say $glot.languages;

```

# TABLE OF CONTENTS

* [NAME](#name)
* [SYNOPSIS](#synopsis)
* [DESCRIPTION](#description)
* [KEY](#key)
* [METHODS](#methods)
  * [`.new`](#new)
  * [`.languages`](#languages)
  * [`.versions`](#versions)
  * [`.run`](#run)
  * [`.stdout`](#stdout)
  * [`.stderr`](#stderr)
  * [`.list`](#list)
  * [`.create`](#create)
  * [`.get`](#get)
  * [`.update`](#update)
  * [`.delete`](#delete)
* [REPOSITORY](#repository)
* [BUGS](#bugs)
* [AUTHOR](#author)
* [LICENSE](#license)

# DESCRIPTION

This module lets you use API provided [glot.io](http://glot.io) which is
a pastebin that also lets you execute code in a number of languages.

# KEY

Some parts of the API require you register at glot.io and [obtain an
API key](https://glot.io/api)

# METHODS

## `.new`

```
my GlotIO $glot .= new: :key<89xxxx9f-a3ec-4445-9f14-6xxxe6ff3846>;

```

Constructs and returns a new `GlotIO` object. Takes one **optional**
argument: `key`, which is [the API key](https://glot.io/api).
Methods that require the key are marked as such.

## `.languages`

```
say "Glot.io supports $_" for $glot.languages;

```

Returns a list of languages supported by GlotIO.

## `.versions`

```
say "Glot.io supports $_ version of Raku"
    for $glot.versions: 'raku';

```

Returns a list of supported versions for a language that
must be supplied as the mandatory positional argument. List of valid
language names can be obtained via `.languages` method. Using an
invalid language will `fail` as an HTTP 404 error.

## `.run`

```
    say $glot.run: 'raku', 'say "Hello, World!"';

    say $glot.run: 'raku', [
        'main.raku'   => 'use lib "."; use Foo; doit;',
        'Foo.rakumod' => 'unit module Foo; sub doit is export { say "42" }',
    ];

    say $glot.run: 'python', 'print "Hello, World!"', :ver<2>;

```

Requests code to run on Glot. The first positional argument specifies
the language to use (see `.languages` method). Second argument
can either be an `Str` of code to run or an `Array` of `Pair`s. If the
array is specified, the key of each `Pair` specifies the filename and
the value specifies the code for that file. The first file in the
array will be executed by Glot, while the rest are supporting files,
such as modules loaded by the first file.

The optional named argument `ver` can be used to specify the version
of the language to use. See `.versions` method.

Returns a `Hash` with three keys: `stdout`, `stderr` which specify
the output streams received from the program and `error` that
seems to contain an error code, if the program doesn't successfully
exit.

If an incorrect language or version are specified, will `fail` with
an HTTP 404 error.

## `.stdout`

```
    say $glot.stdout: 'raku', 'say "Hello, World!"';

```

A shortcut for calling `.run` (takes same arguments) and returning
just the `stdout` key. Will `fail` with the entire `Hash` returned
from `.run` if the program errors out.

## `.stderr`

```
    say $glot.stderr: 'raku', 'note "Hello, World!"';

```

A shortcut for calling `.run` (takes same arguments) and returning
just the `stderr` key. Will `fail` with the entire `Hash` returned
from `.run` if the program errors out.

## `.list`

```
say $glot.list<content>[0..3];

say $glot.list: :3page, :50per-page, :mine;

```

Fetches a list of metadata for snippets. Takes optional
named arguments:

* `page` positive integer starting at and defaulting to 1. Specifies the page to display
* `per-page` positive integer stating the maximum number of items to return per
  page. Defaults to `100`. Maximum value is `100`.
* `mine` boolean specifying whether public or your own snippets should be
  listed. Defaults to `False`. Requires `key` argument to `.new` to be provided
  if set to `True`.

Returns a `Hash` in the following format:

```
    {
        first   => 1,
        last    => 20,
        next    => 5,
        prev    => 3,
        content => [
            {
                created    => "2016-04-09T17:52:19Z",
                files_hash => "2afa1f37cc0bc7d033e4b3a049659792f5caac6d",
                id         => "edltstt3n0",
                language   => "cpp",
                modified   => "2016-04-09T17:52:19Z",
                owner      => "anonymous",
                public     => Bool::True,
                title      => "Untitled",
                url        => "https://snippets.glot.io/snippets/edltstt3n0",
            },
            ...
        ]
    }

```

The `first`, `last`, `next`, `prev` keys indicate the corresponding page number.
All 4 will NOT be present at all times. The `content` key is a list of hashes,
each representing metadata for a snipet.

Attempting to fetch a page that doesn't exist will `fail` with an HTTP 404
error.

## `.create`

```
    say $glot.create: 'perl6', 'say "Hello, World!"';

    say $glot.create: 'perl6', [
            'main.p6' => 'use lib "."; use Foo; say "Hello, World!"',
            'Foo.pm6' => 'unit module Foo;',
        ], 'Module import example',
        :mine;

```

Creates a new snippet.
Takes: a valid language (see `.languages` method), either a `Str` of code
or an array of `filename => code` pairs, and an optional title of the snippet
as positional arguments. An optional `Bool` `mine` named argument, which
defaults to `False` can be set to `True` to specify your snippet should not
be public. API Key (see `.key` in `.new`) must be specified for this option
to succeed.

Returns a hash with metadata for the newly created snippet:

```
    {
      created    => "2016-04-10T17:42:20Z".Str,
      files      => [
        {
          content => "say \"Hello, World!\"".Str,
          name    => "main".Str,
        },
      ],
      files_hash => "6ed47f09569b36dc8d83b6af82026e5f86e3967e".Str,
      id         => "edmx7tewwu".Str,
      language   => "perl6".Str,
      modified   => "2016-04-10T17:42:20Z".Str,
      owner      => "c490baa3-1ecb-42f5-8742-216abbb97f8d".Str,
      public     => Bool::False.Bool,
      title      => "Untitled".Str,
      url        => "https://snippets.glot.io/snippets/edmx7tewwu".Str,
    }

```

## `.get`

```
    say $glot.get: 'edmxttmtd5';

```

Fetches a snippet. Takes one mandatory argument: the ID of the snippet
to fetch. Returns a hash with the snippet details:

```
    {
      created    => "2016-04-10T18:04:30Z".Str,
      files      => [
        {
          content => "use lib \".\"; use Foo; say \"Hello, World!\"".Str,
          name    => "main.raku".Str,
        },
        {
          content => "unit module Foo;".Str,
          name    => "Foo.rakumod".Str,
        },
      ],
      files_hash => "8042cf6813f1772e63c8afd0a556004ad9591ce2".Str,
      id         => "edmxttmtd5".Str,
      language   => "raku".Str,
      modified   => "2016-04-10T18:04:30Z".Str,
      owner      => "c490baa3-1ecb-42f5-8742-216abbb97f8d".Str,
      public     => Bool::True.Bool,
      title      => "Module import example".Str,
      url        => "https://snippets.glot.io/snippets/edmxttmtd5".Str,
    }

```

## `.update`

```
    say $glot.update: 'snippet-id', 'perl6', 'say "Hello, World!"';

    # Or
    say $glot.update: 'snippet-id', 'perl6', [
            'main.p6' => 'use lib "."; use Foo; say "Hello, World!"',
            'Foo.pm6' => 'unit module Foo;',
        ], 'Module import example';

    # Or
    my $snippet = $glot.get: 'edmxttmtd5';
    $snippet<title> = 'New title';
    $glot.update: $snippet;

```

Updates an existing snippet. Requires the use of API key (see `.key` in
constructor). As positional arguments, takes snippet ID to update,
the language of the snippet, snippet code, and snippet title.
The title is optional and will be set to `Untitled` by default.
Snippet code can be provided as a single string of code or as an array
of `Pair`s, where the key is the filename and the value is the code
for the file.

In addition, `.update` can also take a `Hash`. This form is useful
when you already have a snippet `Hash` from `.create` or `.get`
methods and simply wish to modify it. The required keys in the
hash are `id`, `title`, `language`, and `files`, where the
first three are strings and `files` is an array of Hashes, with
each hash having keys `name` and `content` representing the
filename of a file and its code.

Returns a `Hash` with the updated snippet data:

```
    {
        created    => "2016-04-10T18:04:30Z".Str,
        files      => [
          {
            content => "use lib \".\"; use Foo; say \"Hello, World!\"".Str,
            name    => "main.p6".Str,
          },
          {
            content => "unit module Foo;".Str,
            name    => "Foo.pm6".Str,
          },
        ],
        files_hash => "8042cf6813f1772e63c8afd0a556004ad9591ce2".Str,
        id         => "edmxttmtd5".Str,
        language   => "perl6".Str,
        modified   => "2016-04-13T00:05:02Z".Str,
        owner      => "c490baa3-1ecb-42f5-8742-216abbb97f8d".Str,
        public     => Bool::False.Bool,
        title      => "New title".Str,
        url        => "https://snippets.glot.io/snippets/edmxttmtd5".Str,
    }

```

## `.delete`

```
    $glot.delete: 'snippet-id';

```

Deletes a snippet. Requires the use of API key (see `.key` in
constructor). Takes one positional argument: the ID of the
snippet to delete. On success, returns `True`. Attempting
to delete a non-existant snippet will `fail` with an
HTTP 404 error.

---

# REPOSITORY

Fork this module on GitHub:
<https://github.com/raku-community-modules/GlotIO>

# BUGS

To report bugs or request features, please use
<https://github.com/raku-community-modules/GlotIO/issues>

# AUTHOR

Zoffix Znet (<http://zoffix.com/>)

# LICENSE

You can use and distribute this module under the terms of the
The Artistic License 2.0. See the `LICENSE` file included in this
distribution for complete details.


## dist_github-khalidelboray-Text-Slugify.md
[![Build Status](https://travis-ci.org/khalidelboray/raku-text-slugify.svg?branch=master)](https://travis-ci.org/khalidelboray/raku-text-slugify)

# NAME

`Text::Slugify` - create a URL slug from text.

# SYNOPSIS

```
    use Text::Slugify;

    my $txt;

    $txt = "This is a test ---";
    slugify $txt;
    #=> «this-is-a-test»

    $txt = 'C\'est déjà l\'été.';
    slugify $txt;
    #= «c-est-deja-l-ete»

    $txt = 'jaja---lol-méméméoo--a';
    slugify $txt, :max-length(9);
    #=> «jaja-lol»

```

For more examples, have a look at the test file (`t/basic.t6`).

# DESCRIPTION

`Text::Slugify` is a module to slugify text. It takes a piece of text, removes punctuation, spaces and other unwanted characters to produce a string suitable for use in a URL.

# INSTALLATION

## Using zef:

```
zef update && zef install Text::Slugify

```

## From source:

```
git clone https://github.com/khalidelboray/raku-text-slugify.git
cd raku-text-slugify && zef install .

```

# SUBROUTINES

The module exports the following subroutines:

#### `slugify`

```
    sub slugify(
        Str:D $text is copy,            # Text to be slugified.
        Int:D :$max-length = 0,         # Output string length.
        :$separator = "-",              # Separator between words.
        :$regex-pattern = Nil,          # Regex pattern for allowed characters in output text.
        :@stopwords = [],               # Words to be discounted from output text.
        :@replacements = [],            # List of replacement rule pairs e.g. ['|'=>'or', '%'=>'percent']
        Bool:D :$entities = True,
        Bool:D :$decimal = True,
        Bool:D :$hexadecimal = True,
        Bool:D :$word-boundary = False,
        Bool:D :$lowercase = True,      # Set case sensitivity by setting it to False.
        Bool:D :$save-order = False,    # If True and max-length > 0 return whole words in the initial order.
    )

```

#### `smart-truncate`

```
    sub smart-truncate(
        Str:D $string is rw,             # String to be modified.
        Int:D :$max-length = 0,          # Output string length.
        Bool:D :$word-boundary = False,
        Str:D :$separator = " ",         # Separator between words.
        Bool:D :$save-order = False,     # Output text's word order same as input.
    )

```

**NOTE**: To import the subroutine `smart-truncate` or `strip` alongside `slugify` into your code, use `use Text::Slugify :ALL`.

# CREDIT-REFERENCE

This module is mostly based on [Python Slugify](https://github.com/un33k/python-slugify).

This is my fork of <https://gitlab.com/uzluisf/raku-text-slugify>


## dist_zef-andinus-taurus.md
```
                       ━━━━━━━━━━━━━━━━━━━━━━━━━
                                 TAURUS
                        Taurus parses Call logs

                                Andinus
                       ━━━━━━━━━━━━━━━━━━━━━━━━━

Table of Contents
─────────────────

Demo
Installation
Documentation
News

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 Website
 Source
 GitHub (mirror)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Demo
════

  This was recorded with `asciinema'.

  [https://asciinema.org/a/431154.png]

  ⁃ Taurus v0.1.1:
  ⁃ alt-link (download):

[https://asciinema.org/a/431154.png]

Installation
════════════

  Taurus is released to `fez', you can get it from there or install it
  from source. In any case, `zef' is required to install the
  distribution.

  You can run Taurus without `zef'. Just run `raku -Ilib bin/taurus'
  from within the source directory.

Release
───────

  1. Run `zef install taurus'.

  Taurus should be installed, try running `taurus --version' to confirm.

From Source
───────────

  You can either download the release archive generated by cgit/GitHub
  or clone the project if you have `git' installed.

Without `git'
╌╌╌╌╌╌╌╌╌╌╌╌╌

  1. Download the release:
     •
     •
  2. Extract the file.
  3. Run `zef install .' in source directory.

With `git'
╌╌╌╌╌╌╌╌╌╌

  All commits will be signed by my [PGP Key].

  ┌────
  │ # Clone the project.
  │ git clone https://git.tilde.institute/andinus/taurus
  │ cd taurus
  │
  │ # Install taurus.
  │ zef install .
  └────

[PGP Key]

Documentation
═════════════

  Taurus parses Call logs exported by [OpenContacts]. Get the
  application from F-Droid and export the call logs by selecting /More/,
  then /Export call log/ from the three dot menu on top right.

[OpenContacts]

Implementation
──────────────

  It parses the exported log file line by line, stores them & presents
  an interface.

Options
───────

log
╌╌╌

  Exported log file.

digits
╌╌╌╌╌╌

  Number of significant digits in phone numbers. Default is set to 10.
  If the number of digits is less than significant digits then the
  number is discarded, if it's more then the initial extra digits are
  discarded (Country Code, etc.).

News
════

v0.1.1 - 2021-08-19
───────────────────

  ⁃ Better format for timestamps.
  ⁃ Add Yearly Records.
  ⁃ Add Monthly Records.

v0.1.0 - 2021-08-15
───────────────────

  Initial Implementation.

  ⁃ Present overall stats.
  ⁃ Displays contact specific stats.
    ⁃ Outgoing
    ⁃ Incoming
    ⁃ Total Call Time
    ⁃ Declined
    ⁃ They Declined
    ⁃ Missed Calls

```


## dist_zef-lizmat-InterceptAllMethods.md
[![Actions Status](https://github.com/lizmat/InterceptAllMethods/actions/workflows/linux.yml/badge.svg)](https://github.com/lizmat/InterceptAllMethods/actions) [![Actions Status](https://github.com/lizmat/InterceptAllMethods/actions/workflows/macos.yml/badge.svg)](https://github.com/lizmat/InterceptAllMethods/actions) [![Actions Status](https://github.com/lizmat/InterceptAllMethods/actions/workflows/windows.yml/badge.svg)](https://github.com/lizmat/InterceptAllMethods/actions)

# NAME

InterceptAllMethods - export ClassHOW to intercept all method calls

# SYNOPSIS

```
use InterceptAllMethods;

class FooBar {
    method ^find_method(Mu $obj, Str $name) {
        return -> | { say "calling $name" }
    }
}

```

# DESCRIPTION

Change the ClassHOW of the compilation unit so that you can create a class that has a `^find_method` that will be called for **any** method call to that class. This method should then return a `Callable` that will called as if it were the method.

This allows one to implement one's own caching methods, or not have any caching method at all.

# AUTHOR

Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)

Source can be located at: <https://github.com/lizmat/InterceptAllMethods> . Comments and Pull Requests are welcome.

If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!

# COPYRIGHT AND LICENSE

Copyright 2018, 2021, 2023, 2025 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## find-method.md
find\_method

Combined from primary sources listed below.

# [In role Metamodel::MROBasedMethodDispatch](#___top "go to top of document")[§](#(role_Metamodel::MROBasedMethodDispatch)_method_find_method "direct link")

See primary documentation
[in context](/type/Metamodel/MROBasedMethodDispatch#method_find_method)
for **method find method**.

```raku
method find_method($obj, $name, :$no_fallback, *%adverbs)
```

Given a method name, it returns the method object of that name which is closest in the method resolution order (MRO). If no method can be found, it returns a VM-specific sentinel value (typically a low-level NULL value) that can be tested for with a test for [definedness](/routine/defined):

```raku
for <uppercase  uc> {
    Str.^find_method: $^meth andthen .("foo").say
        orelse "method `$meth` not found".say
}
# OUTPUT:
# method `uppercase` not found
# FOO

```

If `:no_fallback` is supplied, fallback methods are not considered.

# [In Metamodel::DefiniteHOW](#___top "go to top of document")[§](#(Metamodel::DefiniteHOW)_method_find_method "direct link")

See primary documentation
[in context](/type/Metamodel/DefiniteHOW#method_find_method)
for **method find method**.

```raku
method find_method($definite_type, $name)
```

Looks up a method on the base type of a definite type.


## control.md
role X::Control

Role for control exceptions

```raku
role X::Control is Exception { }
```

This role turns an exception into a [control exception](/language/exceptions#Control_exceptions), such as [`CX::Next`](/type/CX/Next) or [`CX::Take`](/type/CX/Take). It has got no code other than the definition.

Since Rakudo 2019.03, `throw`ing an object that mixes in this role `X::Control` can raise a control exception which is caught by the [CONTROL phaser](/language/phasers#CONTROL) instead of [CATCH](/language/phasers#CATCH). This allows to define custom control exceptions.

For example, the custom `CX::Vaya` control exception we define below:

```raku
class CX::Vaya does X::Control {
    has $.message
}

sub ea {
    CONTROL {
        default {
            say "Controlled { .^name }: { .message }"
        }
    }
    CX::Vaya.new( message => "I messed up!" ).throw;

}
ea;
# OUTPUT: «Controlled CX::Vaya: I messed up!␤»

```


## dist_cpan-FRITH-Math-Libgsl-Complex.md
[![Build Status](https://travis-ci.org/frithnanth/raku-Math-Libgsl-Complex.svg?branch=master)](https://travis-ci.org/frithnanth/raku-Math-Libgsl-Complex)

# NAME

Math::Libgsl::Raw::Complex - An interface to libgsl, the Gnu Scientific Library - complex numbers.

# SYNOPSIS

```
use Math::Libgsl::Raw::Complex :ALL;

```

# DESCRIPTION

Math::Libgsl::Raw::Complex provides an interface to libgsl's implementation of complex numbers.

This package provides the low-level interface to the C library (Raw).

Math::Libgsl::Complex will not be implemented, because Raku's Complex datatype works just fine. Its Raw counterpart, Math::Libgsl::Raw::Complex, is present because it's needed by other modules that rely on the GSL implementation of complex numbers.

# C Library Documentation

For more details on libgsl see <https://www.gnu.org/software/gsl/>. The excellent C Library manual is available here <https://www.gnu.org/software/gsl/doc/html/index.html>, or here <https://www.gnu.org/software/gsl/doc/latex/gsl-ref.pdf> in PDF format.

# Prerequisites

This module requires the libgsl library to be installed. Please follow the instructions below based on your platform:

## Debian Linux

```
sudo apt install libgsl23 libgsl-dev libgslcblas0

```

That command will install libgslcblas0 as well, since it's used by the GSL.

## Ubuntu 18.04

libgsl23 and libgslcblas0 have a missing symbol on Ubuntu 18.04. I solved the issue installing the Debian Buster version of those three libraries:

* <http://http.us.debian.org/debian/pool/main/g/gsl/libgslcblas0_2.5+dfsg-6_amd64.deb>
* <http://http.us.debian.org/debian/pool/main/g/gsl/libgsl23_2.5+dfsg-6_amd64.deb>
* <http://http.us.debian.org/debian/pool/main/g/gsl/libgsl-dev_2.5+dfsg-6_amd64.deb>

# Installation

To install it using zef (a module management tool):

```
$ zef install Math::Libgsl::Complex

```

# AUTHOR

Fernando Santagata [nando.santagata@gmail.com](mailto:nando.santagata@gmail.com)

# COPYRIGHT AND LICENSE

Copyright 2020 Fernando Santagata

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-JJMERELO-Pod-Load_1.md
[![Build Status](https://travis-ci.com/JJ/p6-pod-load.svg?branch=master)](https://travis-ci.com/JJ/p6-pod-load) [![Build status](https://ci.appveyor.com/api/projects/status/lq9rqjq6hljdfqw4?svg=true)](https://ci.appveyor.com/project/JJ/p6-pod-load)

# NAME

Pod::Load - Loads and compiles the Pod documentation of an external file

# SYNOPSIS

```
use Pod::Load;

# Read a file handle.
my $pod = load("file-with.pod6".IO);
say $pod.raku; # Process it as a Pod

# Or use simply the file name
my @pod = load("file-with.pod6");
say .raku for @pod;

# Or a string
@pod = load("=begin pod\nThis could be a comment with C<code>\n=end pod");

# Or ditch the scaffolding and use the string directly:
@pod = load-pod("This could be a comment with C<code>");

```

# DESCRIPTION

Pod::Load is a module with a simple task: obtain the documentation of an external file in a standard, straighworward way. Its mechanism is inspired by [`Pod::To::BigPage`](https://github.com/perl6/perl6-pod-to-bigpage), from where the code to use the cache is taken from.

### multi sub load

```
multi sub load(
    Str $string
) returns Mu

```

Loads a string, returns a Pod.

### multi sub load

```
multi sub load(
    Str $file where { ... }
) returns Mu

```

If it's an actual filename, loads a file and returns the pod

### multi sub load

```
multi sub load(
    IO::Path $io
) returns Mu

```

Loads a IO::Path, returns a Pod.

## INSTALL

Do the usual:

```
zef install .

```

to install this if you've made any modification.

# INSTRUCTIONS

This is mainly a reminder to myself, although it can help you if you create a distribution just like this one.

Write:

```
export VERSION=0.x.x

```

And

```
make dist

```

To create a tar file ready for CPAN.

# AUTHOR

JJ Merelo [jjmerelo@gmail.com](mailto:jjmerelo@gmail.com)

# COPYRIGHT AND LICENSE

Copyright 2018, 2019, 2020 JJ Merelo

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-lizmat-Unicode.md
[![Actions Status](https://github.com/lizmat/Unicode/actions/workflows/test.yml/badge.svg)](https://github.com/lizmat/Unicode/actions)

# NAME

Unicode - provide information about Unicode versions

# SYNOPSIS

```
use Unicode;

```

# DESCRIPTION

The `Unicode` class provided information about the (current) Unicode version supported.

It was introduced in Rakudo release 2023.02. It is provided here to allow the functionality to be used with older versions of Rakudo.

If Rakudo already supplies a `Unicode` class, then loading this module will effectively be a no-op.

# AUTHOR

Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)

Source can be located at: <https://github.com/lizmat/Unicode> . Comments and Pull Requests are welcome.

If you like this module, or what I’m doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!

# COPYRIGHT AND LICENSE

Copyright 2023 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-jjatria-Timer-Stopwatch.md
## NAME

Timer::Stopwatch - Schedule and reset repeated time measurements

## SYNOPSIS

```
use Timer::Stopwatch;

my $irregular-supply = Supply.interval(1).grep: { Bool.pick }

my $timer = Timer::Stopwatch.new;
react {
    whenever $irregular-supply {
        note "{ now.DateTime.hh-mm-ss }: Received an irregular event";

        # Wait up to 2 seconds for the next event
        $timer.reset: 2;
    }
    whenever $timer {
        note "It's been { .round } seconds since the last event";
        $timer.stop;
    }
    whenever Promise.in: 20 {
        note 'Stopping after 20 seconds';
        $timer.stop;
    }
    whenever $timer.Promise {
        note "Timer was stopped. We're done";
        done;
    }
}

# OUTPUT:
# 20:33:39: Received an irregular event
# 20:33:40: Received an irregular event
# 20:33:42: Received an irregular event
# It's been 2 seconds since the last event
# Timer was stopped. We're done

```

## DESCRIPTION

Timer::Stopwatch is a resettable, stoppable wrapper around a Supply that can be used to mark multiple moments in time.

## METHODS

### in

```
method in(
    Numeric $in
) returns Timer::Stopwatch

```

Creates a new Stopwatch with a timer that will trigger in the given amount of seconds, unless it is reset or stopped before that.

### tick

```
method tick() returns Duration

```

Emits the duration since creation time (or the last `reset`) to the Supply. Returns the emitted Duration.

### reset

```
method reset(
    Numeric $in?
) returns Bool

```

Reset sets the start time for the stopwatch to the current time. If called with a numeric argument, it also sets a timer to expire after the given duration. It returns True if the call interrupted a pending timer, and False if no timer had been set, or if it had already expired, or if the stopwatch had already been stopped.

### stop

```
method stop() returns Bool

```

Stop marks this stopwatch as done. Once a stopwatch has been stopped, most of its actions are finished, and new stopwatch should be created. Internally, it stops any pending timers and closes the supply. It returns True if the call interrupted a pending timer, and False if no timer had been set, or if it had already expired, or if the stopwatch had already been stopped.

### Duration

```
method Duration() returns Duration

```

Returns the amount of time elapsed since the start (or the last reset) as a Duration.

### Promise

```
method Promise() returns Promise

```

Returns a Promise that will be kept when the Stopwatch is stopped. When kept, it will hold the Duration elapsed since the time the Stopwatch was created, or since the last call to `reset`.

### Supply

```
method Supply() returns Supply

```

Returns a live Supply that will receive timer events

## AUTHOR

José Joaquín Atria [jjatria@cpan.org](mailto:jjatria@cpan.org)

## COPYRIGHT AND LICENSE

Copyright 2021 José Joaquín Atria

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-andinus-fornax.md
```
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                 FORNAX
             Collection of tools to visualize Path Finding
                               Algorithms

                                Andinus
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Table of Contents
─────────────────

1. Demo
2. Usage
3. Installation
.. 1. Release
.. 2. From Source
4. Documentation
.. 1. Options
.. 2. Fornax Format
.. 3. Project Structure
5. Bugs
6. News
.. 1. v0.2.0 - 2021-11-25
.. 2. v0.1.1 - 2021-11-16
.. 3. v0.1.0 - 2021-11-03

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 Website
 Source
 GitHub (mirror)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

This collection includes:
• `fornax': Program that parses /Fornax Format/ and outputs video
  solution.
• Algorithms: Various algorithms solved in several programming
  languages.

Writings:
• Fornax: Generating 4.8 million frames:

1 Demo
══════

  Solution for DFS-60, generated on 2021-11-16 (click to play):

  [https://andinus.unfla.me/resources/projects/fornax/2021-11-16-DFS-60-00000436.png]
  • Mirror:

  • Solution for /DFS-71/, generated on /2021-11-18/:

  Fornax v0.1.0:
  • Solution for /DFS-33/, generated on /2021-11-03/:

  • DFS-51-incomplete (upto 187,628 frames; 120 fps):

  • DFS-51-incomplete (upto 4,000 frames; 120 fps):

[https://andinus.unfla.me/resources/projects/fornax/2021-11-16-DFS-60-00000436.png]

2 Usage
═══════

  ┌────
  │ # Solve the maze.
  │ raku algorithms/raku/DFS.raku resources/input/06 > /tmp/solution.fornax
  │
  │ # Visualize the solution.
  │ raku -Ilib bin/fornax /tmp/solution.fornax
  └────

3 Installation
══════════════

  `fornax' is written in Raku, it can be installed with `zef'. You can
  also run it without `zef', just run `raku -Ilib bin/fornax' from
  within the source directory.

  • *Note*: `Cairo' module & `ffmpeg' program is required.

3.1 Release
───────────

  1. Run `zef install 'fornax:auth''

  Fornax should be installed, try running `fornax --version' to confirm.

  • Solving programs / solutions are not included in the distribution,
    get them from this repository.

3.2 From Source
───────────────

  You can either download the release archive generated by cgit/GitHub
  or clone the project if you have `git' installed.

3.2.1 Without `git'
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  1. Download the release:
     •
     •
  2. Extract the file.
  3. Run `zef install .' in source directory.

3.2.2 With `git'
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  All commits by /Andinus/ will be signed by this [PGP Key].

  ┌────
  │ # Clone the project.
  │ git clone https://git.tilde.institute/andinus/fornax
  │ cd fornax
  │
  │ # Install fornax.
  │ zef install .
  └────

[PGP Key]

4 Documentation
═══════════════

  Fornax parses /Fornax format/, generates a `PNG' for each iteration
  which is later converted to a slideshow with `ffmpeg'.

  • Solved paths are highlighted if the iteration is preceded by `|'.
  • Illegal paths are highlighted if the iteration is preceded by `!'.

4.1 Options
───────────

  • `input': This takes solved input file in the /Fornax/ format.
  • `fps': Frame rate for the video solution.
  • `skip-video': Skip generating the video solution.
  • `batch': Number of iterations to process at once.

4.2 Fornax Format
─────────────────

  Fornax format defines 2 formats:
  • Maze (input)
  • Solution (output)

4.2.1 Grids
╌╌╌╌╌╌╌╌╌╌╌

  A grid is printed for every iteration. Grids are composed of cells.

  ━━━━━━━━━━━━━━━━━━━━━━━━━━
   Cell              Symbol
  ──────────────────────────
   Path              `.'
   Blocked           `#'
   Start             `^'
   Destination       `$'
  ──────────────────────────
   Visited           `-'
   Current Path      `~'
   Current Position  `@'
  ━━━━━━━━━━━━━━━━━━━━━━━━━━

4.2.2 Maze (input)
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Maze input must be in this format:
  ┌────
  │ ...rows
  └────

  It is upto the program to infer the number of rows & columns from the
  input file or it ask the user.

4.2.3 Solution (output)
╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌

  Fornax solution format is an intermediate output file generated after
  solving the maze. Algorithms must output the solution in this format:
  ┌────
  │ rows: cols:
  │
  │ ...iterations
  └────

  `...iterations' is to be replaced by the resulting grid in each
  iteration that is to be included in the final video. Since the number
  of rows and columns is known, the whole grid should be printed in a
  single line.

  • Every iteration should be separated by a newline.

  • If the iteration cells is not equal to `rows * columns' or `(rows *
      columns) + 1' then it may be ignored by the program that parses
      the file.

  • Solved iteration can be preceded by `|' character.

  • Iteration that tries to walk on a blocked path can be preceded by
    `!' character.

  • First iteration is assumed to be the maze.

4.3 Project Structure
─────────────────────

  • Algorithms are located in `algorithms/' directory, sub-directory
    needs to be created for programming languages which will hold the
    actual source.

  • Sample solutions can be found in `resources/solutions/' directory.

    • *Note*: Some solutions might output illegal moves (like walking
      over blocked path), this error is only in visualization, the
      solution is correct.

      This has been fixed in commit
      `8cef86f0eb8b46b0ed2d7c37fa216890300249f6'.

5 Bugs
══════

  • If the number of iterations are greater than an 8 digit number then
    the slideshow might be incorrect.

  • `/tmp' is assumed to exist.

  • Might panic with: `MoarVM oops: MVM_str_hash_entry_size called with
      a stale hashtable pointer'. This has been fixed:
      .

6 News
══════

6.1 v0.2.0 - 2021-11-25
───────────────────────

  ⁃ Add demo videos.
  ⁃ Add more solutions.
  ⁃ Implement BFS in Java.
  ⁃ Implement DFS in Raku.
  ⁃ Add basic tests.

6.2 v0.1.1 - 2021-11-16
───────────────────────

  ⁃ Add option to skip generating slideshow.
  ⁃ Use random directory to store solutions.
  ⁃ Process iterations in parallel.
  ⁃ Wait 4s on solution frame.
  ⁃ Add incomplete BFS program.
  ⁃ Add demo videos.
  ⁃ Upgrade to latest Fornax Format.
  ⁃ Add more solutions.

6.3 v0.1.0 - 2021-11-03
───────────────────────

  ⁃ Initial implementation:

    • Includes DFS solver in Java and a tool to visualize the solution.

```


## dist_zef-tony-o-HTML-Parser-XML.md
# Perl 6: HTML::Parser::XML;

This module will read HTML and attempt to build an XML::Document (<https://github.com/supernovus/exemel/#xmldocument-xmlnode>)

## Features:

* Automatically closes certain tags if certain other tags are encountered
* Parses dirty HTML fairly well (AFAIK), submit a bug if it doesn't
* Perl6 Magicness

## Status:

Bugs/feature requests
Maintenance mode

### Usage:

```
my $html   = LWP::Simple.get('http://some-non-https-site.com/');
my $parser = HTML::Parser::XML.new;
$parser.parse($html);
$parser.xmldoc; # XML::Document

```

> or

```
my $html   = LWP::Simple.get('http://some-non-https-site.com/');
my $parser = HTML::Parser::XML.new;
my $xmldoc = $parser.parse($html);

```

Contact me, tony-o on irc.freenode #perl6 (tony-o)

License: Artistic 2.0


## dist_zef-tbrowder-Timezones-US.md
[![Actions Status](https://github.com/tbrowder/Timezones-US/actions/workflows/linux.yml/badge.svg)](https://github.com/tbrowder/Timezones-US/actions) [![Actions Status](https://github.com/tbrowder/Timezones-US/actions/workflows/macos.yml/badge.svg)](https://github.com/tbrowder/Timezones-US/actions) [![Actions Status](https://github.com/tbrowder/Timezones-US/actions/workflows/windows.yml/badge.svg)](https://github.com/tbrowder/Timezones-US/actions)

# NAME

**Timezones::US** - Provides US time zone data and subroutines for use with modules 'DateTime::US' and 'LocalTime'

# SYNOPSIS

```
use Timezones::US;

```

# DESCRIPTION

Raku module **Timezones::US** provides constant US time zone data (currently valid through the year 2030) to be used by related date and time dynamic modules.

The following table shows the time zones included:

US Time Zones

| Name | Symbol | UTC offset (hrs) |
| --- | --- | --- |
| Atlantic | AST | -4, |
| Eastern | EST | -5 |
| Central | CST | -6 |
| Mountain | MST | -7 |
| Pacific | PST | -8 |
| Alaska | AKST | -9 |
| Hawaii-Aleutian | HAST | -10 |
| Samoa | WST | -11 |
| Chamorro | CHST | +10 |

### Exported constants

The following constants are automatically exported into the using environment:

* `SEC-PER-HOUR`

  Seconds per hour: 3600
* `@tz`

  A list of time zones (lower-case symbols)
* `%tzones`

  A hash of all US time zone abbreviations keyed by their symbols (lower-case) with values of names and UTC offsets
* `%dst-exceptions`

  A hash of US time zone abbreviations keyed by their symbols (lower-case) with values of states or regions and details of Daylight Saving exceptions (**CAUTION**: this an incomplete list at the moment)
* `%utc-offsets`

  A hash of US time zone abbreviations keyed by their symbols (lower-case) with value of their UTC offset in hours
* `%offsets-utc`

  A hash of US time zone offsets keyed by their hours with value of their symbols (lower-case)

### Exported subroutines

The following subroutines are automatically exported into the using environment:

* **begin-dst**($year --> DateTime) {...}

  Return the time when DST (Daylight Saving Time) begins.
* **end-dst**($year --> DateTime) {...}

  Return the time when DST ends.
* **is-dst**(DateTime :$localtime! --> Bool) {...}

  Return True if the local time is DST, otherwise return False.
* **is-dst**(:$year!, :$month, :$day, :$hour, :$minute, :$second --> Bool) {...}

  Return True if the local time is DST, otherwise return False.
* **show-us-data**(--> Str) {...}

  List the time zone and DST data being used.

Note some of these routines are now duplicated in module `DateTime::US`, but those are (1) perpetual and (2) return `Date` objects instead of `DateTime` objects which are preferred for use by the author's module `Calendar`. As well, this module was designed to be completely standalone.

If the user requires "perpetual" DST dates for all all years affected under current US federal law, please use the routines in `DateTime::US`.

# AUTHOR

Tom Browder [tbrowder@acm.org](mailto:tbrowder@acm.org)

# COPYRIGHT AND LICENSE

© 2022-2024 Tom Browder

This library is free software; you may redistribute it or modify it under the Artistic License 2.0.


## range.md
class Range

Interval of ordered values

```raku
class Range is Cool does Iterable does Positional {}
```

Ranges serve two main purposes: to generate lists of consecutive numbers or strings, and to act as a matcher to check if a number or string is within a certain range.

Ranges are constructed using one of the four possible range operators, which consist of two dots, and optionally a caret which indicates that the endpoint marked with it is excluded from the range.

```raku
1 .. 5;  # 1 <= $x <= 5
1^.. 5;  # 1 <  $x <= 5
1 ..^5;  # 1 <= $x <  5
1^..^5;  # 1 <  $x <  5
```

The caret is also a prefix operator for constructing numeric ranges starting from zero:

```raku
my $x = 10;
say ^$x;     # same as 0 ..^ $x.Numeric
```

Iterating a range (or calling the `list` method) uses the same semantics as the `++` prefix and postfix operators, i.e., it calls the `succ` method on the start point, and then the generated elements.

Ranges always go from small to larger elements; if the start point is bigger than the end point, the range is considered empty.

```raku
for 1..5 { .say };           # OUTPUT: «1␤2␤3␤4␤5␤»
say ('a' ^..^ 'f').list;     # OUTPUT: «(b c d e)␤»
say 5 ~~ ^5;                 # OUTPUT: «False␤»
say 4.5 ~~ 0..^5;            # OUTPUT: «True␤»
say (1.1..5).list;           # OUTPUT: «(1.1 2.1 3.1 4.1)␤»
```

Use the [`...`](/language/operators#infix_...) sequence operator to produce lists of elements that go from larger to smaller values, or to use offsets other than increment-by-1 and other complex cases.

Use `∞` or `*` (Whatever) to indicate an end point to be open-ended.

```raku
for 1..* { .say };       # start from 1, continue until stopped
for 1..∞ { .say };       # the same

```

Beware that a [`WhateverCode`](/type/WhateverCode) end point, instead of a plain Whatever, will go through the range operator and create another WhateverCode which returns a Range:

```raku
# A Whatever produces the 1..Inf range
say (1..*).^name;        # OUTPUT: «Range␤»
say (1..*);              # OUTPUT: «1..Inf␤»
# Upper end point is now a WhateverCode
say (1..*+20).^name;     # OUTPUT: «{ ... }␤»
say (1..*+20).WHAT;      # OUTPUT: «(WhateverCode)␤»
say (1..*+20).(22);      # OUTPUT: «1..42␤»

```

Ranges implement [`Positional`](/type/Positional) interface, so its elements can be accessed using an index. In a case when the index given is bigger than the Range object's size, [`Nil`](/type/Nil) object will be returned. The access works for lazy Range objects as well.

```raku
say (1..5)[1];  # OUTPUT: «2␤»
say (1..5)[10]; # OUTPUT: «Nil␤»
say (1..*)[10]; # OUTPUT: «11␤»

```

## [Ranges in subscripts](#class_Range "go to top of document")[§](#Ranges_in_subscripts "direct link")

A Range can be used in a subscript to get a range of values. Please note that assigning a Range to a scalar container turns the Range into an item. Use binding, @-sigiled containers or a slip to get what you mean.

```raku
my @numbers =  <4 8 15 16 23 42>;
my $range := 0..2;
.say for @numbers[$range]; # OUTPUT: «4␤8␤15␤»
my @range = 0..2;
.say for @numbers[@range]; # OUTPUT: «4␤8␤15␤»
```

## [Shifting and scaling intervals](#class_Range "go to top of document")[§](#Shifting_and_scaling_intervals "direct link")

It is possible to shift or scale the interval of a range:

```raku
say (1..10) + 1;       # OUTPUT: «2..11␤»
say (1..10) - 1;       # OUTPUT: «0..9␤»
say (1..10) * 2;       # OUTPUT: «2..20␤»
say (1..10) / 2;       # OUTPUT: «0.5..5.0␤»
```

## [Matching against Ranges](#class_Range "go to top of document")[§](#Matching_against_Ranges "direct link")

You can use [smartmatch](/routine/~~) to match against Ranges.

```raku
say 3 ~~ 1..12;          # OUTPUT: «True␤»
say 2..3 ~~ 1..12;       # OUTPUT: «True␤»
```

*In Rakudo only*, you can use the `in-range` method for matching against a range, which in fact is equivalent to smartmatch except it will throw an exception when out of range, instead of returning `False`:

```raku
say ('א'..'ת').in-range('ע');  # OUTPUT: «True␤»
```

However, if it is not included in the range:

```raku
say ('א'..'ת').in-range('p', "Letter 'p'");
# OUTPUT: «(exit code 1) Letter 'p' out of range. Is: "p", should be in "א".."ת"␤

```

The second parameter to `in-range` is the optional message that will be printed with the exception. It will print `Value` by default.

# [Methods](#class_Range "go to top of document")[§](#Methods "direct link")

## [method ACCEPTS](#class_Range "go to top of document")[§](#method_ACCEPTS "direct link")

```raku
multi method ACCEPTS(Range:D: Mu \topic)
multi method ACCEPTS(Range:D: Range \topic)
multi method ACCEPTS(Range:D: Cool:D \got)
multi method ACCEPTS(Range:D: Complex:D \got)
```

Indicates if the `Range` contains (overlaps with) another `Range`. As an example:

```raku
my $p = Range.new( 3, 5  );
my $r = Range.new( 1, 10 );

say $p.ACCEPTS( $r );    # OUTPUT: «False␤»
say $r.ACCEPTS( $p );    # OUTPUT: «True␤»
say $r ~~ $p;            # OUTPUT: «False␤»  (same as $p.ACCEPTS( $r )
say $p ~~ $r;            # OUTPUT: «True␤»   (same as $r.ACCEPTS( $p )
```

An infinite `Range` always contains any other `Range`, therefore:

```raku
say 1..10 ~~ -∞..∞;    # OUTPUT: «True␤»
say 1..10 ~~ -∞^..^∞;  # OUTPUT: «True␤»
```

Similarly, a `Range` with open boundaries often includes other ranges:

```raku
say 1..2 ~~ *..10;  # OUTPUT: «True␤»
say 2..5 ~~ 1..*;   # OUTPUT: «True␤»
```

It is also possible to use non-numeric ranges, for instance string based ones:

```raku
say 'a'..'j' ~~ 'b'..'c';  # OUTPUT: «False␤»
say 'b'..'c' ~~ 'a'..'j';  # OUTPUT: «True␤»
say 'raku' ~~ -∞^..^∞;     # OUTPUT: «True␤»
say 'raku' ~~ -∞..∞;       # OUTPUT: «True␤»
say 'raku' ~~ 1..*;        # OUTPUT: «True␤»
```

When smartmatching a `Range` of integers with a [`Cool`](/type/Cool) (string) the `ACCEPTS` methods exploits the [before](/routine/before) and [after](/routine/after) operators in order to check that the [`Cool`](/type/Cool) value is overlapping the range:

```raku
say 1..10 ~~ '5';  # OUTPUT: «False␤»
say '5' before 1;  # OUTPUT: «False␤»
say '5' after 10;  # OUTPUT: «True␤»
say '5' ~~ *..10;  # OUTPUT: «False␤»
```

In the above example, since the `'5'` string is *after* the `10` integer value, the `Range` does not overlap with the specified value.

When matching with a [`Mu`](/type/Mu) instance (i.e., a generic instance), the [cmp](/routine/cmp) operator is used.

## [method min](#class_Range "go to top of document")[§](#method_min "direct link")

```raku
method min(Range:D:)
```

Returns the start point of the range.

```raku
say (1..5).min;                                   # OUTPUT: «1␤»
say (1^..^5).min;                                 # OUTPUT: «1␤»
```

## [method excludes-min](#class_Range "go to top of document")[§](#method_excludes-min "direct link")

```raku
method excludes-min(Range:D: --> Bool:D)
```

Returns `True` if the start point is excluded from the range, and `False` otherwise.

```raku
say (1..5).excludes-min;                          # OUTPUT: «False␤»
say (1^..^5).excludes-min;                        # OUTPUT: «True␤»
```

## [method max](#class_Range "go to top of document")[§](#method_max "direct link")

```raku
method max(Range:D:)
```

Returns the end point of the range.

```raku
say (1..5).max;                                   # OUTPUT: «5␤»
say (1^..^5).max;                                 # OUTPUT: «5␤»
```

## [method excludes-max](#class_Range "go to top of document")[§](#method_excludes-max "direct link")

```raku
method excludes-max(Range:D: --> Bool:D)
```

Returns `True` if the end point is excluded from the range, and `False` otherwise.

```raku
say (1..5).excludes-max;                          # OUTPUT: «False␤»
say (1^..^5).excludes-max;                        # OUTPUT: «True␤»
```

## [method bounds](#class_Range "go to top of document")[§](#method_bounds "direct link")

```raku
method bounds()
```

Returns a list consisting of the start and end point.

```raku
say (1..5).bounds;                                # OUTPUT: «(1 5)␤»
say (1^..^5).bounds;                              # OUTPUT: «(1 5)␤»
```

## [method infinite](#class_Range "go to top of document")[§](#method_infinite "direct link")

```raku
method infinite(Range:D: --> Bool:D)
```

Returns `True` if either end point was declared with `∞` or `*`.

```raku
say (1..5).infinite;                              # OUTPUT: «False␤»
say (1..*).infinite;                              # OUTPUT: «True␤»
```

## [method is-int](#class_Range "go to top of document")[§](#method_is-int "direct link")

```raku
method is-int(Range:D: --> Bool:D)
```

Returns `True` if both end points are [`Int`](/type/Int) values.

```raku
say ('a'..'d').is-int;                            # OUTPUT: «False␤»
say (1..^5).is-int;                               # OUTPUT: «True␤»
say (1.1..5.5).is-int;                            # OUTPUT: «False␤»
```

## [method int-bounds](#class_Range "go to top of document")[§](#method_int-bounds "direct link")

```raku
proto method int-bounds(|)
multi method int-bounds()
multi method int-bounds($from is rw, $to is rw --> Bool:D)
```

If the `Range` is an integer range (as indicated by [is-int](/routine/is-int)), then this method returns a list with the first and last value it will iterate over (taking into account [excludes-min](/routine/excludes-min) and [excludes-max](/routine/excludes-max)). Returns a [`Failure`](/type/Failure) if it is not an integer range.

```raku
say (2..5).int-bounds;                            # OUTPUT: «(2 5)␤»
say (2..^5).int-bounds;                           # OUTPUT: «(2 4)␤»
```

If called with (writable) arguments, these will take the values of the higher and lower bound and returns whether integer bounds could be determined from the `Range`:

```raku
if (3..5).int-bounds( my $min, my $max) {
    say "$min, $max" ; # OUTPUT: «3, 5␤»
}
else {
    say "Could not determine integer bounds";
}
```

## [method minmax](#class_Range "go to top of document")[§](#method_minmax "direct link")

```raku
multi method minmax(Range:D: --> List:D)
```

If the `Range` is an integer range (as indicated by [is-int](/routine/is-int)), then this method returns a list with the first and last value it will iterate over (taking into account [excludes-min](/routine/excludes-min) and [excludes-max](/routine/excludes-max)). If the range is not an integer range, the method will return a two element list containing the start and end point of the range unless either of [excludes-min](/routine/excludes-min) or [excludes-max](/routine/excludes-max) are `True` in which case a [`Failure`](/type/Failure) is returned.

```raku
my $r1 = (1..5); my $r2 = (1^..5);
say $r1.is-int, ', ', $r2.is-int;                 # OUTPUT: «True, True␤»
say $r1.excludes-min, ', ', $r2.excludes-min;     # OUTPUT: «False, True␤»
say $r1.minmax, ', ', $r2.minmax;                 # OUTPUT: «(1 5), (2 5)␤»

my $r3 = (1.1..5.2); my $r4 = (1.1..^5.2);
say $r3.is-int, ', ', $r4.is-int;                 # OUTPUT: «False, False␤»
say $r3.excludes-max, ', ', $r4.excludes-max;     # OUTPUT: «False, True␤»
say $r3.minmax;                                   # OUTPUT: «(1.1 5.2)␤»
say $r4.minmax;
CATCH { default { put .^name, ': ', .Str } };
# OUTPUT: «X::AdHoc: Cannot return minmax on Range with excluded ends␤»
```

## [method elems](#class_Range "go to top of document")[§](#method_elems "direct link")

```raku
method elems(Range:D: --> Numeric:D)
```

Returns the number of elements in the range, e.g. when being iterated over, or when used as a [`List`](/type/List). Returns 0 if the start point is larger than the end point, including when the start point was specified as `∞`. Fails when the Range is lazy, including when the end point was specified as `∞` or either end point was specified as `*`.

```raku
say (1..5).elems;                                 # OUTPUT: «5␤»
say (1^..^5).elems;                               # OUTPUT: «3␤»
```

## [method list](#class_Range "go to top of document")[§](#method_list "direct link")

```raku
multi method list(Range:D:)
```

Generates the list of elements that the range represents.

```raku
say (1..5).list;                                  # OUTPUT: «(1 2 3 4 5)␤»
say (1^..^5).list;                                # OUTPUT: «(2 3 4)␤»
```

## [method flat](#class_Range "go to top of document")[§](#method_flat "direct link")

```raku
method flat(Range:D:)
```

Generates a [`Seq`](/type/Seq) containing the elements that the range represents.

## [method pick](#class_Range "go to top of document")[§](#method_pick "direct link")

```raku
multi method pick(Range:D:         --> Any:D)
multi method pick(Range:D: $number --> Seq:D)
```

Performs the same function as `Range.list.pick`, but attempts to optimize by not actually generating the list if it is not necessary.

## [method roll](#class_Range "go to top of document")[§](#method_roll "direct link")

```raku
multi method roll(Range:D:         --> Any:D)
multi method roll(Range:D: $number --> Seq:D)
```

Performs the same function as `Range.list.roll`, but attempts to optimize by not actually generating the list if it is not necessary.

## [method sum](#class_Range "go to top of document")[§](#method_sum "direct link")

```raku
multi method sum(Range:D:)
```

Returns the sum of all elements in the Range. Throws [`X::Str::Numeric`](/type/X/Str/Numeric) if an element can not be coerced into Numeric.

```raku
(1..10).sum                                       # 55
```

## [method reverse](#class_Range "go to top of document")[§](#method_reverse "direct link")

```raku
method reverse(Range:D: --> Seq:D)
```

Returns a [`Seq`](/type/Seq) where all elements that the `Range` represents have been reversed. Note that reversing an infinite `Range` won't produce any meaningful results.

```raku
say (1^..5).reverse;                            # OUTPUT: «(5 4 3 2)␤»
say ('a'..'d').reverse;                         # OUTPUT: «(d c b a)␤»
say (1..∞).reverse;                             # OUTPUT: «(Inf Inf Inf ...)␤»

```

## [method Capture](#class_Range "go to top of document")[§](#method_Capture "direct link")

```raku
method Capture(Range:D: --> Capture:D)
```

Returns a [`Capture`](/type/Capture) with values of [`.min`](/type/Range#method_min) [`.max`](/type/Range#method_max), [`.excludes-min`](/type/Range#method_excludes-min), [`.excludes-max`](/type/Range#method_excludes-max), [`.infinite`](/type/Range#method_infinite), and [`.is-int`](/type/Range#method_is-int) as named arguments.

## [method rand](#class_Range "go to top of document")[§](#method_rand "direct link")

```raku
method rand(Range:D --> Num:D)
```

Returns a pseudo-random value belonging to the range.

```raku
say (1^..5).rand;                              # OUTPUT: «1.02405550417031␤»
say (0.1..0.3).rand;                           # OUTPUT: «0.2130353370062␤»
```

## [method EXISTS-POS](#class_Range "go to top of document")[§](#method_EXISTS-POS "direct link")

```raku
multi method EXISTS-POS(Range:D: int \pos)
multi method EXISTS-POS(Range:D: Int \pos)
```

Returns `True` if `pos` is greater than or equal to zero and lower than `self.elems`. Returns `False` otherwise.

```raku
say (6..10).EXISTS-POS(2); # OUTPUT: «True␤»
say (6..10).EXISTS-POS(7); # OUTPUT: «False␤»
```

## [method AT-POS](#class_Range "go to top of document")[§](#method_AT-POS "direct link")

```raku
multi method AT-POS(Range:D: int \pos)
multi method AT-POS(Range:D: int:D \pos)
```

Checks if the [`Int`](/type/Int) position exists and in that case returns the element in that position.

```raku
say (1..4).AT-POS(2) # OUTPUT: «3␤»
```

## [method raku](#class_Range "go to top of document")[§](#method_raku "direct link")

```raku
multi method raku(Range:D:)
```

Returns an implementation-specific string that produces an [equivalent](/routine/eqv) object when given to [EVAL](/routine/EVAL).

```raku
say (1..2).raku # OUTPUT: «1..2␤»

```

## [method fmt](#class_Range "go to top of document")[§](#method_fmt "direct link")

```raku
method fmt(|c)
```

Returns a string where `min` and `max` in the `Range` have been formatted according to `|c`.

For more information about parameters, see [List.fmt](/type/List#method_fmt).

```raku
say (1..2).fmt("Element: %d", ",") # OUTPUT: «Element: 1,Element: 2␤»
```

## [method WHICH](#class_Range "go to top of document")[§](#method_WHICH "direct link")

```raku
multi method WHICH (Range:D:)
```

This returns a string that identifies the object. The string is composed by the type of the instance (`Range`) and the `min` and `max` attributes:

```raku
say (1..2).WHICH # OUTPUT: «Range|1..2␤»
```

## [sub infix:<+>](#class_Range "go to top of document")[§](#sub_infix:<+> "direct link")

```raku
multi infix:<+>(Range:D \r, Real:D \v)
multi infix:<+>(Real:D \v, Range:D \r)
```

Takes a [`Real`](/type/Real) and adds that number to both boundaries of the `Range` object. Be careful with the use of parenthesis.

```raku
say (1..2) + 2; # OUTPUT: «3..4␤»
say 1..2 + 2;   # OUTPUT: «1..4␤»
```

## [sub infix:<->](#class_Range "go to top of document")[§](#sub_infix:<-> "direct link")

```raku
multi infix:<->(Range:D \r, Real:D \v)
```

Takes a [`Real`](/type/Real) and subtract that number to both boundaries of the `Range` object. Be careful with the use of parenthesis.

```raku
say (1..2) - 1; # OUTPUT: «0..1␤»
say 1..2 - 1;   # OUTPUT: «1..1␤»
```

## [sub infix:<\*>](#class_Range "go to top of document")[§](#sub_infix:<*> "direct link")

```raku
multi infix:<*>(Range:D \r, Real:D \v)
multi infix:<*>(Real:D \v, Range:D \r)
```

Takes a [`Real`](/type/Real) and multiply both boundaries of the `Range` object by that number.

```raku
say (1..2) * 2; # OUTPUT: «2..4␤»
```

## [sub infix:</>](#class_Range "go to top of document")[§](#sub_infix:</> "direct link")

```raku
multi infix:</>(Range:D \r, Real:D \v)
```

Takes a [`Real`](/type/Real) and divide both boundaries of the `Range` object by that number.

```raku
say (2..4) / 2; # OUTPUT: «1..2␤»
```

## [sub infix:<cmp>](#class_Range "go to top of document")[§](#sub_infix:<cmp> "direct link")

```raku
multi infix:<cmp>(Range:D \a, Range:D \b --> Order:D)
multi infix:<cmp>(Num(Real) \a, Range:D \b --> Order:D)
multi infix:<cmp>(Range:D \a, Num(Real) \b --> Order:D)
multi infix:<cmp>(Positional \a, Range:D \b --> Order:D)
multi infix:<cmp>(Range:D \a, Positional \b --> Order:D)
```

Compares two `Range` objects. A [`Real`](/type/Real) operand will be considered as both the starting point and the ending point of a `Range` to be compared with the other operand. A [`Positional`](/type/Positional) operand will be compared with the list returned by the [`.list` method](/type/Range#method_list) applied to the other operand. See [`List infix:<cmp>`](/type/List#infix_cmp)

```raku
say (1..2) cmp (1..2); # OUTPUT: «Same␤»
say (1..2) cmp (1..3); # OUTPUT: «Less␤»
say (1..4) cmp (1..3); # OUTPUT: «More␤»
say (1..2) cmp 3;      # OUTPUT: «Less␤»
say (1..2) cmp [1,2];  # OUTPUT: «Same␤»
```

# [Typegraph](# "go to top of document")[§](#typegraphrelations "direct link")

Type relations for `Range`

raku-type-graph

Range
Range

Cool
Cool

Range->Cool

Positional
Positional

Range->Positional

Iterable
Iterable

Range->Iterable

Mu
Mu

Any
Any

Any->Mu

Cool->Any

[Expand chart above](/assets/typegraphs/Range.svg)


## dist_zef-raku-community-modules-Net-LibIDN2.md
[![Actions Status](https://github.com/raku-community-modules/Net-LibIDN2/workflows/test/badge.svg)](https://github.com/raku-community-modules/Net-LibIDN2/actions)

# NAME

Net::LibIDN2 - Raku bindings for GNU LibIDN2

# SYNOPSIS

```
    use Net::LibIDN2;

    my $idn = Net::LibIDN2.new;

    my Int $code;
    my $ulabel = "m\xFC\xDFli";
    my $alabel = $idn.lookup_u8($ulabel, IDN2_NFC_INPUT, $code);
    say "$alabel $code"; # xn--mli-5ka8l 0

    my $result = $idn.register_u8($ulabel, $alabel, IDN2_NFC_INPUT, $code);
    say "$result $code"; # xn--mli-5ka8l 0
    say $idn.strerror($code);      # success
    say $idn.strerror_name($code); # IDN2_OK

```

# DESCRIPTION

Net::LibIDN2 is a Raku wrapper for the GNU LibIDN2 library.

Using this module requires a native LibIDN2 dependency. Here's how to install it for your OS:

* Windows

Clone <https://gitlab.com/libidn/libidn2> and follow the install instructions in the README. Don't forget to add the path to the installed LibIDN2 to your PATH environment variable!

* OS X

  $ brew install libidn2
* Ubuntu/Debian

  $ sudo apt-get install libidn2
* OpenSUSE

  $ sudo zypper install libidn2
* Fedora

  $ sudo yum install libidn2
* Arch/Manjaro

  $ sudo pacman -S libidn2
* FreeBSD

  # pkg install libidn2

or

```
# cd /usr/ports/devel/libidn2
# make config
# make
# make install

```

* OpenBSD

  $ doas pkg\_add libidn2

or

```
$ cd /usr/ports/devel/libidn2
$ doas make
$ doas make install

```

* NetBSD

  # pkgin install libidn2

or

```
# cd /usr/pkgsrc/devel/libidn2
# make
# make install

```

# METHODS

* **Net::LibIDN2.check\_version**(--> Version)
* **Net::LibIDN2.check\_version**(Str *$version* --> Version)
* **Net::LibIDN2.check\_version**(Version *$version* --> Version)

Compares `$version` against the version of LibIDN2 installed and returns either an empty string if `$version` is greater than the version installed, or `IDN2_VERSION` otherwise.

* **Net::LibIDN2.strerror**(Int *$errno* --> Str)

Returns the error represented by `$errno` in human readable form.

* **Net::LibIDN2.strerror\_name**(Int *$errno* --> Str)

Returns the internal error name of `$errno`.

* **Net::LibIDN2.to\_ascii\_8z**(Str *$input* --> Str)
* **Net::LibIDN2.to\_ascii\_8z**(Str *$input*, Int *$flags* --> Str)
* **Net::LibIDN2.to\_ascii\_8z**(Str *$input*, Int *$flags*, Int *$code* is rw --> Str)

Converts a UTF8 encoded string `$input` to ASCII and returns the output. `$code`, if provided, is assigned to `IDN2_OK` on success, or another error code otherwise. Requires LibIDN2 v2.0.0 or greater.

* **Net::LibIDN2.to\_unicode\_8z8z**(Str *$input* --> Str)
* **Net::LibIDN2.to\_unicode\_8z8z**(Str *$input*, Int *$flags* --> Str)
* **Net::LibIDN2.to\_unicode\_8z8z**(Str *$input*, Int *$flags*, Int *$code* is rw --> Str)

Converts an ACE encoded domain name `$input` to UTF8 and returns the output. `$code`, if provided, is assigned to `IDN2_OK` on success, or another error code otherwise. Requires LibIDN v2.0.0 or greater.

* **Net::LibIDN2.lookup\_u8**(Str *$input* --> Str)
* **Net::LibIDN2.lookup\_u8**(Str *$input*, Int *$flags* --> Str)
* **Net::LibIDN2.lookup\_u8**(Str *$input*, Int *$flags*, Int *$code* is rw --> Str)

Performs an IDNA2008 lookup string conversion on `$input`. See RFC 5891, section 5. `$input` must be a UTF8 encoded string in NFC form if no `IDN2_NFC_INPUT` flag is passed.

* **Net::LibIDN2.register\_u8**(Str *$uinput*, Str *$ainput* --> Str)
* **Net::LibIDN2.register\_u8**(Str *$uinput*, Str *$ainput*, Int *$flags* --> Str)
* **Net::LibIDN2.register\_u8**(Str *$uinput*, Str *$ainput*, Int *$flags*, Int *$code* is rw --> Str)

Performs an IDNA2008 register string conversion on `$uinput` and `$ainput`. See RFC 5891, section 4. `$uinput` must be a UTF8 encoded string in NFC form if no `IDN2_NFC_INPUT` flag is passed. `$ainput` must be an ACE encoded string.

# CONSTANTS

* Int **IDN2\_LABEL\_MAX\_LENGTH**

The maximum label length.

* Int **IDN2\_DOMAIN\_MAX\_LENGTH**

The maximum domain name length.

## VERSIONING

* Str **IDN2\_VERSION**

The version of LibIDN2 installed.

* Int **IDN2\_VERSION\_NUMBER**

The version of LibIDN2 installed represented as a 32 bit integer. The first pair of bits represents the major version, the second represents the minor version, and the last 4 represent the patch version.

* Int **IDN2\_VERSION\_MAJOR**

The major version of LibIDN2 installed.

* Int **IDN2\_VERSION\_MINOR**

The minor version of LidIDN2 installed.

* Int **IDN2\_VERSION\_PATCH**

The patch version of LibIDN2 installed.

## FLAGS

* Int **IDN2\_NFC\_INPUT**

Normalize the input string using the NFC format.

* Int **IDN2\_ALABEL\_ROUNDTRIP**

Perform optional IDNA2008 lookup roundtrip check.

* Int **IDN2\_TRANSITIONAL**

Perform Unicode TR46 transitional processing.

* Int **IDN2\_NONTRANSITIONAL**

Perform Unicode TR46 non-transitional processing.

## ERRORS

* Int **IDN2\_OK**

Success.

* Int **IDN2\_MALLOC**

Memory allocation failure.

* Int **IDN2\_NO\_CODESET**

Failed to determine a string's encoding.

* Int **IDN2\_ICONV\_FAIL**

Failed to transcode a string to UTF8.

* Int **IDN2\_ENCODING\_ERROR**

Unicode data encoding error.

* Int **IDN2\_NFC**

Failed to normalize a string.

* Int **IDN2\_PUNYCODE\_BAD\_INPUT**

Invalid input to Punycode.

* Int **IDN2\_PUNYCODE\_BIG\_OUTPUT**

Punycode output buffer is too small.

* Int **IDN2\_PUNYCODE\_OVERFLOW**

Punycode conversion would overflow.

* Int **IDN2\_TOO\_BIG\_DOMAIN**

Domain is larger than `IDN2_DOMAIN_MAX_LENGTH`.

* Int **IDN2\_TOO\_BIG\_LABEL**

Label is larger than `IDN2_LABEL_MAX_LENGTH`.

* Int **IDN2\_INVALID\_ALABEL**

Invalid A-label.

* Int **IDN2\_UALABEL\_MISMATCH**

Given U-label and A-label do not match.

* Int **IDN2\_INVALID\_FLAGS**

Invalid combination of flags.

* Int **IDN2\_NOT\_NFC**

String is not normalized in NFC format.

* Int **IDN2\_2HYPHEN**

String has forbidden two hyphens.

* Int **IDN2\_HYPHEN\_STARTEND**

String has forbidden start/end hyphen.

* Int **IDN2\_LEADING\_COMBINING**

String has forbidden leading combining character.

* Int **IDN2\_DISALLOWED**

String has disallowed character.

* Int **IDN2\_CONTEXTJ**

String has forbidden context-j character.

* Int **IDN2\_CONTEXTJ\_NO\_RULE**

String has context-j character without any rull.

* Int **IDN2\_CONTEXTO**

String has forbidden context-o character.

* Int **IDN2\_CONTEXTO\_NO\_RULE**

String has context-o character without any rull.

* Int **IDN2\_UNASSIGNED**

String has forbidden unassigned character.

* Int **IDN2\_BIDI**

String has forbidden bi-directional properties.

* Int **IDN2\_DOT\_IN\_LABEL**

Label has forbidden dot (TR46).

* Int **IDN2\_INVALID\_TRANSITIONAL**

Label has a character forbidden in transitional mode (TR46).

* Int **IDN2\_INVALID\_NONTRANSITIONAL**

Label has a character forbidden in non-transitional mode (TR46).

# AUTHOR

Ben Davies (kaiepi)

# COPYRIGHT AND LICENSE

Copyright 2017 Ben Davies

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## absolute.md
absolute

Combined from primary sources listed below.

# [In IO::Path](#___top "go to top of document")[§](#(IO::Path)_method_absolute "direct link")

See primary documentation
[in context](/type/IO/Path#method_absolute)
for **method absolute**.

```raku
multi method absolute(IO::Path:D: --> Str)
multi method absolute(IO::Path:D: $base --> Str)
```

Returns a new [`Str`](/type/Str) object that is an absolute path. If the invocant is not already an absolute path, it is first made absolute using `$base` as base, if it is provided, or the `.CWD` attribute the object was created with if it is not.


## line.md
line

Combined from primary sources listed below.

# [In Backtrace::Frame](#___top "go to top of document")[§](#(Backtrace::Frame)_method_line "direct link")

See primary documentation
[in context](/type/Backtrace/Frame#method_line)
for **method line**.

```raku
method line(Backtrace::Frame:D --> Int)
```

Returns the line number (line numbers start counting from 1).

```raku
my $bt = Backtrace.new;
my $btf = $bt[0];
say $btf.line;
```

# [In role X::Comp](#___top "go to top of document")[§](#(role_X::Comp)_method_line "direct link")

See primary documentation
[in context](/type/X/Comp#method_line)
for **method line**.

The line number in which the compilation error occurred.

# [In Label](#___top "go to top of document")[§](#(Label)_method_line "direct link")

See primary documentation
[in context](/type/Label#method_line)
for **method line**.

Returns the line where the label has been defined.

# [In Code](#___top "go to top of document")[§](#(Code)_method_line "direct link")

See primary documentation
[in context](/type/Code#method_line)
for **method line**.

```raku
method line(Code:D: --> Int:D)
```

Returns the line number in the source code at which the code object's declaration begins.

```raku
say &infix:<+>.line;   # OUTPUT: «208␤»
```

If the code object was generated automatically (and thus *not* declared in the source code), then `line` returns the line on which the enclosing scope's declaration begins. For example, when called on an [automatically generated accessor method](/language/objects#Attributes) produced by the `has $.name` syntax, `line` returns the line on which the method's class's declaration begins.

For example, if you have the following source file:

```raku
class Food {                # Line 1
    has $.ingredients;      # Line 2
                            # Line 3
    method eat {};          # Line 4
}                           # Line 5
```

Then the `line` method would give you the following output:

```raku
say Food.^lookup('eat').line;          # OUTPUT: «4␤»
say Food.^lookup('ingredients').line;  # OUTPUT: «1␤»

```

# [In CallFrame](#___top "go to top of document")[§](#(CallFrame)_method_line "direct link")

See primary documentation
[in context](/type/CallFrame#method_line)
for **method line**.

```raku
method line()
```

This is a shortcut for looking up the `line` annotation. For example, the following two calls are identical.

```raku
say callframe(1).line;
say callframe(1).annotations<line>;
```


## dist_github-cbk-API-USNavalObservatory.md
# perl6-API-USNavalObservatory [Build Status](https://travis-ci.org/cbk/API-USNavalObservatory)

## SYNOPSIS

This module is a simple **Perl 6** interface to the U.S. Naval Observatory, Astronomical Applications API v2.2.0
which can be found at <http://aa.usno.navy.mil/data/docs/api.php>

You may choose to use an 8 character alphanumeric identifier in your forms or scripts. This API has a default of **"P6mod"** which is registered with the U.S. Naval Observatory as the default ID of this API. The 'AA' ID is used internally by the U.S. Naval Observatory and thus can not be used.
It is recommended that you override the default `apiID` You may use any other identifier you want for `apiID`. Information about the ID and how to register your own can be found **[here](https://aa.usno.navy.mil/data/docs/api.php#id)**.

#### Example:

the following example creates a new **API::NavalObservatory** object called $webAgent and sets the apiID to 'MyID'.

```
my $webAgent = API::USNavalObservatory.new( apiID => "MyID" );

```

## Returns

* For services which return text, you will receive an JSON formatted blob of text.
* For services which produce a image, this API will save the .PNG file in the current working directory. (Overwriting any existing file with the same name.)

## Methods

There are currently 9 methods which are used to interact with this API.

The API uses UTC time for all time based calls. When crafting your method calls add the `.utc` method on the DateTime object to convert a local time to UTC.

Below is a list of the current methods in this module:

* Day and Night Across the Earth, Cylindrical Projection: `.cylindrical()`
* Day and Night Across the Earth, Spherical Projection: `.spherical()`
* Apparent Disk of the Solar System Object: `.apparentDisk()`
* Phases of the Moon: `.moonPhase()`
* Complete Sun and Moon Data for One Day: `.oneDayData()`
* Sidereal Time: `.siderealTime()`
* Solar Eclipse Calculator: `.solarEclipses()`
* Religious Observances: `.observances()`
* Earth Seasons and Apsides: `.seasons()`

### Day and Night Across the Earth - Cylindrical Projection

Generates a cylindrical map of the Earth (similar to a Mercator projection) with daytime and nighttime areas appropriately shaded.

#### Examples:

The following example shows a request using a date only.

```
say $webAgent.cylindrical( :dateObj( Date.today  ) );

```

This example shows a request that uses both date and time.

```
say $webAgent.cylindrical( :dateTimeObj( DateTime.now ) );

```

#### Return:

This method returns a .png image in the current working directory.

* NOTE: This will overwrite any file with the same name in the CWD.

### Day and Night Across the Earth - Spherical Projections

Creates a .png image view of the Earth with daytime and nighttime areas shaded appropriately. The image generated is of the apparent disk you would see if you were in a spacecraft looking back at Earth.
This method takes two named pramaters: `dateTimeObj` which is a DateTime object and view which is a View subset.

* The value for `view` can be any one of the following: **moon, sun, north, south, east, west, rise, and set.**

#### Example:

```
 say $webAgent.spherical(
    :dateTimeObj( DateTime.now ),
	:view("sun")
);

```

#### Return:

This method returns a .png image in the current working directory.

* NOTE: This will overwrite any file with the same name in the CWD.

### Apparent Disk of a Solar System Object

Produces an apparent disk of a solar system object oriented as if you were viewing it through a high-powered telescope.

#### Example:

```
 say $webAgent.apparentDisk(
	:dateTimeObj( DateTime.now ),
	:body('moon')
);

```

#### Return:

This method returns a png image in the current working directory.

### Phases of the Moon

Returns the dates and times of a list of primary moon phases.
This method has two signatures:

* One where a valid year is provided, and returns ALL moon phase data for that year. This is a un-named pramater.
* One that has will take a `Date` object and a unsigned integer for the number of phases to include in the results.

#### Examples:

The following example shows a request for a given date and number of phases.

```
say $webAgent.moonPhase(
	:dateObj( Date.today() ),
	:numP( 5 )
);

```

The following example shows a request for a given year.

```
 say $webAgent.moonPhase( 2019 );

```

#### Return:

This method returns a JSON formatted text blob.

### Complete Sun and Moon Data for One Day

Returns the rise, set, and transit times for the Sun and the Moon on the requested date at the specified location.

#### Examples:

The following example shows a request using date, coordinates, and time zone.

```
say $webAgent.oneDayData(
	:dateObj( Date.today() ),
	:coords( "41.98N, 12.48E" ),
	:tz(-6)
);

```

The following example shows a request using date amd location.

```
say $webAgent.oneDayData(
	:dateObj( Date.today()),
	:loc("San Diego, CA")
);

```

#### Return:

This method returns a JSON formatted text blob.

### Sidereal Time

Provides the greenwich mean and apparent sidereal time, local mean and apparent sidereal time, and the Equation of the Equinoxes for a given date & time.

#### Examples:

The following example shows a request using a location string.

```
say $webAgent.siderealTime(
    :dateTimeObj(DateTime.new(
        year => 2019,
        month => 2,
        day => 2,
        hour => 2,
        minute => 2,
        second => 1,)),
    :loc("Denver,CO"),
    :reps(90),
    :intvMag(5),
    :intvUnit('minutes')
);

```

The following example shows a request using coordinates.

```
say $webAgent.siderealTime(
    :dateTimeObj( DateTime.new(
        year => 2019,
        month => 2,
        day => 2,
        hour => 2,
        minute => 2,
        second => 1,)),
    :coords("41.98N, 12.48E"),
    :reps(90),
    :intvMag(5),
    :intvUnit('minutes')
);

```

#### Return:

This method returns a JSON formatted text blob.

### Solar Eclipse Calculator

This data service provides local circumstances for solar eclipses, and also provides a means for determining dates and types of eclipses in a given year.

#### Examples:

The following example shows a request using a U.S. based location (San Francisco CA) for the current day.

* NOTE: Currently this module utilizes the URI::Encode, uri\_encode method. Including a comma **,** in the string that is passed to uri\_encode seams to produce a malformed URL which fails when passed to the API. Use a space instead of a comma for now.

```
say $webAgent.solarEclipses(
	:loc("San Francisco CA"),
	:dateObj( Date.today() ),
	:height(50),
	:format("json")
    );

```

The following example shows a request using lat and long.

```
say $webAgent.solarEclipses(
	:coords("46.67N, 1.48E" ),
	:dateObj( Date.today() ),
	:height(50),
	:format("json")
	);

```

The following example shows a request providing only the year in the range of 1800 to 2050.

```
say $webAgent.solarEclipses( 2019 );

```

#### Return:

All these method signatures return an JSON formatted text blob.

### Selected Religious Observances

Single method to handle all three calender types; `christan, jewish, islamic`

* For Christan calender, use years between 1583 and 9999.
* For Jewish calender, use years between 360 and 9999.
* For Islamic calender, use years between 622 and 9999.

#### Example:

```
say $webAgent.observances( :year(2019), :cal('christian') );

```

#### Return:

This method returns a JSON formatted text blob.

### Julian Date Converter

This data service converts dates between the Julian/Gregorian calendar and Julian date. Data will be provided for the years 4713 B.C. through A.D. 9999, or Julian dates of 0 through 5373484.5.

To use the `.julianDate` method, you must provide a valid `DateTime` object and a valid Era OR an unsigned integer.

This method returns a JSON text blob of the request converted into ether a Julian or calendar date.

#### Examples:

```
say $webAgent.julianDate( 2457892.312674 );

```

```
say $webAgent.julianDate( :dateTimeObj(DateTime.now), :era('AD') );

```

#### Return:

Both of these methods returns an JSON formatted text blob.

### Earth's Seasons and Apsides

#### Example:

```
say $webAgent.seasons( :year(2019), :tz(-6), :dst(False) );

```

#### Return:

This method returns a JSON formatted text blob.

## Sample code

* The following example makes a new object and overrides the default apiID. Then calls the solarEclipses method with the year 2019 to find all eclipses for 2019.

```
use v6;
use API::USNavalObservatory;
my $webAgent = API::NavalObservatory.new( apiID => "MyID" );
my $output = $webAgent.solarEclipses( 2019 );
say $output;

```

OUTPUT:

```
{
  "error" : false,
  "year" : 2019,
  "apiversion" : "2.2.0",
  "eclipses_in_year" : [
    {
      "event" : "Partial Solar Eclipse of 6 January 2019",
      "day" : 6,
      "year" : 2019,
      "month" : 1
    },
    {
      "event" : "Total Solar Eclipse of 2 July 2019",
      "month" : 7,
      "year" : 2019,
      "day" : 2
    },
    {
      "event" : "Annular Solar Eclipse of 26 December 2019",
      "month" : 12,
      "year" : 2019,
      "day" : 26
    }
  ]
}

```

## AUTHOR

* Michael, cbk on #perl6, <https://github.com/cbk/>


## dist_github-pierre-vigier-AttrX-PrivateAccessor.md
# Perl6-AttrX::PrivateAccessor

[![Build Status](https://travis-ci.org/pierre-vigier/Perl6-AttrX-PrivateAccessor.svg?branch=master)](https://travis-ci.org/pierre-vigier/Perl6-AttrX-PrivateAccessor)

# NAME

AttrX::PrivateAccessor

# SYNOPSIS

Provide private accessor for private attribute, provide only read accessor, see NOTES for the reason

# DESCRIPTION

This module provides trait private-accessible (providing-private-accessor was too long), which will create a private accessor for a private attribute, in read only, no modification possible

It allows from within a class to access another instance of the same class' private attributes

```
use AttrX::PrivateAccessor;

class Sample
    has $!attribute is private-accessible;
}

```

is equivalent to

```
class Sample
    has $!attribute;

    method !attribute() {
        return $!attribute;
    }
}

```

The private accessor method by default will have the name of the attribute, but can be customized, as an argument to the trait

```
use AttrX::PrivateAccessor;

class Sample
    has $!attribute is private-accessible('accessor');
}

```

THe private method will then be

```
method !accessor() { $!attribute }

```

A use case for having private read accessor could be, let's see that we have class who store a chareacteristic under an interanl format, that should not be visible from the outside. To check if two instances of that class are equal, we have to compare that internal value, we would have a method like that

```
class Foo {
    has $!characteristic is private-accessible;

    ...

    method equal( Foo:D: Foo:D $other ) {
        return $!characteristic == $other!characteristic;
    }
}

```

Without the trai, we can't know the value in the other instance

# NOTES

This module create private accessor in read-only mode. Even if really useful sometimes, accessing private attributes of another instance of the same class is starting to violate encapsulation. Giving permission to modify private attributes of another instance seemed a bit to much, if it is really needed, i guess it would really be some specific case, where writing a dedicated private method with comments seems more adequate. However, if one day that behavior has to be implemented, it could be done through a parameter of the trait, like

```
has $!attribute is private-accessible( :rw )

```

# MISC

To test the meta data of the modules, set environement variable PERL6\_TEST\_META to 1


## dist_cpan-MELEZHIK-Sparrowdo-VSTS-YAML-Solution.md
# Sparrowdo::VSTS::YAML:Solution

Sparrowdo module to generate VSTS yaml steps to build solution files.

```
$ cat sparrowfile

module_run "VSTS::YAML::Solution", %(
  build-dir => "cicd/build",
  vs-version  => '15.0', # visual  studio version, default value
  display-name => "Build app.sln", # optional
  solution => "app.sln", # path to solution file, default is "**\*.sln"
  platform => "x86",
  configuration => "debug",
  restore-solution => "app.sln", # path to NugetRestore solution file
  skip-nuget-install => True, # don't install nuget cli
  test-assemblies => True, # run tests, default value is False
  publish-symbols => False, # publish symbols, this is default value
);

$ sparrowdo --local_mode --no_sudo

```

# Parameters

## vs-version

Visual studio version

## solution

Path to solution file

## platform

Build platform

## configuration

Build configuration

## restore-solution

Path to solution file for `nuget restore` command

## skip-nuget-restore

Don't run `nuget restore` command

## skip-nuget-install

Don't install nuget

## test-assemblies

Run tests

## publish-symbols

Publish symbols

# Author

Alexey Melezhik


## dist_cpan-MARTIMM-Pod-Render.md
# Rendering of pod documents

[![Travis Build Status](https://travis-ci.org/MARTIMM/pod-render.svg?branch=master)](https://travis-ci.org/MARTIMM/pod-render) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/MARTIMM/pod-render?branch=master&passingText=Windows%20-%20OK&failingText=Windows%20-%20FAIL&pendingText=Windows%20-%20pending&svg=true)](https://ci.appveyor.com/project/MARTIMM/pod-render/branch/master) [![License](http://martimm.github.io/label/License-label.svg)](http://www.perlfoundation.org/artistic_license_2_0)

## Synopsis

```
pod-render --html lib/Your/Module.pm6

```

## Documentation

The pdf output is generated with the program `prince`. You can find the downdload page [here](https://www.princexml.com/download/).

### Program and library

* [pod-render.pl6 html](https://nbviewer.jupyter.org/github/MARTIMM/pod-render/blob/master/doc/pod-render.html)
* [Pod::Render html](https://nbviewer.jupyter.org/github/MARTIMM/pod-render/blob/master/doc/Render.html)

### Other examples of the same documents

* [pod-render.pl6 pdf](https://nbviewer.jupyter.org/github/MARTIMM/pod-render/blob/master/doc/pod-render.pdf)
* [pod-render.pl6 md](https://github.com/MARTIMM/pod-render/blob/master/doc/pod-render.md)
* [Pod::Render pdf](https://nbviewer.jupyter.org/github/MARTIMM/pod-render/blob/master/doc/Render.pdf)
* [Pod::Render md](https://github.com/MARTIMM/pod-render/blob/master/doc/Render.md)

### Release notes

* [Release notes](https://github.com/MARTIMM/pod-render/blob/master/doc/CHANGES.md)

## Installing

`zef install Pod::Render`

## Versions of PERL, MOARVM

This project is tested with latest Rakudo built on MoarVM implementing Perl v6.

## Dependency on external programs

When generating pdf files, the program uses **[prince](https://www.princexml.com/download/)** to get the work done. Please also read the [end user license agreement](https://www.princexml.com/license/) before generating prince.

## Authors

`© Marcel Timmerman (MARTIMM on github)`

## Attribution

* `Pod::To::HTML`
* Camelia™ (butterfly) is © 2009 by Larry Wall


## multiple.md
class X::Phaser::Multiple

Compilation error due to multiple phasers of the same type

```raku
class X::Phaser::Multiple does X::Comp { }
```

Thrown when multiple phasers of the same type occur in a block, but only one is allowed (for example `CATCH` or `CONTROL`).

For example

```raku
CATCH { }; CATCH { }

```

dies with

｢text｣ without highlighting

```

```

===SORRY!===
Only one CATCH block is allowed

```

```

# [Methods](#class_X::Phaser::Multiple "go to top of document")[§](#Methods "direct link")

## [method block](#class_X::Phaser::Multiple "go to top of document")[§](#method_block "direct link")

Returns the name of the phaser that occurred more than once.


## dist_zef-lizmat-Bits.md
[![Actions Status](https://github.com/lizmat/Bits/actions/workflows/linux.yml/badge.svg)](https://github.com/lizmat/Bits/actions) [![Actions Status](https://github.com/lizmat/Bits/actions/workflows/macos.yml/badge.svg)](https://github.com/lizmat/Bits/actions) [![Actions Status](https://github.com/lizmat/Bits/actions/workflows/windows.yml/badge.svg)](https://github.com/lizmat/Bits/actions)

# NAME

Bits - provide bit related functions for arbitrarily large integers

# SYNOPSIS

```
use Bits;  # exports "bit", "bits", "bitcnt", "bitswap"

say bit(8, 3);    # 1000 -> True
say bit(7, 3);    # 0111 -> False

say bits(8);      # 1000 -> (3,).Seq
say bits(7);      # 0111 -> (0,1,2).Seq

say bitcnt(8);    # 1000 -> 1
say bitcnt(7);    # 0111 -> 3

say bitswap(1);   # 0001 -> 1110
say bitswap(-1);  # 1111 -> 0000

```

# DESCRIPTION

This module exports a number of function to handle significant bits in arbitrarily large integer values, aka bitmaps. If the specified value is zero or positive, then the on-bits will be considered significant. If the specified value is negative, then the off-bits in the value will be considered significant.

# SUBROUTINES

## bit

```
sub bit(Int:D value, UInt:D bit --> Bool:D)

```

Takes an integer value and a bit number and returns whether that bit is significant (1 for positive values, 0 for negative values).

## bits

```
sub bits(Int:D value --> Seq:D)

```

Takes an integer value and returns a `Seq`uence of the bit numbers that are significant in the value. For negative values, these are the bits that are 0.

## bitcnt

```
sub bitcnt(Int:D value --> Int:D)

```

Takes an integer value and returns the number of significant bits that are set in the value. For negative values, this is the number of bits that are 0.

## bitswap

```
sub bitswap(Int:D value --> Int:D)

```

Takes an integer value and returns an integer value with all of the 1-bits turned to 0-bits and vice-versa.

# AUTHOR

Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)

Source can be located at: <https://github.com/lizmat/Bits> . Comments and Pull Requests are welcome.

If you like this module, or what I'm doing more generally, committing to a [small sponsorship](https://github.com/sponsors/lizmat/) would mean a great deal to me!

# COPYRIGHT AND LICENSE

Copyright 2019, 2020, 2021, 2025 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_github-sirrobert-Class-Utils.md
## Class::Utils

### role Has

Some of the core classes don't run through `bless` during object
creation (apparently for efficiency reasons). This means that if you define
a class that inherits from Array, for example, you can't define properties
for the class using the normal `has` route.

The `Has` role addresses this by importing a new `new` that takes advantage
of bless.

#### Usage

The following code breaks. If you try to access `$.foo` below, you get an
undefined `Any` value instead of `'bar'`.

```
class MySet is Array {
  has $.foo = 'bar';
}

say MySet.new.foo;    # Any()

```

Fix this with `does Has` from `Class::Utils`:

```
use Class::Utils;

class MySet is Array does Has {
  has $.foo = 'bar';
}

say MySet.new.foo;    # bar

```


## dist_github-azawawi-LibZip.md
# LibZip

[![Build Status](https://travis-ci.org/azawawi/perl6-libzip.svg?branch=master)](https://travis-ci.org/azawawi/perl6-libzip) [![Build status](https://ci.appveyor.com/api/projects/status/github/azawawi/perl6-libzip?svg=true)](https://ci.appveyor.com/project/azawawi/perl6-libzip/branch/master)

LibZip provides Perl 6 bindings for libzip

This is an experimental module at the moment.

## Example

```
use v6;

use lib 'lib';
use LibZip;

# Remove the old one (just in case)
my $zip-file-name = "test.zip";
$zip-file-name.IO.unlink;

# Create a new LibZip instance
my $archive = LibZip.new;

# Create a new zip file
$archive.open($zip-file-name);

# Add file to zip archive
$archive.add-file("README.md");

# Add file to zip archive
my $lorem = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
sunt in culpa qui officia deserunt mollit anim id est laborum.";
my Blob $blob = $lorem.encode("UTF-8");
$archive.add-blob("lorem.txt", $blob);

# Close the zip archive
$archive.close;

```

## Author

Ahmad M. Zawawi, azawawi on #perl6, <https://github.com/azawawi/>

## License

[MIT License](LICENSE)