Skip to content

Instantly share code, notes, and snippets.

diff --git a/src/core/interp.c b/src/core/interp.c
index 5d8f0d5..12f19af 100644
--- a/src/core/interp.c
+++ b/src/core/interp.c
@@ -3234,10 +3234,12 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
cur_op += 4;
goto NEXT;
OP(getstdin):
+ printf("getstdin error before? %s\n", strerror(errno));
if (!tc->instance->stdin_handle)
@Mouq
Mouq / feast.p6
Last active January 4, 2016 02:49
use v6;
use MONKEY_TYPING;
augment class Str {
method xml ($name : *@content, *%attrs) {
~ "<$name"~%attrs.kv.map({" $^a='$^b'"}).join~">\n"
~ @content.map(*~"\n").join.indent(4)
~ "</$name>"
}
}
@Mouq
Mouq / Makefile
Last active January 4, 2016 11:29
# Makefile code generated by Configure.pl:
all: j-all m-all m-runner-default
install: j-install m-install m-runner-default-install
clean: j-clean m-clean
test: j-test m-test
spectest: j-spectest m-spectest
coretest: j-coretest m-coretest
# Generated from tools/build/Makefile-common.in
# Copyright (C) 2006-2013, The Perl Foundation.
@Mouq
Mouq / gist:8950902
Last active August 29, 2015 13:56 — forked from anonymous/gist:8928045
say("+123.456e10" ~~ /
:my token SIGN { <[+-]> }
:my token MANTISSA { \d+ '.'? \d* | '.' \d+ }
:my token EXPONENT { <[eE]> <SIGN>? \d+ }
<SIGN>? <MANTISSA> <EXPONENT>?
/)
# ∂
class RT61918 {
has $.inst is rw;
has $!priv is rw;
has $.string = 'krach';
method init {
$.inst = [ rand, rand ];
$!priv = [ rand, rand ].perl;
}
}
use v6;
# Partial solution to https://codegolf.stackexchange.com/questions/20957
enum 数 <零 一 二 三 四 五 六 七 八 九 十>;
sub infix:<加> (\第一, \第二) { 第一 + 第二 }
sub infix:<减> (\第一, \第二) { 第一 - 第二 }
sub infix:<乘以> (\第一, \第二) { 第一 * 第二 }
sub infix:<除以> (\第一, \第二) { 第一 / 第二 }
sub infix:<等于> (\第一, \第二) { 第一 == 第二 }
@Mouq
Mouq / doc.diff
Last active August 29, 2015 13:56
diff --git a/type-graph.txt b/type-graph.txt
index 0c56466..077dd24 100644
--- a/type-graph.txt
+++ b/type-graph.txt
@@ -152,11 +152,6 @@ role TypedArray[::TValue] does Positional[TValue]
# Collections: Associative
role Associative[::T = Mu]
-role Baggy
-class Bag is Iterable does Associative does Baggy
=begin pod
=TITLE Things Rakudo Should Be Able to Do or Ought to Have
My personal TODO list, things that other people haven't already picked up to work on
=begin item
Ecosystem stuff
=item Slang::Indent
diff --git a/lib/Pod/To/HTML.pm b/lib/Pod/To/HTML.pm
index 797ea2d..9564d77 100644
--- a/lib/Pod/To/HTML.pm
+++ b/lib/Pod/To/HTML.pm
@@ -248,7 +248,7 @@ multi sub node2html(Pod::Block::Named $node) returns Str {
return qq{<div class="nested">\n} ~ node2html($node.content) ~ qq{\n</div>\n};
}
when 'output' { return "<pre>\n" ~ node2inline($node.content) ~ "</pre>\n"; }
- when 'pod' { return node2html($node.content); }
+ when 'pod' { return qq[<span class="{$node.config<class>}">\n{node2html($node.content)}</span>\n] }
@Mouq
Mouq / 01-arithmetic.p6
Last active August 29, 2015 13:57
Potential Grammar::Precedence test
use Test;
use Grammar::Precedence;
grammar Arithmetic does Grammar::Precedence {
token TOP { <EXPR> }
# self.push-prec($str) makes $str a new
# precedence level and the loosest level.
# self.unshift-prec($str) would therefor
# make $str a new precedence level and