=begin pod

=TITLE Glossary

=SUBTITLE Glossary of Perl 6 terminology

=head1 Abstract Class

The generic Computer Science term "abstract L<class|#Class>" defines the
L<interface|#Interface> or L<#API> of a class.  In Perl 6, this is
implemented using L<roles|#Role> with L<stubbed|#Stub> methods.

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

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

=head1 Actions

Action methods are typically used to perform transformations and
other actions while parsing a source code program.  Parse grammars
typically use the special token C< {*} > to indicate the point
at which an action method is to be invoked.  In addition, a line
containing C< {*} > may also use C< #= > to specify a "key" that
is to be passed to the action method.

=head1 Advent Calendar

In the context of Perl 6, a yearly set of blog posts for each day from
the 1st until the 25th of December, to be found at
L<https://perl6advent.wordpress.com>.

=head1 Adverb

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:

    q:w"foo bar"   # ":w" is a Quotelike form modifier adverb
    m:g/a|b|c/     # ":g" is also
    4 +> 5 :rotate # ":rotate" is an operator adverb
    @h{3}:exists   # ":exists" is also, 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:

    :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):

    :20seconds     # same as seconds => 20

Also see L<#Colon Pair and Colon List>.

=head1 Adverbial Pair

A generalized form of C<pair notation>.  They all start with the colon, like:

  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 L<#Adverb> and L<#Colon Pair and Colon List>.

=head1 Anonymous

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

    # 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:

    # anonymous, but knows its own name
    my $s = anon sub triple($x) { 3 * $x }
    say $s.name;        # triple
    say triple(42);     # Undeclared routine: triple

=head1 Any

The L<class|#Class> from which most things derive (inherit), except for
L<junctions|#Junction>.  C<Any> itself derives from L<#Mu>.

=head1 any()

A function generating a L<junction|#Junction> with "or" semantics (aka,
L<#True> if any of its values are C<True>.  See also L<any|/routine/any>.

=head1 API

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 implementation.

See also L<#Abstract Class>.

=head1 Apocalypse

A document originally written by L<#TimToady>, in which he processed the
initial barrage of RFC's that came out of the Perl community.  Now only kept
as an historical document for reference.  See also L<#Exegesis> and
L<#Synopsis>.

=head1 Argument

A value that you pass on to a L<subroutine|#Subroutine>, L<method|#Method>
or a L<callable block|#Callable>.  As opposed to the L<#Parameter> that is
specified in the definition of a subroutine/method/callable block.

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

=head1 Array

L<Array|/type/Array> is a subclass of L<List|/type/List> that is mutable.
This means you can e.g. C<.push> and C<.pop> on an array, whereas you cannot
do that on a list.  This is separate from the type of elements in the array:
if they are containers, then they are also mutable, but they don't have to
be.  Arrays are typically recognizable by the L<#@> L<sigil|#Sigil>.

    my @array = 1,2,3;
    say @a;             # [1 2 3]

=head1 Arity

The number of L<positional|#Positional> operands expected by an
L<operator|#Operator>, L<subroutine|#Subroutine>, L<method|#Method> or
L<callable block|#Callable>.

    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 C<Callable> is one of the main selectors in
L<multi-dispatch|#Multi-Dispatch>.

=head1 Attribute

A per-object storage slot.  Other programming languages refer to this as
C<Field>, C<Member>, C<Slot> or C<Property>.

In Perl 6, attributes are defined with the L<#has> keyword inside a
L<class|#Class>:

    class Dog {
        has $.name;    # public attribute "name"
    }

=head1 AST

Acronym for
L<B<A>bstract B<S>yntax B<T>ree|http://en.wikipedia.org/wiki/Abstract_syntax_tree>.
Used in many places, including L<actions|#Actions>, L<#PAST>, and L<#QAST>.

=head1 Autothreading

