Skip to content

Instantly share code, notes, and snippets.

@Mouq
Mouq / gist:7eb9d723d7f05a511529
Last active January 6, 2016 00:25 — forked from anonymous/gist:4beb237a975e65e6e775
perl6 grammar test
grammar Test {
rule TOP { ^ <content>* $ }
rule block { '(' ~ ')' <content>* }
rule content { <-[()]>+ || <block> }
}
class TestActs {
method TOP($/) {
$/.make: $<content>».made.join;
}
@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 / 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>"
}
}
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)
  • S32-exceptions/misc.rakudo.moar 495 - right exception type (X::Method::NotFound)
  • S32-exceptions/misc.rakudo.moar 532 - right exception type (X::TypeCheck::Binding)
  • S32-exceptions/misc.rakudo.moar 536 - right exception type (X::TypeCheck::Return)
  • S32-exceptions/misc.rakudo.moar 540 - right exception type (X::TypeCheck::Assignment)
  • S32-exceptions/misc.rakudo.moar 545 - right exception type (X::Assignment::RO)
  • S32-exceptions/misc.rakudo.moar 575 - right exception type (X::ControlFlow)
  • S32-exceptions/misc.rakudo.moar 589 - right exception type (X::ControlFlow::Return)
  • S32-exceptions/misc.rakudo.moar 611 - nextsame in proto
[amoquin:rakudo]$ perl Configure.pl --backends=moar --prefix=/usr/local [moar-support]
Using /usr/local/bin/nqp-m (version 2013.12.1-8-gcd0db4e / MoarVM 2013.10-280-gd4fc809).
Cleaning up ...
You can now use 'make' to build Rakudo.
After that, 'make test' will run some tests and
'make install' will install Rakudo.
[amoquin:rakudo]$ make install [moar-support]
perl tools/build/gen-cat.pl moar src/vm/moar/ModuleLoaderVMConfig.nqp src/Perl6/ModuleLoader.nqp > src/gen/m-ModuleLoader.nqp
/usr/local/bin/nqp-m --target=mbc --output=blib/Perl6/ModuleLoader.moarvm --encoding=utf8 \
@Mouq
Mouq / gist:7328659
Last active December 27, 2015 12:49
use v6;
grammar UnixPath {
token TOP { ^ [<context> '/']? (<name>|<glob>) +%% '/' $ }
proto token context {*}
token context:sym<~> { <sym> <?[/]> }
token context:sym</> { <?[/]> }
token name { <-[ * / ]>+ }
token glob { $<initial>=['*'?] [<name> '*']+ <final=.name>? }
}
@Mouq
Mouq / gist:7327211
Created November 5, 2013 22:09
Types missing from docs
∘ Baggy
∘ Bag
∘ CallFrame
∘ Dateish
∘ DateTime
∘ Enumeration
∘ GatherIter
∘ IO::FileTestable
∘ IO::ArgFiles
∘ IO::Path
@Mouq
Mouq / gist:7130628
Last active December 26, 2015 09:39
  • test(abc)

Test will abc whatever you paren!!

  • (abc)test

Deprecated.

# Attempt at making the program correct, though it makes
# the program run 4.5 times slower (on my machine).
# In fact, I think it works because the threads
# spend so much time updating the hash
# that the chance of them both selecting the same
# indices AND executing the swap at the same time
# are made an order of magnitude more negligible.
use v6;
sub run (Int $vecs, Int $items, Int $threads, Int $iters) {