## dist_zef-jjatria-HTTP-Tiny.md
## NAME

HTTP::Tiny - A small, simple, correct HTTP/1.1 client

## SYNOPSIS

```
use HTTP::Tiny;

my $response = HTTP::Tiny.new.get: 'http://httpbin.org/get';

die "Failed!\n" unless $response<success>;

say "$response<status> $response<reason>";
# OUTPUT:
# 200 OK

for $response<headers>.kv -> $key, $v {
    for $v.List -> $value {
        say "$key: $value";
    }
}
# OUTPUT:
# content-type: application/json
# date: Fri, 09 Oct 2020 21:49:38 GMT
# connection: close
# content-length: 230
# server: gunicorn/19.9.0
# access-control-allow-origin: *
# access-control-allow-credentials: true

print $response<content>.decode if $response<content>;
# OUTPUT:
# {
#   "args": {},
#   "headers": {
#     "Host": "httpbin.org",
#     "User-Agent": "HTTP-Tiny",
#     "X-Amzn-Trace-Id": "..."
#   },
#   "origin": "...",
#   "url": "http://httpbin.org/get"
# }

```

## DESCRIPTION

This is a very simple but correct HTTP/1.1 client, designed for doing simple
requests without the overhead of a large framework like HTTP::UserAgent.

It is a Raku port of the Perl library of the same name. It supports
redirection, streaming requests and responses, multipart and URL-encoded
form uploads, and correctly handles multipart responses to ranged requests.

