Skip to content

Instantly share code, notes, and snippets.

View lizmat's full-sized avatar
💭
Functioning within parameters

Elizabeth Mattijsen lizmat

💭
Functioning within parameters
View GitHub Profile
@lizmat
lizmat / gist:c7f53fa206da900c2b42
Last active August 29, 2015 14:20
Thoughts on implementing S11/S22 wrt to loading modules
Thoughts on loading modules:
- @*INC is dead, longe live @?INC **** IMPLEMENTED ***
The places to look for loadable modules, are a *compile time* setting, so it
should be set at compile time. Hence it should be called @?INC.
- use lib is a lexical pragma *** IMPLEMENTED as "cur" atm ****
At the moment, use lib just sets @*INC and therefore has action at a distance
effects. Now that we have a lexical pragma framework (under the hood), I can
make "lib" truly lexical.
@lizmat
lizmat / gist:c2e5a958813d4b2d50da
Last active August 29, 2015 14:20
sanity check parameters List.rotor
diff --git a/src/core/List.pm b/src/core/List.pm
index 17bf04b..5d3cc5f 100644
--- a/src/core/List.pm
+++ b/src/core/List.pm
@@ -563,15 +563,23 @@ my class List does Positional { # declared in BOOTSTRAP
}
method rotor(*@cycle, :$partial) {
- my $finished = 0;
+
@lizmat
lizmat / gist:b005de9b024c73a10608
Created April 30, 2015 20:23
kill all backtraces, why????
# Run any code that produces a backtrace with RAKUDO_VERBOSE_STACKFRAME=3
#
# The thinko was using $_ instead of $line - 1 as an index into @lines
# When that is done, it appears that the method is immediately exited without returning anything,
# effectively removing *any* stacktrace information. I assume this is some vague interaction with
# the lazy list machinery / reification / whatever.
$ git diff
diff --git a/src/core/Backtrace.pm b/src/core/Backtrace.pm
index e524228..8b6af4e 100644
@lizmat
lizmat / gist:573712315223a7bbca11
Last active August 29, 2015 14:24
Many errors in JVM spectest
Test Summary Report
-------------------
t/spec/S02-names/is_default.rakudo.jvm (Wstat: 0 Tests: 107 Failed: 1)
Failed test: 104
TODO passed: 107
t/spec/S02-types/native.rakudo.jvm (Wstat: 0 Tests: 48 Failed: 0)
TODO passed: 44
t/spec/S03-junctions/misc.rakudo.jvm (Wstat: 0 Tests: 131 Failed: 1)
Failed test: 131
t/spec/S04-phasers/enter-leave.rakudo.jvm (Wstat: 0 Tests: 25 Failed: 0)
@lizmat
lizmat / gist:b794f31b9d5978e76886
Created July 11, 2015 19:40
CSV taking a supply, returning a lazy list
sub csv(Supply:D $sup) {
my \c= Channel.new;
$sup.tap(
-> \val {
my $csv = val + val; # actual CSV processing
c.send($csv)
},
done => { c.close },
quit => { c.quit($^ex) },
);
$ perl6 t/spec/S32-io/IO-Socket-INET.t
1..47
# [0s] starting tests
# [0s] Testing on port 1024
ok 1 - [1s] echo server and client
ok 2 - finished in time #1
ok 3 - [1s] discard server and client
ok 4 - finished in time #2
ok 5 - [1s] received first 7 characters
ok 6 - finished in time #3
@lizmat
lizmat / gist:d8f40d3b445b4db54031
Created August 8, 2015 15:42
JVM build failure on OS X
Stage start : 0.000
Stage parse : 75.765
Stage syntaxcheck: 0.000
Stage ast : 0.000
Stage optimize : 9.744
Stage jast : Error while compiling op call: Method 'jast' not found for invocant of class 'NQPMu'
in as_jast (gen/jvm/stage2/QAST.nqp:4114)
in as_jast (gen/jvm/stage2/QAST.nqp:3248)
in compile_all_the_stmts (gen/jvm/stage2/QAST.nqp:4080)
in (gen/jvm/stage2/QAST.nqp:3662)
@lizmat
lizmat / gist:bb02b2ca33be658a77d1
Created September 12, 2015 08:51
example of a simple "is tracked" trait in development
class Foo {
has $.a;
has $.b;
has $.c;
has $.changed = False;
method a { self!proxy($!a) }
method b { self!proxy($!b) }
method c { self!proxy($!c) }
@lizmat
lizmat / gist:b74af9a1d79a9f48bf8b
Created September 21, 2015 21:09
GLRifying xx N, causes hang in t/spec/S05-transliteration/trans.t
$ git diff
diff --git a/src/core/List.pm b/src/core/List.pm
index 5b2b372..705d108 100644
--- a/src/core/List.pm
+++ b/src/core/List.pm
@@ -934,8 +934,21 @@ multi sub infix:<xx>(Mu \x, Whatever, :$thunked!) {
GATHER({ loop { take x.() } }).lazy
}
multi sub infix:<xx>(Mu \x, Int() $n, :$thunked!) {
- my int $todo = $n;
@lizmat
lizmat / gist:a24f1fb4c2d3d8aa7465
Created September 21, 2015 21:13
GLRifying "foo" xx *, causes several test fails
diff --git a/src/core/List.pm b/src/core/List.pm
index 5b2b372..7e7f169 100644
--- a/src/core/List.pm
+++ b/src/core/List.pm
@@ -924,6 +924,13 @@ sub flat(**@list is raw) {
sub cache(+@l) { @l }
+role XX-Whatever does Iterator {
+ has Mu $!x;