Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env perl6
#
# oops - oops.moe uploader
# (c) ix 2016
#
## INCLUDES
use v6;
use strict;
➤ perl6
> module Foo::Bar { sub f() is export {} }; my \module = Foo::Bar; say module::EXPORT::.keys;
Could not find symbol '&EXPORT'
in block <unit> at <unknown file> line 1
>
➤ perl6
> module Foo::Bar { sub f() is export {} }; my \module = Foo::Bar;
> say module::EXPORT::.keys;
DBIish/t/10-mysql.t
904:require 'lib.pl';
963:require 'lib.pl';
1069:require 'lib.pl';
1122:require 'lib.pl';
1211:require 'lib.pl';
1254:require 'lib.pl';
1326:require 'lib.pl';
1403:require 'lib.pl';
1458:require 'lib.pl';
@perlpilot
perlpilot / all
Last active September 1, 2015 19:11
classes, roles and grammars in rakudo/src/core
# ack -ho '(?:grammar|role|class)\s+[A-Z][-:\w]*' | sort -u > all
class Any
class Array
class ArrayReificationTarget
class AST
class Attribute
class Backtrace
class Backtrace::Frame
class Bag
class BagHash
--- c/src/core/Any.pm
+++ w/src/core/Any.pm
@@ -256,7 +256,21 @@ my class Any { # declared in BOOTSTRAP
self.map({ next unless .match($test); $_ });
}
multi method grep(Callable:D $test) is rw {
- self.map({ next unless $test($_); $_ });
+ if ($test.count == 1) {
+ self.map({next unless $test($_); $_});
+ } else {
@perlpilot
perlpilot / overlaps-with.p6
Created July 7, 2015 18:18
Overlaps with testing
#!/usr/bin/env perl6
use Test;
sub overlaps-with( $r1, $r2 ) {
$r1.min ~~ $r2 and $r1.max ~~ $r2 or $r2.min ~~ $r1 and $r2.max ~~ $r1
or ( $r1.min == $r2.min and $r1.max <= $r2.max )
or ( $r1.min < $r2.min < $r1.max < $r2.max );
}
use NativeCall;
constant clock_t = int64;
class tms is repr('CStruct') {
has clock_t $.user-time;
has clock_t $.system-time;
has clock_t $.children-user-time;
has clock_t $.children-system-cstime;
}
@perlpilot
perlpilot / gist:525c50dc95880e7388a2
Created June 19, 2015 20:59
LTA load time here ...
➤ time perl6 -Ilib -MLAPACKE -e0
real 0m19.287s
user 0m19.068s
sys 0m0.198s
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
➤ rakudobrew build-panda
Cloning into 'panda'...
remote: Counting objects: 3577, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 3577 (delta 2), reused 0 (delta 0), pack-reused 3567
Receiving objects: 100% (3577/3577), 600.22 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1531/1531), done.
Checking connectivity... done.
Current branch master is up to date.
===SORRY!===