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

# NAME

Raku port of Perl's Sys::Hostname module

# SYNOPSIS

```
use Sys::Hostname;
$host = hostname;

```

# DESCRIPTION

This module tries to mimic the behaviour of Perl's `Sys::Hostname` module as closely as possible in the Raku Programming Language.

Obtain the system hostname as Raku sees it.

All NULs, returns, and newlines are removed from the result.

# PORTING CAVEATS

At present, the behaviour of the built-in `gethostname` sub is used. Any bugs in its behaviour should be fixed there.

# AUTHOR

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

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

# COPYRIGHT AND LICENSE

Copyright 2018, 2019, 2020, 2021 Elizabeth Mattijsen

Originally developed by David Sundstrom and Greg Bacon. Re-imagined from Perl as part of the CPAN Butterfly Plan.

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


## dist_zef-coke-App-SudokuHelper.md
# NAME

sudoku - command-line sudoku utility

# DESCRIPTION

```
$ sudoku combo 6
6
1 5
2 4
1 2 3

```

Display all combinations of sudoku digits that add to the given sum. Solutions
displayed in order from shortest to longest, then in numerical order.

```
$ sudoku combo 30 4
6 7 8 9

```

Display combinations that add to the given sum using the specified number of digits.

```
$ sudoku combo -s 6
6
2 4

$ sudoku combo --sandwich 9
2 7
3 6
4 5
2 3 4

```

Display combinations that add to the given sum that are valid for sandwich suduko.
That is, that exclude the digits 1 and 9.

```
$ sudoku combo -x 10
2 8
3 1 6
3 2 5
4 1 2 3

```

Display combinations where the number of digits in the combination is one of the
digits. `-x` for x-sums variant, where the number outside the puzzle shows the
total of the first `x` digits, where `x` is the first digit. The first digit of
each row is the `x`.

```
$ sudoku combo --sequence 13
6 7

```

Display only combinations where the digits form a sequence.


## dist_zef-Tux-Text-CSV.md
## Module [Test raku](https://github.com/Tux/CSV/actions/workflows/test.yaml)

Text::CSV - Handle CSV data in Raku

## Description

Text::CSV provides facilities for the composition and decomposition
of comma-separated values. An instance of the Text::CSV class can
combine fields into a CSV string and parse a CSV string into fields.

This module provides both an OO API and a functional API to parse
and produce CSV data.

```
 use Text::CSV;

 my $csv = Text::CSV.new;
 my $io  = open "file.csv", :r, chomp => False;
 my @dta = $csv.getline_all($io);

 my @dta = csv(in => "file.csv");

```

Additional (still incomplete) documentation in [the `doc` directory](/doc), including [a markdown version](/doc/Text-CSV.md). Check out also the [examples](/examples).

Debugging information can be obtained by setting the `RAKU_VERBOSE`
environment variable with values ranging to 2 to 9, less to annoyingly verbose.

## Installation

Recent changes can be (re)viewed in the public GIT repository at
<https://github.com/Tux/CSV>
Feel free to clone your own copy:

```
 $ git clone https://github.com/Tux/CSV Text-CSV

```

## Prerequisites

* raku 6.c
* File::Temp - as long as in-memory IO is not native
* Slang::Tuxic - to support my style

## Build/Installation

```
 $ zef install Text::CSV

```

Or just

```
$ zef install .

```

for the already downloaded repo

## License

Copyright (c) 2015-2023 H.Merijn Brand. All rights reserved.

This program is free software; you can redistribute it and/or
modify it under the same terms as Raku itself, which is
GNU General Public License or Artistic License 2.

## Author

H.Merijn Brand [h.m.brand@xs4all.nl](mailto:h.m.brand@xs4all.nl)


