=begin pod

=TITLE Glossary

=SUBTITLE Glossary of Perl 6 terminology

=head1 Abstract Class
X<|Abstract Class>

The generic Computer Science term "abstract class" defines the
L<interface|#Interface> or L<#API> of a class.  In Perl 6, this is
implemented using roles 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 Advent Calendar
X<|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
X<|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
X<|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 Allomorph
X<|Allomorph>

A type that has two related values which may be used depending on the
context. The I<allomorph> types L<IntStr|/type/IntStr>, L<NumStr|/type/NumStr>,
L<RatStr|/type/RatStr> and L<ComplexStr|/type/ComplexStr> may be created
as a result of parsing a quoted string:

    say <42>.WHAT;     # (IntStr)
    say <42.1e0>.WHAT; # (NumStr)
    say <42.1>.WHAT;   # (RatStr)
    say <42+0i>.WHAT;  # (ComplexStr)

Or they may be created explicitly with differing string and numeric values.

=head1 Anonymous
X<|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 API
X<|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
X<|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 Arity
X<|Arity>

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

    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 Autothreading
X<|Autothreading>

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

    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 block
X<|block>

=head1 Boolean
X<|Boolean>

L<Value|#value> of type L<Bool|/type/Bool>. Apart the class itself, can be either
C<True> or C<False>.

=head1 bytecode
X<|bytecode>

=head1 Camelia
X<|Camelia>

A butterfly image intended primarily to represent Perl 6, The Language.

=head1 Colon Pair and Colon List
X<|Colon Pair> X<|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 Damian Conway

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

=head1 Exegesis
X<|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
X<|False>

The value representing logical C<False> of the L<Bool|/type/Bool> enum.

=head1 fiddly
X<|fiddly>

=head1 handles
X<|handles>

=head1 iffy
X<|iffy>

=head1 Instance
X<|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
X<|Interface>

An interface is an L<abstract class|#Abstract Class>.

=head1 IRC
X<|IRC>

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

=head2 camelia
X<|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.

=head2 dalek
X<|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

=head2 yoleaux
X<|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:

=head3 .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

=head3 .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 IRC Lingo

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

=head2 ALAP
X<|ALAP>

As Late As Possible

=head2 autopun
X<|autopun>

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

=head2 backlog
X<|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 Bot
X<|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 DWIM
X<|DWIM>

Do What I Mean.  A programming language designer motto.

=head2 flap
X<|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
X<|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
X<|FSVO>

For Some Value Of...

=head2 FTFY
X<|FTFY>

Fixed That For You

=head2 IWBN
X<|IWBN>

It Would Be Nice

=head2 LHF
X<|LHF>

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

=head2 LTA
X<|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
X<|NST>

No Such Thing

=head2 Opt
X<|Opt>

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

=head2 PB
X<|PB>

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

=head2 PBP
X<|PBP>

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

=head2 PR
X<|PR>

See L<#Pull Request>.

=head2 P5
X<|P5>

Perl 5

=head2 P6
X<|P6>

Perl 6

=head2 RSN
X<|RSN>

Real Soon Now

=head2 RT
X<|RT>

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

=head2 TIMTOWTDI
X<|TIMTOWTDI>

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

=head2 TMI
X<|TMI>

Too Much Information.

=head2 TMTOWTDI
X<|TMTOWTDI>

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

=head2 UGT
X<|UGT>

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

=head2 WFM
X<|WFM>

Works For Me

=head2 WIP
X<|WIP>

Work In Progress

=head2 WP
X<|WP>

Wikipedia

=head2 WW
X<|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 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 Lexing
X<|Lexing>

=head1 Literal
X<|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
X<|Value>

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
X<|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|/language/modules>, L<grammar|/language/grammars>, etc.  These are
typically run just after the class/module/grammar have been compiled (or
when loaded from a pre-compiled file).

=head1 MoarVM
X<|MoarVM>

MoarVM is short for Metamodel On A Runtime Virtual Machine.
It's 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 Multi-Dispatch
X<|Multi-Dispatch>

