Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonathan Worthington jnthn

View GitHub Profile
View gist:9089099
diff --git a/build/probe.pm b/build/probe.pm
index 5e4cee2..ba5a06b 100644
--- a/build/probe.pm
+++ b/build/probe.pm
@@ -51,13 +51,13 @@ sub compile {
my @objs;
foreach my $file ("$leaf.c", @$files) {
(my $obj = $file) =~ s/\.c/$config->{obj}/;
- my $command = "$config->{cc} $cl_define $config->{ccout} $obj $config->{ccswitch} $file >$devnull 2>&1";
+ my $command = "$config->{cc} $cl_define $config->{ccout}$obj $config->{ccswitch} $file >$devnull 2>&1";
View gist:9289075
diff --git a/src/core/interp.c b/src/core/interp.c
index a1bc5cf..a6216eb 100644
--- a/src/core/interp.c
+++ b/src/core/interp.c
@@ -50,6 +50,8 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
/* The current call site we're constructing. */
MVMCallsite *cur_callsite = NULL;
+ MVMuint16 op, last_op;
+
View gist:9431169
diff --git a/src/Perl6/ModuleLoader.nqp b/src/Perl6/ModuleLoader.nqp
index 591c3ae..4abe848 100644
--- a/src/Perl6/ModuleLoader.nqp
+++ b/src/Perl6/ModuleLoader.nqp
@@ -281,7 +281,7 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
# appropriately copied.
if $orig.HOW.name($orig) eq 'Stash' {
for $orig.FLATTENABLE_HASH() {
- unless nqp::existskey($current, $_.key) {
+ if !nqp::existskey($current, $_.key) || nqp::substr($_.key, 0, 1) eq '&' {
View gist:9455271
diff --git a/src/io/syncfile.c b/src/io/syncfile.c
index 904ab6c..6d32d34 100644
--- a/src/io/syncfile.c
+++ b/src/io/syncfile.c
@@ -183,8 +183,9 @@ static MVMint64 eof(MVMThreadContext *tc, MVMOSHandle *h) {
uv_fs_t req;
if (data->ds && !MVM_string_decodestream_is_empty(tc, data->ds))
return 0;
- if ((r = uv_fs_lstat(tc->loop, &req, data->filename, NULL)) == -1)
- MVM_exception_throw_adhoc(tc, "Failed to stat in filehandle: %d", errno);
View gist:9747719
emulates - after keeping things with packages vs compilation units clean, the
spec for emulates seems to blur the boundary again... Problem? Like, what are
the actual semantics of it? How does it emulate? Aliasing? Or is it up to the
module that declares itself as emulating another to export the correct things?
What is the development-time story for CompUnit? A module in development is
obviously not ready for production, but the developer will certainly want to
load it!
How do we specify (in a use statement?) that we are willing to accept a module
View gist:9772688
sub trait_mod:<is>(&c, :$curried!) {
my $arity = &c.arity;
&c.wrap(-> |args {
args.list.elems == $arity
?? callsame()
!! &c.assuming(|args)
});
}
sub foo($a, $b) is curried {
@jnthn
jnthn / ESEventStore.cs
Created Mar 27, 2014
Edument.CQRS EventStore binding
View ESEventStore.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using EventStore.ClientAPI;
View gist:10583405
diff --git a/src/core/frame.c b/src/core/frame.c
index 21d2309..9c8528b 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -961,10 +961,11 @@ static MVMObject * find_invokee_internal(MVMThreadContext *tc, MVMObject *code,
*tweak_cs = orig->with_invocant;
}
else {
- MVMCallsite *new = malloc(sizeof(MVMCallsite));
- new->arg_flags = malloc((orig->arg_count + 1) * sizeof(MVMCallsiteEntry));
View gist:11085557
multi sub trait_mod:<is>( Mu:U $type, :$entity! ) {
role Entity {}
$type.HOW does Entity;
}
class LM::Model::User
is entity
{
}
View gist:11127634
class ACrappyAsyncHTTPServer {
has $.host;
has $.port;
has $.log;
has %!handlers;
method BUILD(:$!host, :$!port) {
$!log = Supply.new;
IO::Socket::Async.listen($!host, $!port).tap(-> $connection {