Autothreading is what happens if you pass a L<Junction|#Junction> to
a subroutine that expects a parameter of type L<#Any> or a subtype thereof
(such as anything L<#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.

    sub f($x) { 2 * $x };
    say f(1|2|3) == 4;    # any(False,True,False)

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

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

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

=head1 Bool

=head1 Callable

=head1 Camelia

=head1 camelia

The L<#Bot> on the #perl6 L<#IRC> channel that evaluates code, eg:

  [16:28:27]  <lizmat>  m: say "Hello world"
  [16:28:28]  <+camelia>    rakudo-moar 812a48: OUTPUT«Hello world␤»

This is a handy tool for showing people if the output is (un)expected.

=head1 Class

=head1 Code

=head1 Colon Pair and Colon List

A colon pair is a shorthand syntax used to create or visually present
a Pair object.  The two most common forms are:

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

This is also known as the adverbial pair form.  Note: when the part after
the colon and before the brackets is not a legal identifier, other
semantics apply, not all of which produce Pair objects.

Two other common forms are:

    :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:

    :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:

    :$foo          # same as foo => $foo
    :@bar          # same as bar => @bar
    :%mapper       # same as mapper => %mapper
    :&test         # same as test => &test

See also L<#Adverb>.

=head1 Constraint

Constraints are a restriction placed on acceptable types for a parameter
or subset type.  They are introduced with the word C<where>.  In the
following example, a constraint is used to make sure an error occurs if
anyone ever calls a subroutine named C<abbreviate> with a string which is
shorter than 10 characters:

    sub abbreviate(Str $thing where { .chars >= 10 }) { ... }

The C<Str> in the above example is also a constraint, but is usually
referred to as a "type constraint."

Note that you can also differentiate candidates in a
L<multi-dispatch|#Multi-Dispatch> by using a different constraint:

    multi sub abbreviate(Str $thing where { .chars > 10 }) {
        "$thing.substr(0,7)..."
    }
    multi sub abbreviate(Str $thing) { $thing }  # no constraint

    say abbreviate("Worthington");   # Worthin...
    say abbreviate("Mäsak");         # Mäsak

=head1 Cool

=head1 dalek

The L<#Bot> on the #perl6 L<#IRC> channel that reports changes made to
various Perl 6 related L<repositories|#Repository>.

  [15:46:40] <+dalek> doc: 2819f25 | lizmat++ | doc/Language/glossary.pod:
  [15:46:40] <+dalek> doc: Add stubs for stuff inside the glossary already
  [15:46:40] <+dalek> doc: review: https://github.com/perl6/doc/commit/2819f250

=head1 Damian Conway

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

=head1 Enum

=head1 Exegesis

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

=head1 False

The value representing logical C<False> of the L<#Bool> L<enum|#Enum>.

=head1 Field

See L<#Attribute>.

=head1 Grammar

=head1 handles

=head1 Hash

=head1 Instance

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

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

    my Str $str = "hello";  ## this is with builtin 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.perl;# 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.

=head1 Interface

=head1 IRC

Internet Relay Chat.  Perl 6 developers and users usually hang out on the
C<#perl6> channel of C<irc.freenode.org>.

=head1 IRC Lingo

The following terms are often used on the Perl 6 related L<#IRC> channels:

=head2 AFAICS

As Far As I Can See

=head2 AFAICT

As Far As I Can Tell

=head2 AFAIK

As Far As I Know

=head2 AFK

Away From Keyboard, as in logged in, but there's no one looking at the screen.

=head2 ALAP

As Late As Possible

=head2 autopun

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

=head2 backlog

That part of a discussion on an L<#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 L<http://irc.perl6.org> to see what has been logged for you.

=head2 BIAB

Back In A Bit.  As in, only L<afk|#AFK> for a little while.

=head2 Bot

A program that does automatic tasks on one or more L<#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 are L<#camelia>, L<#dalek> and L<#yoleaux>.

=head2 BRB

Be Right Back

=head2 DIHWIDT

Doctor, It Hurts When I Do This

=head2 DRY

Don't Repeat Yourself

=head2 DWIM

Do What I Mean.  A programmng language designer motto.

=head2 flap

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

=head2 fossil

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

=head2 FSVO

For Some Value Of...

=head2 FTFY

Fixed That For You

=head2 IC

I See

=head2 IIRC

If I Remember Correctly

=head2 IIUC

If I Understand Correctly

=head2 ISTR

I Seem To Remember

=head2 IWBN

It Would Be Nice

=head2 KISS

L<Keep It Simple, Stupid!|https://en.wikipedia.org/wiki/KISS_principle>, a
famous motto in computer science.

=head2 LGTM

Looks Good To Me

=head2 LHF

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

=head2 LMDDGTFY

Let Me DuckDuckGo That For You.  L<http://lmddgtfy.net>

=head2 LMGTFY

Let Me Google That For You.  L<http://lmgtfy.com/>

=head2 LTA

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

=head2 NST

No Such Thing

=head2 Opt

Short for "optimization", usually in either the context of L<spesh|#Spesh> or
L<#JIT>.

=head2 PB

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

=head2 PBP

"Perl Best Practices".  The book by Damian Conway outlining best practices
when programming Perl 5.

=head2 PR

See L<#Pull Request>.

=head2 P5

Perl 5

=head2 P6

Perl 6

=head2 RSN

Real Soon Now

=head2 RT

Request Tracker (L<http://rt.perl.org/>).  The place where all the bugs
related to L<#Rakudo> live.

=head2 Thnunk

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

=head2 TIMTOWTDI

An alternative form of L<#TMTOWTDI>, explicitly including the "is" from
the contraction "There's".

=head2 TMI

Too Much Information.

=head2 TMTOWTDI

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

=head2 UGT

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

=head2 WFM

Works For Me

=head2 WIP

Work In Progress

=head2 WP

Wikipedia

=head2 WW

Short for C<wrong window>.  When on L<#IRC>, someone types something in a
channel that was intended for another channel, or for a private message.

=head1 Invocant

The object upon which a method is called, is referred to as the I<invocant>
in Perl 6.  It is what C<self> refers to in a method.

    say 'str'.uc;   # 'str' is the invocant of method uc

    class A { method show { self } }
    say A.new.show;       # A.new

=head1 JIT

=head1 Junction

=head1 Larry Wall

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

=head1 List

=head1 Literal

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

    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

=head1 lvalue

An I<lvalue>, or a I<left value>, is anything that can appear on the left
hand side of the assignment operator C<=>.  It is anything you can assign
to.

Typical lvalues are variables, private and C<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 L<rvalues|#rvalue>.

=head1 Mainline

The C<mainline> is the program text that is not part of any kind of block.

    use v6;     # 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
L<class|#class>, L<module|#Module>, L<grammar|#Grammar>, etc.  These are
typically run just after the class/module/grammar have been compiled (or
when loaded from a pre-compiled file).

=head1 Member

See L<#Attribute>.

=head1 Method

=head1 MoarVM

A virtual machine designed specifically for L<#NQP> and its L<#MOP>:
L<#6model>.  A document about
L<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
L<glossary|http://openjdk.java.net/groups/hotspot/docs/HotSpotGlossary.html>
for entries missing from the present one.

=head1 Module

=head1 Mu

=head1 Multi-Dispatch

=head1 Niecza

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

=head1 Not Quite Perl

See L<#NQP>.

=head1 NQP

NQP is a primitive language for writing subroutines and methods using a
subset of the Perl 6 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 L<#Rakudo> typically use
NQP to compile L<action methods|#Actions> that convert a parse tree
into its equivalent L<abstract syntax tree|#AST> representation.

=head1 Operator

=head1 Package

=head1 Parameter

L<Parameter|/type/Parameter> is a class to define parameters to
L<subroutines|#Subroutine>, L<methods|#Method> and a
L<callable blocks|#Callable>.  As opposed to the L<arguments|#Argument>
you specify when calling a subroutine/method/callable block.

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

=head1 Parrot

A L<virtual machine|#Virtual Machine> designed to run Perl 6 and other
L<dynamic languages|#Dynamic Language>.  No longer actively maintained.

=head1 PAST

L<#Parrot> L<#AST>.

=head1 perl

Name of the Perl 5 executor.

=head1 Perl

The Perl programming language in its many forms.

=head1 Perl Community

=head1 PERL

A way to describe L<Perl> as a language, considered to be improper by
many in the L<#Perl Community>.

=head1 Property

See L<#Attribute>.

=head1 Pull Request

A feature of L<https://gitub.com|Github> that allows you to make patches
to be easily applied using the Github user interface.

=head1 QAST

Successor to L<#QAST>.

=head1 Rakudo

Rakudo is the name of a Perl 6 implementation that runs on L<#MoarVM> and
the L<#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."

=head1 Repository

=head1 roast

=head1 Role

=head1 rvalue

A value that can be used on the right hand side of an assignment.  See also
L<#lvalue>.

=head1 Scalar

=head1 Sigil

In Perl, the sigil is the first character of a variable name.  It must be
either L<#$>, L<#@>, L<#%>, or L<#&> respectively for a L<scalar|#Scalar>,
L<array|#Array>, L<hash|#Hash>, or L<code|#Code> variable.  See also
L<#twigil> and L<#role>.  Also sigilled variables allow short conventions
for L<variable interpolation#Variable Interpolation> in a double quoted
string, or even L<postcircumfix|#Postcircumfix> L<expressions|#Expression>
starting with such a variable.

=head1 Sigilless Variable

=head1 Slot

See L<#Attribute>.

=head1 Slurpy

A parameter of a sub or method is said to be I<slurpy> if it can consume an
arbitrary number of arguments. It is indicated by an asterisk C<*> in front
of the parameter name.

    sub sum(*@numbers) {
        return [+] @numbers;
    }

This can also be used to collect all possible named parameters in a call:

    sub allnameds(*%named) { .say for %named.sort }
    allnameds a => 42, :666b, :c<foo>;  # a => 42, b => 666, c => foo

=head1 Spesh

=head1 STD

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

=head1 Stub

=head1 Subroutine

=head1 Symbol

=head1 Synopsis

The current human-readable description of the Perl 6 language.  Still in
development.  Much more a community effort than the L<Apocalypses|#Apocalypse>
and L<Exegeses|#Exegesis> were. The current state of the language is reflected
by L<#roast>, its L<#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.

=head1 test suite

=head1 Texas operator

The ASCII variant of a non-ASCII Unicode L<operator|#Operator> or
L<symbol|#Symbol>.  So described because "Everything's bigger in Texas."
For instance, C<(elem)> corresponds to the C<∈> ("Is this an element of
that set?") operator that comes from set theory.  Texas 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.
Well, maybe just a little...

=head1 TheDamian

L<#IRC> screen name for L<#Damian Conway>, writer of the original
L<Exegeses|#Exegesis>.

=head1 TimToady

L<#IRC> screen name for L<#Larry Wall>, creator of Perl. The name comes from
the pronunciation of L<#TIMTOWTDI> as a word.

=head1 True

The value representing logical C<True> of the L<#Bool> L<enum|#Enum>.

=head1 Twigil

=head1 Type Object

A I<type object> is an object representing a L<class|#Class>, L<role|#Role>,
L<package|#Package>, L<grammar|#Grammar> or L<enum|#Enum>. It is generally
accessible with the same name as the type.

    class A { };
    say A;              # A is the type object
    my $x = A.new();    # same here

    my $x = class {
        method greet() {
            say "hi";
        }
    }

    # $x now holds a type object returned from the
    # anonymous class definition

If a variable is declared to be of a certain type, but never defined, then
it will evaluate to the type object of that type.  As such, type objects can
often turn up in places where "undefined" or "null" would in other
languages:

    # perl6 -e 'my Int $a; sub f(Int $x) { $x + 1 }; f($a);'
    Invocant requires an instance, but a type object was passed

=head1 Variable

=head1 Virtual Machine

A virtual machine is the Perl compiler entity that executes the
L<bytecode|#Bytecode>.  It can optimize the bytecode or generate
L<machine code|#Machine code> L<Just in Time|#JIT>.  Examples are
L<#MoarVM>, L<#Parrot> (who are intended to run Perl 6) and more
generic virtual machines such as L<#JVM> and L<#Javascript>.

=head1 yoleaux

The L<#Bot> on the #perl6 L<#IRC> channel that provides various services
to people logged in.  Commands to yoleax (a pun on YOLO) start with a period.
Some often used commands are:

=head2 .tell

Leave a message to another user who is currently not logged in.  The message
will be relayed as soon as the user says anything on the channel.

  .tell lizmat I've read the glossary

=head2 .u

Look up unicode codepoint information from either a codepoint, or the name
of a codepoint.

 [16:35:44]  <lizmat>   .u empty set
 [16:35:45]  <yoleaux>  U+2205 EMPTY SET [Sm] (∅)
 [16:36:29]  <lizmat>   .u ∅
 [16:36:30]  <yoleaux>  U+2205 EMPTY SET [Sm] (∅)

Some L<#IRC> clients then easily allow you to copy/paste the codepoint in
question, which can be sometimes be easier than other unicode codepoint
input methods.

=head1 $

L<#Sigil> for L<scalar|#Scalar> L<variables|#Variable>.

=head1 @

L<#Sigil> for L<array|#Array> L<variables|#Variable>.

=head1 %

L<#Sigil> for L<hash|#Hash> L<variables|#Variable>.

=head1 &

L<#Sigil> for L<code|#Code> L<variables|#Variable>.

=end pod
