Scoping & phasers
Lexical, dynamic, package and state variables, and the blocks that run at a set moment.
202 rules from 137 tests. 122 of those tests are confirmed on both engines: Raku++ and Rakudo 2026.11 both pass, or Raku++ gives Rakudo's answer on every probe of a family. The verdict is the test's, not each rule's. How to read a case.
bound-type-namesRaku++ matches Rakudo on 25 of 29 probes- 1
A setting type's name that a scope binds to something else (a constant, a sigilless name, an enum value, a subset, a role, a package) means that thing where the binding is in scope and the setting's type everywhere else.
our-writeRaku++ matches Rakudo on 21 of 34 probes- 2
OUR::names the package the code was compiled in, whoever calls it.
shadow-constantRaku++ matches Rakudo on 37 of 38 probes- 1
A constant named like a built-in type and bound to another type makes the name mean that other type.
after
my constant Int = Version,Intmeans Version
shadow-enumRaku++ matches Rakudo on 37 of 38 probes- 1
An enum value named like a built-in type is that enum value where the enum is in scope.
shadow-packageRaku++ matches Rakudo on 36 of 38 probes- 1
package Int …makes the nameInta package where the declaration is in scope.
6e-gatingRaku++ passesRakudo cannot run it- 21
From 6.e a pseudo-package lookup that misses is a Failure; before 6.e it is an undefined value and never a throw.
MY::<$nosuchvar>.^nameisFailureunder 6.e andAnyunder 6.d - 22
From 6.e
LEXICAL::refuses a dynamic variable; before 6.e it hands it back.my $*dyn = 42; sub f { say LEXICAL::<$*dyn> }; fsays 42 under 6.d and fails with "Cannot access" under 6.e
More from this test: Dates & times (2), Exceptions & control flow (1), Hashes & sets (3), I/O & processes (2), Lists & laziness (8), Numerics (1), Classes, roles & the MOP (2), Operators (1), Everything else (2), Regexes & grammars (2), Signatures & dispatch (1), Strings & Unicode (6), divergences (1).
base64-sextetRaku++ passesRakudo passes- 2
FIRST,NEXTandLASTphasers inside a.mapblock fire with loop semantics in the block's own scope, soLASTsees the final iteration's parameters.
More from this test: Exceptions & control flow (1), Lists & laziness (1), Regexes & grammars (1), Signatures & dispatch (4).
batch1-silent-wrong-answersRaku++ passesRakudo passes- 5
letinside a method restores its variable on an unsuccessful exit, as it does in a sub.
More from this test: I/O & processes (3), Lists & laziness (2), Numerics (1), Everything else (2).
block-constant-not-over-core-termRaku++ passesRakudo passes- 1
A plain
constantin a block or an EVAL does not take the place of a CORE term outside it: a bare name finds the lexical scopes and CORE before the package the constant is installed in.after
{ constant Less = 42 },Lessoutside the block is still CORE's - 2
A block's
constantwhose name CORE has no term for is found outside the block through the package.{ constant FOO = 1 }; FOOis 1
block-pad-scopesRaku++ passesRakudo passes- 1
A
mydeclared in anif, loop,given/whenor bare block body is fresh on each entry: a closure keeps its own iteration's variable, nothing leaks into the next iteration, and each recursive activation has its own. - 2
A block's own
myvariables shadow at every nesting level and are visible totemp,MY::,EVAL,:=, typed and native declarations,CATCHandLEAVE.
callable-for-phaser-sees-stateRaku++ passesRakudo passes- 1
The Callable that
&block.callable_for_phaser('LAST')returns sees the block'sstatevariables, also when it is taken before the block has ever run.with
{ state $s = 0; NEXT $s++; LAST say "$s files"; … }the LAST callable reads$s
callers-call-formRaku++ passesRakudo passes- 1
The call forms
CALLERS::('$x'),CALLER::(…)and a package'sM::(…)look the name up in that package, as the<…>form does.CALLERS::('$x')is the lookupCALLERS::<$x>, not a call of a routine namedCALLERS:: - 2
CALLERS::<$_>reaches a routine's own$_or the mainline's; agivenorfortopic is not a dynamic$_.
class-begin-and-run-sinkRaku++ passesRakudo passes- 1
A
BEGINblock in a class body runs and can add methods through::?CLASS.^add_method.BEGIN { for <get head put post delete> -> $method { ::?CLASS.^add_method: $method, method (…) {…} } }gives the class aget
More from this test: I/O & processes (1).
clone-semanticsRaku++ passesRakudo passes- 5
Cloning a Routine or Block gives a clone whose
statevariables start fresh instead of being shared with the original.
More from this test: Containers & assignment (1), Classes, roles & the MOP (4), Operators (1).
compose-cross-placeholderRaku++ passesRakudo passes- 5
A placeholder
$^b(or$:b) and a later bare$bin the same block are one variable.
More from this test: Operators (4).
conformance-phase2-introspectionRaku++ passesRakudo passes- 3
.dynamicasks about the variable: a variable is dynamic by name only when it has the*twigil.
More from this test: Containers & assignment (1), Exceptions & control flow (2), Hashes & sets (1), I/O & processes (1), Classes, roles & the MOP (1), Signatures & dispatch (2), Types & coercion (1).
control-handled-leaves-block-lax-package-var-str-warnsRaku++ passesRakudo passes- 3
Under
no strict, an undeclared variable assigned inside a class body is the package's variable.after
no strict; class Foo { $foo = 42 },$Foo::fooreads it
More from this test: Exceptions & control flow (1), Stringification (1).
control-vs-catch-phaserRaku++ passesRakudo passes- 1
A block may hold both a
CATCHand aCONTROLphaser; only a secondCATCHraisesX::Phaser::Multiple.
corpus-batch-2Raku++ passesRakudo passes- 1
A bare
$is an anonymous state variable with one persistent slot per textual occurrence.say ++$inside a loop numbers the lines
More from this test: Compile-time errors (1), Regexes & grammars (2).
cro-core-clusterRaku++ passesRakudo passes- 1
A
statevariable declared in a loop body is re-initialised each time the loop statement itself is executed anew, while a routine-levelstatevariable persists across calls.a
++state $ncounter in aforinside a sub gives1,2,3on the first call and1,2on the secondAlso held by
loop-state-frame-scan.
More from this test: Concurrency (4), Containers & assignment (1), Classes, roles & the MOP (2), Regexes & grammars (1).
cro-live-clusterRaku++ passesRakudo passes- 3
A dynamic variable is visible through method call frames as well as sub frames.
More from this test: Containers & assignment (1), Modules (1), Classes, roles & the MOP (2), Signatures & dispatch (1), Syntax & parsing (2).
digest-native-widths-clusterRaku++ passesRakudo passes- 5
state $x .= newinitializes only once.state buf32 $w .= newinside areduceblock keeps the same buffer on every iteration
More from this test: Containers & assignment (2), Lists & laziness (2), Numerics (4), Operators (2).
dist-suite-quartetRaku++ passesRakudo passes- 12
my $x will leave {…} = vruns the block at scope exit with$xas the topic.
More from this test: Dates & times (1), Exceptions & control flow (1), I/O & processes (1), Classes, roles & the MOP (4), Operators (1), Everything else (1), Regexes & grammars (2), Signatures & dispatch (2), Stringification (1), Syntax & parsing (3), Types & coercion (2).
doc-renders-without-runningRaku++ passesRakudo passes- 2
A
DOCphaser is the phaser it prefixes under--doc, and nothing otherwise.DOC INIT {…}runs only under--doc, andDOC BEGIN {…}runs under--doc
More from this test: Everything else (1).
dynamic-falls-back-to-globalRaku++ passesRakudo passes- 1
A dynamic variable no caller declares is looked up in GLOBAL, twigil dropped, before it is an error.
%*RED-DEFAULT-DRIVERS<default>reads what was written to%GLOBAL::RED-DEFAULT-DRIVERS - 2
The GLOBAL fallback of a dynamic variable finds only what is GLOBAL's — a
GLOBAL::write or a top-levelour— not a top-levelmy.
dynamic-var-caller-chainRaku++ passesRakudo does not pass- 1
A routine's own
my $*Xbeats its caller's$*X. - 2
A dynamic variable resolves through the caller chain, innermost caller first, before scopes the callee merely closes over; a closure resolves through its callers, not its birth frame.
- 3
Assigning to a dynamic variable in a callee writes the caller's variable, through any number of call levels and through
EVAL.a callee's
$*E++changes the calling sub's$*E
More from this test: Modules (1), Everything else (1).
dynamic-var-memoRaku++ passesRakudo passesdynamic-var-not-foundRaku++ passesRakudo passes- 1
Reading an undeclared dynamic variable answers an armed Failure for X::Dynamic::NotFound:
.defined,if,//,withandsostay quiet, and only using the value throws.$*OSis not a silentAny - 2
Assigning to an undeclared dynamic variable throws X::Dynamic::NotFound outright, and so does
temp $*x = 1.temp $*x = 1throws when$*xis not declared
More from this test: divergences (1).
ecosweep-2026-09Raku++ passesRakudo passes- 1
The key of a pseudo-package lookup may be computed (
MY::{$n}) or interpolated (MY::<<$n>>). - 2
A chained pseudo-package such as
OUTER::MY::names a scope further out.
More from this test: I/O & processes (2), Modules (3), Classes, roles & the MOP (1), Operators (1), Signatures & dispatch (1), Types & coercion (1).
ecosweep-batch-fiveRaku++ passesRakudo passes- 6
::<name>:existstests whether a symbol exists, and:!existsnegates.::<$probe-var>:existsis True for a declared$probe-var;::<$no-such-var>:existsis False - 8
CORE::qualifies a built-in type name.class ShadowEx is CORE::Exception { … }inherits from Exception
More from this test: Hashes & sets (1), Native types & NativeCall (2), Classes, roles & the MOP (2), Operators (1), Regexes & grammars (1), Signatures & dispatch (4), Syntax & parsing (1), Types & coercion (2).
end-phaser-in-subRaku++ passesRakudo passes- 1
An
ENDphaser written inside a sub runs at program end, not when the statement is reached during a call.sub temp-dir { $dir.mkdir; END rm-rf($dir); $dir }removes the directory only at exit - 2
An
ENDphaser is registered at compile time and runs exactly once: one in a sub that is never called still runs, and one in a sub called several times runs once, in the scope of the last entry into its block. - 3
ENDphasers run at exit in reverse source order, wherever they are written.
exe-bare-block-outer-topicRaku++ passesRakudo passes- 2
A bare block called with no argument sees the outer
$_, as its signature$_ is raw = OUTER::<$_>says, while asub { }has a fresh$_of its own.in
$d.watch.tap: { $lock.protect: { %seen{.path.IO.basename}++ } }the inner block's.pathreads the tap block's topic
exe-do-try-block-scopeRaku++ passesRakudo passes- 2
A
myinside ado { … }block declares a variable of that block and leaves an outer variable of the same name alone.my $j = 7; my $r = do { my $j = 100; $j }; say $jprints 7
exe-dynamic-global-fallbackRaku++ passesRakudo passesexe-for-topic-parameter-nativeRaku++ passesRakudo passes- 1
A
forblock with two or more parameters, one of them named$_, makes that parameter the topic.for 1, 2, 3, 4 -> $_, $n { say .succ }prints 2 and 4
exe-leave-armed-firstRaku++ passesRakudo passes- 2
A
LEAVEphaser runs however its scope is left, including by an error in a statement written before theLEAVE.my $r = R.new; LEAVE $r.closewith a dyingnewruns the LEAVE on the undefined$r, and its "No such method 'close'" follows the first errorAlso held by
exe-leave-unwinding,leave-reads-block-locals.
exe-lexical-sub-topicRaku++ passesRakudo passes- 2
A
subdeclared inside a block has a$_of its own, as every routine does, and does not see the$_around it.for 1, 2 -> $x { sub in-loop { $_ // 'U' }; in-loop() }with the mainline's$_set to 'outer' answers 'U'
exe-mechanical-nativeRaku++ passesRakudo passes- 7
A pointy block's parameter named
$_is the topic inside the block.-> Rat $_ { $_ * 2 }reads its parameter, not the outer topic
More from this test: Containers & assignment (1), Exceptions & control flow (2), Classes, roles & the MOP (1), Signatures & dispatch (3).
exe-nested-sub-captureRaku++ passesRakudo passes- 2
A lexical sub is installed at block entry, so it can be called above its own declaration line.
exe-process-scoped-storeRaku++ passesRakudo passes- 1
PROCESS::<$X> = vinstalls the process-wide dynamic variable$*X.
exe-routine-scope-shapesRaku++ passesRakudo passes- 3
An
ourvariable declared inside a sub is its package's variable and keeps its value from call to call.a module sub's
our $v; $v++counts up across calls
More from this test: Modules (1), Classes, roles & the MOP (1), Signatures & dispatch (1).
exe-routine-self-referenceRaku++ passesRakudo passes- 2
A plain block inside a sub is not a routine:
&?ROUTINEthere is the sub around it.
exit-runs-no-leaveRaku++ passesRakudo passesfailure-can-is-failures-ownRaku++ passesRakudo passes- 2
Reading a dynamic variable that is not declared yields a Failure.
More from this test: Classes, roles & the MOP (1).
first-init-written-last-valueRaku++ passesRakudo passesfirst-phaser-once-per-cloneRaku++ passesRakudo passesgather-coroutine-lazinessRaku++ passesRakudo passes- 3
A
gatherdropped while its block is suspended is unwound quietly, without itsLEAVEphasers producing anything.
More from this test: Lists & laziness (2).
gather-late-blockRaku++ passesRakudo passes- 3
A placeholder variable in a
forblock inside agatherbelongs to theforblock, not to the gather's block.gather { for <a b> { take $^v } }takes a and b
More from this test: Lists & laziness (1), Signatures & dispatch (1).
generic-role-bodiesRaku++ passesRakudo does not pass- 8
my $x = BEGIN …in a role body runs once, at the role's declaration.
More from this test: Classes, roles & the MOP (5), Syntax & parsing (2).
global-package-slotRaku++ passesRakudo passes- 1
%GLOBAL::NAMEis a slot in the root package's symbol table: it reads as empty when nobody has filled it and is created on write, with no declaration needed.%GLOBAL::RED-DEFAULT-DRIVERScan be read before anything declares or writes it - 2
A file-scope
our $xlives in the root package and is reachable as$GLOBAL::x.
grand-review-c1-interpRaku++ passesRakudo passes- 2
A
dieorexitinside aLEAVE,KEEPorUNDOphaser takes effect instead of being swallowed. - 3
A matched
whenin a loop body still runs the loop'sNEXTandLASTphasers and contributes the iteration's value. - 4
KEEPandUNDOare chosen by the block's value:KEEPruns on a defined result,UNDOonNilor an undefined result. - 16
A symbolic lookup of an undeclared name,
::('$nope'), carries a typedX::NoSuchSymbolexception.
More from this test: Containers & assignment (1), Exceptions & control flow (3), I/O & processes (1), Numerics (7), Operators (4), Signatures & dispatch (3), Stringification (1), Strings & Unicode (1).
grand-review-c4b-modules-seqRaku++ passesRakudo passes- 5
CALLER::<$x>reads the caller's dynamic variable, not the callee's own variable of that name.
More from this test: Lists & laziness (1), Modules (2).
init-in-routine-runs-onceRaku++ passesRakudo passes- 1
An INIT in a routine runs once, at program start, before the mainline's initializers run.
my $n = 0; sub g { INIT { $n++ }; 1 }; g(); g(); say $nsays 0
is-cached-needs-experimentalRaku++ passesRakudo passes- 2
The
use experimental :cachedpragma is lexical.
More from this test: Compile-time errors (1).
is-dynamic-and-sumRaku++ passesRakudo passesissue-171-constant-before-phasersRaku++ passesRakudo passes- 1
A top-level
constantis bound at compile time, so BEGIN, CHECK and INIT phasers, and subs they call, see its value.constant K = 4; INIT say Kdoes not say(Any)
issue-202-stash-our-variable-lookupRaku++ passesRakudo passes- 1
A package's Stash holds its
ourvariables' containers, soPkg::{'$x'}, a computed key,.AT-KEY,.pairsand a Stash held in a variable read the variable's value and a write through them reaches the variable.Circle::{'$pi'}reads3.14, as$Circle::piandCircle::<$pi>do
More from this test: Modules (1).
js-backend-framework-clusterRaku++ passesRakudo passes- 6
A
&-sigilled parameter is nearer than a sub of the same name, so the routine body sees the argument and not the outer sub. inferredin
sub page($p, &body),&bodyis the argument even when asub bodyexists - 8
Every closure made in a
forloop keeps its own loop variable for that iteration. inferred
More from this test: Operators (1), Signatures & dispatch (1), Strings & Unicode (1), Syntax & parsing (2), Types & coercion (1).
js-pick-and-dynamic-failureRaku++ passesRakudo passes- 2
Reading an undeclared dynamic variable
$*vargives a Failure. inferred
kernel-closure-calleesRaku++ passesRakudo passes- 1
Each closure of one routine body calls the lexical routines its own scope holds, so wrapping one closure's
my sub gaffects only that closure.sub make { my sub g(Int $n --> Int) { $n + 1 }; (sub (Int $x --> Int) { g($x) + g($x) }, &g) }; my ($a, $ag) = make; my ($b, $bg) = make; $a(5); $bg.wrap(-> $n { 1000 }); say $b(5)prints2000
More from this test: Numerics (1).
leave-after-early-returnRaku++ passesRakudo passes- 1
A
LEAVE,KEEPorUNDOphaser may name a variable whosemydeclaration an earlyreturnskipped; the variable exists from block entry and is undefined.
leave-on-every-exit-nativeRaku++ passesRakudo passes- 1
A
LEAVEphaser runs however its block is left: bynext,last,redo,returnor an exception.for ^3 -> $i { LEAVE { … }; next if $i == 1; … }runs the LEAVE three times
leave-reads-block-localsRaku++ passesRakudo passes- 2
A
LEAVEphaser that reads a variable its block declares sees what the variable holds at the moment the block is left.
let-undone-when-leave-diesRaku++ passesRakudo passes- 1
A
letis undone when its routine or method is left by an exception, even when a LEAVE phaser dies during the unwinding; a routine that returns normally keeps thelet.sub f { let $x = 5; LEAVE die "L"; die "first" }restores$x
loop-header-my-shadowsRaku++ passesRakudo passes- 1
A
mydeclared in aloopheader is scoped to the block enclosing the loop.after
loop (my $k = 0; …) { … },$kis readableAlso held by
unboxed-loop-lanes. - 2
Two nested
loops whose headers declare the same name declare two variables, the inner shadowing the outer only inside the outer loop's body.my $t = 0; loop (my $i = 0; $i < 3; $i++) { loop (my $i = 0; $i < 3; $i++) { $t = $t + 1 } }; say $tprints9
loop-state-frame-scanRaku++ passesRakudo passes- 2
The per-loop-execution reset of
statealso holds when the declaration sits under anif, a bare block, a nested loop or a ternary inside the loop body.
modifier-my-declaresRaku++ passesRakudo passes- 2
A
myassigned in a statement run by awhilemodifier keeps its last value in the enclosing scope after the loop.
modinfo-ecosystem-clusterRaku++ passesRakudo passes- 9
A bare
protoormultiin a class body declares a sub, callable from the class's methods.proto pick-one(|) { * }plusmulti sub pick-one(Str:D $s)in a class body are called aspick-one('x') - 14
A nested type is nameable by a partial qualified path from inside its enclosing class.
inside
class Outer { class Inner { class Leaf {…} } }, a method ofOutercan writeInner::Leaf.new
More from this test: Hashes & sets (1), I/O & processes (1), Lists & laziness (1), Operators (1), Regexes & grammars (3), Signatures & dispatch (3), Syntax & parsing (7), Types & coercion (1).
module-compat-clusterRaku++ passesRakudo passes- 2
OUR::{'&name'} := …binds into the package namespace. - 9
An unbound dynamic variable reads as undefined, so
//falls back to its right side. - 10
A
my @*dynis visible, and empty, inside its own initializer.
More from this test: I/O & processes (1), Classes, roles & the MOP (4), Operators (1), Signatures & dispatch (2).
my-class-shadowRaku++ passesRakudo passes- 1
A
my classdeclared in a routine or block shadows a type of the same name only within that scope.after
sub f { my class P { … } }has run,Pagain names the program's ownclass PAlso held by
shadow-scope. - 2
An object of a scope's
my classkeeps its class after the scope has left, and amy roleis scoped the same way.
my-in-short-circuit-and-do-initRaku++ passesRakudo passes- 1
A
myis a compile-time declaration: a variable declared in the right operand of a short-circuiting||,&&,//,or,and,andthenororelseexists even when that operand never runs.after
True || (my $b := 5),$b := 9works - 2
A
doblock that initializes amydeclaration may name the variable being declared, inside a sub as at file scope.my $c := do { $c := 2 }in a sub body compiles and runs
my-stash-sees-test-importsRaku++ passesRakudo passes- 2
OUTER::<&g>:existshonours its adverb and answers a Bool, not the looked-up value.
More from this test: Modules (1).
named-sub-term-declares-nameRaku++ passesRakudo passes- 1
A named
subused as a value declares its name in the enclosing scope, so it can be called by that name, also recursively from inside the term.my &up = sub k(Int $c) {…}; say k(49)calls it
More from this test: Compile-time errors (1), Classes, roles & the MOP (1).
nested-sub-keeps-its-closureRaku++ passesRakudo passes- 1
A nested
my subreached through a closure that outlives the frame it was declared in still sees its enclosing lexicals.
next-in-first-phaserRaku++ passesRakudo passes- 1
nextinside a loop'sFIRSTphaser ends the first iteration, andNEXTandLASTstill run.
no-strict-exeRaku++ passesRakudo passes- 2
Under
no strictan auto-vivified variable lives in the enclosing package or unit scope, not in the block that first writes it.no strict; for 1..5 -> $k { $sum += $k }; say $sumsays 15
no-strict-lexicalRaku++ passesRakudo cannot run it- 1
no strictis lexical: it holds from its statement to the end of the enclosing block and nowhere else.{ no strict; $a = 5 }; $b = 7fails with "Variable '$b' is not declared"
nqp-scope-and-listRaku++ passesRakudo passes- 2
A
mydeclared inside one branch of a ternary expression is visible in the sibling branch, because the declaration belongs to the enclosing block.Also held by
hoist-expr-decls-cache.
More from this test: Types & coercion (1).
open-modes-bind-end-shiftRaku++ passesRakudo cannot run it- 3
A used module's
ENDphaser runs at process end, before the mainline's ownENDblocks, not when the module loads.
More from this test: Containers & assignment (1), I/O & processes (1), Syntax & parsing (1).
order-enum-term-cacheRaku++ passesRakudo passes- 1
A bare
Less(or any core enum member name) means whatever amy \Less, a parameter, a lexical constant or a user enum in scope declares, and the coreOrder::Lessonly when nothing shadows it.
our-belongs-to-its-packageRaku++ passesRakudo passes- 1
An
ourvariable declared in a routine belongs to the package lexically around the routine, wherever the call comes from.a method's
our $kinsideclass CisC's$k, notGLOBAL's - 2
A typed or defaulted
ourvariable keeps its type, value and default however often its declaration runs.a re-run
our Int $xstill refuses a Str
More from this test: Compile-time errors (1).
our-is-one-containerRaku++ passesRakudo passes- 1
our $xnames the package's one container however often the declaration runs, so re-running it in a loop, a sub or a.mapblock keeps the variable's value and$Pkg::xsees every write.for ^400_000 { our $n += 1 }accumulates in one$nrather than counting to 1 - 2
$x := 5on anourvariable rebinds only the lexical name, not the package's variable.
our-on-worker-threadsRaku++ passesRakudo passes- 2
An
ourvariable's stash entry is installed at compile time, so it exists in its package before the declaration has run.GLOBAL::<$x>:existsisTruebefore a nestedour $xhas runAlso held by
stash-exists-answers.
our-qualified-name-is-absoluteRaku++ passesRakudo passes- 1
An
ourdeclaration written with a qualified name is absolute: it declares exactly that name, whatever package it is written in.our $Foo::vinsideclass Foodeclares$Foo::v, andour $Bar::vthere declares$Bar::v - 2
An unqualified
our $vinside a package declares$Pkg::v.
More from this test: divergences (1).
our-var-in-package-blockRaku++ passesRakudo passesour-var-subscript-writes-throughRaku++ passesRakudo passes- 1
A subscript assignment through the qualified name of an
our @aorour %hwrites the package's own container.%Cfg::OPT<width> = 120is seen by the module that declaredour %OPT
package-constant-qualifiedRaku++ passesRakudo passes- 1
A
constantdeclared in a package is reachable by its qualified name from outside it.constant Lib = Base64::Native::BASE64-LIB;resolves
package-stash-symbolsRaku++ passesRakudo passes- 1
A package's stash and its qualified globals are one symbol table:
our sub fooinsideclass Ais&A::foo,A::<&foo>andA.WHO<&foo>, with the sigil carried on the stash key.A.WHO<&foo>is theour sub foodeclared inclass A - 2
Assigning through a stash subscript,
A::<$bar> = 99, writes the same variable the class's ownour $barreads.
pdf-family-2026-09Raku++ passesRakudo passes- 45
tempin a method body is undone when the method returns. - 47
A
subsetoutranks the package-relative short name of a nested class with the same name. - 53
INITtakes a whole statement as its operand, asdodoes. - 56
A
whereclause is evaluated in the scope its signature was written in.
More from this test: Containers & assignment (8), Exceptions & control flow (1), I/O & processes (1), Lists & laziness (1), Modules (1), Numerics (1), Classes, roles & the MOP (14), Operators (1), Regexes & grammars (3), Signatures & dispatch (9), Syntax & parsing (11), Types & coercion (3).
phaser-block-takes-statement-modifierRaku++ passesRakudo passes- 1
A block phaser followed by a statement modifier parses: the phaser is a declaration and is installed whatever the condition says, the condition still runs, and the statement's value is Nil.
LEAVE { say 42 } if False;parses
More from this test: divergences (1).
phaser-written-last-is-nilRaku++ passesRakudo passes- 1
A phaser with no value of its own written last (LEAVE, KEEP, UNDO, PRE, POST, NEXT, LAST, CLOSE, TEMP, QUIT, CATCH, CONTROL) is the last statement of its sub, method, block or
do, whose value is then Nil.sub f { 42; LEAVE { } }answers Nil - 2
An
ENTERphaser written last gives the block its own value.Also held by
first-init-written-last-value.
pred-answer-regex-and-modifier-tempRaku++ passesRakudo passes- 2
temp $x = … if COND;belongs to the enclosing block and is restored at that block's exit, not when the modified statement finishes.temp $colorizor = sub { '' } unless $colorstays in effect for the rest of the block
More from this test: Regexes & grammars (1).
process-scope-and-sigilless-whileRaku++ passesRakudo passes- 1
PROCESS::<$x> = …installs into the PROCESS scope from whatever frame runs it, making$*xvisible everywhere.sub setter() { PROCESS::<$RX-FROM-SUB> = 5 }; setter(); $*RX-FROM-SUBis 5
More from this test: Everything else (1), Syntax & parsing (1), divergences (1).
process-stash-computed-keyRaku++ passesRakudo passes- 1
A pseudo-package stash accepts a computed key in braces, reading the same variable as the angle form.
PROCESS::{"\$$name"}with$name = 'OUT'reads whatPROCESS::<$OUT>reads
More from this test: Containers & assignment (1).
pseudo-package-adverbsRaku++ passesRakudo passespseudo-package-stash-valueRaku++ passesRakudo passes- 1
A bare pseudo-package term such as
MY::orUNIT::is the scope's symbol table, and enumerating it yields the scope's symbols.UNIT::.grep: { .key.starts-with('&') && .key ne '&EXPORT' }finds the unit's subs
qualified-sigil-missRaku++ passesRakudo passes- 1
A package-qualified
%Foo::BARor@Foo::BARthat names no symbol reads as Any, as$Foo::BARdoes.with %Foo::BARdoes not enter its block, and%OUR::BARis Any rather than X::UndeclaredAlso held by
qualified-miss. - 2
A write to a package-qualified name that names no symbol installs the symbol.
%Foo::BAR<k> = 7 - 3
Writing through
OUR::inside a package to a name it never declared creates the package variable.a write through
OUR::in package P creates@P::B, and amy @Bin scope is not itAlso held by
our-write.
quanthash-exact-sethash-zen-dynamicRaku++ passesRakudo passes- 4
$s.dynamicon a scalar decontainerizes and asks the held value (False for a Hash or Array),$s.VAR.dynamicasks the Scalar itself, and for@/%variables the variable's name decides.
More from this test: Hashes & sets (3).
rakudo-t-language-gaps-1Raku++ passesRakudo passes- 5
$<p>:existsasks the Match,SETTING::{…}:existsasks the core, andCORE::<Int>is the type. - 13
Two
willtraits on one variable both run.
More from this test: Compile-time errors (1), Containers & assignment (1), Lists & laziness (1), Classes, roles & the MOP (2), Operators (1), Everything else (1), Regexes & grammars (2), Signatures & dispatch (1), Stringification (2), Strings & Unicode (1), Syntax & parsing (1).
rakudo-t-language-gaps-2Raku++ passesRakudo passes- 14
$*PACKAGEin a role body, and in a package's own trait, is the package being declared. inferred
More from this test: Compile-time errors (1), Exceptions & control flow (2), Hashes & sets (1), Lists & laziness (2), Operators (2), Regexes & grammars (4), Signatures & dispatch (1), Syntax & parsing (1).
rakudo-t-language-gaps-3Raku++ passesRakudo passes- 1
GLOBAL::<$x>:existsandGLOBAL::<Sym> = …read and write the GLOBAL stash,$p::is the stash of the package a value names, andPkg::{'&f'}looks a routine up in a package. inferred
More from this test: Compile-time errors (2), Containers & assignment (1), Lists & laziness (2), Modules (1), Classes, roles & the MOP (1), Operators (2), Regexes & grammars (1), Signatures & dispatch (1), Stringification (1), Syntax & parsing (1).
rakudo-t-language-gaps-4Raku++ passesRakudo passes- 5
A user
role Numeric { }shadows the core role for~~.
More from this test: Compile-time errors (1), Classes, roles & the MOP (3), Operators (2), Regexes & grammars (1), Stringification (1).
rakudo-t-language-gaps-7Raku++ passesRakudo passes- 1
A value-answering phaser takes a regex term:
BEGIN / … /.
More from this test: Regexes & grammars (2), Signatures & dispatch (2), Types & coercion (2).
rakuglaze-round-4Raku++ passesRakudo passes- 3
KEEPruns only when the block's result is defined, in a method as in a sub. inferred
More from this test: Exceptions & control flow (4), Hashes & sets (2), Lists & laziness (1), Classes, roles & the MOP (1), Operators (1), Signatures & dispatch (1), Types & coercion (2).
rakuglaze-round-5Raku++ passesRakudo passes- 3
An
INITin a parameter default runs once, at program start, inside anEVALtoo.
More from this test: Concurrency (1), Containers & assignment (1), Lists & laziness (1), Types & coercion (1).
rakuglaze-round-6Raku++ passesRakudo passes- 11
An
our subdeclared in a class body is installed in that class's package, not in the enclosing module's.with
our sub fin classes A and B of module M,M::A::fandM::B::fare two subs andM::fis noneAlso held by
issue-169-class-our-sub-in-module.
More from this test: Concurrency (1), Exceptions & control flow (1), Hashes & sets (2), I/O & processes (1), Lists & laziness (2), Classes, roles & the MOP (1), Regexes & grammars (1), Syntax & parsing (2).
regex-as-callable-param-and-loop-phasersRaku++ passesRakudo does not pass- 2
A Callable answers
.has-loop-phasersand.callable_for_phaser('FIRST'), giving access to itsFIRST,NEXTandLASTphasers.
More from this test: Signatures & dispatch (1).
return-through-block-undoRaku++ passesRakudo passes- 1
A
returnpassing through a block or routine it does not belong to is an unsuccessful exit for it: itsUNDOruns, not itsKEEP, and itslets are undone, whileKEEPruns only in the routine the return leaves.sub wrap(&b) { KEEP …; UNDO …; b() }; wrap { return 42 }runswrap's UNDO
return-type-package-scopeRaku++ passesRakudo passes- 1
A bare type name after
-->resolves lexically, innermost first, so the enclosing package's own class wins over an imported type with the same short name.in
unit class CSV::Tablewith its ownclass Line,--> LinemeansCSV::Table::Lineeven when an importedLineexists
roast-3log-batch2Raku++ passesRakudo passes- 2
Assigning to
$CALLER::_writes the caller's topic, not the routine's own.
More from this test: Exceptions & control flow (1), Modules (1), Numerics (1), Classes, roles & the MOP (6), Everything else (1), Regexes & grammars (5), Syntax & parsing (1).
roast-last-filesRaku++ passesRakudo passes- 6
OUTER::is exactly one scope, not that scope and those outside it, and amydeclared further down that scope already counts. inferred - 7
Inside an
EVALof 6.c or 6.d code,SETTING::is the calling code; elsewhere it holds no program variable. inferred
More from this test: Compile-time errors (1), Containers & assignment (2), Lists & laziness (2), Numerics (3), Classes, roles & the MOP (1), Operators (1).
roast-sweep-runtimeRaku++ passesRakudo cannot run it- 1
A
subdeclared in a package with no scope declarator stays out of the package's stash, and so does amy constant. inferred - 3
A
LASTphaser runs when amapblock leaves withlast. inferred - 4
A
lastin a loop body'sLEAVEphaser ends the loop. inferred - 5
A
POSTphaser reads the block's return value. inferred - 17
constant Truedeclared in a block shadows the literalTruein that block only. inferred - 18
An
ourdeclaration with no initializer names the same package variable an earlierourpublished, keeping its value. inferred - 19
BEGINandCHECKphasers keep their order whether written as statements or aswill begin/will checktraits. inferred - 20
A
returninside aCHECKphaser is an error, having no routine to leave. inferred - 22
with $xbinds the topic to$x's own container, andwith @abinds it to the Array. inferred - 36
$?PACKAGEinside a lexicalmy packageis that package. inferred - 37
A pseudo-stash lookup sees a
mydeclared further down the same block: the name exists, is undefined, and shadows the outer one. inferred - 41
An
INITterm inside a sub runs once, at program start, and each call reads its value. inferred - 53
A class nested in a package answers to its short name inside that package only. inferred
- 54
A
BEGINabove the line on which anEVALfails to compile has already run by the time it fails. inferred
More from this test: Compile-time errors (4), Concurrency (2), Containers & assignment (2), Exceptions & control flow (2), Hashes & sets (4), I/O & processes (3), Lists & laziness (5), Modules (2), Classes, roles & the MOP (8), Operators (4), Everything else (1), Regexes & grammars (1), Stringification (1), Strings & Unicode (1), Types & coercion (3).
role-state-and-nested-assignRaku++ passesRakudo passes- 1
A
statevariable in a role method is separate for each class that composes the role.
More from this test: Classes, roles & the MOP (1), Types & coercion (1).
routine-has-its-own-topicRaku++ passesRakudo passesroutine-is-lexicalRaku++ passesRakudo passes- 1
&?ROUTINEin a block is the routine the block is written in, not the routine that runs the block, also after that routine has returned and from another thread.sub g { apply({ &?ROUTINE.name }) }answersg
More from this test: Regexes & grammars (1), Signatures & dispatch (1).
run-adverbs-keep-undo-rule-captureRaku++ passesRakudo passes- 2
KEEPfires only on a successful block exit,UNDOonly on an unsuccessful one, andLEAVEalways.
More from this test: I/O & processes (1), Modules (1), Regexes & grammars (1).
sigilless-name-shadows-termRaku++ passesRakudo passes- 1
A sigilless name the program declares beats the built-in term of the same spelling.
sub f(\i) { i }returns its argument, not the imaginary unit
smiley-var-checkedRaku++ passesRakudo cannot run it- 3
my constantdeclares a lexical constant, not a package symbol. inferred
More from this test: Containers & assignment (1), Types & coercion (1).
stash-exists-answersRaku++ passesRakudo passes- 1
GLOBAL::<…>:exists,OUR::<…>:existsandPkg::<…>:existsanswer from the package's symbol table, which holds onlyourvariables and routines, lax variables and qualified writes.an undeclared
@x,%xor&x, a built-in&sayand a top-levelmy @lexdo not exist inGLOBAL
More from this test: Syntax & parsing (1).
stash-reads-and-lexical-routinesRaku++ passesRakudo passes- 1
A plain
sub f, amy sub fand a plainmultiare lexical and not symbols ofGLOBAL; only anour subis in the package's stash.GLOBAL::<&f>:existsisFalsefor a plainsub f - 2
GLOBAL::{'…'}with a string key readsGLOBAL's table as a Stash: a missing key isAny, not a Failure, and a lexicalmyof that name is not found.GLOBAL::{'@x'}for a missing symbol isAny - 3
Assigning to
GLOBAL::{'$x'}for a symbol that does not exist creates the slot.
string-block-anonymous-stateRaku++ passesRakudo passesstub-completed-in-nested-blockRaku++ passesRakudo passes- 1
A package declaration is
our-scoped wherever it is written, so a file-scope stubour class Rak { ... }is completed by aclass Rak { … }body inside a nested block.
supply-on-close-and-close-phaser-scopeRaku++ passesRakudo passes- 3
A
CLOSEphaser in a supply block sees the block body's lexicals, amy subincluded, even when the body has not emitted yet.
More from this test: Concurrency (2).
symbolic-package-variable-missRaku++ passesRakudo passes- 1
A symbolic lookup of a package-qualified variable that nobody declared,
$::('Pkg::name'), is X::NoSuchSymbol rather than an undefined Any, while a declared symbol reads as its value.$::('Names::xx::dow')for an undeclared name is X::NoSuchSymbol
temp-and-env-allomorphRaku++ passesRakudo passes- 1
A
tempcontainer stays in effect across every iteration of a statement-modifier loop in the same scope and is restored only at the enclosing block's exit.temp %h; %h{$_} = 7 for <A B>writes both keys to the temporary hash and restores it after the block
More from this test: Types & coercion (2).
temp-restored-when-leave-diesRaku++ passesRakudo passes- 1
A
temporletin an enclosing block is restored even when an inner block'sLEAVEphaser dies.my $x = 1; try { { temp $x = 2; { LEAVE { die "L" }; die "B" } } }; say $xsays 1
todo-small-divergencesRaku++ passesRakudo passes- 10
anon subsetandanon enuminstall no name in the scope. - 16
MY::<$x>finds the block's own lexical only, not one from an outer scope.
More from this test: Concurrency (1), Containers & assignment (2), Lists & laziness (3), Classes, roles & the MOP (2), Operators (1), Regexes & grammars (1), Stringification (3), Types & coercion (3).
todo-small-divergences-2026-10-11Raku++ passesRakudo does not pass- 12
A
tempvariable is restored before the block'sLEAVEphasers run.
More from this test: Containers & assignment (1), Classes, roles & the MOP (2), Operators (2), Signatures & dispatch (2), Strings & Unicode (1), Syntax & parsing (3), Types & coercion (4), divergences (1).
top100-roots-2026-09-02Raku++ passesRakudo does not pass- 28
An
ENDphaser canstarta worker andawaitit: END phasers run before worker threads are shut down.
More from this test: Containers & assignment (1), Exceptions & control flow (2), Lists & laziness (1), Modules (1), Native types & NativeCall (3), Numerics (1), Classes, roles & the MOP (4), Regexes & grammars (3), Stringification (1), Strings & Unicode (2), Syntax & parsing (3), Types & coercion (6).
topic-param-not-a-pad-slotRaku++ passesRakudo passes- 1
A routine whose parameter is
$_still sees the loop's own topic inside afor,givenor statement-modifier loop.in
method !form-header(Frame $_),$_insidefor 16, 8 ... 0 { … }is the loop value
try-statement-is-a-block-frameRaku++ passesRakudo passes- 3
try my $x = …declares$xin the scope where the statement stands.
More from this test: Exceptions & control flow (2).
type-registryRaku++ passesRakudo passes- 1
::('NoSuchClass')returns a Failure:try ::($n)and.definedprobe existence softly, and X::NoSuchSymbol is thrown when the result is used.
More from this test: Compile-time errors (1).
value-phasers-run-at-their-phaseRaku++ passesRakudo passes- 1
A phaser in term position —
BEGIN,CHECK,INIT,ENTERorFIRST, in block or expression form — is its value as computed at its phase, not where the expression stands.say "body"; my $x = INIT say "init"says init first, andsay now - INIT nowis not negative - 2
FIRST { … }in a loop runs on the first iteration only. - 3
An
INITphaser used as a parameter default runs once, not on every call.
whatever-sub-and-modifier-declRaku++ passesRakudo passes- 2
A
myunder a statement modifier declares its variable in the enclosing scope at compile time, even when the modifier never runs the statement.my @uri-candidates = ... if +@urisdeclares the array either wayAlso held by
modifier-my-declares.
More from this test: Lists & laziness (1), Operators (1).
with-pointy-topicRaku++ passesRakudo passesword-list-escapes-comma-op-forward-typeRaku++ passesRakudo passes- 3
A class, grammar or role declared later in a file is usable by code that runs earlier, as a method invocant or as a value.
G.parse($s, :actions(actions))works withclass actionsdeclared further downAlso held by
forward-types-and-statement-end.
More from this test: Operators (1), Syntax & parsing (1).
zef-ecosystem-clusterRaku++ passesRakudo passes- 1
$ = EXPRon the anonymous state variable assigns on every evaluation; only the slot persists.
More from this test: I/O & processes (2), Regexes & grammars (3), Types & coercion (1).