Skip to content

Instantly share code, notes, and snippets.

View jnthn's full-sized avatar

Jonathan Worthington jnthn

View GitHub Profile
@jnthn
jnthn / s17-changes.md
Last active October 13, 2015 02:59
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

@jnthn
jnthn / gist:fa6a9a3618ae322cb581
Created July 1, 2015 09:26
S09 - the dubious bits

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?

class Domain { ... }
class Aggregate {
has $.id;
trusts Domain;
method !apply-events($id, @events) {
$!id = $id;
self.apply($_) for @events;
}
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)
}
}
}
$ 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
@jnthn
jnthn / nfg.md
Last active August 29, 2015 14:18

NFG and Unicode "plan of attack"

Goals

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
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 !!
class MultiRange {
has Range @.ranges;
method new(**@ranges) {
self.bless(:@ranges);
}
multi method ACCEPTS(MultiRange:D: $value) {
$value ~~ any(@!ranges)
}
grammar G1 {
token TOP { \d+ }
}
class G1Actions {
method TOP($/) {
make "G1: $/";
}
}
grammar G2 {
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);