Skip to content

Instantly share code, notes, and snippets.

@ab5tract
Last active September 19, 2025 13:52
Show Gist options
  • Save ab5tract/15cdd3d7d55b60ca652c2b0d926d2932 to your computer and use it in GitHub Desktop.
Save ab5tract/15cdd3d7d55b60ca652c2b0d926d2932 to your computer and use it in GitHub Desktop.
'UNIT', sub ($cur) {
my Mu $ctx := nqp::getattr(nqp::decont($cur), PseudoStash6c, '$!ctx');
nqp::say("Lookie here! ");
nqp::say(nqp::isnull($ctx));
until nqp::isnull($ctx) || nqp::existskey(nqp::ctxlexpad($ctx), '!UNIT_MARKER') {
nqp::say("going");
$ctx := nqp::ctxouter($ctx);
}
nqp::say(nqp::existskey(nqp::ctxlexpad($ctx), '!UNIT_MARKER')) unless nqp::isnull($ctx);
nqp::isnull($ctx)
?? Nil
!! PseudoStash.NEW-PACKAGE( :$ctx, :mode(STATIC_CHAIN), :name<UNIT> )
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment