← Contents

Appendix A

The Tag Sets

The three closed enumerations everything else switches on.

VT — runtime value tags

src/Value.h. Eighteen tags. Several Raku types are an existing tag plus a marker rather than a tag of their own; those are listed in the second table.

TagLive fieldsNotes
Nilthe absent value
Anythe default undefined value
Boolb
Inti, or big when it overflowsenumName/enumType make it an enum value
Numn
Strs
Arrayarr, isList, itemized, shape, extList, Seq, Junction and lazy sequences all live here
Hashhash, hashKind, objKeyedSet, Bag, Mix, Proxy, Failure, Date and more
Codecodesub, block, method, builtin, WhateverCode
RangerFrom, rTo, rExFrom, rExTo, rNum, extext holds the original endpoint objects
Pairs or pairKey, pairVal, namedArg
Typesa type object; s is the type name
Whatever*
Objectobja user class instance
RatratN, ratD, fatRatnormalised, denominator positive
Regexs (pattern), hashKind (flags)
Matchs, rFrom, rTo, arr, hashfive fields live at once
Complexn (real), im (imaginary)

Types with no tag of their own

Raku typeRepresentation
List, SeqArray with isList
an itemized arrayArray with itemized
JunctionArray with enumName in any/all/one/none
a lazy or infinite sequenceArray with a LazySeqState in ext
Set, Bag, Mix, and their mutable formsHash with hashKind
ProxyHash with hashKind == "Proxy", holding FETCH/STORE
FailureHash with hashKind == "Failure"
Date, DateTimeHash with hashKind
BufStr with hashKind == "Buf" and an identity token in ext
BlobStr with hashKind, compared by value
Instant, DurationNum with hashKind and an identity token
IntStr, RatStr, NumStr, ComplexStrthe numeric tag plus s and hashKind
an enum valueInt with enumName and enumType
FatRatRat with fatRat
a native integer containerany numeric tag with natBits and natSigned
Promise, Channel, Supply, Tap, Locka tag plus state in ext

NK — AST node kinds

src/Ast.h. Forty-nine kinds.

Expressions. IntLit, NumLit, StrLit, InterpStr, BoolLit, VarExpr, ListExpr, Assign, Binary, Unary, Call, MethodCall, Index, Ternary, Range, Pair, BlockExpr, ArrayLit, HashLit, NameTerm, RegexLit, SubstLit, ChainExpr, SymbolicRef, AllomorphLit, NqpOp, Whatever, SelfTerm.

Statements. ExprStmt, VarDecl, SubDecl, IfStmt, WhileStmt, ForStmt, LoopStmt, Block, ReturnStmt, LastStmt, NextStmt, RedoStmt, UseStmt, EmptyStmt, GivenStmt, WhenStmt, RepeatStmt, ClassDecl, EnumDecl, NamedRegexDecl, SubsetDecl.

A great deal of Raku's surface syntax lowers into a few of these. Every operator — built-in, meta, hyper, set, and every user-declared one — is a Binary, Unary or Call. class, role, grammar, module and package are all ClassDecl. A phaser is a Block with a name.

K — regex node kinds

src/Regex.h. Nineteen kinds.

KindConstruct
Lita literal string
Any.
Class<[…]>, \d, <:Nd>, a named class
Seqconcatenation
Alt| (ranked) and || (first match)
Conj&
Rep*, +, ?, ** N..M, with % separators
Group[ ], ( ), $<x>=[…]
AnchorStart, AnchorEnd^, $, ^^, $$
WBLeft, WBRight<<, >> word boundaries
Nopan empty branch
Subrule<name>, <.name>, <alias=rule>, <r($x)>
Look<?…>, <!…>, <?after …>
Code{…}, <?{…}>, <!{…}>, :my
VarMatcha $var atom evaluated at match time
CapStart, CapEnd<( and )>

NqpOpc — the use nqp subset

src/Ast.h. About fifty operation codes in seven groups: lazy control forms, 64-bit integer operations, codepoint-indexed string operations, list and hash primitives, object and attribute helpers, buffer read and write, and folded constants. The full list is in Chapter 30.

Exception and control structs

src/Interpreter.h.

StructMeaning
RakuErrorevery user-visible Raku exception: payload plus message
ReturnExreturn across a callable boundary
LastEx, NextEx, RedoExlabelled or cross-frame loop control
BreakGivenExwhen / succeed across a boundary
ProceedExproceed
LeaveExleave
ResumeEx.resume inside a CATCH
DoneExdone in a supply, whenever or react body
StopGatherExa lazy gather has produced enough
ExitExexit
WorkerAbortExunwind a background worker at shutdown — deliberately not a RakuError
ParseErrora compile-time diagnostic, optionally typed
CodegenError--exe cannot transpile this; bundle instead
AstEmitError--aot cannot rebuild this; bundle instead
AstSerialErrora cache entry is unreadable; parse instead
StepLimitExceededa regex exceeded its backtracking budget
ObsoleteEscapea retired Perl 5 metacharacter in a pattern