=head1 multi-method
X<|multi-method>

=head1 Niecza
X<|Niecza>

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

=head1 Not Quite Perl
X<|NQP>

See L<#NQP>.

=head1 NQP
X<|Not Quite Perl>

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 action methods that convert a parse tree
into its equivalent abstract syntax tree representation.

=head1 NYI
X<|NYI>

Not Yet Implemented

=head1 opcode
X<|opcode>

=head1 Operator
X<|Operator>

An expression is made of operators and operands. More precisely it is made
of an operator and operands that can be subexpressions or L<#value>s.
Operators are an alternative syntax for a L<#multi-method>. With that
syntax, what would be the arguments of the function are named
operands instead. Operators are classified into
L<categories|https://design.perl6.org/S02.html#Grammatical_Categories> of
categories.  A category has a precedence, an arity, and can be L<#fiddly>,
L<#iffy>, L<#diffy>.  Perl 6 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, C<@a[0]> belongs to the postcircumfix
category, is broken into the operand C<@a> and the postcircumfix operator
C<[0]> where C<0> is the postcircumfixed subexpression.

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

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


=head1 Parse Tree
X<|Parse Tree>

=head1 Parameter
X<|Parameter>

L<Parameter|/type/Parameter> is a class to define parameters to
subroutines, method and a L<callable blocks|/type/Callable>.
As opposed to the arguments 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
X<|Parrot>

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

=head1 PAST
X<|PAST>

L<#Parrot> AST.

=head1 perl
X<|perl>

Name of the Perl 5 executor.

=head1 Perl
X<|Perl>

The Perl programming language in its many forms.

=head1 Perl Community
X<|Perl Community>

=head1 PERL
X<|REPL>

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

=head1 POD
X<|POD>

B<P>lain B<O>l' B<D>ocumentation, a documentation format understood by Perl
6. See L<S26|https://design.perl6.org/S26.html> for details.

=head1 Pull Request
X<|Pull Request>

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

=head1 pugs
X<|pugs>

=head1 QAST
X<|QAST>

Successor to L<#PAST> ('Q' being the next letter after 'P').

=head1 Rakudo
X<|Rakudo>

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

=head1 Repository
X<|Repository>

=head1 roast
X<|roast>

The Perl 6 L<specification tests|#test suite>, which live here:
L<https://github.com/perl6/roast/>.  Originally developed for L<#pugs>, it
now serves all Perl 6 implementations.  Why roast? It's the B<r>epository
B<o>f B<a>ll B<s>pec B<t>ests.

=head1 rule
X<|rule>

(Used in regular expressions)

=head1 rvalue
X<|rvalue>

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

=head1 Sigil
X<|Sigil>

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

=head1 Sigilless Variable
X<|Sigilless Variable>

=head1 Spesh
X<|Spesh>

A functionality of the L<#MoarVM> platform that uses run-time gathered data
to improve commonly used pieces of L<#bytecode>. It is much like a JIT
compiler, except that those usually output machine code rather than
bytecode.

=head1 STD
X<|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
X<|Stub>

=head1 Symbol
X<|Symbol>

Fancy alternative way to denote a name. Generally used in the context of
L<module|/language/modules>s linking, be it in the L<#OS> level, or at the Perl 6 L<#Virtual Machine> level
for modules generated from languages targeting these VMs.  The set of
imported or exported symbols is called the symbol table.

=head1 Synopsis
X<|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 Syntax Analysis
X<|Syntax Analysis>

=head1 test suite
X<|test suite>

The Perl 6 test suite is L<#roast>

=head1 Texas operator
X<|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 Thunk
X<|Thunk>

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

=head1 True
X<|True>

The value representing logical C<True> of the L<Bool|/type/Bool> enum.

=head1 value
X<|value>

=head1 Variable
X<|Variable>

A variable is a name for a L<container|/language/containers>.

=head1 Variable Interpolation
X<|Variable Interpolation>

=head1 Virtual Machine
X<|Virtual Machine>

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

=head1 whitespace
X<|whitespace>

=head1 6model
X<|6model>

=end pod
