Skip to content

Instantly share code, notes, and snippets.

@Mouq
Mouq / test.pl
Last active December 20, 2015 13:49
$ mkdir mod_test && cd mod_test
$ mkdir lib
$ curl http://modules.perl6.org/proto.json > proto.json
$ export PERL6LIB=$PWD/lib:PERL6LIB
$ export PREFIX=$PWD/lib
$ perl test.pl
src/core/CallFrame.pm
9: my Mu $interp := pir::getinterp__P;
src/core/control.pm
11: pir::setattribute__vPsP($ex, 'severity', pir::const::EXCEPT_NORMAL);
144: nqp::bindattr($ex, Exception, 'severity', nqp::p6box_i(pir::const::EXCEPT_WARNING));
174: pir::spawnw__IP(
202: pir::spawnw__Is(nqp::unbox_s($cmd)),
src/core/Exception.pm
class Recursive {
has $.r;
class Recursive::Stub is Recursive {
submethod BUILD {}
}
submethod BUILD {
$!r = Recursive::Stub.new;
}
}
@Mouq
Mouq / gist:6594765
Last active December 23, 2015 06:29
use v6;
use File::Find;
token fudge-declaration { ^^ "#?rakudo" .*? $$ }
token test
{
[
| "is"
| "isnt"
# 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) {
@Mouq
Mouq / gist:7130628
Last active December 26, 2015 09:39
  • test(abc)

Test will abc whatever you paren!!

  • (abc)test

Deprecated.

@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: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>? }
}
[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 \
  • 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