This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl6 | |
class For { } | |
class If { | |
has $.value; | |
method perl { "If.new($.value)" } | |
method Str { "<MANGLED_IF $.value>" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void pseudo_sparse_solve(const eslu * const slu, | |
const esm &rhs, | |
esm &result, | |
const bool adjoint = false) { | |
assert( rhs.cols() == rhs.rows() ); | |
int n = rhs.cols(); | |
ers setter(result); | |
Eigen::VectorXcd *invCol = new Eigen::VectorXcd(n); | |
int transpose_flag; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use 5.010; | |
use MIME::Lite; | |
my $prev = '8b643d6119fd9e4a460e6ec12711fa347207a0ec'; | |
if (-e 'previous_mail_hash') { | |
$prev = `cat previous_mail_hash`; | |
chomp $prev; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Test::More tests => 27; | |
use strict; | |
use warnings; | |
{ | |
my ($x, $y); | |
$x := $y; | |
ok !defined($x), 'scalar binding leaves LHS undef'; | |
ok !defined($y), 'scalar binding leaves RHS undef'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/Cool-str.pm b/src/core/Cool-str.pm | |
index a045cd4..e231260 100644 | |
--- a/src/core/Cool-str.pm | |
+++ b/src/core/Cool-str.pm | |
@@ -28,8 +28,19 @@ augment class Cool { | |
return self if @matches == 1 && !@matches[0]; | |
my $prev = 0; | |
my $result = ''; | |
+ my $caller_pad = Q:PIR{ | |
+ $P0 = getinterp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grammar Color { | |
regex blue { :i "blue" } | |
regex green { :i "green" } | |
regex TOP { [<blue> | <green>] <rest> } | |
token rest { ' ' <alpha>+ } | |
} | |
my $match = Color.parse("Blue skies"); | |
say $match.pretty; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
./perl6 -e 'use STATEMENT_PRINT; say rand' | |
use STATEMENT_PRINT | |
say rand | |
0.458330045777501 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
href="/raw$(echo b0rked)test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inspired by python's infix % | |
# see for example http://www.korokithakis.net/tutorials/python | |
sub named-sprintf(Str $format, *%args) { | |
my @args; | |
my $f = $format.subst(:g, | |
rx{ '%(' (\w+) ')' }, | |
-> $/ { @args.push: %args{$0}; '%' } | |
); | |
sprintf $f, @args; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
moritz@jacq:~/p6/nqp>make | |
/home/moritz/p6/nqp/parrot_install/bin/parrot -o Regex.pbc src/Regex.pir src/Regex/constants.pir src/Regex/Cursor.pir src/Regex/Cursor-builtins.pir src/Regex/Cursor-protoregex-peek.pir src/Regex/Match.pir src/Regex/Method.pir src/Regex/Dumper.pir src/PAST/Regex.pir src/PAST/Compiler-Regex.pir | |
nqplexinfo.c:101: failed assertion 'PObj_constant_TEST(_self)' | |
Backtrace - Obtained 18 stack frames (max trace depth is 32). | |
/home/moritz/p6/nqp/parrot_install/lib/libparrot.so.3.0.0(+0x18bf8f) [0x2aae54e76f8f] | |
/home/moritz/p6/nqp/parrot_install/lib/libparrot.so.3.0.0(Parrot_confess+0x8b) [0x2aae54e76f5b] | |
dynext/nqp_group.so(+0xdfa7) [0x2aae58a7dfa7] | |
/home/moritz/p6/nqp/parrot_install/lib/libparrot.so.3.0.0(+0x305d4b) [0x2aae54ff0d4b] | |
/home/moritz/p6/nqp/parrot_install/lib/libparrot.so.3.0.0(+0x306906) [0x2aae54ff1906] | |
/home/moritz/p6/nqp/parrot_install/lib/libparrot.so.3.0.0(+0x3088b5) [0x2aae54ff38b5] |
OlderNewer