Skip to content

Instantly share code, notes, and snippets.

<masak> perl6: my $b := &say; $b(5)
<p6eval> elf 22235:
OUTPUT[/home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.rb:141:in `block
in to_dump0': undefined method `to_dump0' for true:TrueClass (NoMethodError)␤
from /home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.rb:140:in `each'␤
from
<p6eval> ../home/evalenv/pugs/misc/elf/elf_f_src/STD_red/match.r...
<p6eval> ..pugs, rakudo 31066: OUTPUT[5␤]
<masak> perl6: my &b := &say; b(5)
<p6eval> elf 22235:
method format($text) {
my @result_pars;
for split(/\n ** 2..*/, $text) -> $paragraph {
my $cleaned_of_whitespace = $paragraph.trans(
[ /\s+/ => ' ' ]
);
push @result_pars, "<p>$cleaned_of_whitespace</p>";
}
method format($text) {
my @result_pars;
my @split = gather {
my $text_copy = $text;
while $text_copy.index("\n\n") -> $ix {
take $text_copy.substr(0, $ix);
$text_copy .= substr($ix);
while $text_copy.substr(0,1) eq "\n" {
$text_copy .= substr(1);
method format($text) {
my @result_pars;
my @split;
my $text_copy = $text;
while $text_copy.index("\n\n") -> $ix {
push @split, $text_copy.substr(0, $ix);
$text_copy .= substr($ix);
while $text_copy.substr(0,1) eq "\n" {
$ cat .gitconfig
[user]
name = Carl Masak
email = cmasak@gmail.com
[alias]
ci = commit
co = checkout
di = diff
st = status
Test Summary Report
-------------------
t/library/streams.t (Wstat: 256 Tests: 20 Failed: 1)
Failed test: 12
Non-zero exit status: 1
t/stm/queue.t (Wstat: 256 Tests: 4 Failed: 1)
Failed test: 1
Non-zero exit status: 1
Files=396, Tests=11658, 316 wallclock secs ( 7.08 usr 2.22 sys + 141.28 cusr 72.83 csys = 223.41 CPU)
Result: FAIL
$ cat lingering-named-parameter.p6
use v6;
class A {
sub format_line($line is rw, :$link_maker) {
my $result = $line;
if defined $link_maker {
my $link_regex = / \[\[ (<-[\]]>+) \]\] /; # /
$ svn diff -r7551:7552
[...]
sub oh_thank_you {
- my ($sender, $attribute, $channel, $irc) = @_;
+ my ($dialogue) = @_;
my @replies = (q[oh, thank you, thank you!],
q[you want me to leave?],
q[well, yeah. you're excused too.]); # '
+ my $dialogue = Dialogue->new(
+ 'person' => $nick,
+ 'channel' => $channel,
+
+ 'reply' => sub { reply_to( $nick, shift, $channel, $irc ) },
+ 'say' => sub { utter( shift, $channel, $irc ) },
+ 'me' => sub { $irc->yield( ctcp => $channel
+ => 'ACTION ' . shift ) },
+ );
+
'#seju-estraro' => [
'2008-11-27T19:27:18 <ca!n=user@130.238.45.242> (en bot som jag har gjort)',
'2008-11-27T19:27:23 <ca!n=user@130.238.45.242> hi',
'2008-11-27T19:27:23 <zarah> hi ca',
'2008-11-27T19:27:37 <ca!n=user@130.238.45.242> hon bits inte.',
'2008-11-27T19:27:38 <ma!n=user@host86-159-127-180.range86-159.btcentralplus.com> Multlingvulo: vad menar du med "åstadkomma"? :)',
'2008-11-27T19:28:06 <Multlingvulo!i=Multling@nl101-225-107.student.uu.se> jag k?nner en bot, hon heter zarah, zarah heter hon...',
'2008-11-27T19:28:24 <ca!n=user@130.238.45.242> Multlingvulo: det är lite det som är grejen. det är lättare att nå ut till folk numera. så föreningar har lite förlorat sitt syfte.',
'2008-11-27T19:28:37 <ma!n=user@host86-159-127-180.range86-159.btcentralplus.com> å, jag måste säga det här',
'2008-11-27T19:28:49 <ma!n=user@host86-159-127-180.range86-159.btcentralplus.com> SEJU måste snaras byggas om/ut till en medlemslista',