Perl 6 Rigorous Technical Specification

ontents
1 General...............................................................................................................11
1.1 Notation.......................................................................................................11
1.1.1 Typographical conventions....................................................................11
1.1.2 Normative or Informative.......................................................................11
1.2 Observable Behavior....................................................................................11
1.3 noncen .....................................................................................................11
1.4 Grammar.....................................................................................................12
2 Definitions..........................................................................................................13
3 Lexical Conventions............................................................................................15
3.1 Character Set...............................................................................................15
3.1.1 Normalization........................................................................................15
3.1.2 Byte-Ordering Mark...............................................................................15
3.1.3 Encoding Directive................................................................................16
3.1.4 Conflict with #! mark.............................................................................16
3.1.5 encoding pragma...................................................................................17
3.1.6 Out-of-band encoding specification.......................................................17
3.2 Whitespace..................................................................................................17
3.3 Unspace.......................................................................................................18
3.4 Line Counting..............................................................................................20
3.5 Bracketing Characters.................................................................................20
3.6 Comments....................................................................................................21
3.6.1 POD Sections........................................................................................21
3.6.2 The # character...................................................................................21
3.6.2.1 Single-line comments......................................................................21
3.6.2.2 Embedded comments.....................................................................22
3.7 Tokens.........................................................................................................23
3.8 Identifiers.....................................................................................................23
3.8.1 Identifiers for internal use.....................................................................23
3.8.2 Semi-reserved names............................................................................23
3.8.3 Other future names...............................................................................24
3.9 Keywords.....................................................................................................24
3.9.1 Table of keywords .................................................................................24
3.9.2 Reserved trait names.............................................................................27
3.10 Operators and Punctuators........................................................................28
3.11 Literals.......................................................................................................28
3.11.1 Integer.................................................................................................28
3.11.2 Floating Point......................................................................................28
3.11.3 Infinities..............................................................................................28
3.11.4 Quoted Strings....................................................................................28
4 Basic Concepts...................................................................................................30
4.1 Translation and Execution...........................................................................30
4.2 Episodes......................................................................................................30 Perl 6 Rigorous Technical Specification
page 3
4.2.1 Exception handling notes......................................................................30
4.2.2 Context of Execution.............................................................................30
4.2.3 Introspection.........................................................................................31
4.2.4 Parsing episode.....................................................................................31
4.2.5 blah blah...............................................................................................31
4.2.6 BEGIN episode......................................................................................31
4.2.7 CHECK episode.....................................................................................31
4.2.8 INIT episode..........................................................................................32
4.2.9 START episode......................................................................................32
4.2.10 FIRST episode.....................................................................................32
4.2.11 PRE episode........................................................................................32
4.2.12 ENTER episode....................................................................................33
4.2.13 normal execution episode....................................................................33
4.2.14 NEXT episode......................................................................................33
4.2.15 CATCH episode....................................................................................33
4.2.16 CONTROL episode...............................................................................34
4.2.17 LEAVE episode....................................................................................34
4.2.18 KEEP episode......................................................................................34
4.2.19 UNDO episode.....................................................................................34
4.2.20 POST episode......................................................................................34
4.2.21 LAST episode.......................................................................................35
4.2.22 END episode........................................................................................35
4.3 Abstract Syntax Tree....................................................................................35
4.4 Start and Termination..................................................................................35
4.5 Memory Model..............................................................................................35
4.6 Scope...........................................................................................................35
4.6.1 Package-qualified names.......................................................................35
4.6.1.1 Compile-time resolution..................................................................36
4.6.1.2 Run-time resolution........................................................................36
4.6.2 Pseudo-packages...................................................................................36
4.7 Name Lookup...............................................................................................37
4.8 Sigils ($, @, %, etc.)......................................................................................37
4.9 Lvalues........................................................................................................39
4.10 Closures.....................................................................................................39
5 Other Conceptual Notes......................................................................................40
5.1 One-pass parsing.........................................................................................40
5.2 dots..............................................................................................................40
5.3 Undefined types...........................................................................................41
5.4 Even more miscellaneous.............................................................................41
6 Execution Context..............................................................................................42
7 Terms.................................................................................................................43
7.1 Variables and Sigils......................................................................................43
7.1.1 Code Objects.........................................................................................43
7.2 * Whatever.................................................................................................43
7.3 Captures......................................................................................................44
7.4 Signatures....................