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 Confusion { | |
token TOP { ^ <element> $ } | |
rule element { <name> <list> } | |
rule list { '(' ~ ')' [ <name> ]+ % ',' } | |
rule name { \w+ } | |
} | |
class Build { | |
method element ($/) { } | |
# method list ($/) { } |
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
subset HTML of Str; | |
subset HEAD of Str; | |
subset BODY of Str; | |
sub body( --> BODY ) { '<body></body>' } | |
sub head( --> HEAD ) { '<head></head>' } | |
subset HTML-nodes of Cool where HEAD|BODY; | |
# sub html(HTML-nodes @nodes, :$lang?, :$xml-lang?, :$dir? where * eq 'ltr' |
This file has been truncated, but you can view the full file.
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
<?xml version="1.0" encoding="utf-8" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>... <title>Untitled</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <style type="text/css"> body { margin-left: 4em; margin-right: 4em; } div.pod-content { padding-left: 20em; } div.marginale { float: right; margin-right: -4em; width: 18em; font-size: 66%; text-align: left; } h1.title { font-size: 200%; } h1 { font-size: 160%; } h2 { font-size: 140%; } h3 { font-size: 120%; } h4 { font-size: 100%; } h5 { font-size: 100%; } h6 { font-size: 100%; } h7 { font-size: 100%; } pre { padding-left: 2em; } ul.toc { list-style-type: none; padding-left: 0; margin-left: 0 } ul.toc ul { list-style-type: none; } ul.toc ul { margin-left: 0; padding-left: 1em; } ul.toc li { margin-left: 0; padding-left: 0em; } ul.toc li.toc-level-1 { padding-left: 1em; } ul.toc li.toc-level- |
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 v6; | |
use lib '.'; | |
use the-lib; | |
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 v6; | |
role ConcatGuard[::T-right] { | |
has T-right $.attr is rw; | |
method left-type () is nodal { self.WHAT } | |
method right-type () is nodal { T-right } | |
method convert () {...} # --> T-right | |
method new (T-right) {...} | |
# our proto sub infix:<~>(|) {*} | |
# our multi sub infix:<~>(T-left \l, T-right \r) { |
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 v6; | |
role ConcatGuard[::T-right] { | |
has T-right $.attr is rw; | |
method left-type () is nodal { self.WHAT } | |
method right-type () is nodal { T-right } | |
method convert () {...} # --> T-right | |
method new (T-right) {...} | |
} |
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
#!/usr/bin/env perl6 | |
use v6; | |
# Return a string of $length bytes where each bit is 1 50% of the time | |
multi sub random-bytes(Int $length) returns array[uint8] { | |
array[uint8].new((0x00..0xff).roll($length)) | |
# same thing and way faster | |
} | |
# Return a string of $length bytes where each bit is 1 with probability $prob |
This file has been truncated, but you can view the full file.
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
<!DOCTYPE html> | |
<html lang="en" ng-app="moarProfApp" ng-controller="NavigationController"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>MoarVM Profiler Results</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css"> | |
<style> |
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
#!/usr/bin/env perl6 | |
use v6; | |
# Return a string of $length bytes where each bit is 1 50% of the time | |
multi sub random-bytes(Int $length) returns array[uint8] { | |
array[uint8].new((0x00..0xff).roll($length)) | |
# same thing and way faster | |
} | |
# Return a string of $length bytes where each bit is 1 with probability $prob |
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 v6; | |
# Let's prefix &say with the line number it's called from | |
module BaseLib { | |
role BaseRole[::T] is export { | |
has T $.attr is rw; | |
} | |