Skip to content

Instantly share code, notes, and snippets.

View ShimmerFairy's full-sized avatar

Faye ShimmerFairy

  • The Doctor's TARDIS
View GitHub Profile
> my $a = 3; my $b := $a; say $a =:= $b
Too many positional parameters passed; got 2 but expected 1
the code:
our multi infix:<=:=>(Mu \$a, Mu \$b) {
pir::issame__IPP($a, $b) ?? True !! False;
}
diff --git a/src/cheats/relops.pir b/src/cheats/relops.pir
index 416b5ab..c6a0bd1 100644
--- a/src/cheats/relops.pir
+++ b/src/cheats/relops.pir
@@ -35,23 +35,6 @@ src/cheats/cmp.pir - Perl6 comparison builtins
# .tailcall '&prefix:!'($P0)
.end
-
-.sub '&infix:<=:=>' :multi(_,_)
$ pdflatex \\nonstopmode\\input summerjournal.tex
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
%&-line parsing enabled.
entering extended mode
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, arabic, basque, bulgarian, coptic, welsh, czech, slovak, german, ng
erman, danish, esperanto, spanish, catalan, galician, estonian, farsi, finnish,
french, greek, monogreek, ancientgreek, croatian, hungarian, interlingua, ibyc
us, indonesian, icelandic, italian, latin, mongolian, dutch, norsk, polish, por
#!/usr/bin/env perl6
my $phrase = prompt "Enter what you wish to anagram: ";
say "Removing everything except letters";
$phrase ~~ s:g/<-alpha>//;
die("You didn't enter any letters!") if $phrase.chars == 0;
say "String to be anagrammed: $phrase";
$phrase = $pharse.lc;
say "{[*] 1..$phrase.chars} possibilities (counting the original string)";
use v6;
grammar Markov {
token TOP {
[<comment>|<command>]+
}
token comment {
^^ '#' \N* \n
}
token command {
^^ $<item>=[\S+] <ws> '->' <ws> $<stop>=['.'?] $<replacement>=[\N+] \n
@ShimmerFairy
ShimmerFairy / tardis
Created November 4, 2010 02:01
modified bin/tardis file
#! /usr/bin/env perl6
use v6;
use Tardis;
use Yapsi;
my $program;
if @*ARGS == 2 && @*ARGS[0] eq '-e' {
$program = @*ARGS[1];
}
elsif @*ARGS == 1 {
From 34abc6a8675e09c5895fec09274d9148936791fa Mon Sep 17 00:00:00 2001
From: lue <rnddim@gmail.com>
Date: Sun, 7 Nov 2010 15:00:53 -0800
Subject: [PATCH] Added string functionality and some tests to match.
---
lib/Yapsi.pm | 3 ++-
t/compiler.t | 8 ++++++++
2 files changed, 10 insertions(+), 1 deletions(-)
@ShimmerFairy
ShimmerFairy / gist:710830
Created November 22, 2010 22:19
Loopery issues
class Pea {
has $.directive;
has $.blocktype;
has $.contents is rw;
method new($directive, $blocktype, $contents) {
self.bless(*, :$directive, :$blocktype, :$contents);
}
method addline($stuffz) {
@ShimmerFairy
ShimmerFairy / gist:783583
Created January 17, 2011 22:03
Quantum Mechanics explained
class QuantumMechanics is Nature {
# Nature has $experiment
method new($experiment) {
self.bless(*, :$experiment);
}
method sane() {
no; # Nature contains this as an enum
}
method experiments() {
given $experiment.lc {
@ShimmerFairy
ShimmerFairy / grammers
Created February 21, 2011 22:23
Grammar only runs once
grammar AQUA {
# protoregexes
proto token block { {*} } # maybe {*} would be better?
# now for the normal stuff
token document { <block>+ }
multi token block:sym<delimited> {
<delimited> <extraconfig>* <content>+ <delimend>
}