## dist_cpan-UFOBAT-Bailador.md
[![Build Status](https://travis-ci.org/Bailador/Bailador.png)](https://travis-ci.org/Bailador/Bailador)
[![Build status](https://ci.appveyor.com/api/projects/status/github/Bailador/Bailador?svg=true)](https://ci.appveyor.com/project/ufobat/Bailador/branch/dev)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/bailador/Bailador.svg)](http://isitmaintained.com/project/bailador/Bailador "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/bailador/Bailador.svg)](http://isitmaintained.com/project/bailador/Bailador "Percentage of issues still open")
[![](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![Maintenance](https://img.shields.io/maintenance/yes/2018.svg)

# NAME

Bailador

# SYNOPSIS

```
use Bailador;

get '/' => sub {
    "Hello World";
}

baile();

```

# DESCRIPTION

Bailador is a light-weight route-based web application framework for Perl 6. Talk to the developers at <https://perl6-bailador.slack.com/>

# INSTALLATION

Once you have [Rakudo Star](http://rakudo.org/) installed open a terminal (or command line on Windows) and type:

```
$ zef update
$ zef install Bailador

```

This should download and install Bailador.

You can test your installation, and see what is your Bailador installed version with the following command:

```
$ bailador version

```

NB: If you are using Rakudobrew you may need to run the following command to make `bailador` available in your terminal:

```
$ rakudobrew rehash

```

# GETTING STARTED

At the command prompt, create a new Bailador application:

```
$ bailador new App-Name

```

Then, change directory to `App-Name` and start the web server:

```
$ bailador watch bin/app.pl6

```

That's it!
Using a browser, go to http://localhost:3000. Isn't it wonderful?

You can now edit the files and Bailador reloads the application while you're developing.

If you want to learn more about Bailador, please visit our [documentation](doc/README.md).

# EXAMPLES

For more examples, please see the <examples> folder.

# BAILADOR RESOURCES

You can find a list of Bailador resources (articles, posts, talks, books, ...) [here](https://github.com/Bailador/Ressources).

## Bailador-based applications

* <https://github.com/szabgab/Perl6-Maven> serving <http://perl6maven.com/>
* <https://github.com/perl6/cpandatesters.perl6.org/> used to serve <http://testers.p6c.org/> but currently not in use

## Related projects

<https://github.com/pnu/heroku-buildpack-rakudo>

# CONTRIBUTION

[![GitHub contributors](https://img.shields.io/github/contributors/bailador/bailador.svg)](https://github.com/Bailador/Bailador/graphs/contributors)

We encourage you to contribute to Bailador! If you'd like to do that,
see first the [CONTRIBUTING](CONTRIBUTING.md) document.

# LICENSE

Bailador is released under the MIT License.


## dist_zef-wukgdu-SelectiveImporting.md
# NAME

SelectiveImporting - Selective importing, and making aliases from modules

# SYNOPSIS

Installation: `zef install SelectiveImporting`

```
use SelectiveImporting;

use JSON::Fast :select<&to-json &from-json>; # or just `use JSON::Fast`
use JSON::Tiny :select('&to-json' => '&to-json-tiny', '&from-json' => '&from-json-tiny');

# say &to-json.package;        # (Fast)
# say &from-json.package;      # (Fast)
# say &to-json-tiny.package;   # (Tiny)
# say &from-json-tiny.package; # (Tiny)

```

# DESCRIPTION

Aims:

* Import selectively
* Avoid name conflicts

Behavior after `use SelectiveImporting`:

* if there is no arglist in `use` statement, e.g., `use JSON::Fast`
  * `use` behaves as usual
* else if there is no Pair "select" => !Bool
  * `use` behaves as usual
* else if there is Pair "select" => !Bool (handled as a List, "select" => ([Str | Pair]\*))
  * if `Str`
    * import it
  * if `Pair` (`'a' => 'b'`)
    * import `a` and rename it to `b`
  * Special `Pair`s
    * `"our" => ([Str | Pair]*)` for importing items marked as `our`
    * `:exportSub`: whether importing all from `sub EXPORT` or not
  * **Notes** in this case
    * all implicit tags will be ignored, like `:DEFAULT`, `:MANDATORY`, must be marked explicitly
    * items generated by `sub EXPORT` are not imported by default, use `:exportSub` in `:select` to enable it if not `:select` some
    * if tags or `:exportSub` exist, it will import all items from them, and rename items using `Str`|`Pair` except `:our(...)`; if there is not any alias, import without renaming
    * if items don't exist in given `:tag`, it will import from `:ALL`

How to import via `:select`:

* `class` X: 'X'
* `routine` f: '&f'
* `variable` $a: '$a' (@a, %a)
* `sub postfix:<`!`>`: '&postfix:<!>'
* `enum` X <a b c d>: 'X'
  * could import 'a', 'b' to use them directly instead of `X::a` via `:select<X a b>`
* `constant` X: 'X'
* `package` X: 'X'

Use cases:

* use XXX :select<a b $c &d>
* use XXX :select('a', 'b')
* use XXX :select('a' => 'aa', 'b' => 'bb')
* use XXX :select('a' => 'aa', 'b' => 'bb', 'c', 'd')
* use XXX :select(|<c d>, 'a' => 'aa', 'b' => 'bb', 'e')
* use XXX :select(|<c d>, 'a' => 'aa', 'b' => 'bb', :exportSub)
* use XXX :select(|<c d>, 'a' => 'aa', 'b' => 'bb', :exportSub, :our<oa ob>)
* use XXX :select(|<c d>, 'a' => 'aa', 'b' => 'bb', :exportSub, :our('oa' => 'oaa', 'ob' => 'obb', 'oc'))
* use XXX :DEFAULT, :select<a b>
* use XXX :tag1, :tag2, :select<a b>

Skip something when import via `:except`:

* use XXX :except('a', '&c')
* `use XXX :select('a', 'b'), :except('b')` will not import 'b'
* could be used when import `:tag`

How to use other words instead of `select`:

* `use SelectiveImporting ({:select("get")},)`;
* then `use XXX :get(...)`
* also `({:except("skip")},)`
* please check examples/change-key.raku for more details

Examples:

* examples/\*.raku
* t/\*.rakumod \*.rakutest

Note:

* It modifies the default `do_import` in `Perl6/World.nqp`
* It doesn't work in REPL
* It doesn't deal with `EXPORTHOW`

Ref:

* <https://docs.raku.org/language/modules#Exporting_and_selective_importing>
* <https://github.com/rakudo/rakudo/blob/master/src/Perl6/World.nqp>
* <https://github.com/FROGGS/p6-if>

Similar module

* <https://raku.land/zef:wukgdu/CustomImporting> (which imports items and makes aliases through function)
* <https://raku.land/zef:lizmat/from> (which inspires `:except`)

# AUTHOR

wukgdu [wukgdu365@yahoo.com](mailto:wukgdu365@yahoo.com)

<https://github.com/wukgdu>

# COPYRIGHT AND LICENSE

Copyright 2022 wukgdu

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


## annotations.md
annotations

Combined from primary sources listed below.

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

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

```raku
method annotations()
```

Returns a [`Map`](/type/Map) containing the invocants annotations, i.e. `line` and `file`. An easier way to get hold of the annotation information is to use one of the convenience methods instead.

```raku
say callframe.annotations.^name;                   # OUTPUT: «Map␤»
say callframe.annotations<file> eq callframe.file; # OUTPUT: «True␤»
```


## dist_zef-jonathanstowe-JSON-OptIn.md
# JSON-OptIn

Provide a trait and role to identify opt-in JSON serialization

[![CI](https://github.com/jonathanstowe/JSON-OptIn/actions/workflows/main.yml/badge.svg)](https://github.com/jonathanstowe/JSON-OptIn/actions/workflows/main.yml)

## Synopsis

```

use JSON::OptIn;

class Foo {
   # The attribute will be serialized if opt-in has been selected
   has Str $.bar is json;

}

```

## Description

This provides a trait and a role for the identification of 'opt in' serialisiable attributes in,
for example, [JSON::Marshal](https://github.com/jonathanstowe/JSON-Marshal). It's probably
not necessary to use this directly as it will be required by e.g. [JSON::Name](https://github.com/jonathanstowe/JSON-Name)
but it's just more convenient to package it separately.

## Installation

You probably don't need to install this separately unless you are creating a new module that might use it, as it will
be pulled in as a dependency where it is needed, however if you have a working rakudo installation you can install it with *zef*:

```
zef install JSON::OptIn;

```

## Support

This doesn't provide any user facing functionality, it is likely that if you are experiencing problems then it is in some
module that depends on this. However you can report issues at [GitHub](https://github.com/jonathanstowe/JSON-OptIn/issues).

## Licence && Copyright

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

© Jonathan Stowe 2021


## dist_zef-leont-Pod-Usage.md
[![Actions Status](https://github.com/Leont/pod-usage/workflows/test/badge.svg)](https://github.com/Leont/pod-usage/actions)

# NAME

Pod::Usage - extracts POD documentation to show usage information

# SYNOPSIS

```
use Pod::Usage;

multi MAIN(Bool :$help!) {
	render-usage($=pod);
}

sub GENERATE-USAGE(Routine $main, |capture) {
	render-usage($=pod);
}

```

# DESCRIPTION

Pod::Usage is a helper module for generating a usage message that isn't generated from `sub MAIN`, but instead taken from the USAGE section of your documentation.

## filter-usage(@pod-elements)

This filters out the text under the `USAGE` and manipulates it to a renderable POD sniplet.

## render-usage(@pod-elements, :$renderer = Pod::To::Text)

This takes the pod sniplet as extracted by `filter-usage` and renders it using the given renderer.

# SEE ALSO

* as-cli-arguments

# AUTHOR

Leon Timmermans [fawaka@gmail.com](mailto:fawaka@gmail.com)

# COPYRIGHT AND LICENSE

Copyright 2022 Leon Timmermans

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


## parameter.md
class Parameter

Element of a Signature

```raku
class Parameter { }
```

Represents a parameter, for purpose of introspection.

The usual way to obtain a `Parameter` object is to create a signature, and call `.params` on it to obtain a list of the parameters.

```raku
my $sig   = :(Str $x);
my $param = $sig.params[0];
say $param.type;              # OUTPUT: «Str()␤»
```

See [`Signature`](/type/Signature) for more information, and also for an explanation on what most of the concepts related to parameters mean.

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

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

```raku
method name(Parameter:D: --> Str:D)
```

Returns the parameter name, which includes all [sigils](/language/variables#Sigils) and [twigils](/language/variables#Twigils). This name is used internally when applied to code, or in a declaration to determine the declared the name. This name is not necessarily usable by a caller – if it is, it will also appear as an [alias](#method_named_names). Often, the name will be chosen descriptively as a form of self-documentation.

If the parameter is anonymous, an empty string will be returned.

**Note:** Before Rakudo version 2020.08 the return value for an anonymous parameter was [`Nil`](/type/Nil).

```raku
my Signature $sig = :(Str $x, Bool);
say $sig.params[0].name;                 # OUTPUT: «$x␤»
say $sig.params[1].name;                 # OUTPUT: «␤»

```

## [method usage-name](#class_Parameter "go to top of document")[§](#method_usage-name "direct link")

```raku
method usage-name(Parameter:D: --> Str:D)
```

Returns the parameter name without any [sigils](/language/variables#Sigils) and [twigils](/language/variables#Twigils).

If the parameter is anonymous, an empty string will be returned.

**Note:** Before Rakudo version 2020.08 the return value for an anonymous parameter was [`Nil`](/type/Nil).

```raku
my Signature $sig = :(Str $x, Str @*l, Bool);
say $sig.params[0].usage-name;           # OUTPUT: «x␤»
say $sig.params[1].usage-name;           # OUTPUT: «l␤»
say $sig.params[2].usage-name;           # OUTPUT: «␤»

```

## [method sigil](#class_Parameter "go to top of document")[§](#method_sigil "direct link")

```raku
method sigil(Parameter:D: --> Str:D)
```

Returns a string containing the parameter's sigil, for a looser definition of "sigil" than what is considered part of the parameter's [`name`](#method_name). Still returns a sigil even if the parameter is anonymous.

This "sigil" is actually an introspection used to help determine the normal binding style of a parameter, if it has not been altered through a [trait](/language/signatures#Parameter_traits_and_modifiers).

| Sigil | Will bind to | Default behavior |
| --- | --- | --- |
| $ | Scalar | Generate new Scalar, use instead of Scalar in argument, if any |
| @ | Positional | Bind directly to the argument |
| @ | PositionalBindFailover | If binding failed, call argument's .cache method, bind to result |
| % | Associative | Bind directly to the argument |
| & | Callable | Bind directly to the argument |
| \ | (anything) | Bind directly to the argument, keep existing Scalar, if any |

Also, `|` will bind to all remaining arguments and make new [`Capture`](/type/Capture) if needed.

## [method type](#class_Parameter "go to top of document")[§](#method_type "direct link")

Returns the [nominal type constraint](/language/signatures#Type_constraints) of the parameter.

## [method coerce\_type](#class_Parameter "go to top of document")[§](#method_coerce_type "direct link")

Returns the [coercion type](/syntax/Coercion%20type) of the parameter.

## [method constraints](#class_Parameter "go to top of document")[§](#method_constraints "direct link")

Returns [additional constraints](/language/signatures#Type_constraints) on the parameter (usually as an `all`-Junction).

## [method named](#class_Parameter "go to top of document")[§](#method_named "direct link")

```raku
method named(Parameter:D: --> Bool:D)
```

Returns `True` if it's a [named parameter](/language/signatures#Positional_vs._named_arguments).

```raku
my Signature $sig = :(Str $x, Bool :$is-named);
say $sig.params[0].named;                          # OUTPUT: «False␤»
say $sig.params[1].named;                          # OUTPUT: «True␤»
```

## [method named\_names](#class_Parameter "go to top of document")[§](#method_named_names "direct link")

```raku
method named_names(Parameter:D: --> List:D)
```

Returns the list of externally usable names/aliases for a [named parameter](/language/signatures#Positional_vs._named_arguments).

## [method positional](#class_Parameter "go to top of document")[§](#method_positional "direct link")

```raku
method positional(Parameter:D: --> Bool:D)
```

Returns `True` if the parameter is [positional](/language/signatures#Positional_vs._named_arguments).

```raku
my Signature $sig = :(Str $x, Bool :$is-named);
say $sig.params[0].positional;                     # OUTPUT: «True␤»
say $sig.params[1].positional;                     # OUTPUT: «False␤»
```

## [method slurpy](#class_Parameter "go to top of document")[§](#method_slurpy "direct link")

```raku
method slurpy(Parameter:D: --> Bool:D)
```

Returns `True` for [slurpy parameters](/language/signatures#Slurpy_parameters).

## [method twigil](#class_Parameter "go to top of document")[§](#method_twigil "direct link")

```raku
method twigil(Parameter:D: --> Str:D)
```

Returns a string containing the twigil part of the parameter's name.

## [method optional](#class_Parameter "go to top of document")[§](#method_optional "direct link")

```raku
method optional(Parameter:D: --> Bool:D)
```

Returns `True` for [optional parameters](/language/signatures#Optional_and_mandatory_arguments).

## [method raw](#class_Parameter "go to top of document")[§](#method_raw "direct link")

```raku
method raw(Parameter:D: --> Bool:D)
```

Returns `True` for raw parameters.

```raku
sub f($a, $b is raw, \c) {
    my $sig = &?ROUTINE.signature;
    for ^$sig.params.elems {
        say $sig.params[$_].raw;
    }
}
f(17, "4711", 42); # OUTPUT: «False␤True␤True␤»
```

Raw parameters bind either a variable or a value passed to it, with no decontainerization taking place. That means that if a variable was passed to it, you can assign to the parameter. This is different from [rw](#method_rw)-parameter which can only bind to variables, never to values.

This is the normal behavior for parameters declared with a [sigil](#method_sigil) of '`\`', which is not really a sigil insofar as it is only used on the parameter.

```raku
sub f(\x) {
    x = 5;
}
f(my $x);   # works
f(42);      # dies
CATCH { default { put .^name, ': ', .Str } };
# OUTPUT: «X::Assignment::RO: Cannot modify an immutable Int␤»
```

Other parameters may become raw through use of the '`is raw`' [trait](/language/signatures#Parameter_traits_and_modifiers). These still use their sigil in code.

```raku
sub f($x is raw) {
    $x = 5;
}
```

When used with slurpy list parameters, the `is raw` trait will cause the list of arguments given to be packed into a [`List`](/type/List) instead of an [`Array`](/type/Array), which prevents them from being containerized with [`Scalar`](/type/Scalar). This is the default behavior when using `+` with a sigilless parameter:

```raku
my @types is List = Mu, Any;
say -> *@l { @l }(@types)[0] =:= @types[0];        # OUTPUT: «False␤»
say -> +@l { @l }(@types)[0] =:= @types[0];        # OUTPUT: «False␤»
say -> +l { l }(@types)[0] =:= @types[0];          # OUTPUT: «True␤»
say -> *@l is raw { @l }(@types)[0] =:= @types[0]; # OUTPUT: «True␤»
```

## [method capture](#class_Parameter "go to top of document")[§](#method_capture "direct link")

```raku
method capture(Parameter:D: --> Bool:D)
```

Returns `True` for parameters that capture the rest of the argument list into a single [`Capture`](/type/Capture) object.

```raku
sub how_many_extra_positionals($!, |capture) { capture.elems.say }
how_many_extra_positionals(0, 1, 2, 3);                        # OUTPUT: «3␤»
say &how_many_extra_positionals.signature.params[1].capture;   # OUTPUT: «True␤»
```

Like raw parameters, [`Capture`](/type/Capture) parameters do not force any context on the values bound to them, which is why their sigils are only used in declarations.

## [method rw](#class_Parameter "go to top of document")[§](#method_rw "direct link")

```raku
method rw(Parameter:D: --> Bool:D)
```

Returns `True` for [`is rw`](/language/signatures#Parameter_traits_and_modifiers) parameters.

```raku
my Signature $sig = :(Str $x is rw, Bool :$is-named);
say $sig.params[0].rw;                             # OUTPUT: «True␤»
say $sig.params[1].rw;                             # OUTPUT: «False␤»
```

## [method copy](#class_Parameter "go to top of document")[§](#method_copy "direct link")

```raku
method copy(Parameter:D: --> Bool:D)
```

Returns `True` for [`is copy`](/language/signatures#Parameter_traits_and_modifiers) parameters.

```raku
my Signature $sig = :(Str $x, Bool :$is-named is copy);
say $sig.params[0].copy;                           # OUTPUT: «False␤»
say $sig.params[1].copy;                           # OUTPUT: «True␤»
```

## [method readonly](#class_Parameter "go to top of document")[§](#method_readonly "direct link")

```raku
method readonly(Parameter:D: --> Bool:D)
```

Returns `True` for read-only parameters (the default).

```raku
my Signature $sig = :(Str $x is rw, Bool :$is-named);
say $sig.params[0].readonly;                       # OUTPUT: «False␤»
say $sig.params[1].readonly;                       # OUTPUT: «True␤»
```

## [method invocant](#class_Parameter "go to top of document")[§](#method_invocant "direct link")

```raku
method invocant(Parameter:D: --> Bool:D)
```

Returns `True` if the parameter is the [invocant parameter](/language/signatures#Parameter_separators).

```raku
my Signature $sig = :($i : Str $x is rw, Bool :$is-named);
say $sig.params[0].invocant;                       # OUTPUT: «True␤»
say $sig.params[1].invocant;                       # OUTPUT: «False␤»
```

## [method default](#class_Parameter "go to top of document")[§](#method_default "direct link")

```raku
method default(Parameter:D: --> Code:_)
```

Returns a closure that upon invocation returns the [default value](/language/signatures#Optional_and_mandatory_arguments) for this parameter, or [`Code`](/type/Code) if no default was provided.

**Note:** Before Rakudo version 2020.08 the return value for a parameter with no default value was [`Any`](/type/Any).

```raku
my $sig = :($a, $b = 12);
say $sig.params[0].default;        # OUTPUT: «(Code)␤»
say $sig.params[1].default.();     # OUTPUT: «12␤»

```

## [method type\_captures](#class_Parameter "go to top of document")[§](#method_type_captures "direct link")

```raku
method type_captures(Parameter:D: --> List:D)
```

Returns a list of variable names of [type captures](/language/signatures#Type_captures) associated with this parameter. Type captures define a type name within the attached code, which is an alias to the type gleaned from the argument during a call.

```raku
sub a(::T $x) { T.say }
a(8);                                       # OUTPUT: «(Int)␤»
say &a.signature.params[0].type_captures;   # OUTPUT: «(T)␤»
sub b($x) { $x.^name.say }
a(8);                                       # OUTPUT: «Int␤»
```

The type used may change from call to call. Once they are defined, type captures can be used wherever you would use a type, even later in the same signature:

```raku
sub c(::T $x, T $y, $z) { my T $zz = $z };
c(4, 5, 6);          # OK

try c(4, 5, "six");
given $! { .message.say };
# OUTPUT: «Type check failed in assignment to $zz; expected Int but got Str ("six")␤»

try c("four", 5, "six");
given $! { .message.say };
# OUTPUT: «Type check failed in binding to parameter '$y'; expected Str but got Int (5)␤»

```

Type captures may be used at the same time as [type constraints](/language/signatures#Type_constraints).

```raku
sub d(::T Numeric $x, T $y) {};
d(4, 5);            # OK
d(4e0, 5e0);        # OK

try d(4e0, 5);
given $! { .message.say };
# OUTPUT: «Type check failed in binding to parameter '$y'; expected Num but got Int (5)␤»

try d("four", "five");
given $! { .message.say };
# OUTPUT: «Type check failed in binding to parameter '$x'; expected Numeric but got Str ("four")␤»

```

## [method sub\_signature](#class_Parameter "go to top of document")[§](#method_sub_signature "direct link")

```raku
method sub_signature(Parameter:D: --> Signature:_)
```

If the parameter has a [sub-signature](/language/signatures#Sub-signatures), returns a [`Signature`](/type/Signature) object for it. Otherwise returns [`Signature`](/type/Signature).

**Note:** Before Rakudo version 2020.08 the return value for a parameter with no sub-signature was [`Any`](/type/Any).

```raku
my Signature $sig = :(@array ($first, *@rest), @other);
say $sig.params[0].sub_signature;     # OUTPUT:«($first, *@rest)␤»
say $sig.params[1].sub_signature;     # OUTPUT:«(Signature)␤»

```

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

```raku
method prefix(Parameter:D: --> Str:D)
```

If the parameter is [slurpy](/language/signatures#Slurpy_parameters), returns the marker (e.g., `*`, `**`, or `+`) the parameter was declared with. Otherwise, returns an empty string.

```raku
my Signature $flat-slurpy = :($a, *@b);
say $flat-slurpy.params[0].prefix; # OUTPUT:«␤»
say $flat-slurpy.params[1].prefix; # OUTPUT:«*␤»

my Signature $unflat-slurpy = :($a, **@b);
say $unflat-slurpy.params[0].prefix; # OUTPUT:«␤»
say $unflat-slurpy.params[1].prefix; # OUTPUT:«**␤»

my Signature $sar-slurpy = :($a, +@b);
say $sar-slurpy.params[0].prefix; # OUTPUT:«␤»
say $sar-slurpy.params[1].prefix; # OUTPUT:«+␤»
```

## [method suffix](#class_Parameter "go to top of document")[§](#method_suffix "direct link")

```raku
method suffix(Parameter:D: --> Str:D)
```

Returns the `?` or `!` marker a parameter was declared with, if any. Otherwise, returns the empty string.

```raku
my Signature $pos-sig = :($a, $b?);
say $pos-sig.params[0].suffix; # OUTPUT: «␤»
say $pos-sig.params[1].suffix; # OUTPUT: «?␤»

my Signature $named-sig = :(:$a!, :$b);
say $named-sig.params[0].suffix; # OUTPUT: «!␤»
say $named-sig.params[1].suffix; # OUTPUT: «␤»
```

## [method modifier](#class_Parameter "go to top of document")[§](#method_modifier "direct link")

```raku
method modifier(Parameter:D: --> Str:D)
```

Returns the [type smiley](/language/glossary#Type_smiley) (`:U`, `:D`, or `:_`) a parameter was declared with. It returns the empty string for the `:_` type smiley.

```raku
my Signature $sig = :(Str:U $a, UInt:D $b, $c);
say $sig.params[0].modifier; # OUTPUT: «:U␤»
say $sig.params[1].modifier; # OUTPUT: «:D␤»
say $sig.params[2].modifier; # OUTPUT: «␤»
```

# [Runtime creation of Parameter objects (6.d, 2019.03 and later)](#class_Parameter "go to top of document")[§](#Runtime_creation_of_Parameter_objects_(6.d,_2019.03_and_later) "direct link")

```raku
Parameter.new( ... )
```

In some situations, specifically when working with the [MetaObject Protocol](/language/mop), it makes sense to create `Parameter` objects programmatically. For this purpose, you can call the `new` method with the following named parameters:

* name

Optional. The name of the parameter, if any. Can be specified in the same way as in a [`Signature`](/type/Signature). So it may contain specific additional information, such as a sigil (`$`, `@`, `%` or `&`), a `:` prefix to indicate a named parameter, a twigil (`.` or `!`) to indicate public / private attribute binding, a postfix `!` or `?` to indicate an optional / mandatory parameter, and the various combinations of `+`, `*`, `**` prefixes to indicate slurpiness types and `|` to indicate a [`Capture`](/type/Capture).

* type

Optional. The type of the parameter. Assumes [`Any`](/type/Any) if not specified.

* default

Optional. The value of the parameter if the parameter is optional and no argument has been given for that parameter. Assumes not initialization if no argument has been given, which would fall back to the (implicit) type of the parameter.

* where

Optional. Additional constraints to be applied to any argument to match with this parameter. Does not set any additional constraints by default.

* is-copy

Optional. Allows one to set the "is copy" flag on the parameter. Does not set the flag by default.

* is-raw

Optional. Allows one to set the "is raw" flag on the parameter. Does not set the flag by default.

* is-rw

Optional. Allows one to set the "is rw" flag on the parameter. Does not set the flag by default.

* named

Optional. Indicates whether the parameter is a named parameter or not. Should only be specified if the `:` prefix is **not** specified in the name and a named parameter is required.

* optional

Optional. Indicates whether the parameter is optional or not. Should only be specified if the `?` postfix is **not** specified in the name and an optional parameter is required.

* mandatory

Optional. Indicates whether the parameter is mandatory or not. Should only be specified if the `!` postfix is **not** specified in the name and a mandatory parameter is required.

* multi-invocant

Optional. Indicates whether the parameter should be considered in multi-dispatch or not. Defaults to `True`, so one would need to do `:!multi-invocant` to make the parameter **not** be considered in multi-dispatch.

* sub-signature

Optional. Specifies any [`Signature`](/type/Signature) that should be applied to the parameter to deconstruct it. By default, no signature is to be applied.

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

Type relations for `Parameter`

raku-type-graph

Parameter
Parameter

Any
Any

Parameter->Any

Mu
Mu

Any->Mu

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


## dist_github-azawawi-Browser-Open.md
# Browser::Open

[![Actions
Status](https://github.com/azawawi/raku-browser-open/workflows/test/badge.svg)](https://github.com/azawawi/raku-browser-open/actions)

This is a humble Raku port of Perl's
[Browser::Open](http://metacpan.org/module/Browser::Open).

## Installation

To install it using zef, the Raku module manager:

```
$ zef install Browser::Open

```

## Synopsis

```
use Browser::Open;

my $ok = open-browser($url);

```

## Description

This module allow you to open URLs in a browser. A set of known browser commands
per OS-name is tested for presence, and the first one found is executed. With an
optional parameter, all known commands are checked.

## Testing

* To run tests:

```
$ prove --ext .rakutest -ve "raku -I."

```

* To run all tests including author tests (Please make sure
  [Test::Meta](https://github.com/jonathanstowe/Test-META) is installed):

```
$ zef install Test::META
$ AUTHOR_TESTING=1 prove --ext .rakutest -ve "raku -I."

```

## Author

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

Original Perl Author: Pedro Melo `<melo at cpan.org>`

## License

MIT License


## dist_zef-antononcube-Grammar-TokenProcessing.md
# Raku Grammar::TokenProcessing

## In brief

Raku package for processing grammar files in order to:

* Extract tokens
* Replace token names
* Add fuzzy matching expressions in token definitions
* Random sentence generation

**Remark:** This package is made mostly to automate tasks for the DSL system of packages, see:
[Raku-DSL-\*](https://github.com/search?q=user%3Aantononcube+Raku-DSL).
Hence, the package is tested "just" over files written with a particular style and goal.

---

## Installation

Installation from [Zef ecosystem](https://raku.land):

```
zef install Grammar::TokenProcessing

```

Installation from GitHub:

```
zef install https://github.com/antononcube/Raku-Grammar-TokenProcessing.git

```

---

## Examples

Below are shown usages via the Command Line Interface (CLI) of UNIX-like operating systems.

### Add fuzzy matching to token specs

```
add-token-fuzzy-matching --help

```

```
# Usage:
#   add-token-fuzzy-matching <inputFileName> [-o|--output[=Any]] [--add-protos] [--sym-name=<Str>] [--add-exclusions] [--method=<Str>] [--func-name=<Str>] -- Transform a token lines in a grammar role into token lines with fuzzy matching.
#
#     <inputFileName>      Input file name.
#     -o|--output[=Any]    Output file; if not given the output is STDOUT.
#     --add-protos         Should proto tokens/rules/regexes be added or not. [default: False]
#     --sym-name=<Str>     Sym name. I and empty string ('') then no sym is put in. [default: '']
#     --add-exclusions     Should exclusions be added to token extensions or not? [default: True]
#     --method=<Str>       Method to find the word exclusions; one of 'nearest-neighbors' and 'stem-rules'. [default: 'nearest-neighbors']
#     --func-name=<Str>    Function name to do fuzzy matching with. [default: 'is-fuzzy-match']

```

### Gather tokens

```
get-tokens --help

```

```
# Usage:
#   get-tokens <inputFileName> [--token-names] -- Get tokens from token lines in grammar roles.
#   get-tokens [<args> ...] [--token-names] [--per-file]
#
#     <inputFileName>    Input file name.
#     --token-names      Should the token names be gathered or the token literals? [default: False]
#     [<args> ...]       Input file names.
#     --per-file         Should the tokens be printed out per file or not? [default: False]

```

### Gather tokens into a hash

```
get-tokens-hash --help

```

```
# Usage:
#   get-tokens-hash <inputFileName> [--format=<Str>] -- Get tokens from token lines in grammar roles.
#   get-tokens-hash [<args> ...] [--format=<Str>] [--per-file]
#
#     <inputFileName>    Input file name.
#     --format=<Str>     Format of the output. One of 'hash', 'raku', or 'json'. [default: 'json']
#     [<args> ...]       Input file names.
#     --per-file         Should the tokens be printed out per file or not? [default: False]

```

### Replace token names

```
replace-token-names --help

```

```
# Usage:
#   replace-token-names <dirName> <pairs> [--file-ext=<Str>] [--file-new-ext=<Str>] -- Replaces token names in files.
#
#     <dirName>               Directory with files to be processed.
#     <pairs>                 CSV file with replacement pairs. The first column has the original token names; the second column has the new names.
#     --file-ext=<Str>        Extension(s) pattern of the files to be processed. [default: '.rakumod']
#     --file-new-ext=<Str>    Extension to be added to newly obtained files. If NONE the file content is overwritten. [default: '.new']

```

### Random sentence generation

```
random-sentence-generation --help

```

```
# Usage:
#   random-sentence-generation <grammar> [--rule-body=<Str>] [-n[=UInt]] [--max-iterations[=UInt]] [--max-random-list-elements[=UInt]] [--sep=<Str>] [--syms=<Str>] -- Generates random sentences for a given grammar.
#
#     <grammar>                            Grammar name or definition.
#     --rule-body=<Str>                    Rule body (to start generation with.) [default: 'TOP']
#     -n[=UInt]                            Number of sentences. [default: 10]
#     --max-iterations[=UInt]              Max number of recursive rule replacement iterations. [default: 40]
#     --max-random-list-elements[=UInt]    Max number of elements to use generate random lists. [default: 6]
#     --sep=<Str>                          Separator of the join literals; if 'NONE' Raku code lists are returned. [default: ' ']
#     --syms=<Str>                         A string that is a sym or a space separated syms to concretize proto rules with. [default: 'English']

```

Here is example of random sentence generation based on the grammar of the package
["DSL::English::QuantileRegressionWorkflows"](https://raku.land/zef:antononcube/DSL::English::QuantileRegressionWorkflows), [AAp5]:

```
random-sentence-generation DSL::English::QuantileRegressionWorkflows::Grammar

```

```
# compute anomalies with residuals using the threshold NUMBER(12.44)
# resample
# echo plot the error plot
# compute and show bottom the time series data outliers
# take utilize using DATASET_NAME("RMwQ9")
# rescale axes
# show outliers
# compute anomalies using residuals by threshold NUMBER(270.37)
# moving map WL_EXPR("Sqrt[3]") using the NUMBER(76.54) NUMBER(94.92) NUMBER(215.75) and NUMBER(9.17) , NUMBER(57.94) weights
# show date list diagram by date origin DIGIT(9) DIGIT(8) DIGIT(8) DIGIT(9) - DIGIT(4) DIGIT(6) - DIGIT(8) DIGIT(5)

```

Here is another example using the Bulgarian localization of [AAp5] in [AAp7]:

```
random-sentence-generation DSL::Bulgarian::QuantileRegressionWorkflows::Grammar  -n=10 --syms='Bulgarian English'

```

```
# изчисли и покажи  дейта сет извънредности чрез Range [ NUMBER(92.56) , NUMBER(245.24) and NUMBER(136.3) NUMBER(225.38) ] вероятност
# прави квантила регресия пасване
# присвои канален обект до VAR_NAME("z5TbI")
# изчисли QuantileRegression пасване със от NUMBER(16.9) до NUMBER(173.46) стъпка NUMBER(27.55) възли
# рекапитулирай данни
# ползвай  дейта сет VAR_NAME("RZRo7")
# премащабирай  оси
# вземи ползвай от DATASET_NAME("3SKQm")
# изчисли и покажи  извънредности чрез  от NUMBER(172.37) към NUMBER(91.13) чрез стъпка NUMBER(193.01)
# изчисли времеви серия данни извънредности чрез  Range[ NUMBER(70.13) NUMBER(177.74) and NUMBER(169.68) NUMBER(222.75) ]

```

Here we generate sentences with a grammar string (that is a valid Raku definition of a grammar):

```
random-sentence-generation -n=5 "
grammar Parser {
    rule  TOP  { I [ <love> | <hate> ] <lang> }
    token love { '♥' ** 1..3 | love }
    token hate { '🖕' ** 1..2 | hate }
    token lang { < Raku Perl Rust Go Python Ruby > }
}"

```

```
# I ♥ ♥ Go
# I love Perl
# I love Perl
# I love Raku
# I 🖕 Perl

```

### Converting rules to regexes

Here are examples of converting rules to regexes:

```
use Grammar::TokenProcessing;

my %ruleBodies =
        cookie => 'generic? chocolate cookie \w+ \d+',
        cookie-limited => 'crunch bar \d ** 1..2';

for %ruleBodies.kv -> $k, $v {
    say "rule   : $v";
    say "regex  : {rule-to-regex($v)}\n";
}

```

```
# rule   : generic? chocolate cookie \w+ \d+
# regex  : generic? \h+ chocolate \h+ cookie \h+ \w+ \h+ \d+
#
# rule   : crunch bar \d ** 1..2
# regex  : crunch \h+ bar \h+ \d ** 1..2

```

More detailed examples -- with grammar creation for regex verification -- can be found in the test file
["06-rule-to-regex-conversion.rakutest"](./t/06-rule-to-regex-conversion.rakutest).

---

## References

### Packages

[AAp1] Anton Antonov,
[DSL::Shared, Raku package](https://github.com/antononcube/Raku-DSL-Shared),
(2018-2022),
[GitHub/antononcube](https://github.com/antononcube).

[AAp2] Anton Antonov,
[DSL::English::ClassificationWorkflows, Raku package](https://github.com/antononcube/Raku-DSL-General-ClassificationWorkflows),
(2018-2022),
[GitHub/antononcube](https://github.com/antononcube).

[AAp3] Anton Antonov,
[DSL::English::DataQueryWorkflows, Raku package](https://github.com/antononcube/Raku-DSL-English-DataQueryWorkflows),
(2020-2022),
[GitHub/antononcube](https://github.com/antononcube).

[AAp4] Anton Antonov,
[DSL::English::LatentSemanticAnalysisWorkflows, Raku package](https://github.com/antononcube/Raku-DSL-General-LatentSemanticAnalysisWorkflows),
(2018-2022),
[GitHub/antononcube](https://github.com/antononcube).

[AAp5] Anton Antonov,
[DSL::English::QuantileRegressionWorkflows, Raku package](https://github.com/antononcube/Raku-DSL-General-QuantileRegressionWorkflows),
(2018-2022),
[GitHub/antononcube](https://github.com/antononcube).

[AAp6] Anton Antonov,
[DSL::English::RecommenderWorkflows, Raku package](https://github.com/antononcube/Raku-DSL-General-RecommenderWorkflows),
(2018-2022),
[GitHub/antononcube](https://github.com/antononcube).

[AAp7] Anton Antonov,
[DSL::Bulgarian, Raku package](https://github.com/antononcube/Raku-DSL-Bulgarian),
(2022),
[GitHub/antononcube](https://github.com/antononcube).


## emit.md
role CX::Emit

Emit control exception

```raku
role CX::Emit does X::Control { }
```

A [control exception](/language/exceptions#Control_exceptions) to be used when emit is used inside a [`Supply`](/type/Supply) block.

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

## [method message](#role_CX::Emit "go to top of document")[§](#method_message "direct link")

```raku
method message()
```

Returns `'<emit control exception>'`.


## dist_zef-FRITH-Math-Libgsl-Histogram.md
[![Actions Status](https://github.com/frithnanth/raku-Math-Libgsl-Histogram/workflows/test/badge.svg)](https://github.com/frithnanth/raku-Math-Libgsl-Histogram/actions)

![Distribution of simulated events](examples/2Dhistogram.svg)

# NAME

Math::Libgsl::Histogram - An interface to libgsl, the Gnu Scientific Library - Histograms

# SYNOPSIS

```
use Math::Libgsl::Histogram;

my $h = Math::Libgsl::Histogram.new(3).set-ranges(0, 10, 100, 1000);
say $h.find(18);
$h.scanf('file.dat');
say "max: { $h.max-val } in bin { $h.max-bin }";
say "mean: { $h.mean } standard deviation: { $h.sigma }";

```

```
use Math::Libgsl::Histogram2D;

my $h = Math::Libgsl::Histogram2D.new(10, 10)
        .set-uniform(0, 1, 0, 1)
        .accumulate(.3, .3, 1)
        .accumulate(.8, .1, 5)
        .accumulate(.7, .9, .5);
say "Number of bins: x = { $h.nx }, y = { $h.ny }"; # output: Number of bins: x = 10, y = 10
say "bin (0, 0) = { $h.get(0, 0) }";                # output: bin (7, 9) = 0.5

```

# DESCRIPTION

Math::Libgsl::Histogram is an interface to the Histogram functions of libgsl, the Gnu Scientific Library.

This module exports four classes:

* Math::Libgsl::Histogram
* Math::Libgsl::Histogram::PDF
* Math::Libgsl::Histogram2D
* Math::Libgsl::Histogram2D::PDF

Histogram manages one-dimensional histograms, Histogram2D manages two-dimensional histograms, Histogram::PDF uses the 1D histogram as a probability function, same goes for the Histogram2D::PDF.

## Math::Libgsl::Histogram

### new(UInt $size!)

### new(UInt :$size!)

The constructor accepts one simple or named argument: the histogram size, or number of bins.

All the following methods *throw* on error if they return **self**, otherwise they *fail* on error.

### set-ranges(\*@ranges where \*.elems == self.bins + 1 --> Math::Libgsl::Histogram)

This method sets the ranges of the histogram using the **@array**.

This method returns **self**, to allow method chaining.

### set-uniform(Num() $xmin, Num() $xmax where \* > $xmin --> Math::Libgsl::Histogram)

This method sets the ranges of the histogram to cover the range from **$xmin** to **$xmax** uniformly.

This method returns **self**, to allow method chaining.

### increment(\*@x --> Math::Libgsl::Histogram)

This method updates the histogram by adding one (1.0) to each bin whose range contains each of the coordinates **@x**.

This method returns **self**, to allow method chaining.

### accumulate(Num() $x, Num() $weight --> Math::Libgsl::Histogram)

This method updates the histogram by increasing the value of the appropriate bin by the floating-point number **$weight**.

This method returns **self**, to allow method chaining.

### get(Int $i where \* < self.bins --> Num)

This method returns the content of the i-th bin of the histogram.

### get-range(UInt $i --> List)

This method finds the upper and lower range limits of the i-th bin of the histogram and returns them as a two-value list.

### max(--> Num)

### min(--> Num)

### bins(--> UInt)

These methods return the maximum upper and minimum lower range limits and the number of bins of the histogram.

### reset()

This method resets all the bins in the histogram to zero.

### find(Num() $x --> UInt)

This method returns the index of the bin which covers the coordinate **$x** in the histogram.

### copy(Math::Libgsl::Histogram $src where { $src.bins == self.bins } --> Math::Libgsl::Histogram)

This method copies the histogram **$src** into the current object.

This method returns **self**, to allow method chaining.

### clone(--> Math::Libgsl::Histogram)

This method returns a newly created histogram which is an exact copy of the current histogram.

### max-val(--> Num)

This method returns the maximum value contained in the histogram bins.

### max-bin(--> UInt)

This method returns the index of the bin containing the maximum value.

### min-val(--> Num)

This method returns the minimum value contained in the histogram bins.

### min-bin(--> UInt)

This method returns the index of the bin containing the minimum value.

### mean(--> Num)

This method returns the mean of the histogrammed variable, where the histogram is regarded as a probability distribution.

### sigma(--> Num)

This method returns the standard deviation of the histogrammed variable, where the histogram is regarded as a probability distribution.

### sum(--> Num)

This method returns the sum of all bin values.

### equal(Math::Libgsl::Histogram $h2 --> Bool)

This method returns True if the all of the individual bin ranges of the two histograms are identical, and False otherwise.

### add(Math::Libgsl::Histogram $h2 --> Math::Libgsl::Histogram)

This method adds the contents of the bins in histogram h2 to the corresponding bins of the current histogram.

The two histograms must have the same number of bins and the same ranges.

This method returns **self**, to allow method chaining.

### sub(Math::Libgsl::Histogram $h2 --> Math::Libgsl::Histogram)

This method subtracts the contents of the bins in histogram h2 from the corresponding bins of the current histogram.

The two histograms must have the same number of bins and the same ranges.

This method returns **self**, to allow method chaining.

### mul(Math::Libgsl::Histogram $h2 --> Math::Libgsl::Histogram)

This method multiplies the contents of the bins in histogram h2 by the corresponding bins of the current histogram.

The two histograms must have the same number of bins and the same ranges.

This method returns **self**, to allow method chaining.

### div(Math::Libgsl::Histogram $h2 --> Math::Libgsl::Histogram)

This method divides the contents of the bins in histogram h2 by the corresponding bins of the current histogram.

The two histograms must have the same number of bins and the same ranges.

This method returns **self**, to allow method chaining.

### scale(Num() $scale --> Math::Libgsl::Histogram)

This method multiplies the contents of the bins of the current histogram by **$scale**.

This method returns **self**, to allow method chaining.

### shift(Num() $offset --> Math::Libgsl::Histogram)

This method shifts the contents of the bins of the current histogram by **$offset**.

This method returns **self**, to allow method chaining.

### write(Str $filename --> Math::Libgsl::Histogram)

This method writes the ranges and bins of the current histogram to a file in binary format.

This method returns **self**, to allow method chaining.

### read(Str $filename --> Math::Libgsl::Histogram)

This method reads the ranges and bins of the current histogram from a file in binary format.

This method returns **self**, to allow method chaining.

### printf(Str $filename, Str $range-format, Str $bin-format --> Math::Libgsl::Histogram)

This function writes the ranges and bins of the current histogram line-by-line to a file using the format specifiers **$range-format** and **$bin-format**.

This method returns **self**, to allow method chaining.

### scanf(Str $filename --> Math::Libgsl::Histogram)

This function reads formatted data from a file.

The histogram must be preallocated with the correct length since the C library function uses the size of the current object to determine how many numbers to read.

This method returns **self**, to allow method chaining.

## Math::Libgsl::Histogram::PDF

### new(UInt $size!, Math::Libgsl::Histogram $h!)

### new(UInt :$size!, Math::Libgsl::Histogram :$h!)

The constructor accepts two simple or named arguments: the probability distribution function size, or number of bins, and the histogram.

The histogram must not contain negative values, because a probability distribution cannot contain negative values.

### sample(Num() $r --> Num)

This method uses **$r**, a uniform random number between zero and one, to compute a single random sample from the probability distribution object.

## Math::Libgsl::Histogram2D

### new(UInt $nx!, UInt $ny!)

### new(UInt :$nx!, UInt :$ny!)

The constructor accepts two simple or named arguments: the number of bins in the x direction **$nx** and the number of bins in the y direction **$ny**.

### set-ranges(:@xranges where \*.elems == self.nx + 1, :@yranges where \*.elems == self.ny + 1 --> Math::Libgsl::Histogram2D)

This method sets the ranges of the current histogram using the arrays **@xrange** and **@yrange**.

This method returns **self**, to allow method chaining.

### set-uniform(Num() $xmin, Num() $xmax where \* > $xmin, Num() $ymin, Num() $ymax where \* > $ymin --> Math::Libgsl::Histogram2D)

This method sets the ranges of the histogram to cover the ranges **$xmin** to **$xmax** and **$ymin** to **$ymax** uniformly.

This method returns **self**, to allow method chaining.

### increment(Num() $x, Num() $y --> Math::Libgsl::Histogram2D)

This method updates the histogram by adding one (1.0) to the bin whose x and y ranges contain the coordinates **($x, $y)**.

This method returns **self**, to allow method chaining.

### accumulate(Num() $x, Num() $y, Num() $weight --> Math::Libgsl::Histogram2D)

This method updates the histogram by increasing the value of the appropriate bin by the floating-point number **$weight**.

This method returns **self**, to allow method chaining.

### get(UInt $i where \* < self.nx, Int $j where \* < self.ny --> Num)

This method returns the content of the (i, j)-th bin of the histogram.

### get-xrange(UInt $i --> List)

### get-yrange(UInt $i --> List)

This method finds the upper and lower range limits of the i-th and j-th bin in the x and y directions of the histogram and returns them as a two-value list.

### xmax(--> Num)

### xmin(--> Num)

### nx(--> UInt)

### ymax(--> Num)

### ymin(--> Num)

### ny(--> UInt)

These methods return the maximum upper and minimum lower range limits and the number of bins of the histogram.

### reset()

This method resets all the bins in the histogram to zero.

### find(Num() $x, Num() $y --> List)

This method returns the index of the bin which covers the coordinate **($x, $y)** in the histogram.

### copy(Math::Libgsl::Histogram2D $src where { $src.nx == self.nx && $src.ny == self.ny } --> Math::Libgsl::Histogram2D)

This method copies the histogram **$src** into the current object.

This method returns **self**, to allow method chaining.

### clone(--> Math::Libgsl::Histogram2D)

This method returns a newly created histogram which is an exact copy of the current histogram.

### max-val(--> Num)

This method returns the maximum value contained in the histogram bins.

### max-bin(--> List)

This method returns the indexes of the bin containing the maximum value.

### min-val(--> Num)

This method returns the minimum value contained in the histogram bins.

### min-bin(--> List)

This method returns the indexes of the bin containing the minimum value.

### xmean(--> Num)

This method returns the mean of the histogrammed x variable, where the histogram is regarded as a probability distribution.

### ymean(--> Num)

This method returns the mean of the histogrammed y variable, where the histogram is regarded as a probability distribution.

### xsigma(--> Num)

This method returns the standard deviation of the histogrammed x variable, where the histogram is regarded as a probability distribution.

### ysigma(--> Num)

This method returns the standard deviation of the histogrammed y variable, where the histogram is regarded as a probability distribution.

### cov(--> Num)

This method returns the covariance of the histogrammed x and y variables, where the histogram is regarded as a probability distribution.

### sum(--> Num)

This method returns the sum of all bin values.

### equal(Math::Libgsl::Histogram2D $h2 --> Bool)

This method returns True if the all of the individual bin ranges of the two histograms are identical, and False otherwise.

### add(Math::Libgsl::Histogram2D $h2 --> Math::Libgsl::Histogram2D)

This method adds the contents of the bins in histogram h2 to the corresponding bins of the current histogram.

The two histograms must have the same number of bins and the same ranges.

This method returns **self**, to allow method chaining.

### sub(Math::Libgsl::Histogram2D $h2 --> Math::Libgsl::Histogram2D)

This method subtracts the contents of the bins in histogram h2 from the corresponding bins of the current histogram.

The two histograms must have the same number of bins and the same ranges.

This method returns **self**, to allow method chaining.

### mul(Math::Libgsl::Histogram2D $h2 --> Math::Libgsl::Histogram2D)

This method multiplies the contents of the bins in histogram h2 by the corresponding bins of the current histogram.

The two histograms must have the same number of bins and the same ranges.

This method returns **self**, to allow method chaining.

### div(Math::Libgsl::Histogram2D $h2 --> Math::Libgsl::Histogram2D)

This method divides the contents of the bins in histogram h2 by the corresponding bins of the current histogram.

The two histograms must have the same number of bins and the same ranges.

This method returns **self**, to allow method chaining.

### scale(Num() $scale --> Math::Libgsl::Histogram2D)

This method multiplies the contents of the bins of the current histogram by **$scale**.

This method returns **self**, to allow method chaining.

### shift(Num() $offset --> Math::Libgsl::Histogram2D)

This method shifts the contents of the bins of the current histogram by **$offset**.

This method returns **self**, to allow method chaining.

### write(Str $filename --> Math::Libgsl::Histogram2D)

This method writes the ranges and bins of the current histogram to a file in binary format.

This method returns **self**, to allow method chaining.

### read(Str $filename --> Math::Libgsl::Histogram2D)

This method reads the ranges and bins of the current histogram from a file in binary format.

This method returns **self**, to allow method chaining.

### printf(Str $filename, Str $range-format, Str $bin-format --> Math::Libgsl::Histogram2D)

This function writes the ranges and bins of the current histogram line-by-line to a file using the format specifiers **$range-format** and **$bin-format**.

This method returns **self**, to allow method chaining.

### scanf(Str $filename --> Math::Libgsl::Histogram2D)

This function reads formatted data from a file.

The histogram must be preallocated with the correct length since the C library function uses the size of the current object to determine how many numbers to read.

This method returns **self**, to allow method chaining.

## Math::Libgsl::Histogram2D::PDF

### new(UInt $nx!, UInt $ny!, Math::Libgsl::Histogram2D $h!)

### new(UInt :$nx!, UInt :$ny!, Math::Libgsl::Histogram2D :$h!)

The constructor accepts three simple or named arguments: the probability distribution function x and y number of bins, and the histogram.

The histogram must not contain negative values, because a probability distribution cannot contain negative values.

### sample(Num() $r1, Num() $r2 --> List)

This method uses two uniform random numbers between zero and one, **$r1** and **$r2**, to compute a single random sample from the two-dimensional probability distribution.

# C Library Documentation

For more details on libgsl see <https://www.gnu.org/software/gsl/>.

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

# Prerequisites

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

## Debian Linux and Ubuntu 20.04

```
sudo apt install libgsl23 libgsl-dev libgslcblas0

```

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

## Ubuntu 18.04

libgsl23 and libgslcblas0 have a missing symbol on Ubuntu 18.04.

I solved the issue installing the Debian Buster version of those three libraries:

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

# Installation

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

```
$ zef install Math::Libgsl::Histogram

```

# AUTHOR

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

# COPYRIGHT AND LICENSE

Copyright 2020 Fernando Santagata

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


## dist_cpan-MELEZHIK-Sparrow6.md
# Sparrow

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

```

# Build Status

[![Build Status](https://travis-ci.org/melezhik/Sparrow6.svg?branch=master)](https://travis-ci.org/melezhik/Sparrow6)

# Supported languages

You can write underlying Sparrow tasks using following languages:

* Raku
* Perl5
* Ruby
* Python
* Bash
* Powershell

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 as the One Who inspires me in my life!


## dist_zef-leont-TAP.md
# NAME

TAP

# DESCRIPTION

An asynchronous TAP framework written in Raku.

# SYNOPSIS

```
use TAP;
my $harness = TAP::Harness.new(|%args);
$harness.run(@tests);

```

# METHODS

## Class Methods

### new

```
my %args = jobs => 1, err  => 'ignore';
my $harness = TAP::Harness.new( |%args );

```

The constructor returns a new `TAP::Harness` object.
It accepts an optional hash whose allowed keys are:

* `volume`

  Default value: `Normal`

  Possible values: `Silent` `ReallyQuiet` `Quiet` `Normal` `Verbose`
* `jobs`

  The maximum number of parallel tests to run.

  Default value: `1`

  Possible values: An `Int`
* `timer`

  Append run time for each test to output.

  Default value: `False`

  Possible values: `True` `False`
* `err`

  Error reporting configuration.

  Default value: `stderr`

  Possible values: `stderr` `ignore` `merge` `Supply` `IO::Handle`

  | Value | Definition |
  | --- | --- |
  | `stderr` | Direct the test's `$*ERR` to the harness' `$*ERR` |
  | `ignore` | Ignore the test scripts' `$*ERR` |
  | `merge` | Merge the test scripts' `$*ERR` into their `$*OUT` |
  | `Supply` | Direct the test's `$*ERR` to a `Supply` |
  | `IO::Handle` | Direct the test's `$*ERR` to an `IO::Handle` |
* `ignore-exit`

  If set to `True` will instruct `TAP::Parser` to ignore exit and wait for status from test scripts.

  Default value: `False`

  Possible values: `True` `False`
* `trap`

  Attempt to print summary information if run is interrupted by SIGINT (Ctrl-C).

  Default value: `False`

  Possible values: `True` `False`
* `handlers`

  Default value: `TAP::Harness::SourceHandler::Raku`

  Possible values: `TAP::Harness::SourceHandler::Raku`
  `TAP::Harness::SourceHandler::Exec`

  | Language | Handler |
  | --- | --- |
  | Raku | `TAP::Harness::SourceHandler::Raku.new` |
  | Perl 5 | `TAP::Harness::SourceHandler::Exec.new('perl')` |
  | Ruby | `TAP::Harness::SourceHandler::Exec.new('ruby')` |
  | Python | `TAP::Harness::SourceHandler::Exec.new('python')` |

## Instance Methods

### run

```
$harness.run(@tests);

```

Accepts an array of `@tests` to be run. This should generally be the names of test files.

# TODO

These features are currently not implemented but are considered desirable:

* Rule based parallel scheduling
* Source Handlers other than `::Raku`
* Better documentation

# LICENSE

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


## dist_cpan-KAIEPI-Digest-BubbleBabble.md
[![Build Status](https://travis-ci.org/Kaiepi/p6-Digest-BubbleBabble.svg?branch=master)](https://travis-ci.org/Kaiepi/p6-Digest-BubbleBabble)

# NAME

Digest::BubbleBabble - Support for BubbleBabble string encoding and decoding

# SYNOPSIS

```
use Digest::BubbleBabble;

my $digest = 'BubbleBabble is useful!'.encode;
my $fingerprint = Digest::BubbleBabble.encode($digest);
say $fingerprint.decode; # xidez-kidoh-sucen-furyd-sodyz-gidem-doled-cezof-rexux

$digest = Digest::BubbleBabble.decode($fingerprint);
say $digest.decode; # BubbleBabble is useful!

say Digest::BubbleBabble.validate('xexax'.encode);        # True
say Digest::BubbleBabble.validate('YXl5IGxtYW8K'.encode); # False

```

# DESCRIPTION

Digest::BubbleBabble is a way of encoding digests in such a way that it can be more easily legible and memorable for humans. This is useful for cryptographic purposes.

# METHODS

* **Digest::BubbleBabble.encode**(Blob *$digest* --> Blob)

Returns the given digest blob, encoded as a BubbleBabble fingerprint.

* **Digest::BubbleBabble.decode**(Blob *$fingerprint* --> Blob)

Returns the decoded BubbleBabble fingerprint blob. This throws an `X::Digest::BubbleBabble::Decode` exception if the fingerprint provided does not follow BubbleBabble encoding.

* **Digest::BubbleBabble.validate**(Blob *$fingerprint* --> Bool)

This validates whether or not a fingerprint uses valid BubbleBabble encoding. Returns `True` when the fingerprint is valid, and `False` otherwise.

# AUTHOR

Ben Davies (kaiepi)

# COPYRIGHT AND LICENSE

Copyright 2018 Ben Davies

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


## orelse.md
orelse

Combined from primary sources listed below.

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

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

The `orelse` operator is similar to `infix //`, except with looser precedence and `$_` aliasing.

Returns the first defined argument, or else the last argument. Last argument is returned as-is, without being checked for definedness at all. Short-circuits. The result of the left side is bound to `$_` for the right side, or passed as an argument if the right side is a [`Callable`](/type/Callable), whose [count](/routine/count) must be `0` or `1`.

This operator is useful for handling [`Failure`](/type/Failure)s returned by routines since the expected value is usually [defined](/routine/defined) and [`Failure`](/type/Failure) never is:

```raku
sub meows { ++$ < 4 ?? fail 'out of meows!' !! '🐱' }

sub meows-processor1 { meows() orelse .return } # return handled Failure
sub meows-processor2 { meows() orelse fail $_ } # return re-armed Failure
sub meows-processor3 {
    # Use non-Failure output, or else print a message that stuff's wrong
    meows() andthen .say orelse ‘something's wrong’.say;
}

say "{.^name}, {.handled}"  # OUTPUT: «Failure, True␤»
    given meows-processor1;
say "{.^name}, {.handled}"  # OUTPUT: «Failure, False␤»
    given meows-processor2;
meows-processor3;           # OUTPUT: «something's wrong␤»
meows-processor3;           # OUTPUT: «🐱␤»
```


## modules-core.md
Core modules

Core modules that may be useful to module authors

The Rakudo implementation has a few modules included you may want to use; please note that the implementation is not part of the Raku specification and thus might be subject to change without prior notice. The following is a list of them, along with links to their source code.

## [`CompUnit::*` modules and roles](#Core_modules "go to top of document")[§](#CompUnit::*_modules_and_roles "direct link")

These modules are mostly used by distribution build tools, and are not intended to be used (at least until version 6.c) by the final user.

* [`CompUnit::Repository::Staging`](https://github.com/rakudo/rakudo/blob/main/lib/CompUnit/Repository/Staging.rakumod).
* [`CompUnit::Repository::(FileSystem|Installation|AbsolutePath|Unknown|NQP|Perl6|RepositoryRegistry)`](https://github.com/rakudo/rakudo/blob/main/src/core.c/CompUnit/RepositoryRegistry.rakumod).

## [`NativeCall` modules](#Core_modules "go to top of document")[§](#NativeCall_modules "direct link")

* [`NativeCall`](https://github.com/rakudo/rakudo/blob/main/lib/NativeCall.rakumod) Native Calling Interface ([docs](/language/nativecall))
* [`NativeCall::Types`](https://github.com/rakudo/rakudo/blob/main/lib/NativeCall/Types.rakumod) Used by `NativeCall`
* [`NativeCall::Compiler::GNU`](https://github.com/rakudo/rakudo/blob/main/lib/NativeCall/Compiler/GNU.rakumod) Used by `NativeCall`
* [`NativeCall::Compiler::MSVC`](https://github.com/rakudo/rakudo/blob/main/lib/NativeCall/Compiler/MSVC.rakumod) Used by `NativeCall`

## [Other modules](#Core_modules "go to top of document")[§](#Other_modules "direct link")

* [`Pod::To::Text`](https://github.com/rakudo/rakudo/blob/main/lib/Pod/To/Text.rakumod) Used by several external modules
* [`Test`](/type/Test) Test routines (see [tutorial](/language/testing))
* [`experimental`](https://github.com/rakudo/rakudo/blob/main/lib/experimental.rakumod) ([documentation](/language/pragmas#experimental))
* [`newline`](https://github.com/rakudo/rakudo/blob/main/lib/newline.rakumod)


## next-handle.md
next-handle

Combined from primary sources listed below.

# [In IO::CatHandle](#___top "go to top of document")[§](#(IO::CatHandle)_method_next-handle "direct link")

See primary documentation
[in context](/type/IO/CatHandle#method_next-handle)
for **method next-handle**.

```raku
method next-handle(IO::CatHandle:D: --> IO::Handle:D)
```

Switches the active source handle to the next handle in the source handle queue, which is the sources given in `@handles` attribute to [`.new`](/type/IO/CatHandle#method_new). The return value is the currently active source handle or [`Nil`](/type/Nil) if the source handle queue has been exhausted.

Coerces [`Cool`](/type/Cool) source "handles" to [`IO::Path`](/type/IO/Path); opens [`IO::Path`](/type/IO/Path) and unopened [`IO::Handle`](/type/IO/Handle) source handles for reading using the invocant's [`$.nl-in`](/type/IO/CatHandle#method_nl-in), [`$.chomp`](/type/IO/CatHandle#method_chomp), and [`$.encoding`](/type/IO/CatHandle#method_encoding) attributes; those same attributes of already-opened [`IO::Handle`](/type/IO/Handle) objects will be changed to the values of the invocant's attributes.

This method is called automatically whenever CatHandle's methods require a switch to the next source handle, triggers [`.on-switch`](/type/IO/CatHandle#method_on-switch) [`Callable`](/type/Callable) to be called, and is called once during [.new](/type/IO/CatHandle#method_new) call. The `.on-switch` will continue to be triggered each time this method is called, even after the source handle queue has been exhausted. Note that generally reaching the EOF of the currently active source handle does not trigger the `.next-handle` call, but rather further read operations that need more data do.

```raku
(my $f1 = 'foo'.IO).spurt: "a\nb";
(my $f2 = 'bar'.IO).spurt: "c\nd";
with IO::CatHandle.new: :on-switch{ say '▸ Switching' }, $f1, $f2 {
    say 'one';
    .next-handle.^name.say;
    say 'two';
    .next-handle.^name.say;
    say 'three';
    .next-handle.^name.say;
    # OUTPUT:
    # ▸ Switching
    # one
    # ▸ Switching
    # IO::Handle
    # two
    # ▸ Switching
    # Nil
    # three
    # ▸ Switching
    # Nil
}

```


## dist_zef-librasteve-Physics-Unit.md
[![](https://img.shields.io/badge/License-Artistic%202.0-0298c3.svg)](https://opensource.org/licenses/Artistic-2.0)
[![](https://github.com/librasteve/raku-Physics-Unit/actions/workflows/unit-weekly.yaml/badge.svg)](https://github.com/librasteve/raku-Physics-Unit/actions/workflows/unit-weekly.yaml)

# Version 2

This version of Physics::Unit is a breaking change and a major refactor of the configuration files, build and load process to enable pluggable definitions. All configuration data is now loaded from resource YAML files, Config.rakumod and en\_SI.rakumod. *See below for long term goals.*

Synthetic Units (e.g. .type => ```synthetic:m-1``) allows Measure calculations to produce intermediate results without dredefined units for every intermediate step.

CreateUnit is consolidated to Unit.new, GetUnit becomes Unit.find and all non method parts of API are replaced.

*You will need to upgrade Physics::Measure to v2+ also*

---

# Physics::Unit

A set of stock SI, Imperial and US Unit objects for raku that are employed by [Physics::Measure](https://github.com/librasteve/raku-Physics-Measure) objects.

#viz. <https://en.wikipedia.org/wiki/International_System_of_Units>

# Instructions

`zef install Physics::Unit`

The `locale` for units is set to 'us' or 'imp' (imperial) automatically depending on your `%*ENV<LANG>` system value.
You can override this with `export RAKULAND='en_US'` or `export RAKULAND='anything else'`.
This affects vanilla gallons, pints, mpg, etc. so don't worry if you are from Europe.
You can always use `imp-pint` vs `us-pint` explicitly to override.

# Synopsis - Physics::Unit

```
#!/usr/bin/env raku
use Physics::Unit;

#SYNOPSIS

# Define your own Unit named "ff"
my $ff = Unit.new( defn => 'furlong / fortnight', names => ['ff'] );
say '==============';
dd $ff;
say "$ff";				# 'ff' ... string context gives unit name
say $ff.type;			# 'Speed' inferred from defn
say $ff.canonical;		# 'm.s-1' SI derived unit representation
say $ff.pretty;			# 'm⋅s⁻¹' SI recommended string representation
say $ff.raku;			#  or 'say $ff;' or 'dd $ff;' for details

#Unit.new( factor => 0.00016631, offset => 0, defn => 'furlong / fortnight', type => Speed,
#			 dims => [1,0,-1,0,0,0,0,0], dmix => ("fortnight"=>-1,"furlong"=>1).MixHash, names => ['ff'] );

# New Unit by renaming an existing one
my $fh = $ff.new( <fh fi> );

# Flexible unit expression (here using the newly defined Unit 'ff'):
my $gonzo = Unit.new( defn => "13 square millimeters per ff", names => ['gonzo'] );

# Parsing of input
my $u1 = Unit.find( 'J' );
my $u2 = Unit.find( 'kg m^2 / s^2' );
my $u3 = Unit.find( 'kg m^2/s^2' );
say "compare $u1, $u2... " ~ $u2.same-unit($u1);   #True

# Check directory information
use Physics::Unit::Directory;

my $dx := Directory.instance;
put $dx.type.names;
put $dx.unit.names;

```

The ① symbol is used to denote Dimensionless units.

% (1) A ABV ABVs Bq C Centigrade Centigrades F Fahrenheit Fahrenheits GeV GeVs Gy H Hz J K L MeV MeVs Mx N Nm Ns PS Pa Rankine Rankines S Sv T TeV TeVs V W Wb acre acres alcohol-unit alcohol-units amp ampere amperes amps ampère ampères angstrom angstroms are ares astronomical-unit astronomical-units atm atmosphere atmospheres atms atomic-mass-unit atomic-mass-units au bar barn barns barrel barrels bars becquerel becquerels bottle bottles british-thermal-unit british-thermal-units btu btus bushel bushels ca cable cables cal calorie calories cals candela candelas candle candles carat carats cc cd celsius centuries century centurys coulomb coulombs cup cups cycle cycles day days deg degree degrees degs deg² deg²s demi demis dram drams dyne dynes eV earth-gravity earth-gravitys electron-volt electron-volts erg ergs farad farads fathom fathoms feet feets ff fh fi fifth fifths firkin firkins floz fluid-ounce fluid-ounces fluidram fluidrams foot footpound footpounds foots fortnight fortnights fps ft ft-lb ft-lbs furlong furlongs g g0 gallon gallons gauss gill gills gm gon gons gonzo grain grains gram gram-force gram-forces gramme grammes grams gray grays hectare hectares hemi hemis henry henrys hertz horsepower horsepowers hour hours hp hr hundredweight hundredweights imp-gallon imp-gallons imp-pint imp-pints in inch inchs j-point j-points joule joules kWh kWhs karat karats kat katal katals kats kcal kcals kelvin kelvins kg kg m/s kg m^2 kg m^2 / s^2 kg m^2/s kg m^2/s^2 kg/m^3 kgf kgfs kilogram kilograms km knot knots kph kphs kps l lb lbm lbms lbs light-year light-years liter liters litre litres lm long-ton long-tons lumen lumens lux luxs lx ly m m/s m/s^2 m2 m3 m^2 m^3 maxwell maxwells meter meters metre metres metric-ton metric-tons mho mhos micron microns mile miles millenia millenias millenium milleniums min minim minims mins minute minutes mol mole moles mols month months mph mphs m² m³ nautical-mile nautical-miles newton newton-metre newton-metres newtons nmile nmiles ohm ohms one ones ounce ounce-force ounce-forces ounces oz parsec parsecs pascal pascals peck pecks pennyweight pennyweights percent percents perch perchs pi pica picas pint pints point points pole poles pound pound-force pound-forces pound-second pound-seconds pounds pounds-mass psi psis quart quarts rad radian radians radians per second radians per seconds rads rem rems revolution revolutions revolutions per second revolutions per seconds revs rod rods rpm rpms s scruple scruples sec second seconds secs semi semis short-ton short-tons siemens sievert sieverts slug slug ft/s slugs sp spat spats sr steradian steradians stone stones tablespoon tablespoons tbsp tbsps teaspoon teaspoons tesla teslas therm therms ton tonne tonnes tons torr torrs troy-ounce troy-ounces troy-pound troy-pounds tsp tsps u unity unitys us-gallon us-gallons us-horsepower us-horsepowers us-hp us-hps us-pint us-pints volt volts watt watts weber webers week weeks yard yards year years yr ° °C °F °R °proof °proofs º å Ω μ ᵍ ①

# Operation Principles & Edge Cases

## Operation Principles

1. Definition can be shared with several unit names - thus J and Nm can remain distinct
2. Unit.find first tries name match, then calls Unit.new to try definition match
3. Matching names is exact; definitions is loose
4. Defn matches dimension Mix (shallow) - thus 'kg m^2 / s^2' and 'N m' do remain distinct
5. Long strings (eg. 'kg m^2/s^2') auto reduce to SI derived units (eg. 'J') [if Unit already instaniated]
6. Override with Unit.new(defn=>'kg m^2/s^2', names=>['kg m^2/s^2']);

## Edge Cases

Unit.find('J'); #stock unit name=>'J'.., type=>Energy, defn=>'kg m^2 / s^2'
Unit.find('kg m^2/s^2'); #same unit name=>'J'.., type=>Energy, defn=>'kg m^2 / s^2'
Unit.find('kg m^2 / s^2');#same unit name=>'J'.., type=>Energy, defn=>'kg m^2 / s^2'
Unit.find('Nm'); #stock unit name=>'Nm', type=>Torque, defn=>'N m'
Unit.find('N m'); #same unit name=>'Nm', type=>Torque, defn=>'N m'
Unit.new(defn=>'kg m^2/s^2', names=>['kg m^2/s^2']);
Unit.find('kg m^2/s^2'); #new unit name=>''kg m^2/s^2', type=>Energy,Torque, defn=>'kg m^2/s^2'
.type('Energy'); #This establishes the type=>Energy once and for all
Unit.find('kg m^2/s^2'); #same unit name=>'kg m^2/s^2', type=>Energy, defn='kg m^2/s^2'

# Long Term Goals

## Next

1. Split SI only from others
2. Currency
3. Information
4. Split en\_US / en\_GB
5. Log units (dB, etc)

## Pluggability

Leverage the raku zef module ecosystem to handle dependencies.

In pursuit of:

* Speed of core definitions
* More independence en\_US vs en\_GB
* New types of definitions (currency, information)
* Enabling 3rd party extensions
* Internationalization
* Multiple systems and domains (see pint *default\_en.txt*)
  * en\_SI
  * en\_Liquid (ABV, volumes)
  * en\_Kitchen (spoons, etc)
  * en\_Time
  * en\_CGS
  * en\_KMS (? needed)
  * en\_Avoirdupois
  * en\_Astronomical
  * en\_Earth (knot, atm)
  * en\_Green
  * en\_Chemistry

## Internationalization

```
en_SI Base Units
#viz https://en.wikipedia.org/wiki/Dimensional_analysis#Definition
'Length'      => ['m', 'metre', 'meter',],
'Mass'        => ['kg', 'kilogram',],
'Time'        => ['s', 'sec', 'second',],
'Current'     => ['A', 'amp', 'ampere', 'ampère',],
'Temperature' => ['K', 'kelvin',],
'Substance'   => ['mol', 'mole',],
'Luminosity'  => ['cd', 'candela', 'candle',],
'Angle'		  => ['radian',],

fr_SI / Base, Derived
# Unités de base du SI
# Voir https://fr.wikipedia.org/wiki/Analyse_dimensionnelle#Définition
##revenir aux pluriels algorithmiques
'Longueur'    => ['m', 'mètre',],
'Masse'       => ['kg', 'kilogramme',],
'Temps'       => ['s', 'sec', 'seconde',],
'Courant'     => ['A', 'amp', 'ampère',],
'Température' => ['K', 'kelvin',],
'Substance'   => ['mol', 'mole',],
'Luminosité'  => ['cd', 'candela',],
'Angle'       => ['radian',],

de_SI / Base, Derived
# SI-Basiseinheiten
# Siehe https://de.wikipedia.org/wiki/Dimensionale_Analyse#Definition
##zurück zu algorithmischen Pluralformen
'Länge'        => ['m', 'Meter',],
'Masse'        => ['kg', 'Kilogramm',],
'Zeit'         => ['s', 'sek', 'Sekunde',],
'Stromstärke'  => ['A', 'Amp', 'Ampere',],
'Temperatur'   => ['K', 'Kelvin',],
'Stoffmenge'   => ['mol', 'Mol',],
'Lichtstärke'  => ['cd', 'Candela',],
'Winkel'       => ['Radiant',],

class Longueur is Length {}

```perl6
$ cat Physics.rakumod
unit module Physics;

my class Length {
has Int $.value;
}

my package EXPORT::en {
OUR::<Length> := Length;
}

my package EXPORT::de {
OUR::<Länge> := Length;
}
$ raku -I. -e 'use Physics :en; say Length;'
(Length)
$ raku -I. -e 'use Physics :de; say Länge;'
(Length)

```

# Others

* Improved plural automation (internationalization)
* Slangify (ie Physics::Measure)

Copyright (c) Henley Cloud Consulting Ltd. 2021-2024


## dist_cpan-RBT-Net-DNS.md
# Net::DNS

A simple DNS resolver.

Note: If you are behind a firewall that blocks Google DNS, you will need to set
DNS\_TEST\_HOST in your environment to pass the tests.

## Example Usage

```
my $resolver = Net::DNS.new('8.8.8.8'); # google dns server

my @mx-ips = $resolver.lookup-mx('gmail.com');

my @all = $resolver.lookup-ips('google.com');
my @ipv4 = $resolver.lookup-ips('google.com', :inet);
my @ipv6 = $resolver.lookup-ips('google.com', :inet6);

my @dns-answers = $resolver.lookup('A', 'google.com'); # ("1.2.3.4", "5.6.7.8", ...)

```

## Methods

* `new(Str $host, $socket = IO::Socket::INET)`

  Creates a new DNS resolver using the specified DNS server.

  The `$socket` parameter lets you inject your own socket class to use for the
  query (so you can do a proxy negotiation or somesuch first).
* `lookup-ips(Str $name, :$inet, :$inet6)`

  Looks up the specified $name, looking for A and AAAA records (only searches
  for A when :inet is specified, and only searches for AAAA when :inet6 is
  specified). Will chase down CNAME records to get you the actual IP
  addresses. Will return a list of A and AAAA responses.
* `lookup-mx(Str $name, :$inet, :$inet6)`

  Does a lookup for MX records, and then internally calls `lookup-ips` to
  find the actual addresses for the mailservers. Returns a list of A and AAAA
  records, in MX priority order.
* `lookup(Str $type, Str $name)`

  Looks up the specified $name, looking for records of $type. Returns a list of
  response classes, specified below. A failed lookup returns an empty list.

## Supported DNS Types

The return of a lookup is a list of classes. Which class depends on the request
type.

The object returned will stringify to something useful, and will also provide
attributes to access each piece of information that was returned.

Note that all of these classes also have a `@.owner-name` attribute. Normally this
is the same as the domain name you did the lookup on.

* `A`

  Returns a class with attribute `@.octets`, which will have 4 elements.

  Stringifies to an ip address ("192.168.0.1")
* `AAAA`

  Returns a class with attribute `@.octets`, which will have 16 elements.

  Stringifies to an ipv6 address ("2607:f8b0:…")
* `CNAME`

  Returns a class with attribute `@.name`, which is a domain name split on '.'.
  To get the full domain name, call $object.name.join('.');

  Stringifies to a domain name.
* `MX`

  Returns a class with attributes `$.priority`, `@.name`.

  Stringifies to a domain name.
* `NS`

  Returns a class with attribute `@.name`

  Stringifies to a domain name.
* `PTR`

  Returns a class with attribute `@.name`

  Stringifies to a domain name.
* `RRSIG`

  Returns a class with attributes `$.type-covered`, `$.algorithm`,
  `$.labels`, `$.original-ttl`, `$.signature-expiration`,
  `$.signature-inception`, `$.key-tag`, `$.signer-name`, and
  `$.signature`.

  Stringifies to a a string with similar output to the output produced
  by the `dig` command line utility.

  Note that this module does not validate the validity of a DNSSEC signature.
* `SRV`

  Returns a class with the attributes `$.priority`, `$.weight`, `$.port`, `@.name`.

  Stringifies to "the.server:port".
* `SPF`

  Returns a class with the attribute `$.text`

  Stringifies to the text
* `TXT`

  Returns a class with the attribute `$.text`

  Stringifies to the text
* `SOA`

  Returns a class with the attributes `@.mname`, `@.rname`, `$.serial`, `$.refresh`,
  `$.retry`, `$.expire`, `$.minimum`

  Stringifies to a format similar to nslookup
* `AXFR`

  Zone transfer request.

  This is a special case - it returns a list of the above objects instead of it's
  own response type.

## Exceptions

DNS Server errors will produce a Failure response on lookup(), lookup-ips(), and lookup-mx() with an X::Net::DNS object.

* server-message

  A complete Net::DNS::Message structured response from the server.
* rcode-value

  Return code Integer received from the DNS server.
* rcode-name

  [Return code name](https://support.umbrella.com/hc/en-us/articles/232254248-Common-DNS-return-codes-for-any-DNS-service-and-Umbrella-)
  received from the DNS server. Common values are SERVFAIL and NXDOMAIN.
* message

  A short english message which might be shown to users.


## dist_cpan-JGOFF-App-nm2perl6.md
[![Build Status](https://travis-ci.org/drforr/perl6-App-nm2perl.svg?branch=master)](https://travis-ci.org/drforr/perl6-App-nm2perl)

# NAME

App::nm2perl6 - Translate library symbols to valid Perl 6

# SYNOPSIS

```
$ nm /path/to/libgecode.so | nm2perl6 > libgecode.pm6

```

# DESCRIPTION

Pipe the output from nm(1) into the nm2perl6 binary (or use the filename) and it will generate a set of Perl 6 classes and methods in the (mangled) symbol table. This is useful if you don't have headers for the library, or if you simplly don't want to waste the time trying to untangle the definitions.

It can't distinguish between arrays and pointers because the C++ syntax is the same for both, so it (probably wrongly) defaults to 'Pointer[ type ]' for 'int32 \*' and so on. C++ symbols don't come with usage or variables, so none are provided in the output.

It does unpack the basic `Bool`, `Str`, `long` types as well, but maybe not as consistently as you'd like. See the next section for some possible quirks. Also, the C++ unmangler only covers a limited range of types, so it's possible that this module will come up with type signatures that NativeCall can't understand (yet.)

## GNU quirks

I have to choose between 'CArray' and 'Pointer', I'll just use 'Pointer' for now.

'Pv' is just 'Pointer' type, as it's 'void\*' in C. 'Pc' is just 'Str' type 'v' is ... not there.

# AUTHOR

Jeffrey Goff [drforr@pobox.com](mailto:drforr@pobox.com)

# COPYRIGHT AND LICENSE

Copyright 2019 Jeffrey Goff

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


## dist_zef-JRaspass-TOML-Thumb.md
# TOML::Thumb

[![pipeline](https://gitlab.com/JRaspass/toml-thumb/badges/master/pipeline.svg)](https://gitlab.com/JRaspass/toml-thumb/commits/master)

In English folklore, [Tom Thumb](https://en.wikipedia.org/wiki/Tom_Thumb) was a diminutive man. TOML::Thumb is a
diminutive TOML (de)serializer.

It aims to fully support [TOML v1.0.0](https://toml.io).

**Note until the full test suite passes this module will remain pre 1.0 and
breaking changes are to be expected.**

## SYNOPSIS

```
use TOML::Thumb;

my %config = 'config.toml'.IO.&from-toml;

spurt 'config.toml', to-toml %config;

```

## SUBROUTINES

### from-toml

```
multi sub from-toml(IO  $toml)
multi sub from-toml(Str $toml)

```

### to-toml

```
sub to-toml(%hash)

```

## PERFORMANCE

Testing the large TOML file from [CPAN Rocks](https://cpan.rocks).

```
$ ls -hs dists.toml; wc -l $_
4.1M dists.toml
282687 dists.toml

```

```
$ time raku -MTOML::Thumb -e 'from-toml slurp "dists.toml"'

real    0m15.926s
user    0m15.814s
sys     0m0.210s

$ time raku -MConfig::TOML -e 'from-toml slurp "dists.toml"'

real    186m51.735s
user    186m22.130s
sys     0m11.225s

```

```
$ raku -v
This is Rakudo version 2020.02 built on MoarVM version 2020.02
implementing Raku 6.d.

$ lscpu | sed -nr '/Model name/ s/.*: +//p'
Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz

```

## SEE ALSO

* [Config::TOML](https://raku.land/github:atweiden/Config::TOML)
* [TOML](https://raku.land/zef:tony-o/TOML)


## systemic.md
role Systemic

Information related to the build system

Built-in class for providing built system related information. Usually accessed through dynamic variables mixing this role such as the [`$*KERNEL`](/language/variables#Dynamic_variables), [`$*VM`](/language/variables#Dynamic_variables), or [`$*RAKU`](/language/variables#Dynamic_variables).

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

## [method auth](#role_Systemic "go to top of document")[§](#method_auth "direct link")

Instance method returning the "auth" (as in "author" or "authority") of the object. Returns "unknown" if the "auth" could not be established.

## [method config](#role_Systemic "go to top of document")[§](#method_config "direct link")

Instance returning a hash with object configuration information. Subject to change without notice, but can be helpful in environments where only one type of virtual machine is in use, or to find about the configuration of any other object that mixes in this role.

## [method desc](#role_Systemic "go to top of document")[§](#method_desc "direct link")

Instance method returning the "desc" (as in "description") of the VM object. Returns a [`Str`](/type/Str) type object if the "desc" could not be established.

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

Instance method returning the name of the object.

## [method signature](#role_Systemic "go to top of document")[§](#method_signature "direct link")

Instance method returning the signature of the object. Returns a [`Blob`](/type/Blob) type object if the signature could not be established.

## [method version](#role_Systemic "go to top of document")[§](#method_version "direct link")

Instance method returning the version of the object as a [`Version`](/type/Version) object. Returns a [`Version`](/type/Version) object "unknown" if the version could not be established.

## [method gist](#role_Systemic "go to top of document")[§](#method_gist "direct link")

```raku
method gist( Systemic:D: )
```

Instance method returning the name and version of the object.

```raku
say $*RAKU.gist; # OUTPUT: «Raku (6.d)␤»
```

`$*RAKU` is an object of the [`Raku`](/type/Raku) type, which mixes in this role and thus implements this method.

## [method Str](#role_Systemic "go to top of document")[§](#method_Str "direct link")

```raku
method Str
```

Instance method returning the name of the object.

```raku
say $*RAKU.Str; # OUTPUT: «Raku␤»
```

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

Type relations for `Systemic`

raku-type-graph

Systemic
Systemic

Mu
Mu

Any
Any

Any->Mu

VM
VM

VM->Systemic

VM->Any

Compiler
Compiler

Compiler->Systemic

Compiler->Any

Raku
Raku

Raku->Systemic

Raku->Any

Perl
Perl

Perl->Raku

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


## dist_cpan-KAJI-App-Platform.md
# Platform Project Development

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

![Demo-Nginx-LDAP](demo/platform-nginx-ldap.gif)

# SYNOPSIS

```
Usage:	platform COMMAND

A tool for running projects through container environment programmatible way

Options:
  -D, --debug              Enable debug mode
  -a, --data-path string   Location of resource files (default "/Users/tojo/.platform")
  -d, --domain string      Domain address (default "localhost")
  -n, --network string     Network name (default "acme")

Commands:
  attach      Attach to a running container through shell
  create      Start shared platform services
  destroy     Shutdown shared platform services
  remove      Initialize single project or environment with collection of projects
  rm          Remove stopped project or environment
  run         Initialize single project or environment with collection of projects
  ssh         Wrapper to ssh* commandds
  ssl         Wrapper to openssl command
  start       Start suspended project or environment
  stop        Stop suspended project or environment

Run 'platform COMMAND --help' for more information on a command.

```

# Documentation

See <http://p6-platform.readthedocs.io> for documentation

# Installing

Quick and dirty if you have perl6 already installed:

`zef install App::Platform`


## dist_zef-jmaslak-DateTime-Monotonic.md
[![Build Status](https://travis-ci.org/jmaslak/Raku-DateTime-Monotonic.svg?branch=master)](https://travis-ci.org/jmaslak/Raku-DateTime-Monotonic)

# NAME

DateTime::Monotonic - is a Never-Decreasing Time-Elapsed Counter

# SYNOPSIS

```
#
# Procedural Interface
#
use DateTime::Monotonic :ALL;

my $start = monotonic-seconds;
# Do something that takes time here
my $end = monotonic-seconds;

say "Processing took at least {$end - $start} seconds";

#
# OO Interface
#

use DateTime::Monotonic;

my $tm = DateTime::Monotonic.new;

my $start = $tm.seconds;
# Do something that takes time here
my $end = $tm.seconds;

say "Processing took at least {$end - $start} seconds";

```

# DESCRIPTION

DateTime::Monotonic is A Never-Decreasing Time-Elapsed Counter.

This means that for any given instance of `DateTime::Monotonic`, the time will always increment, never decrement, even if the system clock is adjusted.

On Linux, this will use a monotonic second counter that is independent of the time-of-day clock. This allows reasonably accurate time measurements independent of the system clock being changed.

On non-Linux hosts, this will simulate a monotonic second counter by treating negative time shifts between successive calls to `seconds` as if no time elapsed. It will continue to be impacted by time shifts forward.

The procedural iterface uses a single, global, instance of `DateTime::Monotonic` initialized with default options. The OO instance allows multiple independent, instances of `DateTime::Monotonic` to be created. Each one independently starts counting from the first call of `seconds` on that instance.

# Procedural Interface

The procedural interface provides a simple way of accessing a globally-shared (within program scope) monotonic clock. It starts counting from the first access ("time zero").

To export all symbols, import the `:ALL` tag. Each procedure also has a tag (the name of the sub, prefaced by a colon) by which it is exported.

## monotonic-seconds(-->Numeric:D)

Returns relative time between this call and the first procedural interface call.

On the first procedural call, this will return "time zero" which is the value `0`. Following calls to `seconds` will return the time elapsed (in seconds, including fractional seconds) since this "time zero".

On Linux systems, this will provide reasonably accurate time regardless of system clock adjustement.

On Non-Linux systems, this will provide an always-incrementing number which will not be accurate with adjustments. If the time-of-day clock would indicate time went backwards between the procedural call and the previous procedural call, this sub will return the previous result (I.E. the number returned will be the same as if no time elapsed between calls). If time is adjusted forward between calls, this will return a value that appears to have caused more time to elapse than actually has elapsed - but it will always be in a forward direction.

This sub is thread safe.

## monotonic-whole-seconds(-->Int:D)

This is merely a wrapper around `monotonic-seconds` that provides the same result as `monotonic-seconds` but without the decimal component.

This sub is thread safe.

# ATTRIBUTES

## has-monotonic-support

This is `True` on systems with monotonic counters that are supported by this module (currently just Linux). If true, you can measure time elapsed reasonably accurately even if the system clock is adjusted.

If this is `False`, the monotonic support is emulated, subject to the limitations described below under `seconds`.

# METHODS

## seconds(-->Numeric:D)

Returns relative time between this `seconds` call and the first `seconds` call of this instance of `DateTime::Monotonic`.

On the first call for an instance of `DateTime::Monotonic`, will return "time zero" which is the value `0`. Following calls to `seconds` will return the time elapsed (in seconds, including fractional seconds) since this "time zero".

On Linux systems, this will provide reasonably accurate time regardless of system clock adjustement.

On Non-Linux systems, this will provide an always-incrementing number which will not be accurate with adjustments. If the time-of-day clock would indicate time went backwards between a `seconds` call and the previous `seconds` call, this method will return the previous result (I.E. the number returned will be the same as if no time elapsed between calls). If time is adjusted forward between calls, this will return a value that appears to have caused more time to elapse than actually has elapsed - but it will always be in a forward direction.

This method is thread safe.

# BUGS

While there are no known bugs, this module does not yet support non-Linux OSes fully. It will provide non-reversing time on those systems, but the module could be improved by adding additional OS support.

# AUTHOR

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

# COPYRIGHT AND LICENSE

Copyright © 2018-2022 Joelle Maslak

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