Skip to content

Instantly share code, notes, and snippets.

View awwaiid's full-sized avatar

Brock Wilcox awwaiid

View GitHub Profile
awwaiid@misao:~/dcpm$ perl randori-2010301-roman.pl
shift on reference is experimental at randori-2010301-roman.pl line 25.
shift on reference is experimental at randori-2010301-roman.pl line 68.
ok 1 - Simple 1 works
ok 2 - Real simple 2 works
ok 3 - We have prepended values!
ok 4 - We have Vs
ok 5 - seventeen and stuff
ok 6 - nineteen and stuff
ok 7 - twenty and stuff
ok 1 - Simple 1 works
ok 2 - Real simple 2 works
not ok 3 - We have prepended values!
# Failed test 'We have prepended values!'
# at roman-mark.pl line 35.
# got: 'IIII'
# expected: 'IV'
ok 4 - We have Vs
ok 5 - seventeen and stuff
not ok 6 - nineteen and stuff
say "hello";
subset NWZ of Int where * > -1;
proto conversion(NWZ $x, $s = ""){*}
multi conversion(0, $s = "0") {
$s
}
multi conversion($x where * %% 2, $s) {
conversion($x div 2, "0" ~ $s)
}
multi conversion($x, $s) {
say "hello";
subset Natural of Int where * > -1;
# Using a given/when (like a case statement)
sub conv1(Natural $x) {
given $x {
when 0 { "0" }
when 1 { "1" }
when * %% 2 { conv1($x div 2) ~ "0" }
Strange Loop talk proposal -- due 2016-05-09
http://thestrangeloop.com/cfp.html
Title: Rakudo/Perl6, The Polyglot Langauge
Abstract (max 1500 chars)
========
Taking multi-paradigm to a new level, Perl 6 goes far beyond it's Perl 5 roots, adopting concepts from many languages. From Haskell/Elixir style typed multi-dispatch to Ruby style objects-all-the-way-down, you can pick a model that best fits your problem domain. Add to this some very practical innovations, such as a grammar engine and native stream/promise async/concurrency, and you have both a useful tool and an interesting experimention platform. The production-ready Rakudo implementation of Perl 6 targets both it's own MoarVM and the JVM, and a JS target is in progress!

Strange Loop talk proposal -- due 2016-05-09 http://thestrangeloop.com/cfp.html

Title: Rakudo/Perl6, The Polyglot Language

Abstract (max 1500 chars)

Taking multi-paradigm to a new level, Perl 6 goes far beyond its Perl 5 roots, adopting concepts from many languages. From Haskell/Elixir style typed multi-dispatch to Ruby style objects-all-the-way-down, you can pick a model that best fits your problem domain. Add to this some very practical innovations, such as a grammar engine and native stream/promise async/concurrency, and you have both a useful tool and an interesting experimentation platform. The production-ready Rakudo implementation of Perl 6 targets both its own MoarVM and the JVM, and a JS target is in progress!

> 5+5
10
> next
CONTROL: Died with CX::Next
EXCEPTION: control exception
in sub eval at simple-repl.p6 line 8
in block <unit> at simple-repl.p6 line 34
> last
sub no-catch-control {
die "no-catch-control exception";
}
sub catch-control {
CONTROL {
say "CONTROL: {$_.gist}";
die "control exception";
}
sub no-catch-control {
die "no-catch-control exception";
}
sub catch-control {
CONTROL {
say "CONTROL: {$_.gist}";
die "control exception";
}