Skip to content

Instantly share code, notes, and snippets.


Jonathan Worthington jnthn

View GitHub Profile
jnthn /
Last active Oct 13, 2015
Overview of planned some S17 changes, for community review

Changes and syntactic relief for S17

This document describes the eventual intended semantics of await, lays out some syntactic relief for working with supplies, considers the status of channels, and proposes the end of the syntax formerly known as earliest, winner, etc. - which I've never really liked. One further area to be covered in a similar document to this is cancellation.

Feedback welcome! -- jnthn

View gist:fa6a9a3618ae322cb581

Things I've spotted in S09 that want a review

Array is compact?

We pretty solidly have Array as a reference type. However, it's in the list of things that make a compact array:

my Array @ragged2d;

I guess this is fossil?

View Evject.pm6
class Domain { ... }
class Aggregate {
has $.id;
trusts Domain;
method !apply-events($id, @events) {
$!id = $id;
self.apply($_) for @events;
View M.pm6
my package EXPORTHOW {
class SUPERSEDE::class is Metamodel::ClassHOW {
method is_trusted(Mu $obj, Mu $claimant) {
$claimant.^compute_mro(); # force it to be computed for typecheck below
callsame() || $claimant.^type_check($obj.WHAT)
View gist:1bb97ea3820d5248d6ad
$ perl6-m -e "BEGIN { my Int $i = 'omg' };"
===SORRY!=== Error while compiling -e
An exception occurred while evaluating a BEGIN
at -e:1
Exception details:
Type check failed in assignment to '$i'; expected 'Int' but got 'Str'
in block at -e:1

NFG and Unicode "plan of attack"


Do the following on Moar without busting JVM support along the way (it likely gets approximations of things here as needed until we have time to do the full NFG works there):

  • Make Str and str NFG by default
  • Implement types Uni/NFC/NFD/NFKC/NFKD
View gist:36054887e166cf0e35f8
diff --git a/src/Perl6/Actions.nqp b/src/Perl6/Actions.nqp
index 5a92c57..0ce6e26 100644
--- a/src/Perl6/Actions.nqp
+++ b/src/Perl6/Actions.nqp
@@ -3538,18 +3538,13 @@ class Perl6::Actions is HLL::Actions does STDActions {
method capterm($/) {
- # Construct a Parcel, and then call .Capture to coerce it to a capture.
- my $past := $<termish> ?? $<termish>.ast !!
View gist:aabc5e604dbb75fd0d69
class MultiRange {
has Range @.ranges;
method new(**@ranges) {
multi method ACCEPTS(MultiRange:D: $value) {
$value ~~ any(@!ranges)
View gist:2ec8ae8a847310f85210
grammar G1 {
token TOP { \d+ }
class G1Actions {
method TOP($/) {
make "G1: $/";
grammar G2 {
View gist:ef0af70a206b38f9d9e6
diff --git a/src/core/nativecall.c b/src/core/nativecall.c
index 51c9352..385bfcf 100644
--- a/src/core/nativecall.c
+++ b/src/core/nativecall.c
@@ -501,7 +501,6 @@ static char callback_handler(DCCallback *cb, DCArgs *cb_args, DCValue *cb_result
"Internal error: unhandled dyncall callback argument type");
- MVM_gc_root_temp_pop_n(tc, num_roots);