## dist_zef-jjmerelo-Doc-TypeGraph.md
[![Test](https://github.com/JJ/Raku-Doc-TypeGraph/actions/workflows/test.yaml/badge.svg)](https://github.com/JJ/Raku-Doc-TypeGraph/actions/workflows/test.yaml)

# NAME

Doc::TypeGraph - Parse a description of the types for documentation.

# SYNOPSIS

```

    use Doc::TypeGraph;

    # create and initialize it
    my $tg = Doc::TypeGraph.new-from-file("./resources/type-graph.txt");

    # and use it!
    say $tg.sorted;

```

# DESCRIPTION

Doc::TypeGraph creates a graph of all types in a file that describes
them. It gives you info about what classes a type inherits from and the roles it does. In addition, it also computes the inversion of this relations, which let you know what types inherit a given type and the types implementing a specific role.

All types are represented using a `Doc::Type` object. Categories are just
descriptive and are not really used in the generation of graphs. They will
probably be eliminated in later iterations of this library.

# Installation

You will need to have `graphviz` installed to generate the graphs; it uses
`dot`

# FILE SYNTAX

```
[ Category ]
# only one-line comments are supported
packagetype typename[role-signature]
packagetype typename[role-signature] is typename[role-signature] # inheritance
packagetype typename[role-signature] does typename[role-signature] # roles

[ Another cateogory ]

```

* Supported categories: `Metamodel`, `Domain-specific`, `Basic`, `Composite`, `Exceptions` and `Core`.
* Supported packagetypes: `class`, `module`, `role` and `enum`.
* Supported typenames: whatever string following the syntax
  `class1::class2::class3 ...`; `class` follows the usual identifier
  format that might include apostrophes and dashes.
* `[role-signature]` is not processed, but you can add it anyway.
* If your type inherits from more than one type or implements several roles, you can add more `is` and `does` statements (separated by spaces).

Example:

```
[Metamodel]
# Metamodel
class Metamodel::Archetypes
role  Metamodel::AttributeContainer
class Metamodel::GenericHOW       does Metamodel::Naming
class Metamodel::MethodDispatcher is Metamodel::BaseDispatcher is Another::Something
enum  Bool                          is Int
module Test

```

(whitespace is only included for appearance, it does not have any
meaning)

### has Associative %.types

Format: $name => Doc::Type.

### has Positional @.sorted

Sorted array of type names.

### method new-from-file

```
method new-from-file(
    $fn
) returns Mu

```

Initialize %.types from a file.

### method parse-from-file

```
method parse-from-file(
    $fn
) returns Mu

```

Parse the file (using the Decl grammar) and initialize %.types and @.sorted

### method topo-sort

```
method topo-sort() returns Mu

```

This method takes all Doc::Type objects in `%.types` and sort them
by its name. After that, recursively, add all roles and supers in the
object to `@!sorted`

# AUTHOR

Moritz Lenz <@moritz> Antonio Gámiz <@antoniogamiz>

# COPYRIGHT AND LICENSE

This module is a spin-off from the Official Doc repo, if you want to see the
past changes go to the [official doc](https://github.com/Raku/doc).

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


## dist_zef-tony-o-Text-CSV-LibCSV.md
# Text::CSV::LibCSV

Uses a wrapper that can stream data/records from a csv file using libcsv.

# Options

## Delimiter (`.new(:delimiter<>)`)

LibCSV allows a char to be specified for the delimiter, if you provide a multicharacter string only the first ordinal will be used.

## Quote (`.new(:quote<>)`)

LibCSV allows a char to be specified for the quoting char, if you provide a multicharacter string only the first ordinal will be used.

## Preserve Whitespace (`.new(:preserve-ws)`)

You can choose to not auto-trim tabs and spaces from data by passing this option along

## Parser Options (`.new(:parser-options(int32))`)

See your local libcsv documentation for what is acceptable here, out of the box is provided the structure:

```
CSV-STRICT        => 1
CSV-REPALL-NL     => 2
CSV-STRICT-FINI   => 4
CSV-APPEND-NULL   => 8
CSV-EMPTY-IS-NULL => 16

```

You can build your own options with the enum (example: `CSV-STRICT +| CSV-EMPTY-IS-NULL`) or the convenience method: `Text::CSV::LibCSV.build-options(:CSV-STRICT, :CSV-EMPTY-IS-NULL)`

## Has Headers (`.new(:has-headers) | .read-file(:has-headers)`)

When provided to `.new` this option will set the default parsing mode to assuming there are headers in the CSV file. This option can be overridden by passing this option to `.read-file`. This option will also cause a hash containing `header => <value>` pairs rather than array to be returned from parsing

## Auto Decode (`.new(:auto-decode)`)

This will auto-decode the data records that are emitted from libcsv. If this option is left empty then the user will receive `Buf` types back

# Usage

## OO interface

```
use Text::CSV::LibCSV;

my $parser-options = CSV-STRICT +| CSV-EMPTY-IS-NULL;
my Text::CSV::LibCSV $parser .=new(:$parser-options, :auto-decode('utf8'), :has-headers);

my @lines = $parser.read-file('path-to-file');

# @lines = [ { ... }, { ... }, ... ];

```

## Procedural

```
use Text::CSV::LibCSV :csv-read-file;

my @lines = csv-read-file('path-to-file', :$parser-options, :auto-decode('utf8'), :has-headers);

# @lines = [ { ... }, { ... }, ... ];

```

# Streaming

Sometimes your CSV files are large or simply want to act as the record/data is available. This is possible with the following pattern:

```
use Text::CSV::LibCSV;

my Supplier $on-data   .=new;
my Supplier $on-record .=new;

$on-data.Supply.tap( -> $data {
  # depending on your options $data contains a Buf or Buf.decode()
});

$on-record.Supply.tap( -> $record {
  # depending on your options $record contains a hash or array
});

my $parser-options = CSV-STRICT +| CSV-EMPTY-IS-NULL;
my Text::CSV::LibCSV $parser .=new(:$parser-options, :auto-decode('utf8'), :has-headers);

$parser.read-file('path-to-file', :$on-data, :$on-record, :!return-all);

```


## dist_zef-skaji-App-Mi6.md
[![Actions Status](https://github.com/skaji/mi6/actions/workflows/test.yml/badge.svg)](https://github.com/skaji/mi6/actions)

# NAME

App::Mi6 - minimal authoring tool for Raku

# SYNOPSIS

```
$ mi6 new Foo::Bar # create Foo-Bar distribution for Zef ecosystem
$ mi6 build        # build the distribution and re-generate README.md/META6.json
$ mi6 test         # run tests
$ mi6 release      # release your distribution to Zef ecosystem

```

# INSTALLATION

First make sure you have rakudo v2020.11 or later. If not, install rakudo from <https://rakudo.org/downloads>.

Then:

```
$ zef install App::Mi6

```

# DESCRIPTION

App::Mi6 is a minimal authoring tool for Raku. Features are:

* Create minimal distribution skeleton for Raku
* Generate README.md from lib/Main/Module.rakumod's pod
* Run tests by `mi6 test`
* Release your distribution to [Zef ecosystem](https://deathbyperl6.com/faq-zef-ecosystem/) or [CPAN ecosystem](https://www.cpan.org/authors/id/)

# FAQ

## Can I customize mi6 behavior?

Yes. Use `dist.ini`:

```
; dist.ini
name = Your::Module::Name

; mi6 automatically guesses source-url by `git remote -v`.
; if it doesn't work for some reasons, you can specify source-url:
source-url = https://github.com/you/Your-Module-Name.git

[ReadmeFromPod]
; if you want to disable generating README.md from main module's pod, then:
; enabled = false
;
; if you want to change a file that generates README.md, then:
; filename = lib/Your/Tutorial.pod

[UploadToZef]    ; Upload your distribution to Zef ecosystem
; [UploadToCPAN] ; You can also use UploadToCPAN instead, to upload your distribution to CPAN ecosystem

[PruneFiles]
; if you want to prune files when packaging, then
; filename = utils/tool.pl
;
; you can use Raku regular expressions
; match = ^ 'xt/'

[MetaNoIndex]
; if you do not want to list some files in META6.json as "provides", then
; filename = lib/Should/Not/List/Provides.rakumod

[AutoScanPackages]
; if you do not want mi6 to scan packages at all,
; but you want to manage "provides" in META6.json by yourself, then:
; enabled = false

[Badges]
; if you want to add badges to README.md, then
; provider = travis-ci.org
; provider = travis-ci.com
; provider = appveyor
; provider = github-actions/name.yml

; execute some commands before `mi6 build`
[RunBeforeBuild]
; %x will be replaced by $*EXECUTABLE
; cmd = %x -e 'say "hello"'
; cmd = %x -e 'say "world"'

; execute some commands after `mi6 build`
[RunAfterBuild]
; cmd = some shell command here

```

## How can I manage depends, build-depends, test-depends?

Write them to META6.json directly :).

## Where is the spec of META6.json?

<https://design.raku.org/S22.html>

See also [The Meta spec, Distribution, and CompUnit::Repository explained-ish](https://perl6advent.wordpress.com/2016/12/16/day-16-the-meta-spec-distribution-and-compunitrepository-explained-ish/) by ugexe.

## What is the format of the .pause file?

Mi6 uses the .pause file in your home directory to determine the username. This is a flat text file, designed to be compatible with the .pause file used by the Perl5 `cpan-upload` module (<https://metacpan.org/pod/cpan-upload>). Note that this file only needs to contain the "user" and "password" directives. Unknown directives are ignored.

An example file could consist of only two lines:

```
user your_pause_username
password your_pause_password

```

Replace `your_pause_username` with your PAUSE username, and replace `your_pause_password` with your PAUSE password.

This file can also be encrypted with GPG if you do not want to leave your PAUSE credentials in plain text.

## What existing files are modified by `mi6`?

After the initial `mi6` creation step, the following files are changed by `mi6` during each build or release operation:

* `README.md`
* `Changes`
* `META6.json`
* modules in the lib directory

## How is the version number specified?

When you are ready to release a module and enter at the CLI mi6 release, you will get a response presenting a proposed version number which you can either accept or enter a new one (which must be greater than the one offered by default).

During the release, `mi6` updates the files mentioned above with the selected version number.

## What is the required format of the `Changes` file before a release?

Ensure your `Changes` file looks like something like this **before** you start a release operation

```
{{$NEXT}}
    - Change entry line 1
    - Change entry line 2
    - Change entry line 3

```

Notes:

* `mi6 release` will replace the `{{$NEXT}}` line with the new version number and its timestamp
* You **must** have at least one change entry line
* The first change entry line **must** start with a space or tab

## What is the source of the author's email address?

The email is taken from the author's `.gitconfig` file. In general, that same email address should match any email address existing in a module's `META6.json` file.

## How does one change an existing distribution created with `mi6` to use Zef ecosystem instead of CPAN ecosystem?

First, the author must have an active account with [fez](https://github.com/tony-o/raku-fez) which will create a `.fez-config.json` file in the author's home directory.

Then, starting with an existing module created with `mi6`, do the following:

* Add the following line to your `dist.ini` file:

  `[UploadToZef]`
* Change all instances of the `auth<cpan:CPAN-USERNAME>` to `auth<zef:zef-username>`. Check files `META6.json` and the module's leading or main module file in directory `./lib`.
* Optional, but recommended: Add an entry in the module's `Changes` file mentioning the change.
* Run `mi6 build; mi6 test`.
* Commit all changes.
* Run `mi6 release` and accept (or increase) the version number offered by `mi6`.

# TODO

documentation

# SEE ALSO

<https://github.com/tokuhirom/Minilla>

<https://github.com/rjbs/Dist-Zilla>

# AUTHOR

Shoichi Kaji [skaji@cpan.org](mailto:skaji@cpan.org)

# COPYRIGHT AND LICENSE

Copyright 2015 Shoichi Kaji

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


## ff-circumflex-accent.md
ff^

Combined from primary sources listed below.

# [In Operators](#___top "go to top of document")[§](#(Operators)_infix_ff^ "direct link")

See primary documentation
[in context](/language/operators#infix_ff^)
for **infix ff^**.

```raku
sub infix:<ff^>(Mu $a, Mu $b)
```

Works like [ff](/routine/ff), except it does not return `True` for items matching the stop condition (including items that first matched the start condition).

```raku
my @list = <X A B C Y>;
say $_ if /A/ ff /C/ for @list;    # OUTPUT: «A␤B␤C␤»
say $_ if /A/ ff^ /C/ for @list;   # OUTPUT: «A␤B␤»
```

The sed-like version can be found in [fff^](/routine/fff$CIRCUMFLEX_ACCENT).

This operator cannot be overloaded, as it's handled specially by the compiler.


## dist_cpan-JGOFF-Grammar-Common.md
# Grammar-Common [Build Status](http://travis-ci.org/drforr/perl6-Grammar-Common)

# Grammar-Common

Common bits for grammars, such as math expressions.

All files here will be roles, rather than standalone grammars and actions.
Yes, simple actions are included that return simple hashes containing the parse
tree. You can override these as well, or simply include your own actions.

The test suite shows you how to return more complex objects - I elected not
to do this even though it does make quite a bit more sense because I didn't
want to arbitrary clutter the grammar namespace.

Read the individual Grammar::Common files for more documentation, but these
are generally meant to be dropped in with
'also does Grammar::Common::Expression::Infix;' and using the resulting
rule as you like.

In most cases default values will be provided, although I'm probably going to
go with C-style variables and values, just because adding a full Perl-style
expression encourages people to think it's reparsing Perl 6, but that's another
module.

# Installation

* Using zef (a module management tool bundled with Rakudo Star):

```
    zef update && zef install Grammar::Common

```

## Testing

To run tests:

```
    prove -e perl6

```

## Author

Jeffrey Goff, DrForr on #perl6, <https://github.com/drforr/>

## License

Artistic License 2.0


## concreterolehow.md
role Metamodel::ConcreteRoleHOW

Provides an implementation of a concrete instance of a role

```raku
    class Metamodel::ConcreteRoleHOW
        does Metamodel::Naming
        does Metamodel::Versioning
        does Metamodel::PrivateMethodContainer
        does Metamodel::MethodContainer
        does Metamodel::MultiMethodContainer
        does Metamodel::AttributeContainer
        does Metamodel::RoleContainer
        does Metamodel::MultipleInheritance
        does Metamodel::ArrayType
        does Metamodel::Concretization {}

```

*Warning*: this class is part of the Rakudo implementation, and is not a part of the language specification.

You can use this to build roles, in the same way that `ClassHOW` can be used to build classes:

```raku
my $a = Metamodel::ConcreteRoleHOW.new_type(name => "Bar");
$a.^compose;
say $a.^roles; # OUTPUT: «(Mu)␤»

```

The main difference with [`ClassHOW.new_type`](/type/Metamodel/ClassHOW#method_new_type) is that you can mix-in roles in this newly created one.

This class is Rakudo specific, and provided only for completeness. Not really intended to be used by the final user.


## dist_zef-martimm-Gnome-Gtk4.md
![](https://martimm.github.io/gnome-gtk3/content-docs/images/gtk-raku.png)

# Gnome::Gtk4 - Raku interface to the GTK toolkit

![L](http://martimm.github.io/label/License-label.svg)

# Description

This package holds the native object description as well as the interface description to connect to the Gnome libraries. This set of modules will never act on their own. They will be used by other packages such as `Gnome::Gtk4` and the like.

## Example

An example of a window showing two buttons is shown below. Its origin comes from the package **GTK::Simple** of Richard Hainsworth.

Some important things to note;

* It is important to add the `:api<2>` part to the module in the *use* statement to be sure you get the proper module. This is neccesary to prevent clashes with the older **Gnome::Gtk3** series of modules when you have installed them or when your application gets installed on some other machine. However, this set of repos only holds **Gnome::Gtk4** but the repos it depends on have the same names as before like **Gnome::Glib**, **Gnome::Gio** and **Gnome::GObject**. Those classes are all redone with the :api<2> tag. And, dunno, maybe the gtk3 gets added in the future.
* The instanciation of the classes in the `Gnome::*` `:api<2>` packages is changed compared to the `:api<1>` version. There is no `new()` (for most classes).

  The decision is made to follow the interface of the gnome libraries more strictly. Because of that, it is easier to look into examples written in C and translate it into Raku.

  The Raku new method only accepts named arguments, except when you tinker a bit with it, which I didn't want to do.

  E.g. the GtkWindow class has a `gtk_window_new()`. So it became `new-window()` and returns an instanciated object. Other examples like this are `new-label()` and `new-grid()`, with or without parameters. Other new functions are longer, e.g. Label has also `gtk_label_new_with_mnemonic()` which becomes `new-with-mnemonic()`.
* As with the :api<1> version, this version makes use of native types as used in the gnome libraries. An example of this is `gboolean` type which is mapped to some Raku native type in the **Gnome::N::GlibToRakuTypes** module.

### Initialization

Loading the modules needed for the application.

```
use Gnome::Glib::N-MainLoop:api<2>;

use Gnome::Gtk4::Button:api<2>;
use Gnome::Gtk4::Window:api<2>;
use Gnome::Gtk4::Grid:api<2>;

use Gnome::N::GlibToRakuTypes:api<2>;
use Gnome::N::N-Object:api<2>;

# Convenience shortened class names
constant Window = Gnome::Gtk4::Window;
constant Button = Gnome::Gtk4::Button;
constant Grid = Gnome::Gtk4::Grid;

my Gnome::Glib::N-MainLoop $main-loop .= new-mainloop( N-Object, True);

```

### Helper class to handle the events from the buttons

The first method `stopit()` is used to stop the application, triggered by a button on the decoration of the application. The second method `b1-press()` is called when the top button is pressed. After showing a message it will make the second button responsive and the top button is made insensitive. The third method `b2-press()` will also stop the program.

```
class SH {
  method stopit ( --> gboolean ) {
    say 'close request';
    $main-loop.quit;

    0
  }

  method b1-press ( Button() :_native-object($button1), Button :$button2 ) {
    say 'button1 pressed';
    $button2.set-sensitive(True);
    $button1.set-sensitive(False);
  }

  method b2-press ( ) {
    say 'button2 pressed';
    $main-loop.quit;
  }
}

# Instanciate the helper object
my SH $sh .= new;

```

### Building the GUI

First the two buttons are created. Registration of the signal is using the methods in the **SH** class. The first three parameters are obliged and the named arguments are optional.

```
with my Button $button2 .= new-with-label('Goodbye') {
  .register-signal( $sh, 'b2-press', 'clicked');
  .set-sensitive(False);
}

with my Button $button1 .= new-with-label('Hello World') {
  .register-signal( $sh, 'b1-press', 'clicked', :$button2);
}

```

Next, the buttons are placed in a grid. The grid gets a wide empty area around the buttons.

```
with my Grid $grid .= new-grid {
  .set-margin-top(30);
  .set-margin-bottom(30);
  .set-margin-start(30);
  .set-margin-end(30);

  .attach( $button1, 0, 0, 1, 1);
  .attach( $button2, 0, 1, 1, 1);
}

```

Finally the grid is placed in a window. It gets a title in the decoration of the window and the button action in the decoration to stop the application will be processed by `stopit()`.

```
with my Window $window .= new-window {
  .register-signal( $sh, 'stopit', 'close-request');
  .set-title('Hello GTK!');
  .set-child($grid);
  .show;
}

```

### Starting the application

To get everything visible and responsive we need to start the event loop. The call to `$main-loop.quit();` in two of the methods in the **SH** class will cause the program to return from this call.

```
$main-loop.run;

```

# Documentation

* [🔗 Website](https://martimm.github.io/)
* [🔗 License document](http://www.perlfoundation.org/artistic_license_2_0)
* [🔗 Release notes](https://github.com/MARTIMM/gnome-native/blob/master/CHANGES.md)
* [🔗 Issues](https://github.com/MARTIMM/gnome-source-skim-tool/issues)

# Installation

Use the following command to install `Gnome::Gtk4:api<2>` and all its dependencies.

```
zef install Gnome::Gtk4:api<2>

```

# Author

Name: **Marcel Timmerman**
Github account name: **MARTIMM**

# Issues

There are always some problems! If you find one please help by filing an issue at [my github project root](https://github.com/MARTIMM/gnome-source-skim-tool/issues).

# Attribution

* The inventors of Raku, formerly known as Perl 6, of course and the writers of the documentation which helped me out every time again and again.
* The builders of all the Gnome libraries and the documentation.
* Other helpful modules for their insight and use.


## dist_zef-melezhik-Sparrow6.md
# Sparrow

![SparkyCI](https://sparky.sparrowhub.io/badge/gh-melezhik-Sparrow6?foo=bar)

[Discord chat](https://discord.gg/ZMXSMFTK)

Sparrow is a Raku based automation framework. It's written on Raku and has Raku API.

Who might want to use Sparrow? People dealing with daily tasks varying from servers software installations/configurations to
cloud resources creation.

Sparrow could be thought as an alternative to existing configuration management
and provisioning tools like Ansible or Chef, however Sparrow is much broader and not limited to configuration
management only.

It could be seen as a generic automation framework enabling an end user quick and effective script development
easing some typical challenges along the road - such as scripts configurations, code reuse and testing.

# Sparrow Essential Features

* Sparrow is a language friendly framework. A user write underlying code on a language of their choice (see supported languages),
  and Sparrow glues all the code using Raku API within high level Sparrow scenarios.
* Sparrow has a command line API. A user can run scripts using command line API, at this point to *use* Sparrow one does not
  need to know any programming language at all.
* Sparrow is a script oriented framework. Basic low level building blocks in Sparrow are old good scripts.
  That makes Sparrow extremely effective when working with existing codebase written on many well known languages.
* Sparrow is a function oriented framework. Though users write underlying code as scripts, those scripts are called as
  Raku functions within high level scenarios.
* Sparrow has a repository of ready to use scripts or Sparrow plugins as they called in Sparrow. No need to code at all,
  just find a proper plugin and start using it. Sparrow repository could be easily deployed as public or private instances
  using just an Nginx web server.

# Install

```
zef install Sparrow6

```

# Supported languages

You can write underlying Sparrow tasks using following languages:

* Raku
* Perl5
* Ruby
* Python
* Bash
* Powershell
* [Golang](https://github.com/melezhik/sparrowgo)

All the languages have a *unified* Sparrow API easing script development, see Sparrow development guide.

# Documentation

## Sparrow Development Guide

Check out [documentation/development](https://github.com/melezhik/Sparrow6/blob/master/documentation/development.md) guide on how to develop Sparrow tasks
using Sparrow compatible languages.

## Raku API

Sparrow Raku API allows to run Sparrow tasks as Raku functions. One can use `task-run` function to run arbitrary Sparrow plugins or tasks. Or
choose Sparrow DSL to call a subset of Raku functions designed for most popular automation tasks.

### Task Run

Sparrow provides Raku API to run Sparrow tasks as functions:

```
task-run "run my build", "vsts-build", %(
  definition => "JavaApp"
);

```

Read more about Sparrow task runner at [documentation/taskrunner](https://github.com/melezhik/Sparrow6/blob/master/documentation/taskrunner.md).

### Sparrow DSL

Sparrow DSL allows one to run Sparrow tasks using even better Raku functions shortcuts. In comparison with `task-run` function, DSL provides input parameters
validation and dedicated function names. DSL is limited to a certain subset of Sparrow plugins:

```
#!raku

package-install "nginx";

service-restart "nginx";

bash "echo Hello World";

```

See a full list of DSL functions here - [documentation/dsl](https://github.com/melezhik/Sparrow6/blob/master/documentation/dsl.md).

## Plugins

Sparrow plugins are distributable scripts written on Sparrow compatible languages.

One could run plugins as Raku functions using Raku API or as command line utilities.

Check out [documentation/plugins](https://github.com/melezhik/Sparrow6/blob/master/documentation/plugins.md) for details.

## Repositories

Sparrow repositories store distributable Sparrow tasks packaged as plugins.

See [documentation/repository](https://github.com/melezhik/Sparrow6/blob/master/documentation/repository.md).

### Cli API

Sparrow provides a handy command line interface to run Sparrow tasks as command line.

Enter `s6` - Sparrow command line client and plugin manager.

You use `s6` to install, configure and run tasks as well as uploading tasks to repositories.

Check [documentation/s6](https://github.com/melezhik/Sparrow6/blob/master/documentation/s6.md) for details.

### Sparrow modules

Sparrow modules allow to write portable Sparrow scenarios distributed as Raku modules,
read more about it in [documentation/modules](https://github.com/melezhik/Sparrow6/blob/master/documentation/modules.md).

## Testing API

Sparrow provides it's way to write tests for tasks, making it is easy not only create scripts, but write tests for your script codebase.

### Task checks

Task checks is regexp based DSL to verify structured and unstructured text.

It allows to write *embedded* tests for user scripts verifying scripts output.

With task checks it's easy to develop scripts in TDD way or create black box testing test suites. See, for example, Tomty framework.

Read more about task checks at [documentation/taskchecks](https://github.com/melezhik/Sparrow6/blob/master/documentation/taskchecks.md).

### M10

METEN - is a Minimalist Embedded Testing Engine. You can "embed" test into task source code and conditionally run them.

The method is not of much use in favor of task checks approach.

Check out [documentation/m10](https://github.com/melezhik/Sparrow6/blob/master/documentation/m10.md) for details.

## Environment variables

Sparrow is configurable though some environment variables.

Check out [documentation/envvars](https://github.com/melezhik/Sparrow6/blob/master/documentation/envvars.md) documentation.

# Sparrow eco system

Sparrow eco system encompasses various tools and subsystems. Choose the one you need. All the tools are powered by Sparrow engine.

## Sparrowdo

Sparrow based configuration management tool.

Visit [Sparrowdo](https://github.com/melezhik/sparrowdo) GH project for details.

## Tomtit

Task runner and workflow management tool.

Visit [Tomtit](https://github.com/melezhik/tomtit) GH project for details.

## Tomty

Tomty is a Sparrow based test framework.

Visit [Tomty](https://github.com/melezhik/tomty) GH project for details.

## Sparky

Run Sparrow tasks in asynchronously and remotely.

Visit [Sparky](https://github.com/melezhik/sparky) GH project for details.

# Internal APIs

This section contains links to some internal APIs, which are mostly of interest for Sparrow developers:

* Sparrow6::Task::Repository API - [documentation/internal/repo-and-plugins-api](https://github.com/melezhik/Sparrow6/blob/master/documentation/internal/repo-and-plugins-api.md)

# Roadmap

Sparrow is not yet (fully) implemented, see [Roadmap](https://github.com/melezhik/Sparrow6/blob/master/Roadmap.md) to check a status.

# Examples

See `.tomty/` folder.

# Author

Alexey Melezhik

# Thanks to

God Who inspires me in my life!


## does.md
does

Combined from primary sources listed below.

# [In Type system](#___top "go to top of document")[§](#(Type_system)_trait_does "direct link")

See primary documentation
[in context](/language/typesystem#trait_does)
for **trait does**.

The trait `does` can be applied to roles and classes providing compile time mixins. To refer to a role that is not defined yet, use a forward declaration. The type name of the class with mixed in roles does not reflect the mixin, a type check does. If methods are provided in more than one mixed in role, the method that is defined first takes precedence. A list of roles separated by comma can be provided. In this case conflicts will be reported at compile time.

```raku
role R2 {...};
role R1 does R2 {};
role R2 {};
class C does R1 {};

say [C ~~ R1, C ~~ R2];
# OUTPUT: «[True True]␤»
```

For runtime mixins see [but](/language/operators#infix_but) and [does](/language/operators#infix_does).

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

See primary documentation
[in context](/type/Mu#routine_does)
for **routine does**.

```raku
method does(Mu $type --> Bool:D)
```

Returns `True` if and only if the invocant conforms to type `$type`.

```raku
my $d = Date.new('2016-06-03');
say $d.does(Dateish);             # OUTPUT: «True␤»    (Date does role Dateish)
say $d.does(Any);                 # OUTPUT: «True␤»    (Date is a subclass of Any)
say $d.does(DateTime);            # OUTPUT: «False␤»   (Date is not a subclass of DateTime)

```

Unlike [`isa`](/routine/isa#(Mu)_routine_isa), which returns `True` only for superclasses, `does` includes both superclasses and roles.

```raku
say $d.isa(Dateish); # OUTPUT: «False␤»

```

Using the smartmatch operator [~~](/routine/~~) is a more idiomatic alternative.

```raku
my $d = Date.new('2016-06-03');
say $d ~~ Dateish;                # OUTPUT: «True␤»
say $d ~~ Any;                    # OUTPUT: «True␤»
say $d ~~ DateTime;               # OUTPUT: «False␤»
```

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

See primary documentation
[in context](/language/operators#infix_does)
for **infix does**.

```raku
sub infix:<does>(Mu $obj, Mu $role) is assoc<non>
```

Mixes `$role` into `$obj` at runtime. Requires `$obj` to be mutable.

Similar to [but](/routine/but) operator, if `$role` supplies exactly one attribute, an initializer can be passed in parentheses.

Similar to [but](/routine/but) operator, the `$role` can instead be an instantiated object, in which case, the operator will create a role for you automatically. The role will contain a single method named the same as `$obj.^name` and that returns `$obj`:

```raku
my $o = class { method Str { "original" } }.new;
put $o;            # OUTPUT: «original␤»
$o does "modded";
put $o;            # OUTPUT: «modded␤»
```

If methods of the same name are present already, the last mixed in role takes precedence.


## dist_zef-coke-App-Zef-Deps.md
# Overview

`zef-deps` is a script to report on module dependencies for raku.

Given a list of package names on the command line, generate a listing of all
dependencies, direct and indirect.

# Usage

```
% zef-deps App::Cal
App::Cal
    Terminal::ANSIColor
    Test::Differences
        Data::Dump
        Text::Diff
            Algorithm::Diff
                Test
            Test
            Text::Tabs

```

The indent level shows the nesting of dependencies. So in this example, `App::Cal` depends
on `Test::Differences`, which in turn depends on `Data::Dump`. Both `Algorithm::Diff` and
`Text::Diff` depend on `Test`.

Multiple packages can be specified on the command line.

If a single name of `.` is specified, `zef-deps` will instead read the local
`META6.json` and use the `depends` attribute as the list of packages.

In the default textual output, repeated dependencies anywhere in the hierarchy are replaced with `...`.

# Options

`--json` generates JSON output for the dependencies.

`--png` generates a `png` file showing dependencies using `dot`. To use this option,
you must install the optional module `Uxmal`. When run with this option, a file is generated in a temp
directory and the path to the file is printed as the only non-debug output.

# Environment variables

## ZEF\_DEPS\_INDENT

Indenting defaults to 4 spaces but can be overridden by setting this environment variable to
the number of desired spaces.


## dist_zef-raku-community-modules-Math-Symbolic.md
[![Actions Status](https://github.com/raku-community-modules/Math-Symbolic/actions/workflows/linux.yml/badge.svg)](https://github.com/raku-community-modules/Math-Symbolic/actions) [![Actions Status](https://github.com/raku-community-modules/Math-Symbolic/actions/workflows/macos.yml/badge.svg)](https://github.com/raku-community-modules/Math-Symbolic/actions) [![Actions Status](https://github.com/raku-community-modules/Math-Symbolic/actions/workflows/windows.yml/badge.svg)](https://github.com/raku-community-modules/Math-Symbolic/actions)

# NAME

Math::Symbolic - Symbolic math for Raku

# SYNOPSIS

Either of

```
symbolic --m=1 --b=0 'y=m*x+b' x

```

on the command line, or

```
say Math::Symbolic.new("y=m*x+b").isolate("x").evaluate(:m(1), :b(0));

```

in Raku code, will print

```
x=y

```

# DESCRIPTION

This is a Raku symbolic math module. It parses, manipulates, evaluates, and outputs mathematical expressions and relations. This module is PRE-ALPHA quality.

# USAGE

## Command line

A basic command line program named 'symbolic' is provided.

It takes at least one positional argument: the relation or expression to work with. If a second positional is passed, it is the name of the variable to isolate in the given relation (non-relation expressions are unsupported for isolation). If "0" is passed instead of a variable name, the relation is arranged with 0 on the right side and terms grouped by variable (when possible) on the left side.

If any named args are passed, they are substituted into the expression for the variables they name. Each named argument's value is parsed as an expression itself, so it doesn't just have to be a numeric value to give the variable.

The resulting expression will be printed after applying all requested transformations, and attempting to simplify.

## API

At the time of this writing, most of the API is too unstable to document yet. To minimize exposure to the internal chaos and to provide a starting point for thinking about what functionality needs to exist in a more formal future API, a minimal temporary public interface is implemented as a small collection of simple methods in the main `Math::Symbolic` class. Note that where the actual signatures differ from what is documented here, the undocumented differences are considered "private", and may not do what is expected.

# METHODS

## .new(Str:D $expression)

Creates a new `Math::Symbolic` object, initialized with the tree resulting from a parse of $expression (which may also be a relation; currently only "=" equality is supported for relations).

## .clone()

Returns a clone of the object with an independent copy of the tree structure. This is important because all manipulations (below) are done in place, and cloning avoids the parsing overhead of .new().

## .isolate(Str:D $var)

Arranges a relation with $var on the left and everything else on the right. Or attempts to. It supports simple operation inversion when only one instance of a variable exists, as well as attempting to combine instances via distributive property and/or factoring of polynomial expressions, if necessary. Calling `.isolate` on a non-relation expression is not supported.

## .evaluate(\*%values)

Replaces all instances of variables named by the keys of the hash, with the expressions in the values of the hash, and simplifies the result as much as possible (see `.simplify`). If the resulting expression has no variables, this means it can be fully evaluated down to a single value.

Note that fully evaluating an equation with valid values would result in something mostly unhelpful like "0=0" if the simplifier is smart enough. Though in the future, when such a relation can be evaluated for truth, that will become useful.

## .simplify()

Makes a childish attempt to reduce the complexity of the expression by evaluating operations on constants, removing operations on identity values (and eventually other special cases like 0, inverse identity, etc). Also already does a very small number of rearrangements of combinations of operations, like transforming a+-b into a-b.

`.simplify` is sometimes called after certain manipulations like `.isolate` and `.poly` which might otherwise leave messy expressions e.g. operations with identity values and awkward forms of negation and inversion. It is also called at the end of the command line tool for output of the final result.

## .poly(Str $var?)

Attempts to arrange the equation/expression in polynomial form. If $var is given, terms are grouped for that specific variable. Otherwise terms are grouped separately according to the set of all variables in a term. For example "x²+x²\*y" will be unchanged by `.poly()`, but `.poly('x')` will rearrange it to something like "x²\*(1+y)". Unlike the formal definition of a polynomial, this function may accept and return any expression for coefficients, and allows for exponents of any constant value.

If `.poly` is called on a relation, it is first arranged so that the right side is equal to zero, before grouping terms on the left. An attempt is made to guess which side should be subtracted from the other to avoid ending up with an excessive amount of negation.

## .expression(Str:D $var)

Creates a new `Math::Symbolic` object from the expression on the right-hand side of a relation after isolating $var on the left. Note that unlike the above transformations, no changes are made to the original object.

## .compile($positional = False, $defaults?)

Returns a Raku subroutine which is mathematically equivalent to the `Math::Symbolic` expression. Not all operations are currently supported. Compiling relations is also undefined behavior at this time.

All arguments are named by default. If $positional is True, all arguments are positional instead, sorted in default Raku sort order. If $positional is itself a Positional class then only the listed variables will be taken positionally, in the specified order.

All arguments are also required by default. If $defaults is an Associative object, it is taken as a map of variable names to default values, and the listed variables will be optional. If $defaults is any other defined value, that value is taken as the default for all arguments.

## .routine($positional = False, $defaults?)

Identical to `.compile (above)`, but returns the code as a string without compiling via `EVAL`, for instance to embed the code into another module or script.

## .count()

Returns the number of nodes in the expression's tree. This could be useful to determine if an expression has been fully evaluated, or used as a crude complexity metric.

## .dump\_tree()

Prints out the tree structure of the expression. This really should return the string instead, and perhaps be renamed.

## .Str()

Returns the expression re-assembled into a string by the same syntactic constructs which govern parsing. As with all Raku objects, this is also the method which gets called when the object is coerced to a string by other means, e.g. interpolation, context, or the ~ prefix. The `.gist` method is also handled by this routine, for easy printing of a readable result.

Passing the result of `.Str` back in to `.new` should always yield a mathematically equivalent structure (exact representation may vary by some auto-simplification), giving the same type of round-trip characteristics to expressions that `.raku` and `EVAL()` provide for Raku objects. This allows a user to, for instance, isolate a variable in an equation, then plug the result in to `.evaluate` for that variable in a different equation, all with the simplicity of strings; no additional classes or APIs for the user to worry about (albeit at a steep performance penalty).

## .Numeric()

Returns the expression coerced first to a string (see above), then to a number. This will fail if the expression hasn't already been evaluated or simplified (see further above) to a single constant value. As with all Raku objects, this is also the method which gets called when the object is coerced to a number by other means, e.g. context or the + prefix.

# SYNTAX AND OPERATIONS

All whitespace is optional. Implicit operations, e.g. multiplication by putting two variables in a row with no infix operator, are not supported, and likely never will be. It leads to far too many consequences, compromises, complexities and non-determinisms.

The available operations and syntax in order of precedence are currently:

```
* Terms
    * Variables
        * valid characters for variable names are alphanumerics and underscore
        * first character must not be a number, mainly to avoid collisions with
        E notation (see below)
    * Values
        * optional sign (only "-" for now)
        * E notation supported
            * case insensitive
            * no restriction on value of exponent, with sign and decimal
            * subexpressions not supported (e is numeric syntax, not an op)
        * leading zeros before decimals not required
        * imaginary, complex, quaternion, etc NYI
        * vector, matrix, set, etc NYI
* Circumfix
    * () Grouping Parens
    * || Absolute Value
        * cannot invert this op for solving/manipulating, ± NYI
* Postfix
    * ! Factorial
        * syntax only, no functional implementation
    * ² Square (same as ^ 2)
* Prefix
    * - Negate (same as * -1)
    * √ Square Root (same as ^ .5)
* Infix Operation
    * Power
        * ^ Exponentiation, like raku's **
            * mathematical convention dictates that this operation be chained
            right-to-left, which is NYI
        * √ Root, n√x is the same as x^(1/n)
            * evaluates to positive only (± NYI)
            * imaginary numbers NYI
            * ^/ is a Texan variant of √ with the operands reversed
                * x^/n is the same as x^(1/n) or n√x
        * Logarithms are NYI, so no solving for variables in exponents yet
    * Scale
        * * Multiplication
        * / Division
    * Shift
        * + Addition
        * - Subtraction
* Infix Relation
    * = Equality is currently the only relation supported
        * this is really because proper relations are more-or-less NYI
    * note that relations are optional in the input string, it automatically
    detects whether it is working with an expression or a relation
        * really it just breaks if you call 'solve' on an expression ATM

```

## BUGS

Many, in all likelihood. Patches graciously accepted.

# AUTHOR

raydiak

# COPYRIGHT AND LICENSE

Copyright 2014 - 2021 raydiak

Copyright 2025 Raku Community

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


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

# NAME

Abbreviations - Provides abbreviations for an input set of one or more words

# SYNOPSIS

```
use Abbreviations;
my $words = 'A ab Abcde';
# The main exported routine:
my %abbrevs = abbreviations $words;
say %abbrevs.gist;
# OUTPUT: «{A => A, Abcde => Ab, ab => a}␤»

```

# DESCRIPTION

**Abbreviations** is a module with one automatically exported subroutine, `abbreviations`, which takes as input a set of words and returns the original set with added unique abbreviations for the set. (Note the input words are also abbreviations in the context of this module.)

Its signature:

```
sub abbreviations($word-set,      #= Str, List, or Hash (Set)
                 :$out-type = HA, #= the default, HashAbbrev
                 :$lower-case,    #= convert the word st to lowercase
                 :$min-length,    #= minimum abbreviation length
                 ) is export {...}

```

A *word* satisfies the Raku regex `$word ~~ /\S+/` which is quite loose. Using programs can of course further restrict that if need be. For example, for use with module **Opt::Handler** words must satisfy this regex: `$word ~~ /<ident>/`.

## A regex alternation for single-word sets

A natural consequence of generating all the abbreviations for a set of one word is this: the output provides a regex alternation which matches any partial length of the target word. For example, given a target word 'Args':

```
use Abbreviations;
use Test;
my $target = "Args";
my $regex = abbrev $target; # OUTPUT: «"A|Ar|Arg|Args"␤»;
my $res = False;
my @w = $regex.split('|');
for @w {
    when /<$regex>/ {
        $res = True
    }
    default {
        $res = False
    }
}
is $res, True; # OUTPUT: «ok 1␤»

```

As shown in the example above, limiting the input set to one word results in the output of a regex alternation string. The rest of this description applies to sets of two or more words.

## Abbrevians for multiple-word sets

The input multiple-word set can be in one of three forms: (1) a list (recommended), (2) a string containing the words separated by spaces, or (3) as a hash (or set) with the words being keys of the hash (set members). Duplicate words will be automatically and quietly eliminated.

Note the input word set will not be modified unless the `:lower-case` option is used. In that case, all characters will be transformed to lower-case and any new duplicate words deleted.

If the user wishes, he or she can restrict the minimum length of the generated abbreviations by using the `:$min-length` parameter.

One will normally get the result as a hash with the input words as keys with their shortest abbreviation as values (return type HA), but the return type can be specified via `enum Out-type` if desired by selecting one of the `:$output-type` options. For example:

```
my %abbrevs = abbrevs @words, :output-type(AH);

```

There are two shorter alias names for `sub abbreviations` one can use that are always exported:

```
 abbrevs
 abbrev

```

In the sprit of the module, one can `use Abbreviations :ALL;` and have these additional shorter alias names available:

```
 abbre
 abbr
 abb
 ab
 a

```

Each of those is individually available by adding its name as an adverb, for example:

```
use Abbreviations :abb;
my %abb = abb $words;

```

### `enum Out-type`

```
enum Out-type is export <HA H AH AL L S >;

```

The *enum* `Out-type` is exported automatically as it is required for using `sub abbreviations`. It has the following types:

* `HA` (HashAbbrev)

The default *HashAbbrev* (`HA`) returned will have input words as keys whose value will be the shortest valid abbreviation.

* `H` (Hash)

A variant of `HA`, the *Hash* (`H`) returned will have input words as keys whose value will be a sorted list of its valid abbreviations (sorted by length, shortest first, then by `Str` order).

* `AH` (AbbrevHash)

An *AbbrevHash* (`AH`) is keyed by all of the valid abbreviations for the input word list and whose values are the word from which that abbreviation is defined.

* `AL` (AbbrevList)

An *AbbrevList* (`AL`) is special in that the returned list is the one, shortest abbreviation for each of the input words in input order. For example,

```
my @w = <Monday Tuesday Wednesday Thursday Friday Saturday Sunday>;
my @abb = abbrevs @w, :output-type(AL);
say @abb; # OUTPUT: «M Tu W Th F Sa Su␤»

```

Note that a hash (or set) input type will not reliably provide this output as expected since the keys are not stored in order. Instead, the ouput will be based on a list of the hash's keys. In effect, entering `%out = abbreviations %in` is the same as:

```
my @inputlist = %in.keys.sort({.chars, .Str}';
my %out = abbreviations @inputlist;

```

* `L` (List)

A *List* (`L`) contains all of the valid abbreviations for the input word list, including the words themselves, sorted by length, then character order.

* `S` (String)

A *String* (`S`) is the string formed by joining the *List* by a single space between words.

### Improved abbreviation search

The abbreviation algorithm has been improved from the original (as found on <https://rosettacode.org>) in the following way: The input word set is formed into subgroups comprised of each input word. Abbreviations are created for each word, abbreviations shared by two or words are eliminated, then all those abbreviations are combined into one set. The result will be the largest possible set of unique abbreviations for a given input word set.

For example, given an input set consisting of the words `A ab Abcde`, the default output hash of abbreviations (with the original words as keys) contains a total of seven abbreviations:

```
    A     => ['A'],
    ab    => ['a', 'ab'],
    Abcde => ['Ab', 'Abc', 'Abcd', 'Abcde'],

```

If the `:lower-case` option is used, we get a slightly different result since we have fewer unique abbreviations from the lower-cased words. The new hash has only five abbreviations:

```
my $words = 'A ab Abcde':
my %abbr = abbrevs $words, :lower-case;

```

The result is

```
    a     => ['a'],
    ab    => ['ab],
    abcde => ['abc', 'abcd', 'abcde'],

```

Notice the input word **ab** now has only one abbreviation and **abcde** has only three.

## Other exported symbols

### `sub sort-list`

```
sub sort-list(@list, :$type = SL, :$reverse --> List) is export(:sort)
{...}

```

By default, this routine sorts all lists by word length, then by Str order. The order by length is by the shortest abbreviation first unless the `:$reverse` option is used. This is the routine used for all the output types produced by this module *except* the *AbbrevList* (`AL`) which keeps the original word set order.

The routine's output can be modified for other uses by entering the `:$type` parameter to choose another of the s.

### `enum Sort-type`

```
enum Sort-type is export(:sort) < SL LS SS LL N>;

```

The `Sort-type`s are:

* SL - order by Str, then order by Length
* LS - order by Length, then order by Str
* SS - Str order only
* LL - Length order only
* N - Numerical order only (falls back to SS if any words are not numbers)

# AUTHOR

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

# CREDITS

* Leon Timmermans (aka @Leont) for inspiration from his Raku module `Getopt::Long`.
* @thundergnat, the original author of the Raku `auto-abbreviate` algorithm on [Rosetta Code](http://rosettacode.org/wiki/Abbreviations,_automatic#Raku).
* The Raku community for help with subroutine signatures.

# COPYRIGHT and LICENSE

Copyright © 2020-2023 Tom Browder

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


## vm.md
class VM

Raku Virtual Machine related information

```raku
class VM does Systemic { }
```

Built-in class for providing information about the virtual machine in which Raku is running. Usually accessed through the [$\*VM](/language/variables#index-entry-%24*VM) dynamic variable.

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

## [method osname](#class_VM "go to top of document")[§](#method_osname "direct link")

```raku
multi method osname(VM:U:)
multi method osname(VM:D:)
```

Instance / Class method returning the name of the Operating System, as known by the configuration of the VM object / currently running virtual machine.

## [method precomp-ext](#class_VM "go to top of document")[§](#method_precomp-ext "direct link")

Instance method returning a string of the extension that should be used for precompiled files of the VM object.

## [method precomp-target](#class_VM "go to top of document")[§](#method_precomp-target "direct link")

Instance method returning a string of the value of the compilation target that should be used when precompiling source-files with the VM object.

## [method prefix](#class_VM "go to top of document")[§](#method_prefix "direct link")

Instance method returning a string of the path in which the virtual machine of the VM object is installed.

## [method request-garbage-collection](#class_VM "go to top of document")[§](#method_request-garbage-collection "direct link")

Available as of the 2020.05 release of the Rakudo compiler.

Class method that tells the virtual machine on which Raku is running, to perform a garbage collect run when possible. Issues a warning if such a request is not supported by the virtual machine.

Provides no guarantee that the process will actually use less memory after a garbage collect. In fact, calling this method repeatedly, may actually cause more memory to be used due to memory fragmentation.

Mainly intended as a debugging aid for module / core developers.

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

Type relations for `VM`

raku-type-graph

VM
VM

Any
Any

VM->Any

Systemic
Systemic

VM->Systemic

Mu
Mu

Any->Mu

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


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

# NAME

Benchmark - Simple benchmarking

# SYNOPSIS

```
use Benchmark;

my ($start, $end, $diff, $avg) = timethis(1000, "code");
my @stats = timethis(1000, sub { #`( code ) });
say @stats;

my %results = timethese 1000, {
    "foo" => sub { ... },
    "bar" => sub { ... },
};
say ~%results;

```

# DESCRIPTION

A simple benchmarking module with an interface similar to Perl's `Benchmark.pm`. However, rather than output results to `$*OUT`, the results are merely returned so that you can output them however you please.

You can also have some basic statistics:

```
use Benchmark;

%result = timethis(10, { sleep rand }, :statistics);
say %result;
say "$_ : %result{$_}" for <min median mean max sd>;

my %results = timethese 5, {
    "foo" => { sleep rand },
    "bar" => { sleep rand },
}, :statistics;
say ~%results;

```

# AUTHOR

Jonathan Scott Duff

# COPYRIGHT AND LICENSE

Copyright 2009 - 2016 Jonathan Scott Duff

Copyright 2017 - 2023 Raku Community

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


## dist_cpan-JNTHN-Cro-WebSocket.md
# Cro::WebSocket Build Status

This is part of the Cro libraries for implementing services and distributed
systems in Raku. See the [Cro website](http://cro.services/) for further
information and documentation.


## dist_zef-l10n-L10N-IT.md
# NAME

L10N::IT - Italian localization of Raku

# SYNOPSIS

```
use L10N::IT;
dillo "Hello World";

```

# DESCRIPTION

L10N::IT contains the logic to provide a Italian localization of the Raku Programming Language.

# AUTHORS

JJ Merelo

# COPYRIGHT AND LICENSE

Copyright 2023 Raku Localization Team

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


## gather-take.md
gather take

Combined from primary sources listed below.

# [In Control flow](#___top "go to top of document")[§](#(Control_flow)_gather_take_gather_take "direct link")

See primary documentation
[in context](/language/control#gather/take)
for **gather/take**.

`gather` is a statement or block prefix that returns a [sequence](/type/Seq) of values. The values come from calls to [take](/type/Mu#routine_take) in the dynamic scope of the `gather` code. In the following example, we implement a subroutine to compute the factors of an integer with `gather` (note that the factors are not generated in order):

```raku
sub factors( Int:D \n ) {
    my $k = 1;
    gather {
        while $k**2 < n {
            if n %% $k {
                take $k;
                take n div $k;
            }
            $k++;
        }
        take $k if $k**2 == n;
    }
}

say factors(36); # OUTPUT: «1, 36, 2, 18, 3, 12, 4, 9, 6␤»
```

The `gather/take` combination can generate values lazily, depending on context. Binding to a scalar or sigilless container will force laziness. If you want to force lazy evaluation use the [lazy](/type/Iterable#method_lazy) subroutine or method. For example:

```raku
my @vals = lazy gather {
    take 1;
    say "Produced a value";
    take 2;
}
say @vals[0];
say 'between consumption of two values';
say @vals[1];

# OUTPUT:
# 1
# between consumption of two values
# Produced a value
# 2
```

`gather/take` is scoped dynamically, so you can call `take` from subs or methods that are called from within `gather`:

```raku
sub weird(@elems, :$direction = 'forward') {
    my %direction = (
        forward  => sub { take $_ for @elems },
        backward => sub { take $_ for @elems.reverse },
        random   => sub { take $_ for @elems.pick(*) },
    );
    return gather %direction{$direction}();
}

say weird(<a b c>, :direction<backward> );          # OUTPUT: «(c b a)␤»
```

If values need to be mutable on the caller side, use [take-rw](/type/Mu#routine_take-rw).

Note that the [`Seq`](/type/Seq) created by `gather/take` may be coerced to another type. An example with assignment to a hash:

```raku
my %h = gather { take "foo" => 1; take "bar" => 2};
say %h;                   # OUTPUT: «{bar => 2, foo => 1}␤»
```

**Note**: `gather/take` must not be used to collect results from `react/whenever`. The `whenever` block is not run from the thread that runs the `gather/react`, but the thread that runs the `emit`. On this thread, there is no handler for the control exception thrown by `take`, causing it to error out.


## is.md
is

Combined from primary sources listed below.

# [In module Test](#___top "go to top of document")[§](#(module_Test)_sub_is "direct link")

See primary documentation
[in context](/type/Test#sub_is)
for **sub is**.

```raku
multi is(Mu $got, Mu:U $expected, $desc = '')
multi is(Mu $got, Mu:D $expected, $desc = '')
```

Marks a test as passed if `$got` and `$expected` compare positively with the [`eq` operator](/routine/eq), unless `$expected` is a type object, in which case [`===` operator](/routine/===) will be used instead; accepts an optional description of the test as the last argument.

**NOTE:** the `eq` operator stringifies its operands, which means `is()` is not a good function for testing more complex things, such as lists: `is (1, (2, (3,))), [1, 2, 3]` passes the test, even though the operands are vastly different. For those cases, use [`is-deeply` routine](#sub_is-deeply)

```raku
my $pdf-document; sub factorial($x) { ... }; ...;
is $pdf-document.author, "Joe", 'Retrieving the author field';
is factorial(6),         720,   'Factorial - small integer';
my Int $a;
is $a, Int, 'The variable $a is an unassigned Int';

```

**Note:** if *only* whitespace differs between the values, `is()` will output failure message differently, to show the whitespace in each values. For example, in the output below, the second test shows the literal `\t` in the `got:` line:

```raku
is "foo\tbar", "foo\tbaz";   # expected: 'foo     baz'␤#      got: 'foo   bar'
is "foo\tbar", "foo    bar"; # expected: "foo    bar"␤#      got: "foo\tbar"

```

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

See primary documentation
[in context](/language/traits#The_is_trait)
for **The is trait**.

```raku
proto trait_mod:<is>(Mu $, |) {*}
```

`is` applies to any kind of scalar object, and can take any number of named or positional arguments. It is the most commonly used trait, and takes the following forms, depending on the type of the first argument.


## dist_zef-Altai-man-Slang-Kazu.md
[![Build Status](https://travis-ci.org/Altai-man/Slang-Kazu.svg?branch=master)](https://travis-ci.org/Altai-man/Slang-Kazu)

# NAME

Slang::Kazu - Japanese numerals in your Perl 6

# SYNOPSIS

```
use Slang::Kazu;
say "3542" ~~ 三千五百四十二; # True
say '一' ~~ /<single-kazu>/; # Will match any digit from 1 to 9

```

# DESCRIPTION

Slang::Kazu is a Perl 6 slang that allows you to use a subset of native Japanese numerals in your Perl 6 code because you can.

You can use numbers from 1 to 99999. Counters are yet to be implemented. Mostly this is a clone of [drforr's](http://github.com/drforr) `Slang::Roman`, but for Japanese numerals - all thanks to him for the idea and the implementation.

Currently, incorrect numbers like `二二` are evaluated to `Nil` and you will see some scary errors because of that, so don't lose your kanji!

This project is just a joke and doesn't intented to be used in any serious codebases! You are warned.

# AUTHOR

Altai-man on Github, you can cast sena\_kun on freenode too.

# COPYRIGHT AND LICENSE

Copyright ©

License GPLv3: The GNU General Public License, Version 3, 29 June 2007 <https://www.gnu.org/licenses/gpl-3.0.txt>

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.


## dist_github-grondilu-EC.md
![Sparky](https://sparky.sparrowhub.io/badge/grondilu-elliptic-curves-raku?foo=bar)

# Elliptic Curves Cryptography in raku

secp256k1 and ed25519 in [raku](http://raku.org)

## Synopsis

```
{
    use secp256k1;

    say G;
    say $_*G for 1..10;

    use Test;
    is 35*G + 5*G, 40*G;
}

{
    use ed25519;

    # create a key
    # - randomly :
    my ed25519::Key $key .= new;
    # - from a seed :
    my blob8 $secret-seed .= new: ^256 .roll: 32;
    my ed25519::Key $key .= new: $secret-seed;

    # use key to sign a message
    my $signature = $key.sign: "Hello world!";

    # verify signature
    use Test;
    lives-ok { ed25519::verify "foo", $key.sign("foo"), $key.point };
    dies-ok  { ed25519::verify "foo", $key.sign("bar"), $key.point };
}

```

## References

* [RFC 8032](http://www.rfc-editor.org/info/rfc8032)
* Jacobian coordinates:
  * [WikiBooks entry](https://en.wikibooks.org/wiki/Cryptography/Prime_Curve/Jacobian_Coordinates)
  * [hyperelliptic.org page](http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html)
* Chalkias, Konstantinos, et. al. ["Taming the many EdDSAs."](https://eprint.iacr.org/2020/1244.pdf) *Security Standardisation Research Conference*, Dec. 2020


## dist_zef-jonathanstowe-Lumberjack-Dispatcher-Syslog.md
# Lumberjack::Dispatcher::Syslog

A Syslog dispatcher for the Lumberjack logger

![Build Status](https://github.com/jonathanstowe/Lumberjack-Dispatcher-Syslog/workflows/CI/badge.svg)

## Synopsis

```

    use Lumberjack;
    use Lumberjack::Dispatcher::Syslog;

    # Add the syslog dispatcher
    Lumberjack.dispatchers.append: Lumberjack::Dispatcher::Syslog.new;

    class MyClass does Lumberjack::Logger {
       method start() {
           self.log-info("Starting ...");
           ...
       }

       method do-stuff() {
          self.log-debug("Doing stuff ...");
          ...
          if $something-went-wrong {
             self.log-error("Something went wrong");
          }
       }
       method stop() {
           ...
           self.log-info("Stopped.");
       }
    }

    MyClass.log-level = Lumberjack::Debug;

```

## Description

This provides a dispatcher for
[Lumberjack](https://github.com/jonathanstowe/Lumberjack) which allows
you to log to your system's `syslog` facility, this may log to various
log files in, for instance, `/var/log` depending on the configuration
of the syslog daemon. Because the actual logging daemon being used
may differ from system to system (there is syslog-ng, rsyslog, syslog
"classic" etc,) you will need to refer to the local documentation or
a system administrator to determine the actual logging behaviour. Some
systems may for instance just drop "debug" or "trace" messages in the
default configuration (or put them in separate files.)

## Installation

Assuming you have got a working installation of Rakudo you should be able to install this with *zef*:

```
zef install Lumberjack::Dispatcher::Syslog

```

Or if you have a local clone of the code:

```
zef install .

```

## Support

This in itself is very simple, it is likely that the configuration of
the syslog itself is more of a challenge and you should refer to the
configuration or documentation of the local syslog installation in
the first instance if things aren't being logged as you expect. You
may also want to check the documentation for Lumberjack itself as
well as Log::Syslog::Native which this uses to send the messages.

If you have any problems or suggestions for the module itself then
please feel free to post at <https://github.com/jonathanstowe/Lumberjack-Dispatcher-Syslog/issues>

## Licence and copyright

This is free software. Please see the <LICENCE> file in the repository.

© Jonathan Stowe, 2016 - 2021


## dist_zef-jonathanstowe-EventSource-Server.md
# EventSource::Server

A simple handler to provide Server Sent Events from Raku applications

![Build Status](https://github.com/jonathanstowe/EventSource-Server/workflows/CI/badge.svg)

## Synopsis

This sends out an event with the DateTime string every second

```
use EventSource::Server;
use HTTP::Server::Tiny;

my $supply = Supply.interval(1).map( { EventSource::Server::Event.new(type => 'tick', data => DateTime.now.Str) } );

my &es = EventSource::Server.new(:$supply);

HTTP::Server::Tiny.new(port => 7798).run(&es)

```

Or using Cro:

```
use EventSource::Server;

use Cro::HTTP::Router;
use Cro::HTTP::Server;

my $supply = Supply.interval(1).map( { EventSource::Server::Event.new(type => 'tick', data => DateTime.now.Str) } );

my $es = EventSource::Server.new(:$supply);

my $app = route {
    get -> {
        content 'text/event-stream', $es.out-supply;
    }
};

my Cro::Service $tick = Cro::HTTP::Server.new(:host<localhost>, :port<7798>, application => $app);

$tick.start;

react whenever signal(SIGINT) { $tick.stop; exit; }

```

And in some Javascript program somewhere else:

```
var EventSource = require('eventsource');

var v = new EventSource(' http://127.0.0.1:7798');

v.addEventListener("tick", function(e) {
    console.info(e);

}, false);

```

See also the [examples directory](examples) in this distribution.

## Description

This provides a simple mechanism for creating a source of [Server Sent Events](https://www.w3.org/TR/eventsource/) in a
web server application.

The EventSource interface is implemented by most modern web browsers and
provides a lightweight alternative to Websockets for those applications
where only a uni-directional message is required (for example for
notifications,)

## Installation

Assuming you have a working installation of Rakudo with `zef` installed then you should be able to install this with:

```
zef install EventSource::Server

```

If you want to install this from a local copy substitute the distribution
name for the path to the local copy.

## Support

This is quite a simple module but is fairly difficult to test well without
bringing in a vast array of large and otherwise un-needed modules, so
I won't be surprised there are bugs, similarly whilst I have tested for
interoperability with the Javascript hosts that I have available to me
I haven't tested against every known host that provides the EventSource
interface.

So please feel free to report any problems (or make suggestions,) to
<https://github.com/jonathanstowe/EventSource-Server/issues>

## Copyright and Licence

This is free software, please see the <LICENCE> file in the
distribution.

© Jonathan Stowe 2017 - 2021


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

# NAME

Raku port of Perl's defined() / undef() built-ins

# SYNOPSIS

```
use P5defined;

my $foo = 42;
given $foo {
    say defined();  # True
}

say defined($foo);  # True

$foo = undef();
undef($foo);

```

# DESCRIPTION

This module tries to mimic the behaviour of Perl's `defined` and `undef` built-ins as closely as possible in the Raku Programming Language.

# ORIGINAL PERL 5 DOCUMENTATION

```
defined EXPR
defined Returns a Boolean value telling whether EXPR has a value other
        than the undefined value "undef". If EXPR is not present, $_ is
        checked.

        Many operations return "undef" to indicate failure, end of file,
        system error, uninitialized variable, and other exceptional
        conditions. This function allows you to distinguish "undef" from
        other values. (A simple Boolean test will not distinguish among
        "undef", zero, the empty string, and "0", which are all equally
        false.) Note that since "undef" is a valid scalar, its presence
        doesn't necessarily indicate an exceptional condition: "pop"
        returns "undef" when its argument is an empty array, or when the
        element to return happens to be "undef".

        You may also use "defined(&func)" to check whether subroutine
        &func has ever been defined. The return value is unaffected by any
        forward declarations of &func. A subroutine that is not defined
        may still be callable: its package may have an "AUTOLOAD" method
        that makes it spring into existence the first time that it is
        called; see perlsub.

        Use of "defined" on aggregates (hashes and arrays) is deprecated.
        It used to report whether memory for that aggregate had ever been
        allocated. This behavior may disappear in future versions of Perl.
        You should instead use a simple test for size:

            if (@an_array) { print "has array elements\n" }
            if (%a_hash)   { print "has hash members\n"   }

        When used on a hash element, it tells you whether the value is
        defined, not whether the key exists in the hash. Use "exists" for
        the latter purpose.

        Examples:

            print if defined $switch{D};
            print "$val\n" while defined($val = pop(@ary));
            die "Can't readlink $sym: $!"
                unless defined($value = readlink $sym);
            sub foo { defined &$bar ? &$bar(@_) : die "No bar"; }
            $debugging = 0 unless defined $debugging;

        Note: Many folks tend to overuse "defined" and are then surprised
        to discover that the number 0 and "" (the zero-length string) are,
        in fact, defined values. For example, if you say

            "ab" =~ /a(.*)b/;

        The pattern match succeeds and $1 is defined, although it matched
        "nothing". It didn't really fail to match anything. Rather, it
        matched something that happened to be zero characters long. This
        is all very above-board and honest. When a function returns an
        undefined value, it's an admission that it couldn't give you an
        honest answer. So you should use "defined" only when questioning
        the integrity of what you're trying to do. At other times, a
        simple comparison to 0 or "" is what you want.

        See also "undef", "exists", "ref".

undef EXPR
undef   Undefines the value of EXPR, which must be an lvalue. Use only on
        a scalar value, an array (using "@"), a hash (using "%"), a
        subroutine (using "&"), or a typeglob (using "*"). Saying "undef
        $hash{$key}" will probably not do what you expect on most
        predefined variables or DBM list values, so don't do that; see
        "delete". Always returns the undefined value. You can omit the
        EXPR, in which case nothing is undefined, but you still get an
        undefined value that you could, for instance, return from a
        subroutine, assign to a variable, or pass as a parameter.
        Examples:

            undef $foo;
            undef $bar{'blurfl'};      # Compare to: delete $bar{'blurfl'};
            undef @ary;
            undef %hash;
            undef &mysub;
            undef *xyz;       # destroys $xyz, @xyz, %xyz, &xyz, etc.
            return (wantarray ? (undef, $errmsg) : undef) if $they_blew_it;
            select undef, undef, undef, 0.25;
            ($a, $b, undef, $c) = &foo;       # Ignore third value returned

        Note that this is a unary operator, not a list operator.

```

# PORTING CAVEATS

## Parentheses

Because of some overzealous checks for Perl 5isms, it is necessary to put parentheses when using `undef` as a value. Since the 2018.09 Rakudo compiler release, it is possible to use the `isms` pragma:

```
use isms <Perl5>;
say undef;    # Nil

```

## $\_ no longer accessible from caller's scope

In future language versions of Raku, it will become impossible to access the `$_` variable of the caller's scope, because it will not have been marked as a dynamic variable. So please consider changing:

```
defined;

```

to either:

```
defined($_);

```

or, using the subroutine as a method syntax, with the prefix `.` shortcut to use that scope's `$_` as the invocant:

```
.&defined;

```

# AUTHOR

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

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!

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

# COPYRIGHT AND LICENSE

Copyright 2018, 2019, 2020, 2021, 2023 Elizabeth Mattijsen

Re-imagined from Perl as part of the CPAN Butterfly Plan.

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


## dist_zef-iynehz-Inline-Scheme-Gambit.md
[![Actions Status](https://github.com/iynehz/perl6-Inline-Scheme-Gambit/actions/workflows/ci.yml/badge.svg)](https://github.com/iynehz/perl6-Inline-Scheme-Gambit/actions)

# Inline::Scheme::Gambit

This is a Raku module which allows execution of Gambit Scheme code from
Raku code with inspiration from other Inline:: modules like
Inline::Python, Inline::Lua, Inline::Scheme::Guile, etc.

## Synopsis

```
use Inline::Scheme::Gambit;

my $gambit = Inline::Scheme::Gambit.new;

my $code = q:to/END/;
    (define (fib n)
     (if (< n 2) n (+ (fib (- n 1)) (fib (- n 2)))))
END

$gambit.run($code);
say $gambit.call('fib', 8);

say $gambit.call('map',
                 $gambit.run(q{(lambda (n) (fib n))}),
                 [0 .. 8]);

```

## Status

Testing has only been done under Rakudo MoarVM on x86-64 Linux. It requires
Gambit-C 4, and Gambit-C 4.8.3 and 4.2.8 have been tested by the author.

Values can be passed to and returned from Gambit-C. Simple types
like boolean, integer, number, string, list, table, vector should
work. Present mapping between Gambit-C and Raku types is as
following table.

```
Gambit-C            from Perl                       to Perl
boolean             Bool                            Bool
integer(exact)      Int                             Int
rational(exact)     Rat                             Rat
rational(inexact)   Num                             Num
complex             Complex                         Complex
string              Stringy                         Str
list                Positional                      Array
table               Associative                     Hash
vector                                              Array
procedure                                           OpaquePointer
other objects       OpaquePointer                   OpaquePointer

```

Note that at present both scheme list and vector converts to Array
in Raku, but through the call() method (see below) Raku Array only
converts to list.

The API is incomplete and experimental. It may change in future if
necessary.

### To Do

* Think about wrapping OpaquePointer for scheme-object, so that it can
  do better on scheme list/vector/procedure/etc.
* Support scheme record type.
* Improve error handling.

## Install

```
zef install Inline::Scheme::Gambit

```

It by default tries to use 'gsc-script' or 'gsc' as the gsc command,
and dynamically link to libgambc.so. It supports several environment
variables to override the default behavior.

For example to override gsc in case 'gsc-script' or 'gsc' is not in
PATH, or 'gsc-script' is an incorrect symlink.

```
GSC=/usr/bin/gsc zef install Inline::Scheme::Gambit

```

And if on your system gambit dll is not named libgambc.so, you can override
it like below,

```
LIBS="-l:libgambit.so.4" zef install Inline::Scheme::Gambit

```

Or if you would like to static link to some libgambit.a

```
LIBS=-lutil MYEXTLIB=/usr/lib/gambit-c/libgambit.a zef install Inline::Scheme::Gambit

```

You can refer to Makefile.in and Build.pm to know more details.

## Usage

### Inline::Scheme::Gambit

Object of Inline::Scheme::Gambit represents a global Gambit-C instance.

#### method new()

Returns the global Inline::Scheme::Gambit singleton. The first call to
new() initializes the singleton.

#### method run(Str:D $code)

Runs $code and returns any resulting value.

#### method call(Str:D $name, \*\*@args)

Calls the named function with @args, and returns any resulting value.

## Contact

<https://github.com/iynehz/perl6-Inline-Scheme-Gambit>


## dist_cpan-ANTONOV-Data-Reshapers.md
# Raku Data::Reshapers

[![Build Status](https://app.travis-ci.com/antononcube/Raku-Data-Reshapers.svg?branch=main)](https://app.travis-ci.com/github/antononcube/Raku-Data-Reshapers)
[![](https://img.shields.io/badge/License-Artistic%202.0-0298c3.svg)](https://opensource.org/licenses/Artistic-2.0)

This Raku package has data reshaping functions for different data structures that are
coercible to full arrays.

The supported data structures are:

* Positional-of-hashes
* Positional-of-arrays

The five data reshaping provided by the package over those data structures are:

* Cross tabulation, `cross-tabulate`
* Long format conversion, `to-long-format`
* Wide format conversion, `to-wide-format`
* Join across (aka `SQL JOIN`), `join-across`
* Transpose, `transpose`

The first four operations are fundamental in data wrangling and data analysis;
see [AA1, Wk1, Wk2, AAv1-AAv2].

(Transposing of tabular data is, of course, also fundamental, but it also can be seen as a
basic functional programming operation.)

---

## Usage examples

### Cross tabulation

Making contingency tables -- or cross tabulation -- is a fundamental statistics and data analysis operation,
[Wk1, AA1].

Here is an example using the
[Titanic](https://en.wikipedia.org/wiki/Titanic)
dataset (that is provided by this package through the function `get-titanic-dataset`):

```
use Data::Reshapers;

my @tbl = get-titanic-dataset();
my $res = cross-tabulate( @tbl, 'passengerSex', 'passengerClass');
say $res;

# {female => {1st => 144, 2nd => 106, 3rd => 216}, male => {1st => 179, 2nd => 171, 3rd => 493}}

say to-pretty-table($res);
# +--------+-----+-----+-----+
# |        | 1st | 2nd | 3rd |
# +--------+-----+-----+-----+
# | female | 144 | 106 | 216 |
# | male   | 179 | 171 | 493 |
# +--------+-----+-----+-----+

```

### Long format

Conversion to long format allows column names to be treated as data.

(More precisely, when converting to long format specified column names of a tabular dataset become values
in a dedicated column, e.g. "Variable" in the long format.)

```
my @tbl1 = @tbl.roll(3);
.say for @tbl1;

.say for to-long-format( @tbl1 );

my @lfRes1 = to-long-format( @tbl1, 'id', [], variablesTo => "VAR", valuesTo => "VAL2" );
.say for @lfRes1;

```

### Wide format

Here we transform the long format result `@lfRes1` above into wide format --
the result has the same records as the `@tbl1`:

```
say to-pretty-table( to-wide-format( @lfRes1, 'id', 'VAR', 'VAL2' ) );

# +-------------------+----------------+--------------+--------------+-----+
# | passengerSurvival | passengerClass | passengerAge | passengerSex |  id |
# +-------------------+----------------+--------------+--------------+-----+
# |        died       |      1st       |      20      |     male     | 308 |
# |        died       |      2nd       |      40      |    female    | 412 |
# |      survived     |      2nd       |      50      |    female    | 441 |
# |        died       |      3rd       |      20      |     male     | 741 |
# |        died       |      3rd       |      -1      |     male     | 932 |
# +-------------------+----------------+--------------+--------------+-----+

```

### Transpose

Using cross tabulation result above:

```
my $tres = transpose( $res );

say to-pretty-table($res, title => "Original");
# +--------------------------+
# |         Original         |
# +--------+------+----------+
# |        | died | survived |
# +--------+------+----------+
# | female | 127  |   339    |
# | male   | 682  |   161    |
# +--------+------+----------+

say to-pretty-table($tres, title => "Transposed");
# +--------------------------+
# |        Transposed        |
# +----------+--------+------+
# |          | female | male |
# +----------+--------+------+
# | died     |  127   | 682  |
# | survived |  339   | 161  |
# +----------+--------+------+

```

---

## TODO

1. Simpler more convenient interface.

   * ~~Currently, a user have to specify four different namespaces
     in order to be able to use all package functions.~~
2. More extensive long format tests.
3. More extensive wide format tests.
4. Implement verifications for

   * Positional-of-hashes
   * Positional-of-arrays
   * Positional-of-key-to-array-pairs
   * Positional-of-hashes, each record of which has:

     * Same keys
     * Same type of values of corresponding keys
   * Positional-of-arrays, each record of which has:

     * Same length
     * Same type of values of corresponding elements
5. Implement "nice tabular visualization" using
   [Pretty::Table](https://gitlab.com/uzluisf/raku-pretty-table)
   and/or
   [Text::Table::Simple](https://github.com/ugexe/Perl6-Text--Table--Simple).
6. Document examples using pretty tables.
7. Implement transposing operation for:

   * hash of hashes
   * hash of arrays
   * array of hashes
   * array of arrays
   * array of key-to-array pairs
8. Implement to-pretty-table for:

   * hash of hashes
   * hash of arrays
   * array of hashes
   * array of arrays
   * array of key-to-array pairs
9. Implemented join-across:

   * inner, left, right, outer
   * single key-to-key pair
   * multiple key-to-key pairs
   * optional fill-in of missing values
   * handling collisions
10. Implement to long format conversion for:

    * hash of hashes
    * hash of arrays
11. Speed/performance profiling.

* Come up with profiling tests
* Comparison with R
* Comparison with Python

---

## References

### Articles

[AA1] Anton Antonov,
["Contingency tables creation examples"](https://mathematicaforprediction.wordpress.com/2016/10/04/contingency-tables-creation-examples/),
(2016),
[MathematicaForPrediction at WordPress](https://mathematicaforprediction.wordpress.com).

[Wk1] Wikipedia entry, [Contingency table](https://en.wikipedia.org/wiki/Contingency_table).

[Wk2] Wikipedia entry, [Wide and narrow data](https://en.wikipedia.org/wiki/Wide_and_narrow_data).

### Functions, repositories

[AAf1] Anton Antonov,
[CrossTabulate](https://resources.wolframcloud.com/FunctionRepository/resources/CrossTabulate),
(2019),
[Wolfram Function Repository](https://resources.wolframcloud.com/FunctionRepository).

[AAf2] Anton Antonov,
[LongFormDataset](https://resources.wolframcloud.com/FunctionRepository/resources/LongFormDataset),
(2020),
[Wolfram Function Repository](https://resources.wolframcloud.com/FunctionRepository).

[AAf3] Anton Antonov,
[WideFormDataset](https://resources.wolframcloud.com/FunctionRepository/resources/WideFormDataset),
(2021),
[Wolfram Function Repository](https://resources.wolframcloud.com/FunctionRepository).

[AAf4] Anton Antonov,
[RecordsSummary](https://resources.wolframcloud.com/FunctionRepository/resources/RecordsSummary),
(2019),
[Wolfram Function Repository](https://resources.wolframcloud.com/FunctionRepository).

### Videos

[AAv1] Anton Antonov,
["Multi-language Data-Wrangling Conversational Agent"](https://www.youtube.com/watch?v=pQk5jwoMSxs),
(2020),
[YouTube channel of Wolfram Research, Inc.](https://www.youtube.com/channel/UCJekgf6k62CQHdENWf2NgAQ).
(Wolfram Technology Conference 2020 presentation.)

[AAv2] Anton Antonov,
["Data Transformation Workflows with Anton Antonov, Session #1"](https://www.youtube.com/watch?v=iXrXMQdXOsM),
(2020),
[YouTube channel of Wolfram Research, Inc.](https://www.youtube.com/channel/UCJekgf6k62CQHdENWf2NgAQ).

[AAv3] Anton Antonov,
["Data Transformation Workflows with Anton Antonov, Session #2"](https://www.youtube.com/watch?v=DWGgFsaEOsU),
(2020),
[YouTube channel of Wolfram Research, Inc.](https://www.youtube.com/channel/UCJekgf6k62CQHdENWf2NgAQ).


## dist_github-ugexe-Distribution-Common.md
## Distribution::Common

Create an installable Distribution from common sources.

But really this serves to provide examples on how to create your own `Distribution` classes that don't
rely on a specific file system directory layout before being installed.

## Synopsis

```
use Distribution::Common::Git;
use Distribution::Common::Tar;
use Distribution::Common::Directory;

# a local path with a .git folder
my $git-dist = Distribution::Common::Git.new($path.IO, :$force);

# a file ending in .tar.gz
my $tar-dist = Distribution::Common::Tar.new($path.IO, :$force);

# a plain directory like Distribution::Path for brevity
my $dir-dist = Distribution::Common::Directory.new($path.IO, :$force);

```

## Classes

### Distribution::Common::Tar

Installable `Distribution` from a `.tar.gz` archive

### Distribution::Common::Git

Installable `Distribution` from a local git repo. Because this is a directory it inclusion is meant to serve as
an example as `Distribution::Common::Directory` will handle this similarly. In the future however it could
support changing branches

### Distribution::Common::Directory

Essentially the built-in `Distribution::Path` but built around the `Distribution::Common` interface

## Roles

### Distribution::Common

The base for the various common distribution classes. Fulfills rakudo's `Distribution` role by providing its own
IO interface requirements (`Distribution::IO`) which do most of the actual work. It's main purpose is to fake `IO::Handle`
methods such as `open` and `close` for `IO`-like access to objects that don't need to be `.open` before being read.

### Distribution::IO

Like rakudo's own `Distribution`, but with an additional requirement, `ls-files`, to automatically handle
the setting of `$!meta{files}` for `Distribution::Common`

### Distribution::IO::Proc::Tar

### Distribution::IO::Proc::Git

Extract a single file from a distribution to memory. When `CompUnitRepository::Installation::Install.install` accesses
such files they are written directly to their install location instead of first using an intermediate temporary location

### Distribution::IO::Directory

Basically provides a recursive file listing and little else


## dist_cpan-VRURG-OO-Plugin.md
# NAME

OO::Plugin – framework for working with OO plugins.

# SYNOPSIS

```
use OO::Plugin;
use OO::Plugin::Manager;

class Foo is pluggable {
    has $.attr;
    method bar is pluggable {
        return 42;
    }
}

plugin Fubar {
    method a-bar ( $msg ) is plug-around( Foo => 'bar' ) {
        $msg.set-rc( pi ); # Will override &Foo::bar return value and prevent its execution.
    }
}

my $manager = OO::Plugin::Manager.new.initialize;
my $instance = $manager.create( Foo, attr => 'some value' );
say $instance.bar;  # 3.141592653589793

```

# DESCRIPTION

With this framework any application can have highly flexible and extensible plugin subsystem with which plugins would be capable of:

* method overriding
* class overriding (inheriting)
* callbacks
* asynchronous event handling

The framework also supports:

* automatic loading of plugins with a predefined namespace
* managing plugin ordering and dependencies

Not yet supported but planned for the future is plugin compatibility management.

Read more in [OO::Plugin::Manual](https://github.com/vrurg/Perl6-OO-Plugin/blob/v0.0.4/docs/md/OO/Plugin/Manual.md).

# SEE ALSO

[OO::Plugin::Manual](https://github.com/vrurg/Perl6-OO-Plugin/blob/v0.0.4/docs/md/OO/Plugin/Manual.md), [OO::Plugin](https://github.com/vrurg/Perl6-OO-Plugin/blob/v0.0.4/docs/md/OO/Plugin.md), [OO::Plugin::Manager](https://github.com/vrurg/Perl6-OO-Plugin/blob/v0.0.4/docs/md/OO/Plugin/Manager.md), [OO::Plugin::Class](https://github.com/vrurg/Perl6-OO-Plugin/blob/v0.0.4/docs/md/OO/Plugin/Class.md)

# AUTHOR

Vadim Belman [vrurg@cpan.org](mailto:vrurg@cpan.org)


## dist_zef-jmaslak-Net-BGP.md
# NAME

Net::BGP - BGP Server Support

# SYNOPSIS

```
use Net::BGP

my $bgp = Net::BGP.new( port => 179 );  # Create a server object

```

# DESCRIPTION

This provides framework to support the BGP protocol within a Raku application.

This is a pre-release of the final version, and as such the interface may change. The best way of seeing how this module works is to look at `bin/bgpmon.pl6` and examining it. If you are interested in using this module, and have any suggestions at all, please let me know!

# ATTRIBUTES

## port

The port attribute defaults to 179 (the IETF assigned port default), but can be set to any value between 0 and 65535. It can also be set to Nil, meaning that it will be an ephimeral port that will be set once the listener is started.

## listen-host

The host to listen on (defaults to the IPv4 any-host IP, 0.0.0.0).

## server-channel

Returns the channel communicate to command the BGP server process. This will not be defined until `listen()` is executed. It is intended that user code will send messages to the BGP server.

## user-channel

Returns the channel communicate for the BGP server process to communicate to user code.

## add-unknown-peers

If this is `True` (default is `False`), connections from unknown peers are allowed. When they first connect, a new peer is added to the peer list using the remote address and the ASN sent in the peer's OPEN message.

# METHODS

## listen

```
$bgp.listen();

```

Starts BGP listener, on the port provided in the port attribute.

For a given instance of the BGP class, only one listener can be active at any point in time.

## peer-add

```
$bgp.peer-add(
              :peer-asn(65001),
              :peer-ip("192.0.2.1"),
              :peer-port(179),
              :passive(False),
              :ipv4(True),
              :ipv6(False),
              :md5($key),
);

```

Add a new peer to the BGP server.

Providing `peer-asn` and `peer-ip` is required. However, if the `peer-port` is not provided, `179` will be used. If `passive` is not used, the connection will not be configured as a passive connection. If `ipv4` is not provided, it defaults to `True` (enabling the IPv4 address family), while `ipv6` defaults to `False` (disabling the IPv6 address family). If an `md5` parameter is provided, this is used to set up MD5 associations (on OSes that support this via the `TCP::LowLevel` module).

# PATRONS

Mythic Beasts, a managed and unmanaged VPS, dedicated server, web and email hosting company (among many other services) generously donated the use of a VPS host with IPv4 and IPv6 BGP feeds for the development of this module. Check them out at <https://www.mythic-beasts.com/>.

# AUTHOR

Joelle Maslak [jmaslak@antelope.net](mailto:jmaslak@antelope.net)

# COPYRIGHT AND LICENSE

Copyright © 2018-2020 Joelle Maslak

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


## dist_zef-martimm-Gnome-GObject.md
![](https://martimm.github.io/gnome-gtk3/content-docs/images/gtk-perl6.png)

# Gnome GObject - The base type system and object class

![Artistic License 2.0](https://martimm.github.io/label/License-label.svg)

## Documentation

* [🔗 Website, entry point for all documents and blogs](https://martimm.github.io/)
* [🔗 License document](https://www.perlfoundation.org/artistic_license_2_0)
* [🔗 Release notes of all the packages in `:api<2>`](https://github.com/MARTIMM/gnome-source-skim-tool/blob/main/CHANGES.md)
* [🔗 Issues of all the packages in `:api<2>`](https://github.com/MARTIMM/gnome-source-skim-tool/issues)

# Installation

Do not install this package on its own. Instead install `Gnome::Gtk4` newest api.

`zef install Gnome::Gtk4:api<2>`

# Author

Name: **Marcel Timmerman**
Github account name: **MARTIMM**

# Issues

There are always some problems! If you find one please help by filing an issue at [my github project](https://github.com/MARTIMM/gnome-source-skim-tool/issues).

# Attribution

* The inventors of Raku, formerly known as Perl 6, of course and the writers of the documentation which helped me out every time again and again.
* The builders of all the Gnome libraries and the documentation.
* Other helpful modules for their insight and use.


## naming.md
role Metamodel::Naming

Metaobject that supports named types

```raku
role Metamodel::Naming { }
```

*Warning*: this role is part of the Rakudo implementation, and is not a part of the language specification.

[Metamodel](/language/mop) role for (optionally) named things, like classes, roles and enums.

# [Methods](#role_Metamodel::Naming "go to top of document")[§](#Methods "direct link")

## [method name](#role_Metamodel::Naming "go to top of document")[§](#method_name "direct link")

```raku
method name($type)
```

Returns the name of the metaobject, if any.

```raku
say 42.^name;       # OUTPUT: «Int␤»
```

## [method set\_name](#role_Metamodel::Naming "go to top of document")[§](#method_set_name "direct link")

```raku
method set_name($type, $new_name)
```

Sets the new name of the metaobject.