Cookie support depends on external classes, such as [Cookie::Jar](https://raku.land/zef:jjatria/Cookie::Jar) or some
other class with a compatible interface.

## METHODS

Calling the `new` method to construct an object is optional when using the
methods described in this section. When not doing so, `new` will be called
automatically before executing the request, and the created object will be
discarded after the request is complete.

### new

```
method new (
    Str   :$agent = 'HTTP-Tiny/VERSION Raku',
          :$cookie-jar,
          :%default-headers,
    Str   :$http-proxy,
    Str   :$https-proxy,
    Bool  :$keep-alive = True,
    Int   :$max-redirect = 5,
    Set() :%no-proxy,
    Bool  :$throw-exceptions,
) returns HTTP::Tiny

```

Creates a new HTTP::Tiny object. The following attributes are parameters:

#### agent

A Str to use as the value of the `User-Agent` header. Defaults to
'HTTP-Tiny/$VERSION Raku'.

#### cookie-jar

An object to use for parsing and storing cookies and generating the `Cookie`
header. The object must have an `add` method that can be called with the URL
and a `Set-Cookie` string to store a cookie; and a `header` method that can
be called with the request method and URL to generate the appropriate
`Cookie` header.

See [Cookie::Jar](https://raku.land/zef:jjatria/Cookie::Jar) for one possible implementation of such a cookie jar class.

#### default-headers

A Hash of default headers to apply to requests. Headers specified during the
call take precedence over the ones specified here.

#### max-redirect

Maximum number of redirects allowed. Defaults to 5. Set to 0 to prevent
redirection.

#### keep-alive

Whether to re-use the last connection, if it is for the same scheme, host,
and port. Defaults to True.

#### throw-exceptions

When set to True, non-success HTTP responses will throw a `X::HTTP::Tiny`
exception. The original error response Hash will be available as the result of
the `.response` method of the exception.

#### proxy

URL of a generic proxy server for both HTTP and HTTPS connections.

Defaults to the value in the `all_proxy` or `ALL_PROXY` environment
variables (in that order). Set to the empty string to ignore variables set in
the environment.

#### no-proxy

Set of domain suffixes that should not be proxied. Any value that implements
the `Set` method is allowed. A Str is also allowed, in which case it must be
a comma-separated list of suffixes that will be split, trimmed, and coerced to
a Set.

Defaults to the value in the `no_proxy`, which will be treated like the Str
case described above.

#### http-proxy

URL of a proxy server for HTTP connections.

Defaults to the value in the `http_proxy` or `HTTP_PROXY` environment
variables, or to the value of the `proxy` parameter described above (in that
order). Set to the empty string to ignore variables set in the environment.

#### https-proxy

URL of a proxy server for HTTPS connections.

Defaults to the value in the `https_proxy` or `HTTPS_PROXY` environment
variables, or to the value of the `proxy` parameter described above (in that
order). Set to the empty string to ignore variables set in the environment.

### delete

Shorthand method for calling `request` with 'DELETE' as the method. See the
documentation for `request` for full details on the supported parameters and
the return value.

### get

Shorthand method for calling `request` with 'GET' as the method. See the
documentation for `request` for full details on the supported parameters and
the return value.

### head

Shorthand method for calling `request` with 'HEAD' as the method. See the
documentation for `request` for full details on the supported parameters and
the return value.

### options

Shorthand method for calling `request` with 'OPTIONS' as the method. See the
documentation for `request` for full details on the supported parameters and
the return value.

### patch

Shorthand method for calling `request` with 'PATCH' as the method. See the
documentation for `request` for full details on the supported parameters and
the return value.

### post

Shorthand method for calling `request` with 'POST' as the method. See the
documentation for `request` for full details on the supported parameters and
the return value.

### put

Shorthand method for calling `request` with 'PUT' as the method. See the
documentation for `request` for full details on the supported parameters and
the return value.

### trace

Shorthand method for calling `request` with 'TRACE' as the method. See the
documentation for `request` for full details on the supported parameters and
the return value.

### request

```
method request (
    Str $method,
    Str $url,
       :%headers,
       :$content,
       :&data-callback,
       :&trailer-callback,
) returns Hash

```

Executes an HTTP request of the given method type on the given URL. The URL
must have unsafe characters escaped and international domains encoded. Valid
HTTP methods are 'GET', 'DELETE', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT',
and 'TRACE', with their names being case sensitive as per the HTTP/1.1
specification.

If the URL includes a "user:password" stanza, they will be used for
Basic-style authorisation headers. For example:

```
$ua.request: 'GET', 'http://Aladdin:open sesame@example.com/';

```

If the "user:password" stanza contains reserved characters, they must
be percent-escaped:

```
$ua.request: 'GET', 'http://john%40example.com:password@example.com/';

```

The `Authorization` header generated from these data will not be included
in a redirected request. If you want to avoid this behaviour you can set the
value manually, in which case it will not be modified or ignored.

The remaining named parameters are detailed below.

#### %headers

A map of headers to include with the request. If the value is a List of
strings, the header will be output multiple times, once with each value in the
array. The headers specified in this parameter overwrite any default ones.

The `Host` header is internally generated from the request URL [in accordance
with RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). It is a fatal error to specify this header. Other
headers may be ignored or overwritten if necessary for transport compliance,
but this will in general be avoided.

#### $content

A value to use for the body of the request, which can be a Blob, a Str or
Numeric, a Hash, or a Callable, with each of these modifying the default
assumptions about the request.

If `$content` is a Blob, the `Content-Type` header will default to
`application/octet-stream` and the contents of the Blob will be used as-is as
the body. The `Content-Length` header will also default to the number of
bytes in the Blob.

If `$content` is a Str or Numeric, it will be stringified by calling `Str`
on it and internally encoded as UTF-8 and converted to a Blob. The
`Content-Type` will in this case default to `text/plain;charset=UTF-8`,
but handling will otherwise be as detailed above.

If `$content` is a Hash, the default content type will depend on the values.
If any of the values is an IO::Path object it will be `multipart/form-data`,
otherwise it will be `application/x-www-form-urlencoded`.

If `$content` is a Callable, it will be called iteratively to produce the
body of the request. When called, it must return a Blob with the next part
of the body until the body has been fully generated, in which case it must
return an empty Blob, or a Blob type object.

Note that these behaviours are the *default* behaviours, and represent the
assumptions that will be made about the request based on the input.

When using a Callable, the `Content-Type` will default to
`application/octet-stream` and if no `Content-Length` header has been set,
the `Transfer-Encoding` will default to `chunked`, with each new part of the
body being sent in a separate chunk.

When using a Hash, its contents will be encoded depending on the value of the
`Content-Type` header. Using IO::Path objects as values is only supported
with multipart form encoding. If a value is a IO::Path, IO::Handle, or
anything that supports the `slurp` method, this will be called with the
`:bin` argument to provide the value of that key, and the content type will
be set to `application/octet-stream`. If using an IO::Path object, the
filename will be set to the result of calling `basename`.

If no value is set, no `Content-Type` or `Content-Length` headers will be
generated.

#### &data-callback

The data callback takes a block of code that will be executed once with each
chunk of the response body. The callback will be introspected to determine
how many arguments it can receive, and will be called with up to three
arguments each time:

* A Blob with the current encoded response chunk
* A Hash with the current state of the response Hash
* A Hash with the part headers (only for multipart responses)

This should allow customising the behaviour of the callback depending on the
response status or headers before receiving the full response body.

The callback must support at least the Blob argument. The other two are
optional. Not supporting any of these is an error.

#### &trailer-callback

When using a chunked transfer encoding, this callback will be called once after
the request body has been sent. It should return a Hash which will be used to
add trailing headers to the request.

#### The response Hash

The `request` method returns a Hash with the response. The Hash will have the
following keys:

success
: A Bool that will be true if the response status code starts with a 2.

url
: The URL that provided the response as a Str. This will be the URL provided by
the caller unless there were redirections, in which case it will be the last
URL queried in the redirection chain.

status
: The HTTP status code of the response as an Int.

reason
: The response phrase as provided by the server.

content
: The body of the response as a Buf[uint8]. This key will be missing if the
response had no content or if a data callback was provided to consume the
body. HTTP::Tiny will never automatically decode a response body.

headers
: A Hash of header fields. All header fields will be normalised to be lower
case. If a header is repeated, the value will be a List with the received
values as Str objects. Otherwise, the value will be a Str. Header values will
be decoded using ISO-8859-1 as per [RFC 7230 § 3.2.4](https://tools.ietf.org/html/rfc7230#section-3.2.4).

protocol
: The protocol of the response, such as 'HTTP/1.1' or 'HTTP/1.0'.

redirects
: If this key exists, it will hold a List of response Hash objects from the
encountered redirects in the order they occurred. This key will no exist if
no redirection took place.

If an exception is encountered during execution, the `status` field will be
set to '599' and the `content` field will hold the text of the exception.

### mirror

```
method mirror (
    Str  $url,
    IO() $file,
        :$content,
        :%headers,
        :&trailer-callback,
) returns Hash

```

Executes a `GET` request for the URL and saves the response body to the
specified file. The URL must have unsafe characters escaped and
international domain names encoded. If the file already exists, the request
will include an `If-Modified-Since` header with the modification timestamp
of the file if none has already been provided in the `:%headers` parameter.
The parent directories of the file will not be automatically created.

The value of `$file` can be anything that implements an `.IO` method.

The `success` field of the response will be true if the status code is 2XX
or if the status code is 304 (unmodified).

If the file was modified and the server response includes a properly formatted
`Last-Modified` header, the file modification time will be updated
accordingly. Note that currently this makes use of the `touch` system
command,and will therefore not work if this command is not available.

### can-ssl

```
with HTTP::Tiny.can-ssl {
    # SSL support is available
}
else {
    note 'SSL support not available: ' ~ .exception.message;
}

```

Indicates if SSL support is available by checking for the correct version
of [IO::Socket::SSL](https://raku.land/github:sergot/IO::Socket::SSL) (greater than or equal to 0.0.2). It will either return
True if SSL support is available, or a Failure indicating why it isn't.

## PROXY SUPPORT

HTTP::Tiny can proxy both HTTP and HTTPS requests. Only Basic proxy
authorization is supported and it must be provided as part of the proxy URL,
as in `http://user:pass@proxy.example.com/`.

HTTP::Tiny supports the following proxy environment variables:

* `http_proxy` or `HTTP_PROXY`
* `https_proxy` or `HTTPS_PROXY`
* `all_proxy` or `ALL_PROXY`

An HTTPS connection may be made via an HTTP proxy that supports the
`CONNECT` method (cf. RFC 2817). If your proxy itself uses HTTPS, you can
not tunnel HTTPS over it.

Be warned that proxying an HTTPS connection opens you to the risk of a
man-in-the-middle attack by the proxy server.

The `no_proxy` environment variable is supported in the format of a
comma-separated list of domain extensions proxy should not be used for.

Proxy arguments passed to `new` will override their corresponding
environment variables.

## LIMITATIONS

HTTP::Tiny aims to be *conditionally compliant* with the
[HTTP/1.1 specifications](http://www.w3.org/Protocols/):

* ["Message Syntax and Routing" [RFC7230]](https://tools.ietf.org/html/rfc7230)
* ["Semantics and Content" [RFC7231]](https://tools.ietf.org/html/rfc7231)
* ["Conditional Requests" [RFC7232]](https://tools.ietf.org/html/rfc7232)
* ["Range Requests" [RFC7233]](https://tools.ietf.org/html/rfc7233)
* ["Caching" [RFC7234]](https://tools.ietf.org/html/rfc7234)
* ["Authentication" [RFC7235]](https://tools.ietf.org/html/rfc7235)

It aims to meet all "MUST" requirements of the specification, but only some
of the "SHOULD" requirements.

Some particular limitations of note include:

* HTTP::Tiny focuses on correct transport. Users are responsible for
  ensuring that user-defined headers and content are compliant with the
  HTTP/1.1 specification.
* Users must ensure that URLs are properly escaped for unsafe characters
  and that international domain names are properly encoded to ASCII.
* Redirection is very strict against the specification. Redirection is
  only automatic for response codes 301, 302, 307 and 308 if the request
  method is `GET` or `HEAD`. Response code 303 is always converted into a
  `GET` redirection, as mandated by the specification. There is no
  automatic support for status 305 ("Use proxy") redirections.
* In the event of a redirect, the content of the original request will
  not be included, and any headers that make reference to the content will
  be removed. This also applies to other headers that do not make reference
  to content, but that are likewise rendered stale by the redirect, as per
  [RFC 9110 § 15.4](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.4).
* There is no provision for delaying a request body using an `Expect`
  header. Unexpected `1XX` responses are silently ignored as per the
  specification.
* Only 'chunked' `Transfer-Encoding` is supported.
* There is no support for a Request-URI of `*` for the `OPTIONS` request.
* Headers mentioned in the RFCs and some other, well-known headers are
  generated with their canonical case. The order of headers is not
  preserved: control headers are sent first, while the remainder are sent
  in an unspecified order.
* No mitigations for [httpoxy](https://httpoxy.org) have been implemented.
  If you are using this library under CGI, you are on your own.

## SEE ALSO

### Other Clients

#### [Cro::HTTP](https://raku.land/cpan:JNTHN/Cro::HTTP)

Part of the Cro family of libraries, it is written with asynchronous code as
its primary goal. Supports HTTP/2.0.

#### [Curlie](https://raku.land/cpan:BDUGGAN/Curlie)

A recent high-level interface based on `libcurl`. Depends on LibCurl,
mentioned below.

#### [HTTP::Tinyish](https://raku.land/cpan:SKAJI/HTTP::Tinyish)

Another port from Perl, HTTP::Tinyish offers a similar interface to this
library while relying on an externally available `curl` binary.

#### [HTTP::UserAgent](https://raku.land/github:sergot/HTTP::UserAgent)

The de-facto blocking HTTP client for Raku, used by most applications. If a
feature you want is not supported by HTTP::Tiny, try using this distribution.
It is included in the Rakudo Star distribution, so chances are you already
have it.

That said, at the time of writing HTTP::UserAgent does not handle 1XX
responses, nor does it support chunked requests.

#### [LibCurl](https://raku.land/github:CurtTilmes/LibCurl)

Raku bindings for `libcurl`. The bindings are fairly low-level, so they allow
for finer control than HTTP::Tinyish, but at the cost of a more complicated
interface.

#### [LWP::Simple](https://raku.land/zef:raku-community-modules/LWP::Simple)

An older an more barebones blocking HTTP client for Raku, preceding the
development of HTTP::UserAgent.

#### [Net::HTTP](https://raku.land/github:ugexe/Net::HTTP)

A library providing the building blocks to write your own HTTP client.
Supports connection caching and should be thread safe.

Code is fairly low-level, so use in real-world scenarios might require
some effort until more progress is done in the implementation of classes
like Net::HTTP::Client.

#### [WWW](https://raku.land/github:raku-community-modules/WWW)

This distribution exports a set of routines to run HTTP requests. It does
not implement its own transport layer, but is instead built on top of
HTTP::UserAgent.

### Additional Features

#### [Cookie::Jar](https://raku.land/zef:jjatria/Cookie::Jar)

Required for cookie support. Any class that supports `add` and `header`
methods like the ones in this class can be used with HTTP::Tiny.

#### [IO::Socket::SSL](https://raku.land/github:sergot/IO::Socket::SSL)

Required for HTTPS support.

## AUTHOR

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

## ACKNOWLEDGEMENTS

The code in this distribution is heavily inspired by that of
[the Perl library of the same name](https://metacpan.org/pod/HTTP::Tiny),
written by Christian Hansen and David Golden.

Some parts of the code have been adapted from existing solutions in the
HTTP::UserAgent codebase, which served as a reference on the use of the
Raku toolbox.

## COPYRIGHT AND LICENSE

Copyright 2019-2022 José Joaquín Atria

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


## numstr.md
class NumStr

Dual value floating-point number and string

```raku
class NumStr is Allomorph is Num { }
```

`NumStr` is a dual value type, a subclass of both [`Allomorph`](/type/Allomorph), hence [`Str`](/type/Str), and [`Num`](/type/Num).

See [`Allomorph`](/type/Allomorph) for further details.

```raku
my $num-str = <42.1e0>;
say $num-str.^name;         # OUTPUT: «NumStr␤»

my Num $num = $num-str;     # OK!
my Str $str = $num-str;     # OK!

# ∈ operator cares about object identity
say 42e10 ∈ <42e10  55  1>; # OUTPUT: «False␤»

```

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

## [method new](#class_NumStr "go to top of document")[§](#method_new "direct link")

```raku
method new(Num $i, Str $s)
```

The constructor requires both the [`Num`](/type/Num) and the [`Str`](/type/Str) value, when constructing one directly the values can be whatever is required:

```raku
my $f = NumStr.new(42.1e0, "forty two and a bit");
say +$f; # OUTPUT: «42.1␤»
say ~$f; # OUTPUT: «"forty two and a bit"␤»
```

## [method Num](#class_NumStr "go to top of document")[§](#method_Num "direct link")

```raku
method Num
```

Returns the [`Num`](/type/Num) value of the `NumStr`.

## [method Numeric](#class_NumStr "go to top of document")[§](#method_Numeric "direct link")

```raku
multi method Numeric(NumStr:D: --> Num:D)
multi method Numeric(NumStr:U: --> Num:D)
```

The `:D` variant returns the numeric portion of the invocant. The `:U` variant issues a warning about using an uninitialized value in numeric context and then returns value `0e0`.

## [method Real](#class_NumStr "go to top of document")[§](#method_Real "direct link")

```raku
multi method Real(NumStr:D: --> Num:D)
multi method Real(NumStr:U: --> Num:D)
```

The `:D` variant returns the numeric portion of the invocant. The `:U` variant issues a warning about using an uninitialized value in numeric context and then returns value `0e0`.

# [Operators](#class_NumStr "go to top of document")[§](#Operators "direct link")

## [infix `===`](#class_NumStr "go to top of document")[§](#infix_=== "direct link")

```raku
multi infix:<===>(NumStr:D $a, NumStr:D $b)
```

`NumStr` Value identity operator. Returns `True` if the [`Num`](/type/Num) values of `$a` and `$b` are [identical](/routine/===) and their [`Str`](/type/Str) values are also [identical](/routine/===). Returns `False` otherwise.

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

Type relations for `NumStr`

raku-type-graph

NumStr
NumStr

Allomorph
Allomorph

NumStr->Allomorph

Num
Num

NumStr->Num

Mu
Mu

Any
Any

Any->Mu

Cool
Cool

Cool->Any

Stringy
Stringy

Str
Str

Str->Cool

Str->Stringy

Allomorph->Str

Numeric
Numeric

Real
Real

Real->Numeric

Num->Cool

Num->Real

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


## dist_cpan-JFORGET-Date-Calendar-Persian.md
# NAME

Date::Calendar::Persian - Conversions from / to the Persian calendar

# SYNOPSIS

Converting a Gregorian date (e.g. 16th February 2021) into Persian

```
use Date::Calendar::Persian;
my Date $dt-greg;
my Date::Calendar::Persian $dt-persian;

$dt-greg    .= new(2021, 2, 16);
$dt-persian .= new-from-date($dt-greg);

say $dt-persian;
# --> 1399-11-28
say $dt-persian.strftime("%A %d %B %Y");
# --> Se shanbe 28 Bahman 1399

```

Converting a Persian date (e.g. 1 Farvardin 1400) into Gregorian

```
use Date::Calendar::Persian;
my Date::Calendar::Persian $dt-persian;
my Date $dt-greg;

$dt-persian .= new(year => 1400, month => 1, day => 1);
$dt-greg   = $dt-persian.to-date;

say $dt-greg;
# --> 2021-03-21

```

# DESCRIPTION

Date::Calendar::Persian is a class representing dates in the Persian
calendar. It allows you to convert a Persian date into Gregorian or
into other implemented calendars, and it allows you to convert dates
from Gregorian or from other calendars into Persian.

The Date::Calendar::Persian class gives the arithmetic version of the
Persian calendar. The astronomic Persian calendar is partially
implemented in Date::Calendar::Persian::Astronomical, included in this
distribution.

# INSTALLATION

```
zef install Date::Calendar::Persian

```

or

```
git clone https://github.com/jforget/raku-Date-Calendar-Persian.git
cd raku-Date-Calendar-Persian
zef install .

```

# AUTHOR

Jean Forget [JFORGET@cpan.org](mailto:JFORGET@cpan.org)

# COPYRIGHT AND LICENSE

Copyright (c) 2021 Jean Forget, all rights reserved.

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


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

# NAME

IRC::Log::Textual - interface to IRC logs from Textual

# SYNOPSIS

```
use IRC::Log::Textual;

my $log = IRC::Log::Textual.new($filename.IO);

say "Logs from $log.date()";
.say for $log.entries.List;

my $log = IRC::Log::Textual.new($text, $date);

```

# DESCRIPTION

The IRC::Log::Textual distrubution provides an interface to the IRC logs that are generated by the *Textual* application on MacOS. Please see [C<IRC::Log](https://raku.land/zef:lizmat/IRC::Log) for more information.

Since Textual stores its daily file in the local time zone, specifying a path with `.new` will **also** read the files in the same directory that are one day before it and one day after it to make sure all entries of the date in UTC are captured.

# AUTHOR

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

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

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

# COPYRIGHT AND LICENSE

Copyright 2021, 2025 Elizabeth Mattijsen

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


## mrobasedmethoddispatch.md
role Metamodel::MROBasedMethodDispatch

Metaobject that supports resolving inherited methods

```raku
role Metamodel::MROBasedMethodDispatch { }
```

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

This role implements locating methods based on the method resolution order of related (usually "super"/"parent") types.

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

## [method find\_method](#role_Metamodel::MROBasedMethodDispatch "go to top of document")[§](#method_find_method "direct link")

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

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

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

```

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

## [method find\_method\_qualified](#role_Metamodel::MROBasedMethodDispatch "go to top of document")[§](#method_find_method_qualified "direct link")

```raku
method find_method_qualified($obj, $type, $name)
```

Given a method name and a type, returns the method from that type. This is used in calls like

```raku
self.SomeParentClass::the_method();

```

## [method can](#role_Metamodel::MROBasedMethodDispatch "go to top of document")[§](#method_can "direct link")

```raku
method can($obj, $name)
```

Returns the list of methods of that name the object can do.

## [method publish\_method\_cache](#role_Metamodel::MROBasedMethodDispatch "go to top of document")[§](#method_publish_method_cache "direct link")

```raku
method publish_method_cache($obj)
```

Walk MRO and add methods to cache, unless another method lower in the class hierarchy "shadowed" it.


## dist_github-whity-Hematite-Middleware-Session.md
# Hematite Session Middleware

[![test](https://github.com/whity/raku-hematite-middleware-session/actions/workflows/test.yml/badge.svg)](https://github.com/whity/raku-hematite-middleware-session/actions/workflows/test.yml)

## Usage

```

use Logger;
use Hematite;
use Hematite::Middleware::Session;

class App is Hematite::App {
    method startup {
        self.log.level = Logger::DEBUG;

        # encrypted cookie
        # self.use(
        #     Hematite::Middleware::Session.create(
        #         store => {
        #             type   => 'cookie',
        #             secret => 'secret', # encryption secret key (required),
        #             # secret => ['current', 'old'],
        #         },
        #         cookie     => 'sid',
        #         expires_in => '1hour',
        #     )
        # );

        # redis
        # self.use(
        #     Hematite::Middleware::Session.create(
        #         store => {
        #             type => 'redis',
        #             host => '127.0.0.1',
        #             port => '6379',
        #         },
        #         cookie     => 'sid',
        #         expires_in => '1hour',
        #     )
        # );

        self.GET('/', sub ($ctx) {
            # get session/flash value
            say $ctx.flash<y>;
            say $ctx.session<x>;

            # set session/flash values
            $ctx.flash<y>   = 'y';
            $ctx.session<x> = 'x';

            return $ctx.render('session middleware test', inline => True);
        });
    }
}

```

## TODO

* better doc
* unit tests
* ...

## Contributing

1. Fork it ( [https://github.com/[your-github-name]/raku-hematite-middleware-session/fork](https://github.com/%5Byour-github-name%5D/raku-hematite-middleware-session/fork) )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request

## Contributors

* whity(<https://github.com/whity>) André Brás - creator, maintainer


## adverb.md
class X::Syntax::Regex::Adverb

Compilation error due to an unrecognized regex adverb

```raku
class X::Syntax::Regex::Adverb does X::Syntax { }
```

Syntax error thrown when an unrecognized or illegal regex adverb is encountered.

For example

```raku
rx:g/a/

```

dies with

｢text｣ without highlighting

```

```

===SORRY!===
Adverb g not allowed on rx

```

```

because `:g` belongs to a match operation, not a regex itself.

# [Methods](#class_X::Syntax::Regex::Adverb "go to top of document")[§](#Methods "direct link")

## [method adverb](#class_X::Syntax::Regex::Adverb "go to top of document")[§](#method_adverb "direct link")

```raku
method adverb(--> Str:D)
```

Returns the illegally used adverb

## [method construct](#class_X::Syntax::Regex::Adverb "go to top of document")[§](#method_construct "direct link")

```raku
method construct(--> Str:D)
```

Returns the name of the construct that adverb was used on (`m`, `ms`, `rx`, `s`, `ss`).


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

# NAME

BSON::Simple - Simple codec for the BSON (Binary JSON) serialization format

# SYNOPSIS

```
use BSON::Simple;

# Encode a Raku value to BSON, or vice-versa
my $bson = bson-encode($value);
my $val1 = bson-decode($bson);              # Dies if more data past first decoded document
my $val2 = bson-decode($bson, my $pos = 0); # Updates $pos after decoding first document

# Request warnings when decoding deprecated BSON element types
# (default is to ignore deprecations and handle all known element types)
my $*BSON_SIMPLE_WARN_DEPRECATED = True;
my $bad  = bson-decode($deprecated);     # Warns, but returns decoding anyway

# Decode into default Raku Hash and Blob types, instead of ordered hashes
# and wrapped BSON::Simple::Binary objects
my $*BSON_SIMPLE_PLAIN_HASHES = True;
my $*BSON_SIMPLE_PLAIN_BLOBS  = True;
my $simple = bson-decode($bson);

```

# DESCRIPTION

BSON::Simple is a trivial implementation of the core functionality of the [BSON serialization format](https://bsonspec.org/), used as the primary data format of the [MongoDB document-oriented database](https://en.wikipedia.org/wiki/MongoDB).

Note that because it is important to retain key order, BSON maps are decoded as ordered hashes using the Hash::Ordered module. Likewise, several BSON types that must maintain a distinction from Raku's standard types are decoded into objects that do the BSON::Simple::Special role.

If you would prefer to decode into standard (unordered) Raku hashes, you can set the `$*BSON_SIMPLE_PLAIN_HASHES` dynamic variable to `True`. Likewise, if you would prefer to decode default-subtype Binary fields into plain Raku `Blob` objects (rather than wrapped into a `BSON::Simple::Binary` object), set the `$*BSON_SIMPLE_PLAIN_BLOBS` dynamic variable to `True`.

# CAVEATS

* Does not support the Decimal128 type yet

# RELATED

The older [BSON Raku module](https://raku.land/cpan:MARTIMM/BSON) also implements the BSON format. It has a much more detailed API, making it considerably more verbose in actual usage than BSON::Simple. It is also more difficult to adapt as one optional encoding among many for a generic data service (which might serve CSV, JSON, CBOR, and BSON, for example). Finally, its internal design makes it somewhat more difficult to optimize, as it was written before modern buffer handling was added to Raku and before parallelism overhead was fully understood.

On the other hand, that original BSON module has a decade of real world testing and many hundreds of commits behind it, and this module is brand new.

To see how this module compares to other data serialization modules, see [serializer-perf](https://github.com/japhb/serializer-perf) .

# AUTHOR

Geoffrey Broadwell [gjb@sonic.net](mailto:gjb@sonic.net)

# COPYRIGHT AND LICENSE

Copyright 2021,2025 Geoffrey Broadwell

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


## stashing.md
role Metamodel::Stashing

Metarole for type stashes

```raku
role Metamodel::Stashing { }
```

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

Types may have a stash associated with them, which is a named hash containing our-scoped symbols for that type's package. When this is the case, they can be used like namespaces; you can get their stash using their `WHO` property or with the `::` dispatch operator:

```raku
module Nested {
    module Namespace {
        constant Symbol = $?MODULE;
    }
}

say Nested::Namespace::Symbol;         # OUTPUT: «(Namespace)␤»
say Nested.WHO<Namespace>.WHO<Symbol>; # OUTPUT: «(Namespace)␤»

```

`Metamodel::Stashing` is the metarole that handles creating and setting a stash object for types. Types used with this metarole are expected to support naming, so when writing custom HOWs that do it, ensure they also do [`Metamodel::Naming`](/type/Metamodel/Naming).

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

## [method add\_stash](#role_Metamodel::Stashing "go to top of document")[§](#method_add_stash "direct link")

```raku
method add_stash($type_obj)
```

Creates and sets a stash for a type, returning `$type_obj`.

This method is typically called as the last step of creating a new type. For example, this is how it would be used in a minimal HOW that only supports naming and stashing:

```raku
class WithStashHOW
    does Metamodel::Naming
    does Metamodel::Stashing
{
    method new_type(WithStashHOW:_: Str:D :$name! --> Mu) {
        my WithStashHOW:D $meta := self.new;
        my Mu             $type := Metamodel::Primitives.create_type: $meta, 'Uninstantiable';
        $meta.set_name: $type, $name;
        self.add_stash: $type
    }
}

my Mu constant WithStash = WithStashHOW.new_type: :name<WithStash>;
say WithStash.WHO; # OUTPUT: «WithStash␤»

```


## glossary.md
## Chunk 1 of 2
Glossary

Glossary of Raku terminology

# [Abstract class](#Glossary "go to top of document")[§](#Abstract_class "direct link")

The generic Computer Science term "abstract class" defines the [interface](#Interface) or [API](#API) of a class. In Raku, this is implemented using [roles](#Roles) with [stubbed](#Stub) methods.

```raku
role Canine {
    method bark { ... }          # the ... indicates a stub
}

class Dog does Canine {
    method bark { say "woof" }   # *MUST* be implemented by class
}
```

# [Advent calendar](#Glossary "go to top of document")[§](#Advent_calendar "direct link")

In the context of Raku, a yearly set of blog posts for each day from the 1st until the 25th of December, to be found at <https://raku-advent.blog>.

# [Adverb](#Glossary "go to top of document")[§](#Adverb "direct link")

Generically, an adverb is a named argument to a function. There are also some specific syntax forms that allow adverbs to be tucked into some convenient places:

```raku
q:w"foo bar";   # ":w" is a Quotelike form modifier adverb
m:g/a|b|c/;     # ":g" is too
@h{3}:exists;   # ":exists" is too, but is known as a subscript adverb

```

Adverbs are usually expressed with colon pair notation, and for this reason colon pair notation is also known as the adverbial pair form:

```raku
:a(4)          # Same as "a" => 4
```

Some other forms that use a colon in ways that have adverb-like semantics are called adverbial forms. One special form starts with an integer value, followed by a name (for the key):

```raku
:20seconds     # same as seconds => 20
```

Also see [Colon pair and colon list](#Colon_pair_and_colon_list).

# [Adverbial pair](#Glossary "go to top of document")[§](#Adverbial_pair "direct link")

A generalized form of `pair notation`. They all start with the colon, as shown in the following examples:

| adverbial pair | pair notation |
| --- | --- |
| :foo<bar> | foo => 'bar' |
| :foo(42) | foo => 42 |
| :42foo | foo => 42 |
| :$foo | foo => $foo |
| :foo | foo => True |
| :!foo | foo => False |

Also see [Adverb](#Adverb) and [Colon pair and colon list](#Colon_pair_and_colon_list).

# [Allomorph](#Glossary "go to top of document")[§](#Allomorph "direct link")

A type that has two related values which may be used depending on the context. For example [`IntStr`](/type/IntStr) allomorph `is` both an [`Int`](/type/Int) and a [`Str`](/type/Str), so it will be accepted by anything that expects an [`Int`](/type/Int), a [`Str`](/type/Str), or an [`IntStr`](/type/IntStr). Keep in mind that certain constructs, such as [sets, bags, and mixes](/language/setbagmix) care about object identity, and so will not accept an allomorph as equivalent of its components alone.

The *allomorph* types [`IntStr`](/type/IntStr), [`NumStr`](/type/NumStr), [`RatStr`](/type/RatStr) and [`ComplexStr`](/type/ComplexStr) may be created as a result of parsing a string quoted with angle brackets:

```raku
say <42>.^name;     # OUTPUT: «IntStr␤»
say <42.1e0>.^name; # OUTPUT: «NumStr␤»
say <42.1>.^name;   # OUTPUT: «RatStr␤»
```

**Note**: angle brackets can also be used to create literals for which you'd normally need to use some operator (e.g. `/` for [`Rat`](/type/Rat) or `+` for [`Complex`](/type/Complex)). This allows you to use such literals in places where expressions are not allowed, for example, as literals in signatures:

```raku
# Wrong, can't use an operator there:
multi foo (1/3) { say "It's one third!" }

```

```raku
# Right, a Rat literal:
multi foo (<1/3>) { say "It's one third!" }

```

If you *do* want an allomorph and not a literal [`Numeric`](/type/Numeric), then include whitespace around angle brackets:

```raku
say <42/1>.^name;    # OUTPUT: «Rat␤»
say <42+0i>.^name;   # OUTPUT: «Complex␤»
say < 42+0i >.^name; # OUTPUT: «ComplexStr␤»
say < 42/1 >.^name;  # OUTPUT: «RatStr␤»
```

Please see [the Numerics page](/language/numerics#Allomorphs) for a more complete description on how to work with these allomorphs.

# [Anonymous](#Glossary "go to top of document")[§](#Anonymous "direct link")

A subroutine, method or submethod is called *anonymous* if it can't be called by name.

```raku
# named subroutine
sub double($x) { 2 * $x };

# anonymous subroutine, stored in a named scalar
my $double = sub ($x) { 2 * $x };
```

Note that it is still allowed to have a name, but you cannot call it by that name:

```raku
# anonymous, but knows its own name
my $s = anon sub triple($x) { 3 * $x }
say $s.name;        # OUTPUT: «triple␤»

```

```raku
say triple(42);     # OUTPUT: «Undeclared routine: triple␤»

```

# [API](#Glossary "go to top of document")[§](#API "direct link")

Application Programming Interface. Ideally, someone using your system or library should be able to do so with knowledge only of the API, but not necessarily knowing anything about the internals or the implementation details.

See also [abstract class](#Abstract_class).

# [Apocalypse](#Glossary "go to top of document")[§](#Apocalypse "direct link")

A document originally written by [TimToady](#TimToady), in which he processed the initial barrage of RFCs that came out of the Perl community. Now only kept as a historical document for reference. See also [Exegesis](#Exegesis) and [Synopsis](#Synopsis).

# [Arity](#Glossary "go to top of document")[§](#Arity "direct link")

The number of [`Positional`](/type/Positional) operands expected by an [operator](#Operator), subroutine, method or callable block.

```raku
sub infix:<+>(Foo $a, Foo $b) { $a.Int + $b.Int }  # arity of "+" is 2
sub frobnicate($x) { ... }                         # arity of 1
sub the-answer() { 42 }                            # arity of 0
-> $key, $value { ... }                            # arity of 2

```

The arity of a [`Callable`](/type/Callable) is one of the main selectors in [multi-dispatch](#Multi-dispatch).

# [ASCII operator](#Glossary "go to top of document")[§](#ASCII_operator "direct link")

The ASCII variant of a non-ASCII Unicode [operator](#Operator) or [symbol](#Symbol). For instance, `(elem)` corresponds to the `∈` ("Is this an element of that set?") operator that comes from set theory. ASCII operators are a workaround to the problem that people don't know how to type Unicode yet. Culturally, while we encourage people to use the Unicode symbols in a vague sort of way, we do not disparage the use of the [ASCII variants](/language/unicode_ascii). Well, maybe just a little...

# [Autothreading](#Glossary "go to top of document")[§](#Autothreading "direct link")

Autothreading is what happens if you pass a [`Junction`](/type/Junction) to a subroutine that expects a parameter of type [`Any`](/type/Any) or a subtype thereof (such as anything [`Cool`](/type/Cool)). The call is then executed for each value of the junction. The result of these calls is assembled in a new junction of the same type as the original junction.

```raku
sub f($x) { 2 * $x };
say f(1|2|3) == 4;    # OUTPUT: «any(False, True, False)␤»
```

Here `f()` is a sub with one parameter, and since it has no explicit type, it is implicitly typed as [`Any`](/type/Any). The [`Junction`](/type/Junction) argument causes the `f(1|2|3)` call to be internally executed as `f(1)|f(2)|f(3)`, and the resulting junction is `2|4|6`. These are then all compared to `4`, resulting in a junction `False|True|False`. This process of separating junction arguments into multiple calls to a function is called *autothreading*.

If you use the resulting junction in a Boolean context, such as with an `if`, it collapses into a single Boolean which is `True` if any of the values in the junction are True.

```raku
if f(1|2|3) == 4 {    # fires because f(2) == 4 is true
    say 'success';
}

```

# [Backtracking](#Glossary "go to top of document")[§](#Backtracking "direct link")

Backtracking is the default way a regexp is matched. The engine is allowed to explore several ways moving backward in the string characters in order to allow every piece of a regexp to match something. For more information, see [Regexp Backtracking section](/language/regexes#Backtracking).

# [binder](#Glossary "go to top of document")[§](#binder "direct link")

When you pass an argument list to a function (or any other callable, like a method or a block), the argument list gets bound to the parameters in the signature. The code that does this is called the *binder*.

# [block](#Glossary "go to top of document")[§](#block "direct link")

[Blocks](/type/Block) are code object with its own lexical scope, which allows them to define variables without interfering with other in the containing block.

# [bytecode](#Glossary "go to top of document")[§](#bytecode "direct link")

Although Raku looks like an interpreted language, since it uses the `#!` form to run its scripts (and they are called *scripts*), it is actually [compiled to run in a virtual machine](https://www.reddit.com/r/perl6/comments/42dkme/perl6_not_being_an_interpreted_language/) so the compiler (currently Rakudo) generates [bytecode](https://en.wikipedia.org/wiki/Bytecode) that runs either in MoarVM or the Java Virtual Machine, the two VMs currently supported.

# [Camelia](#Glossary "go to top of document")[§](#Camelia "direct link")

A butterfly image intended primarily to represent Raku, The Language.

# [Colon pair and colon list](#Glossary "go to top of document")[§](#Colon_pair_and_colon_list "direct link")

A colon pair is a shorthand syntax used to create or visually present a [`Pair`](/type/Pair) object. The two most common forms are:

```raku
:a(4)          # Same as "a" => 4,   same as Pair.new("a", 4)
:a<4>          # Same as "a" => "4", same as Pair.new("a", val("4"))
```

This is also known as the adverbial pair form.

**Note**: when the part after the colon and before the balanced delimiters is not a legal identifier, other semantics apply, not all of which produce [`Pair`](/type/Pair) objects.

Two other common forms are:

```raku
:a             # Same as :a(True)
:!a            # Same as :a(False)
```

A colon list just means that a list that contains only colon pairs, does not need commas, or even spaces:

```raku
:a(4):c:!d:c   # Same as a => 4, c => True, d => False, c => True
```

Finally, if there is a variable with the same name as an intended adverbial pair, you don't have to specify the name twice, but just specify the adverb with the appropriate sigil:

| variable only | same as |
| --- | --- |
| :$foo | foo => $foo |
| :@bar | bar => @bar |
| :%mapper | mapper => %mapper |
| :&test | test => &test |

See also [Adverb](#Adverb).

# [Community](#Glossary "go to top of document")[§](#Community "direct link")

See <https://raku.org/community/> for information about how to participate in the friendly Raku community.

# [Damian Conway](#Glossary "go to top of document")[§](#Damian_Conway "direct link")

Original author of the [Exegesis](#Exegesis) (among many other things). See also <https://en.wikipedia.org/wiki/Damian_Conway>.

# [decont](#Glossary "go to top of document")[§](#decont "direct link")

Short for "decontainerize", meaning to remove an item [from its `Scalar` container](/language/containers), often to obtain [a different behavior](https://perl6advent.wordpress.com/2017/12/02/#theoneandonly) for items that have it.

# [diffy](#Glossary "go to top of document")[§](#diffy "direct link")

See [operator](#Operator). It means the type of the operator result is sufficiently different from its arguments that op= makes little sense.

# [Exegesis](#Glossary "go to top of document")[§](#Exegesis "direct link")

A document originally written by [TheDamian](#TheDamian), in which he tried to explain the [Apocalypses](#Apocalypse) to the common (wo)man. Now only kept as a historical document for reference. See also [Synopsis](#Synopsis).

# [Forward declarations](#Glossary "go to top of document")[§](#Forward_declarations "direct link")

Declare the scope and/or type of a functional entity (class or routine) without actually declaring its code by using the ["stub" operator](/language/operators#listop_...); code will be declared later on in the same file.

```raku
grammar Quux {
    my regex future {...};
    say "foobarbaz" ~~ /<future>/;
    regex future { f \w** 2 b \w ** 2 }
}

```

In this case, the regex acts as a method; please note that the scope is only declared once.

# [fiddly](#Glossary "go to top of document")[§](#fiddly "direct link")

Too complicated to apply a metaop to. See [operator](#Operator).

# [Handle](#Glossary "go to top of document")[§](#Handle "direct link")

A handle is a data structure used to store information about some input/output operation such as file or socket reading or writing. Raku uses [`IO::Handle`](/type/IO/Handle) as a base class for filehandles, and [`IO::Socket`](/type/IO/Socket) for sockets.

# [Huffmanize](#Glossary "go to top of document")[§](#Huffmanize "direct link")

With reference to [Huffman coding](https://en.wikipedia.org/wiki/Huffman_coding), "huffmanizing" is making things that are commonly used easier, and often shorter, to type. With things that are used less frequently it's both less of a bother to type longer pieces of code and often longer, more descriptive naming is necessary to easily be reminded of what the rarely-used feature does.

For example, printing output is a common task, while performing thread-safe atomic addition on native atomicity-safe integers is much less so. There's a need to "huffmanize" the task printing and that's why you can do it by just typing three letters [put](/routine/put). But there's no need to "huffmanize" the rarely-needed atomic operators, which is why you type the lengthier names, such as [atomic-inc-fetch](/routine/atomic-inc-fetch). The name [put](/routine/put) is a bit vague, but because it's commonly used, it's easy to learn what it does. On the other hand, the name [atomic-inc-fetch](/routine/atomic-inc-fetch) is rarer, and the more descriptive name helps recall its purpose better.

# [iffy](#Glossary "go to top of document")[§](#iffy "direct link")

Often used as a Boolean value. See [operator](#Operator). Made via the [`use` keyword](/language/modules#use).

# [import](#Glossary "go to top of document")[§](#import "direct link")

Include functions from a module in the current namespace.

# [infix stopper](#Glossary "go to top of document")[§](#infix_stopper "direct link")

An *infix stopper* is something that tells us the grammar not try to parse an infix at that point. Consider say `"abc42def" ~~ m|\d+|`. Ordinarily, a `|` in a regex is treated as an alternation, but since the infix stopper matches the current regex terminator, we don't continue and try to parse an infix at that point. The `|` is thus treated as the end of the regex.

# [Instance](#Glossary "go to top of document")[§](#Instance "direct link")

An *instance* of a class is also called an *object* in some other programming languages. It has storage for attributes and is often the return value of a call to a method called `new`, or a literal.

Instances of most types are defined to be `True` e.g., `defined($instance)` is `True`.

```raku
my Str $str = "hello";  ## this is with built-in types, e.g. Str
if defined($str) {
    say "Oh, yeah. I'm defined.";
}
else {
    say "No. Something off? ";
}

## if you wanted objects...
class A {
    # nothing here for now.
}

my $an_instance = A.new;
say $an_instance.defined.raku;# defined($an_instance) works too.
```

To put things another way, a class contains the blueprints of methods and attributes, and an instance carries it into the real world.

# [Interface](#Glossary "go to top of document")[§](#Interface "direct link")

An interface is an [abstract class](#Abstract_class).

# [Invocant](#Glossary "go to top of document")[§](#Invocant "direct link")

Caller, *the one who calls or invokes*. The invocant of a method would be the object on which that method is being called, or, in some cases, the class itself. *Invocant* is used instead of caller because the latter refers to the *scope*.

# [IRC](#Glossary "go to top of document")[§](#IRC "direct link")

Internet Relay Chat. Raku developers and users usually hang out on the `#raku` channel of `irc.libera.chat`. This channel is also populated by a host of friendly bots that allow you to interact with Raku and its codebase, as well as send delayed messages and other goodies. Check the full list in [the community page of raku.org](https://raku.org/community/irc).

# [IRC lingo](#Glossary "go to top of document")[§](#IRC_lingo "direct link")

The following terms are often used on the Raku related [IRC](#IRC) channels:

## [ALAP](#Glossary "go to top of document")[§](#ALAP "direct link")

As Late As Possible

## [autopun](#Glossary "go to top of document")[§](#autopun "direct link")

A self-referencing pun, e.g. "Are you ignorant or apathetic?" - "I don't know, and I don't care."

## [backlog](#Glossary "go to top of document")[§](#backlog "direct link")

That part of a discussion on an [IRC](#IRC) channel that you've missed. If it is not or no longer available in your IRC client, you can go to sites such as <https://irclogs.raku.org> to see what has been logged for you.

## [Bot](#Glossary "go to top of document")[§](#Bot "direct link")

A program that does automatic tasks on one or more [IRC](#IRC) channels by acting like a regular user (as far as the IRC server is concerned) and performing some tasks that may involve answering to users requests. Examples can be found [on the IRC page of raku.org](https://raku.org/community/irc).

## [Compilation unit or *compunit*](#Glossary "go to top of document")[§](#Compilation_unit_or_compunit "direct link")

A [compunit](https://github.com/rakudo/rakudo/blob/master/docs/module_management.md) is a piece of Raku code that is analyzed and compiled as a single unit. Typically, this piece of code will be contained in a single file, but code inside an [EVAL](/routine/EVAL) is also considered a compunit.

## [DWIM](#Glossary "go to top of document")[§](#DWIM "direct link")

*Do What I Mean*. A programming language designer motto. The opposite of a DWIM is a [WAT](#WAT).

## [flap](#Glossary "go to top of document")[§](#flap "direct link")

Sometimes a test will fail under some conditions, but not others; when this test passes in some test runs and fails in others, it's called flapping.

## [fossil](#Glossary "go to top of document")[§](#fossil "direct link")

Something in a generally current document that is no longer true but which has not yet been fixed by correcting or removing it.

## [FSVO](#Glossary "go to top of document")[§](#FSVO "direct link")

For Some Value Of...

## [FTFY](#Glossary "go to top of document")[§](#FTFY "direct link")

Fixed That For You

## [gradual typing](#Glossary "go to top of document")[§](#gradual_typing "direct link")

You don't have to specify types of variables and parameters, but if you do, it helps in early determination of impossible dispatches and better optimization. See also <https://en.wikipedia.org/wiki/Gradual_typing>.

## [IIRC](#Glossary "go to top of document")[§](#IIRC "direct link")

If I Read (or Remember) Correctly.

## [IMHO](#Glossary "go to top of document")[§](#IMHO "direct link")

In My Humble Opinion.

## [IWBN](#Glossary "go to top of document")[§](#IWBN "direct link")

It Would Be Nice

## [LHF](#Glossary "go to top of document")[§](#LHF "direct link")

Low Hanging Fruit. Usually used in the context of a (relatively) simple task to be performed by a (relative) newbie.

## [LGTM](#Glossary "go to top of document")[§](#LGTM "direct link")

Looks Good To Me

## [LTA](#Glossary "go to top of document")[§](#LTA "direct link")

Less Than Awesome. Usually used in the context of an error message that is rather non-descriptive or unrelated to the actual error.

## [NST](#Glossary "go to top of document")[§](#NST "direct link")

No Such Thing

## [Opt](#Glossary "go to top of document")[§](#Opt "direct link")

Short for "optimization", usually in either the context of [spesh](#Spesh) or JIT.

## [PB](#Glossary "go to top of document")[§](#PB "direct link")

Short for "problem". As in "that's not the pb".

## [PR](#Glossary "go to top of document")[§](#PR "direct link")

See [Pull request](#Pull_request).

## [P5](#Glossary "go to top of document")[§](#P5 "direct link")

Perl 5

## [P6](#Glossary "go to top of document")[§](#P6 "direct link")

Raku (née Perl 6)

## [RSN](#Glossary "go to top of document")[§](#RSN "direct link")

Real Soon Now.

## [RT](#Glossary "go to top of document")[§](#RT "direct link")

Request Tracker (<https://rt.perl.org/>). The place where all the bugs related to [Rakudo](#Rakudo) used to live. Nowadays, the Github issue tracker of the rakudo/rakudo repository is used for that.

## [TIMTOWTDI](#Glossary "go to top of document")[§](#TIMTOWTDI "direct link")

An alternative form of [TIMTOWTDI](#TMTOWTDI), explicitly including the "is" from the contraction "There's".

## [TMI](#Glossary "go to top of document")[§](#TMI "direct link")

Too Much Information.

## [TMTOWTDI](#Glossary "go to top of document")[§](#TMTOWTDI "direct link")

"There's More Than One Way To Do It", the Perl motto.

## [UGT](#Glossary "go to top of document")[§](#UGT "direct link")

"Universal Greeting Time" - i.e., it's always "morning".

## [WFM](#Glossary "go to top of document")[§](#WFM "direct link")

Works For Me

## [WIP](#Glossary "go to top of document")[§](#WIP "direct link")

Work In Progress

## [WP](#Glossary "go to top of document")[§](#WP "direct link")

Wikipedia

## [WW](#Glossary "go to top of document")[§](#WW "direct link")

Short for `wrong window`. When on [IRC](#IRC), someone types something in a channel that was intended for another channel, or for a private message.

# [Larry Wall](#Glossary "go to top of document")[§](#Larry_Wall "direct link")

[Perl's](#Perl) benevolent dictator for life, among many other things. See also <https://en.wikipedia.org/wiki/Larry_Wall>.

# [Lexing](#Glossary "go to top of document")[§](#Lexing "direct link")

Performing [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis), a step which usually precedes parsing.

# [Literal](#Glossary "go to top of document")[§](#Literal "direct link")

A *literal* is a piece of code that directly stands for an (often built-in) object and also refers to the object itself.

```raku
my $x = 2;      # the 2 is a literal
say $x;         # $x is not a literal, but a variable
my $s = "Foo";  # the "Foo" is a literal, the $s is a variable
```

Different types of literals are described in [the syntax document](/language/syntax#Literals).

# [LHS](#Glossary "go to top of document")[§](#LHS "direct link")

As an acronym left-hand side, it usually refers to the left hand side of an expression, and more specifically to the left-hand side of expressions such as `$lhs = "this would be the right-hand side"`. Since the left hand side of these expressions modify their value, when something behaves as a LHS it means that it can be read and written to.

# [lvalue](#Glossary "go to top of document")[§](#lvalue "direct link")

An *lvalue*, or a *left value*, is anything that can appear on the left-hand side of the assignment operator `=`. It is anything you can assign to.

Typical lvalues are variables, private and `is rw` attributes, lists of variables and lvalue subroutines.

Examples of lvalues:

| Declaration | lvalue | Comments |
| --- | --- | --- |
| my $x; | $x |  |
| my ($a, $b); | ($a, $b) |  |
| has $!attribute; | $!attribute | Only inside classes |
| has $.attrib is rw; | $.attrib |  |
| sub a is rw { $x }; | a() |  |

Examples of things that are not lvalues:

|  |  |
| --- | --- |
| 3 | literals |
| constant x = 3; | constants |
| has $.attrib; | attributes; you can only assign to $!attrib |
| sub f { }; f(); | "normal" subs are not writable |
| sub f($x) { $x = 3 }; | error - parameters are read-only by default |

These are typically called [rvalues](#rvalue).

# [Mainline](#Glossary "go to top of document")[§](#Mainline "direct link")

The `mainline` is the program text that is not part of any kind of block.

```raku
use v6.c;     # mainline
sub f {
              # not in mainline, in sub f
}
f();          # in mainline again

```

You can also have the mainline of any package-like declarator, such as class, [module](/language/modules), [grammar](/language/grammars), etc. These are typically run just after the class/module/grammar have been compiled (or when loaded from a precompiled file).

# [Mayspec](#Glossary "go to top of document")[§](#Mayspec "direct link")

Stands for "Maybe Specification". Usually refers to existing tests in the [language specification](https://github.com/Raku/roast/). The speaker is indicating they did not check whether the test is a spectest or a propspec test; i.e., whether the test is included in a released language specification or is a new test, proposed for the next version of the spec.

# [MoarVM](#Glossary "go to top of document")[§](#MoarVM "direct link")

MoarVM is short for Metamodel On A Runtime Virtual Machine. It's a virtual machine designed specifically for [NQP](#NQP) and its [MOP](/language/mop): [6model](#6model). A document about [the purpose of MoarVM](https://github.com/MoarVM/MoarVM/blob/master/docs/reveal.md). MoarVM has some similarities with the Hotspot VM so you may peruse its [glossary](http://openjdk.java.net/groups/hotspot/docs/HotSpotGlossary.html) for entries missing from the present one.

# [Multi-dispatch](#Glossary "go to top of document")[§](#Multi-dispatch "direct link")

The mechanism used to invoke different routines ([`Method`](/type/Method)s or [`Sub`](/type/Sub)s) of the same name, selecting the correct one based on the [`Parameter`](/type/Parameter) prototype and the arguments it was called with.

The selection process is primarily based on types and number of arguments ([arity](#Arity)), where the narrowest, most specific candidate wins, typically without regard to the order of declaration. The `is default` trait may be used as a tie breaker in this first phase. There is also a secondary phase where some different tie breakers may be evaluated in order of declaration of the methods or subs.

# [multi-method](#Glossary "go to top of document")[§](#multi-method "direct link")

A [method](/type/Method) that has multiple candidates going by the same name and are subject to [Multi-Dispatch](#Multi-dispatch).

# [Née](#Glossary "go to top of document")[§](#Née "direct link")

"Formerly known as".

# [NFG](#Glossary "go to top of document")[§](#NFG "direct link")

Normal Form Grapheme is the way Raku implements graphemes, using a normal form in which strings with the same graphemes can be easily compared in constant time. More on that on [these articles](https://6guts.wordpress.com/2015/04/12/this-week-unicode-normalization-many-rts/) [in 6guts](https://6guts.wordpress.com/2015/04/20/this-week-digging-into-nfg-fixing-use-fatal-and-more/) and a fun explanation of how NFG works in [this IRC log](https://irclogs.raku.org/perl6/2018-04-29.html#16:57-0002).

# [Niecza](#Glossary "go to top of document")[§](#Niecza "direct link")

An implementation of Raku targeting the .NET platform. No longer actively maintained.

# [Not Quite Perl](#Glossary "go to top of document")[§](#Not_Quite_Perl "direct link")

See [NQP](#NQP).

# [NQP](#Glossary "go to top of document")[§](#NQP "direct link")

NQP is a primitive language for writing subroutines and methods using a subset of the Raku syntax. It's not intended to be a full-fledged programming language, nor does it provide a runtime environment beyond the basic VM primitives. Compilers (such as [Rakudo](#Rakudo)) typically use NQP to compile action methods that convert a parse tree into its equivalent abstract syntax tree representation.

# [NYI](#Glossary "go to top of document")[§](#NYI "direct link")

Not Yet Implemented

# [opcode](#Glossary "go to top of document")[§](#opcode "direct link")

An opcode, or operation code, is a bytecode operation, that is, a command of the language actually used on the virtual machine. They are not usually intended for human consumption, but they are usually specified somewhere, like [this document for MoarVM](https://github.com/MoarVM/MoarVM/blob/master/docs/bytecode.markdown).

# [Operator](#Glossary "go to top of document")[§](#Operator "direct link")

An expression is made of operators and operands. More precisely it is made of an operator and operands that can be subexpressions or [value](#value)s. Operators are an alternative syntax for a [multi-method](#multi-method). With that syntax, what would be the arguments of the function are named operands instead. Operators are classified into [categories](https://github.com/Raku/old-design-docs/blob/master/S02-bits.pod#Grammatical_Categories) of categories. A category has a precedence, an arity, and can be [fiddly](#fiddly), [iffy](#iffy), [diffy](#diffy). Raku is very creative as to what is an operator, so there are many categories. Operators are made of many tokens, possibly with a subexpression. For example, `@a[0]` belongs to the postcircumfix category, is broken into the operand `@a` and the postcircumfix operator `[0]` where `0` is the postcircumfixed subexpression.

The `<O(I<...>)>` construction gives information about an operator that completes the information provided by its category. Below `%conditional` is the category, `:reducecheck<ternary>`, which specifies calling `.ternary` to post-process the [parse subtree](#Parse_tree) and `:pasttype<if>` specifies the NQP [opcode](#opcode) generated in the AST from the parse


## glossary.md
## Chunk 2 of 2
 subtree.

```raku
<O('%conditional, :reducecheck<ternary>, :pasttype<if>')>
```

# [Parse tree](#Glossary "go to top of document")[§](#Parse_tree "direct link")

A [parse tree](https://en.wikipedia.org/wiki/Parse_tree) represents the structure of a string or sentence according to a grammar. [`Grammar`](/type/Grammar)s in Raku output parse trees when they successfully match a string.

# [Parameter](#Glossary "go to top of document")[§](#Parameter "direct link")

[`Parameter`](/type/Parameter) is a class to define parameters to [`Sub`](/type/Sub)routines, [`Method`](/type/Method)s and [`Callable`](/type/Callable) blocks. As opposed to the arguments you specify when calling a subroutine/method/callable block.

```raku
sub foo($bar) { say $bar }     # $bar is a parameter
foo(42);                       # 42 is an argument
```

# [Parrot](#Glossary "go to top of document")[§](#Parrot "direct link")

A [virtual machine](#Virtual_machine) designed to run Raku and other dynamic languages. No longer actively maintained.

# [PAST](#Glossary "go to top of document")[§](#PAST "direct link")

[Parrot](#Parrot) AST.

# [Perl](#Glossary "go to top of document")[§](#Perl "direct link")

The Perl programming language.

# [Perl 6](#Glossary "go to top of document")[§](#Perl_6 "direct link")

The name used for Raku before October 2019.

# [PERL](#Glossary "go to top of document")[§](#PERL "direct link")

A way to describe [Perl](#Perl) as a language, considered to be improper by many in the [Perl Community](/language/community).

# [POD](#Glossary "go to top of document")[§](#POD "direct link")

**P**lain **O**l' **D**ocumentation, a documentation format understood by Raku. See [here](/language/pod) for further information.

# [POV](#Glossary "go to top of document")[§](#POV "direct link")

Stands for "Proof Of Viability". To be included in the language specification, a "proof of viability" implementation of the feature must exist in at least one mostly-compliant Raku compiler.

# [Propspec](#Glossary "go to top of document")[§](#Propspec "direct link")

Stands for "Proposed Specification". Usually refers to existing tests in the [language specification](https://github.com/Raku/roast/) that are proposed for inclusion in the next release.

# [Pull request](#Glossary "go to top of document")[§](#Pull_request "direct link")

A feature of [GitHub](https://github.com) and other git hosts like [GitLab](https://gitlab.com) that allows you to make patches to be easily applied using the GitHub web user interface. It means you request someone to do a git pull from your [repository](#Repository) to hers. PR is its usual acronym.

# [priming](#Glossary "go to top of document")[§](#priming "direct link")

Priming (sometimes called [partial function application](https://en.wikipedia.org/wiki/Partial_application) in other programming languages) is the act of creating a new function by providing some but not all of the arguments to an existing function. For example, to create a function that takes one argument and adds 42 to it, you could prime the addition operator with `42` as a single argument: `* + 42`. See [Whatever-priming](/type/Whatever) and [assuming](/type/Code#method_assuming).

# [property](#Glossary "go to top of document")[§](#property "direct link")

In this context, it either refers to an [object property](/language/objects#index-entry-Property-property), which is the value of an instance variable, or a [Unicode property](/language/regexes#Unicode_properties) which are codepoint features that allow programs to identify what kind of entity they represent, that is, if they are a letter, or a number, or something completely different like a control character.

# [pugs](#Glossary "go to top of document")[§](#pugs "direct link")

[pugs](https://en.wikipedia.org/wiki/Pugs) was one of the first interpreters/compilers written for Raku. It was written in Haskell by Audrey Tang.

# [QAST](#Glossary "go to top of document")[§](#QAST "direct link")

Successor to [PAST](#PAST) ('Q' being the next letter after 'P').

# [Rakudo](#Glossary "go to top of document")[§](#Rakudo "direct link")

Rakudo is the name of a Raku implementation that runs on [MoarVM](#MoarVM) and the JVM. It is an abbreviation of `Rakuda-do`, which, when translated from Japanese, means "The Way of the Camel". Also, in Japanese, "Rakudo" means "Paradise."

# [Reify](#Glossary "go to top of document")[§](#Reify "direct link")

In the English language, [reify means](https://www.dictionary.com/browse/reify) "to convert into or regard as a concrete thing." Its meaning in Raku is very similar, in that conceptual things, like "elements of an infinite list", get *reified* when you try to operate on some of them. In general, reification means turning a potential element (be it an element in a lazy list that has not been computed yet or an element in a container that has not been extracted) into its actual value.

# [Repository](#Glossary "go to top of document")[§](#Repository "direct link")

A filesystem under control of a source control management application, usually git, that holds the sources for a project, library or application. This file, for instance, is in [a GitHub repository](https://github.com/Raku/doc). Repositories store not only files, but also history of changes and can be used by the developing or writing team for interaction through issues or comments to code.

In Raku context, however, a repository is also a short name for *compilation unit repository* and constitutes a system that locates and loads modules, managing their installation and precompilation. They are structured as linked lists, including chain of repositories ending in the default `Compunit::Repository::Installation`.

# [RHS](#Glossary "go to top of document")[§](#RHS "direct link")

Acronym for Right-Hand Side, usually refers to the right-hand side of assignment expressions such as `my $bound := $rhs`.

# [roast](#Glossary "go to top of document")[§](#roast "direct link")

The Raku [specification tests](#Test_suite), which live here: <https://github.com/Raku/roast/>. Originally developed for [pugs](#pugs), it now serves all Raku implementations. Why roast? It's the **r**epository **o**f **a**ll **s**pec **t**ests.

# [Roles](#Glossary "go to top of document")[§](#Roles "direct link")

Roles, mix-ins or traits define interfaces and/or implementation of those interfaces as well as instance variables using them, and are mixed-in when declaring classes that follow that interface. [Abstract classes](#Abstract_class) are particular examples of Roles where the actual implementation is deferred to the class that uses that Role.

Roles are part of Raku's [object system](/language/objects), and are declared using the [role](/language/objects#index-entry-role_declaration-role) keyword and used in class declaration via [does](/routine/does).

# [rvalue](#Glossary "go to top of document")[§](#rvalue "direct link")

A value that can be used on the right-hand side of an assignment. See also [lvalue](#lvalue).

# [SAP](#Glossary "go to top of document")[§](#SAP "direct link")

Stands for "Specification APpendices". The [SAP](https://github.com/Raku/roast/tree/master/APPENDICES) includes optional tests that implementations may choose to follow, but don't necessarily have to.

Can be used as a verb. To *SAP* something is to place it into Specification Appendices.

# [Semilist](#Glossary "go to top of document")[§](#Semilist "direct link")

A semilist is a *semicolon-separated* list like this one: `1;3;5`, and is actually a list of lists, with each component of the semilist being a slice of a particular dimension. `@array[1;3;5]` would be equivalent to `@array[1][3][5]`.

# [Sigil](#Glossary "go to top of document")[§](#Sigil "direct link")

In Perl, the sigil is the first character of a variable name. It must be either $, @, %, or & respectively for a [`Scalar`](/type/Scalar), [`Array`](/type/Array), [`Hash`](/type/Hash), or [`Code`](/type/Code) variable. See also Twigil and role. Also sigiled variables allow short conventions for [variable interpolation](#Variable_interpolation) in a double quoted string, or even postcircumfix expressions starting with such a variable.

# [Sigilless variable](#Glossary "go to top of document")[§](#Sigilless_variable "direct link")

[Sigilless variables](/language/variables#index-entry-\_(sigilless_variables)) are actually aliases to the value it is assigned to them, since they are not containers. Once you assign a sigilless variable (using the escape `\`), its value cannot be changed.

# [Spesh](#Glossary "go to top of document")[§](#Spesh "direct link")

A functionality of the [MoarVM](#MoarVM) platform that uses runtime gathered data to improve commonly used pieces of [bytecode](#bytecode). It is much like a JIT compiler, except that those usually output machine code rather than bytecode.

# [STD](#Glossary "go to top of document")[§](#STD "direct link")

`STD.pm` is the "standard" Raku grammar definition (see <https://github.com/perl6/std/>) that was used to implement Raku. STD.pm is no longer really a "specification" in a proscriptive sense: it's more of a guideline or model for Raku implementations to follow.

# [Stub](#Glossary "go to top of document")[§](#Stub "direct link")

Stubs define name and signature of methods whose implementation is deferred to other classes.

```raku
role Canine {
    method bark { ... }          # the ... indicates a stub
}
```

Classes with stubs are [Abstract classes](#Abstract_class).

# [Symbol](#Glossary "go to top of document")[§](#Symbol "direct link")

Fancy alternative way to denote a name. Generally used in the context of [module](/language/modules)s linking, be it in the OS level, or at the Raku [virtual machine](#Virtual_machine) level for modules generated from languages targeting these VMs. The set of imported or exported symbols is called the symbol table.

# [Synopsis](#Glossary "go to top of document")[§](#Synopsis "direct link")

The current human-readable description of the Raku language. Still in development. Much more a community effort than the [Apocalypses](#Apocalypse) and [Exegeses](#Exegesis) were. The current state of the language is reflected by [roast](#roast), its [test suite](#Test_suite), not the synopses where speculative material is not always so flagged or more recent additions have not been documented. This is even more true of material that has not been yet implemented.

# [Syntax analysis](#Glossary "go to top of document")[§](#Syntax_analysis "direct link")

A syntax or syntactic analysis is equivalent to [parsing](https://en.wikipedia.org/wiki/Parsing) a string to generate its [parse tree](#Parse_tree).

# [Test suite](#Glossary "go to top of document")[§](#Test_suite "direct link")

The Raku test suite is [roast](#roast).

# [TheDamian](#Glossary "go to top of document")[§](#TheDamian "direct link")

[IRC](#IRC) screen name for [Damian Conway](#Damian_Conway), writer of the original [Exegeses](#Exegesis).

# [TimToady](#Glossary "go to top of document")[§](#TimToady "direct link")

[IRC](#IRC) screen name for [Larry Wall](#Larry_Wall), creator of Perl. The name comes from the pronunciation of [TIMTOWTDI](#TIMTOWTDI) as a word.

# [token](#Glossary "go to top of document")[§](#token "direct link")

In this context, a [`token`](/syntax/token) is a regex that does not backtrack. In general, [tokens](https://en.wikipedia.org/wiki/Lexical_analysis) are extracted from the source program while [lexing](#Lexing).

# [Thunk](#Glossary "go to top of document")[§](#Thunk "direct link")

A piece of code that isn't immediately executed, but doesn't have an independent scope.

# [Tight and loose precedence](#Glossary "go to top of document")[§](#Tight_and_loose_precedence "direct link")

In this context, tight or tighter refers to [precedence rules](/language/functions#Precedence) and is the opposite of `looser`. Precedence rules for new terms are always expressed in relationship with other terms, so `is tighter` implies that operands with that operator will be grouped before operands with the looser operator. Operators with [tight precedence](/language/operators#Tight_AND_precedence) are grouped with priority to others and are generally tighter than most others; loose [exactly the opposite](/language/traps#Loose_Boolean_operators), so it is always convenient to be aware of the exact precedence of all operators used in an expression.

# [Truthy and Falsy](#Glossary "go to top of document")[§](#Truthy_and_Falsy "direct link")

A value is "truthy" if it evaluates to `True` in Boolean context and "falsy" if it evaluates to `False`.

For example, a non-empty string is considered `True` and an empty string `False`:

```raku
say so "";                    # OUTPUT: «False␤»
say so "non-empty";           # OUTPUT: «True␤»

say "truthy" if "non-empty";  # OUTPUT: «truthy␤»

```

while [`Numeric`](/type/Numeric)s are considered `True` when non-zero:

```raku
say so  0;                    # OUTPUT: «False␤»
say so  1;                    # OUTPUT: «True␤»
say so -1;                    # OUTPUT: «True␤»

say "truthy" if -1;           # OUTPUT: «truthy␤»
say 0 || "falsy";             # OUTPUT: «falsy␤»

```

# [twine](#Glossary "go to top of document")[§](#twine "direct link")

A data structure used to hold a POD string with embedded formatting codes. For example:

```raku
=begin pod
C<foo>
=end pod
say $=pod[0].contents[0].contents.raku;

```

The output will be:

```raku
["", Pod::FormattingCode.new(type => "C", meta => [], config => {}, contents => ["foo"]),""]

```

[[1]](#fn1)

# [Type objects](#Glossary "go to top of document")[§](#Type_objects "direct link")

A [type object](/language/classtut#A_word_on_types) is an object that is used to represent a type or a class. Since in object oriented programming everything is an object, classes are objects too, and they inherit from [`Mu`](/type/Mu).

# [Type smiley](#Glossary "go to top of document")[§](#Type_smiley "direct link")

A [type smiley](/language/signatures#Constraining_argument_definiteness) is a suffix a type may have that indicates the definiteness of values that can typecheck against it. This may be `:D` to indicate that only defined values can typecheck (i.e. instances), `:U` to indicate that only undefined values can typecheck (i.e. type objects), or `:_` to indicate that both defined and undefined values can typecheck. These resemble emoticons, thus the name.

# [value](#Glossary "go to top of document")[§](#value "direct link")

A value is what is actually contained in a container such as a variable. Used in expressions such as [lvalue](/language/glossary#lvalue), to indicate that that particular container can be assigned to.

# [UB](#Glossary "go to top of document")[§](#UB "direct link")

Stands for "Undefined Behavior". In other words, it is something that is not explicitly specified by the language specification.

# [Value type](#Glossary "go to top of document")[§](#Value_type "direct link")

A type is known as a **value type** if it is immutable and any instance of that type is interchangeable with any other instance "of the same value"—that is, any instance constructed in the same way. An instance of a value type is often *called* a **value** (but should not be confused with [lvalue](#lvalue)s or [rvalue](#rvalue)s).

For example, numbers are value types, so a number constructed one place in your program with, for instance, the literal `3` can't be changed in any way—it simply *is* 3—and any later use of the literal `3` can safely be pointed at the same place in memory as the first with no ill consequences.

Classes doing the roles [`Numeric`](/type/Numeric) and [`Stringy`](/type/Stringy) are among a few examples of built-in value types.

A value type is created by ensuring that an instance of the value type is immutable (i.e., its attributes cannot be modified after construction) and that its [`WHICH`](/routine/WHICH) method returns the same thing every time an instance with the same value is constructed (and conversely returns a different thing every time an instance with a different value is constructed).

The language is free to optimize based on the assumption that equivalent instances of value types are interchangeable, but you should not depend on any such optimization. For instance, if you want [`clone`](/routine/clone) to return an instance of `self`, or you want instance construction to be [memoized](https://en.wikipedia.org/wiki/Memoization) so that re-construction of a previously-constructed value always returns the same instance, you currently must override this behavior yourself.

(The same would hold true of object finalization, but if your instances need special destruction behavior, you almost certainly do not actually have a value type. Values should be thought of as "timeless" and existing in some ideal form outside of your program's memory, like natural values are.)

# [Variable](#Glossary "go to top of document")[§](#Variable "direct link")

A variable is a name for a [container](/language/containers).

# [Variable interpolation](#Glossary "go to top of document")[§](#Variable_interpolation "direct link")

The value of variables is interpolated into strings by simply inserting that variable into the string:

```raku
my $polation="polation";
say "inter$polation";     # OUTPUT: «interpolation␤»
```

This might need curly braces in case it precedes some alphanumeric characters

```raku
my $inter="inter";
say "{$inter}polation"; # OUTPUT: «interpolation␤»
```

Interpolation occurs in [string context](/language/contexts#String), so a valid stringification method must exist for the class. More general interpolation can be achieved using the [double q](/language/quoting#Interpolation:_qq) quoting constructs.

# [Virtual machine](#Glossary "go to top of document")[§](#Virtual_machine "direct link")

A virtual machine is the Raku compiler entity that executes the [bytecode](#bytecode). It can optimize the bytecode or generate machine code Just in Time. Examples are [MoarVM](#MoarVM), [Parrot](#Parrot) (who are intended to run Raku) and more generic virtual machines such as JVM and Javascript.

## [WAT](#Glossary "go to top of document")[§](#WAT "direct link")

The opposite of a [DWIM](#DWIM); counter-intuitive behavior. It is said that to every DWIM there is a corresponding WAT. See also <https://www.destroyallsoftware.com/talks/wat>.

# [whitespace](#Glossary "go to top of document")[§](#whitespace "direct link")

A character or group of blank characters, used to separate words. An example is the space character « ».

# [6model](#Glossary "go to top of document")[§](#6model "direct link")

`6model` is used in the [MoarVM](/language/glossary#MoarVM), and provides primitives used to create an object system. It is described in [this presentation by Jonathan Worthington](https://jnthn.net/papers/2013-yapceu-moarvm.pdf) and implemented [here in MoarVM](https://github.com/MoarVM/MoarVM/tree/master/src/6model).

1 [[↑]](#fnret1) The `twine` is an array with an odd number of elements beginning with a simple string, alternating with formatting code objects and simple strings, and ending with a simple string; the formatting code objects are inter`twine`d with the strings. The strings may be empty (as shown in the example). A twine with no formatting code will contain one simple string.


## dist_zef-demayl-Email-Valid.md
# Email::Valid

Email::Valid - raku programming language library to validate/parse email addresses

## Synopsis

```
use v6.c;
use Email::Valid;

my $email = Email::Valid.new(:simple); # By default :simple( True )

if $email.validate("test@domain.tld") {
    say "test@domain.tld is valid";
}

say "Mailbox is: " ~ $email.parse('test@domain.tld')<email><mailbox>;
say "Domain is: "  ~ $email.parse('test@domain.tld')<email><domain>;
# Mailbox is: test
# Domain is: domain.tld

# Variant with custom type
my Email $str = 'test@test.com';

```

## Description

This module validates if given email is valid.
It's a validation only for "most" popular email types.
It allows IDN domains ( 'xn--' ) and IP address domains ( IPv4 + IPv6 ) disabled by default

## Methods

* validate( Str $email! --> Bool )
* parse( Str $email! --> Match ); # email => { 'mail@example.com' => { mailbox => 'mail', domain => {'example.com'=> [ example. ], tld => 'com' } } }
* mx\_validate( Str $email! --> Bool ) # Just check if domain has MX record
* extract( Str $text!, Bool :$matchs = False, Bool :$validate = False --> List )

## Constructor

* Bool mx\_check = False # MX test
* Bool allow-ip = False # Allow IPv4 & IPv6 as domain
* Bool allow-local = False # Allow IP private addresses in domain
* Bool allow-quoted = False # Allow quoted mailboxes ( "box"@domain.com )
* Bool simple = True # Perform only local tests ( w/o MX check for example )
* Str ns\_server = '8.8.8.8'# Define NS server for MX test
* Int ns\_server\_timeout = 5 # NS server timeout in seconds

## Examples

### Using MX check

* 8.8.8.8 is the default DNS server
* 5 seconds is the default NS lookup timeout

```
use Email::Valid;
use Sys::IP;
my $ns_server = Sys::IP.new.get_dns_ips().first // '8.8.8.8';
my $email = Email::Valid.new(:simple(False), :mx_check, :$ns_server, :ns_server_timeout(5) );

if !$email.validate("test@domain.tld") {
    say "Invalid"
} else {
	say "Valid"
}

```

### Extract emails from text & validate them

```
my $txt   = 'Some mails - <mail1@dont-exist.com,mail2@mail.com>'
my $email = Email::Valid.new(:!simple, :mx_check );

$email.extract( $txt, :validate ) ;
# (mail2@mail.com) because it has valid MX record

```

## TODO

* Add MX Check
* Add "Hello" Callback verification ( test if mailbox exists on target server )
* Add TLD check ( create module Net::Domain::TLD )
* Add POD documentation ( Inline )
* Allow multiple NS servers for MX test
* Allow quoted mailboxes
* Allow ip addresses in domain part
* Fix ( Add ) IDN domain char limit
* Improve check when Net::DNS module supports timeout and remove hack here


## declarator.md
class RakuAST::Doc::Declarator

Contains the declarator docs of a RakuAST object

```raku
class RakuAST::Doc::Declarator { }
```

The `RakuAST::Doc::Declarator` class contains the leading and trailing documentation of an object doing the [`RakuAST::Doc::DeclaratorTarget`](/type/RakuAST/Doc/DeclaratorTarget) role.

Support for [`RakuAST`](/type/RakuAST) functionality is available in language version `6.e+` and was added in Rakudo compiler release 2023.02. In earlier language versions it is only available when specifying:

```raku
use experimental :rakuast;
```

## [Object introspection](#class_RakuAST::Doc::Declarator "go to top of document")[§](#Object_introspection "direct link")

`RakuAST::Doc::Declarator` objects are typically created when parsing Raku Programming Language code that has objects with leading (`#|`) and trailing (`#=`) documentation on it. So most developers will only need to know how to introspect the objects created.

### [method WHEREFORE](#class_RakuAST::Doc::Declarator "go to top of document")[§](#method_WHEREFORE "direct link")

```raku
say "attached to a $declarator.WHEREFORE.^name() object";

```

Returns the object for which this object contains the declarator documentation.

### [method leading](#class_RakuAST::Doc::Declarator "go to top of document")[§](#method_leading "direct link")

```raku
.say for $declarator.leading;

```

Returns the lines of the leading declarator documentation (one for each line with `#|` if the object was created from parsing Raku source code.

### [method trailing](#class_RakuAST::Doc::Declarator "go to top of document")[§](#method_trailing "direct link")

```raku
.say for $declarator.trailing;

```

Returns the lines of the trailing declarator documentation (one for each line with `#=` if the object was created from parsing Raku source code.

### [method raku](#class_RakuAST::Doc::Declarator "go to top of document")[§](#method_raku "direct link")

```raku
# method .gist falls back to .raku
say $declarator;  # RakuAST::Doc::Declarator.new(...

```

Returns the string that is needed for the creation of the block using [`RakuAST`](/type/RakuAST) calls.

# [Object creation](#class_RakuAST::Doc::Declarator "go to top of document")[§](#Object_creation "direct link")

One seldom creates `RakuAST::Doc::Declarator` objects directly. This documentation is intended for those few people who'd like to devise their own way of programmatically building a `RakuAST::Doc::Declarator` object.

## [method new](#class_RakuAST::Doc::Declarator "go to top of document")[§](#method_new "direct link")

```raku
method new(
  Str:D :$WHEREFORE,  # the associated RakuAST object
        :@leading,    # leading lines of documentation
        :@trailing    # trailing lines of documentation
)

```

The `new` method can be called to create a new `RakuAST::Doc::Declarator` object. It only takes named arguments.

```raku
# there is no syntax for creating just a ::Declarator object

my $declarator = RakuAST::Doc::Declarator.new(
  :WHEREFORE(RakuAST::VarDeclaration::Simple.new(...)),
  :leading("line 1 leading","line 2 leading"),
  :trailing("line 1 trailing","line 2 trailing")
);

```

Note that the leading and trailing documentation may contain any left margin whitespace.

### [:WHEREFORE](#class_RakuAST::Doc::Declarator "go to top of document")[§](#:WHEREFORE "direct link")

The [`RakuAST`](/type/RakuAST) object for which this declarator contains the documentation.

### [:leading](#class_RakuAST::Doc::Declarator "go to top of document")[§](#:leading "direct link")

A [`Positional`](/type/Positional) with the lines of leading documentation strings.

### [:trailing](#class_RakuAST::Doc::Declarator "go to top of document")[§](#:trailing "direct link")

A [`Positional`](/type/Positional) with the lines of trailing documentation strings.

# [Object modification](#class_RakuAST::Doc::Declarator "go to top of document")[§](#Object_modification "direct link")

## [method set-WHEREFORE](#class_RakuAST::Doc::Declarator "go to top of document")[§](#method_set-WHEREFORE "direct link")

```raku
$declarator.set-WHEREFORE($object);

```

Set the object for which the `RakuAST::Doc::Declarator` object contains the documentation.

## [method set-leading](#class_RakuAST::Doc::Declarator "go to top of document")[§](#method_set-leading "direct link")

```raku
$declarator.set-leading;  # reset
$declarator.set-leading("foo", "bar");

```

Set the leading documentation. If no arguments are specified, reset to not having any leading documentation.

## [method add-leading](#class_RakuAST::Doc::Declarator "go to top of document")[§](#method_add-leading "direct link")

```raku
$declarator.add-leading("additional");

```

Add a line to the leading documentation.

## [method set-trailing](#class_RakuAST::Doc::Declarator "go to top of document")[§](#method_set-trailing "direct link")

```raku
$declarator.set-trailing;  # reset
$declarator.set-trailing("foo", "bar");

```

Set the trailing documentation. If no arguments are specified, reset to not having any trailing documentation.

## [method add-trailing](#class_RakuAST::Doc::Declarator "go to top of document")[§](#method_add-trailing "direct link")

```raku
$declarator.add-trailing("additional");

```

Add a line to the trailing documentation.


## dist_github-salortiz-LMDB.md
# LMDB

LMDB is a native Perl6 bindings for the OpenLDAP's lmdb (Lightning
Memory-Mapped Database) C library.

lmdb is an ultra-fast, ultra-compact key-value data store developed
by Symas for the OpenLDAP Project. See <http://symas.com/mdb/> for details.

## PREREQUISITES

Right now lmdb needs a 64bits platform.

Before you can install LMDB you need to have the following installed
on your system:

* Rakudo 2015.12 or superior
* lmdb Version 0.9.17 or greater.

  You can get the latest version from <https://github.com/LMDB/lmdb>.

  Some Linux distributions are now including it:

  * Fedora 20+

    `yum install lmdb-devel`
  * Ubuntu

    `apt-get install liblmdb0`
* The lmdb library must be compiled and installed for the NativeCall machinery to found it

## INSTALLATION

You install this module with zef:

```
zef install LMDB

```

## USE

See QUICK-GUIDE.md

\*\*\* WARNING \*\*\*
This is an early release to allow the interested people the testing and
discussion of the module: there is some missing features and you should
be aware that the API isn't in stone yet. See TODO

## COPYRIGHT

Copyright © 2016-2019 by Salvador Ortiz Garcia


## ord.md
ord

Combined from primary sources listed below.

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

See primary documentation
[in context](/type/Str#routine_ord)
for **routine ord**.

```raku
multi        ord(Str:D  --> Int:D)
multi method ord(Str:D: --> Int:D)
```

Returns the codepoint number of the base characters of the first grapheme in the string.

Example:

```raku
ord("A"); # 65
"«".ord;  # 171
```

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

See primary documentation
[in context](/type/Cool#routine_ord)
for **routine ord**.

```raku
sub ord(Str(Cool))
method ord()
```

Coerces the invocant (or in sub form, its argument) to [`Str`](/type/Str), and returns the [Unicode code point](https://en.wikipedia.org/wiki/Code_point) number of the first code point.

```raku
say 'a'.ord;            # OUTPUT: «97␤»
```

The inverse operation is [chr](/routine/chr).

Mnemonic: returns an ordinal number


## dist_zef-tony-o-Pluggable.md
# NAME

Pluggable - dynamically find modules or classes under a given namespace

This is a modified version orginally based on <https://github.com/tony-o/perl6-pluggable>.

# SYNOPSIS

Given a set of plugins in your library search path:

```
a::Plugins::Plugin1
a::Plugins::Plugin2
a::Plugins::PluginClass1::PluginClass2::Plugin3

```

And an invocation of Pluggable like this:

```
use Pluggable;

class a does Pluggable {
    method listplugins () {
        @($.plugins).map({.perl}).join("\n").say;
    }
}

a.new.listplugins;

```

The following output would be produced:

```
a::Plugins::Plugin1
a::Plugins::Plugin2
a::Plugins::PluginClass1::PluginClass2::Plugin3

```

# FEATURES

* Role as well as procedural interface
* Custom module name matching
* Finding plugins outside of the current modules namespace

# DESCRIPTION

## Object-Oriented Interface

When "doing" the Pluggable role, a class can use the "plugins" method:

```
$.plugins(:$base = Nil, :$plugins-namespace = 'Plugins', :$name-matcher = Nil)

```

### :$base (optional)

The base namespace to look for plugins under, if not provided then the namespace from which pluggable is invoked is used.

### :$plugins-namespace (default: 'Plugins')

The name of the namespace within *$base* that contains plugins.

### :$name-matcher (optional)

If present, the name of any module found will be compared with this and only returned if they match.

## Procedural Interface

In a similar fashion, the module can be used in a non-OO environment, it exports a single sub:

```
plugins($base, :$plugins-namespace = 'Plugins', :$name-matcher = Nil)

```

### $base (required)

The base namespace to look for plugins under. Unlike in the OO case, this is required in the procedural interface.

### :$plugins-namespace (default: 'Plugins')

The name of the namespace within *$base* that contains plugins.

### :$name-matcher (optional)

If present, the name of any module found will be compared with this and only returned if they match.

# DEBUGGING

If you're having trouble with an object you think should be loading but would like to find out what is bonking in `require`, set `$*DEBUG-PLUGINS` to a truthy value.

# LICENSE

Released under the Artistic License 2.0 <http://www.perlfoundation.org/artistic_license_2_0>

# AUTHORS

* Robert Lemmen <robertle@semistable.com>
* tony-o <https://www.github.com/tony-o/>


## positional.md
class X::Constructor::Positional

Error due to passing positional arguments to a default constructor

```raku
class X::Constructor::Positional is Exception { }
```

Thrown from [Mu.new](/type/Mu#method_new) when positional arguments are passed to it.

For example

```raku
class A { };
A.new(2, 3);
CATCH { default { put .^name, ': ', .Str } };
# OUTPUT: «X::Constructor::Positional: Default constructor for 'A' only takes named arguments␤»
```

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

Type relations for `X::Constructor::Positional`

raku-type-graph

Positional
Positional

Stringy
Stringy

Blob
Blob

Blob->Positional

Blob->Stringy

Mu
Mu

Any
Any

Any->Mu

Cool
Cool

Cool->Any

Iterable
Iterable

Range
Range

Range->Positional

Range->Cool

Range->Iterable

List
List

List->Positional

List->Cool

List->Iterable

Associative
Associative

IO::Path::Parts
IO::Path::Parts

IO::Path::Parts->Positional

IO::Path::Parts->Any

IO::Path::Parts->Iterable

IO::Path::Parts->Associative

Uni
Uni

Uni->Positional

Uni->Stringy

Uni->Any

Array
Array

Array->List

Slip
Slip

Slip->List

NFKC
NFKC

NFKC->Uni

NFD
NFD

NFD->Uni

NFC
NFC

NFC->Uni

NFKD
NFKD

NFKD->Uni

Buf
Buf

Buf->Blob

utf8
utf8

utf8->Blob

utf8->Any

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