Skip to content

Instantly share code, notes, and snippets.

use v6.d;
enum Meat <Chicken Beef Pork Fish Veggie>;
enum Ingredient <Cheese Rice Beans Salsa Guacamole SourCream Lettuce Tomato Onion Cilantro PicoDeGallo>;
subset Burritoish where Meat | Ingredient;
sub return-burrito($meat, @ingredients) {
$meat, @ingredients
use v6;
constant transporter = -> { :1a, :2a; }
use foo transporter;
my \l = ("Hello", "bye", ("something", ("list", "foo", "boo"), ("mars", "bar")));
sub tree-it($item) {
my %h is default(IterationEnd) = $item.pairs;
do for 0..* -> $idx {
last if %h{$idx}:!exists;
my $left = %h{$idx};
my $right = %h{$idx + 1};
dd $right;
role LoL {
method AT-POS() {...}
method head() {...}
method tail() {...}
}
role HoH {
method AT-KEY() {...}
}
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html>
<head>
<title>Converted POD6 documentation</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style type="text/css">
body { margin-left: 4em; margin-right: 4em; }
p {
text-rendering: optimizeLegibility;
font-feature-settings: "kern" 1;
===> Searching for: hide-methods, InterceptAllMethods, Method::Also, Object::Delayed, Object::Trampoline
===> Staging Method::Also:ver<0.0.8>:auth<zef:lizmat>
===> Staging [OK] for Method::Also:ver<0.0.8>:auth<zef:lizmat>
===> Staging InterceptAllMethods:ver<0.0.3>:auth<zef:lizmat>
===> Staging [OK] for InterceptAllMethods:ver<0.0.3>:auth<zef:lizmat>
===> Staging Object::Trampoline:ver<0.0.12>:auth<zef:lizmat>
===> Staging [OK] for Object::Trampoline:ver<0.0.12>:auth<zef:lizmat>
===> Staging hide-methods:ver<0.0.6>:auth<zef:lizmat>
===> Staging [OK] for hide-methods:ver<0.0.6>:auth<zef:lizmat>
===> Staging Object::Delayed:ver<0.0.13>:auth<zef:lizmat>
my \a = (42 & 42).defined;
dd a;
my \b = (42 & 42).Str;
dd b;
#! /usr/bin/env raku
use v6.d;
use lib $*PROGRAM.resolve.dirname;
use util;
sub MAIN() {
put ‘I'm doing a thing.’;
put i-am-helpful;
my atomicint $spawn-limit = 8;
multi sub spawn(&c, |args) {
# dd ⚛$spawn-limit;
⚛$spawn-limit > 0
?? ($spawn-limit⚛-- ;start { LEAVE $spawn-limit⚛++; c(|args) })
!! c(|args)
}
sub collect(*@things) {
slip @things.map: -> $thing { $thing ~~ Promise ?? await $thing !! $thing }
my @a = 'Raku' xx 2**16;
sub foo([]) { }
foo(@a);