»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
timotimo oh god damn it. 00:00
this is pretty bad.
m: 'Hello' ~~ rx:i:m/ Hiyao / 00:01
camelia ( no output )
timotimo m: say 'Hello' ~~ rx:i:m/ Hiyao /
camelia rakudo-moar fb4252: OUTPUT«「Hello」␤»
timotimo ^- literal with ignoremark + ignorecase only checks the very first character ...
TimToady yao indeed 00:02
timotimo i came here to fix something entirely different :|
j: say "hi" 00:03
camelia rakudo-jvm cd19db: OUTPUT«hi␤»
00:03 mcmillhj left
timotimo github.com/perl6/nqp/blob/master/s...#L653-L662 - would have to have a loop, or an entirely different approach 00:03
j: say 'Hello' ~~ rx:i:m/ Hiyao /
camelia rakudo-jvm cd19db: OUTPUT«===SORRY!===␤java.lang.RuntimeException: ordbaseat NYI␤»
timotimo :\ 00:04
no NFG support ...
00:07 skids joined
TEttinger NFG? 00:10
timotimo Normalized Form Grapheme 00:11
though ordbaseat isn't NFG-only 00:12
TEttinger that's... a mouthful
I thought normalization was primarily for diacritics and case folding?
timotimo that's right 00:13
i'd think moarvm learned the ordbaseat instruction at the same time it got NFC, but what do i know :)
TEttinger is this a case folding thing?
timotimo not case folding
ordbaseat gives you the ord of the character that's "minus" all the marks
so a for ä
TEttinger huh, there weren't any marks in that j: command though 00:14
just wondering...
j: say 'Hello' ~~ rx:i/ Hiyao /
camelia rakudo-jvm cd19db: OUTPUT«Nil␤»
timotimo well, :m is for "ignoremarks"
TEttinger and mark means anything normalization would remove, then, like graves and acutes? 00:15
timotimo normalization doesn't remove graves or acutes
it will re-order them, though
TEttinger j: say 'Hello' ~~ rx:m/ Hiyao /
camelia rakudo-jvm cd19db: OUTPUT«===SORRY!===␤java.lang.RuntimeException: ordbaseat NYI␤»
TEttinger oh yeah, right 00:16
it would take the a with hat and separate it into the ascii a, then the hat
timotimo that depends on what normalization form you're running
there's NFD, which is "decomposed". that one will give you a and the hat
TEttinger that's the one I've used so far 00:17
timotimo NFC, which is "composed", will try to find an a-with-hat in the unicode corpus
AngeloMichael Excuse my naïveté, but what is actually done when the compiler sinks something (and what is that something referred to)?
timotimo the code generator will put calls to the .sink method of things into the code for you
TEttinger AngeloMichael, excused, but chiefly because that is some nice use of diacritics on naïveté
AngeloMichael Haha. Merci. 00:18
00:18 mcmillhj joined, MilkmanDan joined
timotimo m: Failure.new("hello") 00:19
camelia rakudo-moar fb4252: OUTPUT«hello␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
TEttinger u: exclamation
TimToady effectively, when you sink something, you don't care about the value, you only care about the side effect
timotimo m: my $foo = Failure.new("hello"); say "done"
camelia rakudo-moar fb4252: OUTPUT«done␤»
TimToady so it's sort of the driver of imperative programming
dalek c: 0dc372f | (Eike Frost)++ | doc/Language/typesystem.pod6:
Fix typo (tuested -> trusted)
c: 51db7bf | Altai-man++ | doc/Language/typesystem.pod6:
Merge pull request #829 from eikef/typesystemtypo

Fix typo (tuested -> trusted)
TimToady as opposed to functional programming, which tries to avoid side effects 00:20
and hence tends to avoid semicolons
AngeloMichael Ah, okay; that makes sense. Thanks, TimToady.
TimToady semicolon isn't the only way to get a sink context, but it's the usual way 00:21
m: sub foo() { 42; 43 }
camelia rakudo-moar fb4252: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 42 in sink context (line 1)␤»
TimToady m: sub foo(--> Nil) { 43 }
camelia rakudo-moar fb4252: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 43 in sink context (line 1)␤»
TEttinger hm. I wonder if there's any comparable "other direction" for side effects, like a "forward effect" that is still part of a pure computation, but changes some upcoming part of the computation in a mutable-like way 00:22
unmatched} m: say "All hell is breaking loose" ~~ m:i:m/"All is fine, I am sure of it"/
camelia rakudo-moar fb4252: OUTPUT«「All hell is breaking loose」␤»
TimToady TEttinger: well, arguably that's what binding is
unmatched} peels "Production Ready" sticker off the Perl 6 box...
:)
TEttinger m: say "Production Ready" ~~ m:i:m/"Pfft, Not Yet"/ 00:23
camelia rakudo-moar fb4252: OUTPUT«「Production Re」␤»
timotimo unmatched}: do you want to RT it? i haven't done it yet
00:23 mcmillhj left
unmatched} Sure, will do. 00:23
TEttinger m: say "Production Ready" ~~ m:i:m/"Probably fine for lots of uses"/
camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
timotimo unless someone else did it already 00:24
TEttinger m: say "Production Ready" ~~ m:i:m/"\bPARTY PARTY PARTY, I WANNA HAVE A PARTY"/
camelia rakudo-moar fb4252: OUTPUT«False␤»
TEttinger interesting
m: say "Production Ready" ~~ m:i:m/"\bProduction Ready"/ 00:25
camelia rakudo-moar fb4252: OUTPUT«False␤»
timotimo it's too long
TEttinger m: say "Production Ready" ~~ m:i/"\bProduction Ready"/
camelia rakudo-moar fb4252: OUTPUT«False␤»
TEttinger isn't \b boundary?
timotimo not inside ""
TEttinger ??? 00:26
unmatched} Done: rt.perl.org/Ticket/Display.html?id=128875
TEttinger m: say "Production Ready" ~~ m:i/\bProduction Ready/
camelia rakudo-moar fb4252: OUTPUT«Potential difficulties:␤ Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)␤ at <tmp>:1␤ ------> 3y "Production Ready" ~~ m:i/\bProduct…»
unmatched} m: say "Production Ready" ~~ m:i/\b 'Production Ready'/
camelia rakudo-moar fb4252: OUTPUT«False␤»
unmatched} m: say "Production Ready" ~~ m:i/<< 'Production Ready'/
camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
TEttinger m: say "Production Ready" ~~ m:i:m/<< 'Production Ready'/ 00:27
camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
timotimo not sure what \b means in our regex syntax
TEttinger neat
m: say "Production Ready" ~~ rx:i:m/<< 'Production Ready'/
camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
TEttinger so it correctly treats zero-length stuff as not changing the first letter
m: say "Production Ready" ~~ rx:i:m/<< 'Production Readier'/
camelia rakudo-moar fb4252: OUTPUT«「Production Ready」␤»
00:28 pierre_ left
timotimo um ... of course it does? 00:29
it's about every single literal you can find
12.82user 0.68system 0:13.51elapsed 99%CPU (0avgtext+0avgdata 2647752maxresident)k 00:31
^- used to be
0.34user 0.02system 0:00.36elapsed 99%CPU (0avgtext+0avgdata 82720maxresident)k 00:32
^- now is
actually ... used to be worse, i think.
let me check.
nah, used to be exactly that much 00:35
which makes me wonder why my first optimization attempt yielded no benefit at all ...
00:35 mcmillhj joined
timotimo when it should have reduced the amount of lc calls by a whole lot ... 00:35
maybe we ought to implement an op in moarvm that strips a character of all marks and returns the stripped result 00:37
00:40 mcmillhj left
timotimo fires up his slightly more beefy desktop for a spec test run 00:40
um ... can't reach it 00:42
hack it is, then.
ugh. make test would have already shown my code to be broken 00:44
good thing at this time of day people don't tend to be building perl6 00:51
i have a bad history of not testing before i push; when will i learn? >:( 00:54
00:54 mcmillhj joined
timotimo ah, just a silly mistake i made 00:55
00:59 lee_ joined, mcmillhj left
timotimo right. my thing is still wrong 00:59
i'd need an ifnull for the lc-ing ... 01:00
makes me wonder why it didn't fail "make test" locally 01:03
tonight is the night timo talks to himself a lot
gfldex wut? 01:04
timotimo well, nobody engages me in this discussion :P
so i just use the open IRC channel as a rubber duckie
01:05 pierre_ joined
timotimo so, how are you doin, gfldex? 01:05
01:05 pierre_ left
unmatched} *crickets* 01:05
:D
gfldex i'm a wee bit dreaded by the perspective to write a complete description of class 01:06
timotimo oh, really? 01:07
that seems like biting off a lot at once
unmatched}: are you glad i made your shit faster, now that you've replaced it with other shit? :) 01:08
gfldex m: class C is Any { has Any $.attr = Any; method foo(*%_ --> $?CLASS:D){ self } } 01:09
camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed return value␤at <tmp>:1␤------> 3has Any $.attr = Any; method foo(*%_ -->7⏏5 $?CLASS:D){ self } }␤»
gfldex m: class C is Any { has Any $.attr = Any; method foo(*%_ --> $?CLASS){ self } }
camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed return value␤at <tmp>:1␤------> 3has Any $.attr = Any; method foo(*%_ -->7⏏5 $?CLASS){ self } }␤»
gfldex m: class C is Any { has Any $.attr = Any; method foo(*%_ --> C:D){ self } }
camelia ( no output )
gfldex m: class C is Any { has Any $.attr = Any; method foo(*%_ --> ::?CLASS){ self } } 01:10
camelia ( no output )
gfldex m: class C is Any { has Any $.attr = Any; method foo(*%_ --> ::?CLASS:D){ self } }
camelia ( no output )
unmatched} timotimo: I'm so drunk, I can barely read... so... Sure, I'm ghlad of any improvement :D
m: say class {} ~~ Any 01:11
camelia rakudo-moar fb4252: OUTPUT«True␤»
timotimo if you can't read, let me summarize it for you: my cut-down version of your code runs in 0.36 seconds instead of 13.5 seconds
unmatched}
.oO( my code?? )
the bug about the m:i// on huge text?
timotimo m: say "and the memory usage is down to { 8272000 / 2647752 }% of what it used to be"
camelia rakudo-moar fb4252: OUTPUT«and the memory usage is down to 3.1241597% of what it used to be␤»
timotimo yes, that one
unmatched} timotimo++ fixing things
01:12 freezerburnv_ joined
gfldex m: class C is Any { has Any $.attr = Any; only method foo(*%_ --> ::?CLASS:D){ self } } 01:12
camelia ( no output )
01:12 zacts left 01:13 mcmillhj joined
gfldex m: class C is Any { has Any $!attr = Any; only method attr { return-rw $!attr }; only method foo(*%_ --> ::?CLASS:D){ self } } 01:13
camelia ( no output )
timotimo ah, i *thought* it was something with :: at the beginning
gfldex i think that's all the defaults for a very simple class. Whereby the return type constraint is not really there ofc. 01:14
01:17 mcmillhj left
timotimo hum. i wonder ... S05-modifier perl5_5 has a bit of b0rkage 01:20
why? >:( 01:21
the output from these tests is really not helpful 01:22
01:23 mcmillhj joined 01:28 mcmillhj left 01:35 pierre_ joined
timotimo i can't tell why it's not matching there :\ 01:35
01:37 itaipu joined, Actualeyes joined 01:40 sena_kun left 01:43 pierre_ left 01:46 ilbot3 left 01:47 ilbot3 joined 01:49 lee_ left 01:54 mcmillhj joined 01:55 MilkmanDan left 01:56 MilkmanDan joined, itaipu left 01:59 mcmillhj left, sufrostico joined 02:05 sufrostico left 02:06 cyphase left 02:08 mcmillhj joined 02:13 mcmillhj left 02:16 cyphase_eviltwin joined 02:22 BenGoldberg joined 02:25 noganex_ joined 02:28 noganex left 02:36 TEttinger left 02:38 freezerburnv_ left 02:41 mcmillhj joined, AlexDaniel joined 02:42 wamba joined, TEttinger joined 02:46 mcmillhj left 02:52 mcmillhj joined 02:55 LegalResale joined 02:57 mcmillhj left 02:58 pierre_ joined 03:06 pierre__ joined, pierre_ left
lucs m: (my $s = "1a 2b 1c 2d") ~~ s:g/ 1 <( \S /{ ~$0.uc }/; say $s # How to fix? I want: 「1A 2b 1C 2d␤」 03:06
camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:2␤------> 3d") ~~ s:g/ 1 <( \S /{ ~$0.uc }/; say $s7⏏5 # How to fix? I want: 「1A 2b 1C 2d␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ …»
03:07 mcmillhj joined
AlexDaniel committable: releases say "All hell is breaking loose" ~~ m:i:m/"All is fine, I am sure of it"/ 03:07
committable AlexDaniel: ¦«2015.10,2015.11,2015.12,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07,HEAD»: 「All hell is breaking loose」
AlexDaniel well, that's unfortunate 03:09
TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g/ 1 <( ( \S ) /{ ~$0.uc }/; say $s 03:10
camelia rakudo-moar fb4252: OUTPUT«1A 2b 1C 2d␤»
TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g/ 1 <( \S /{ ~$/.uc }/; say $s
camelia rakudo-moar fb4252: OUTPUT«1A 2b 1C 2d␤»
lucs TimToady: Oh, thanks. 03:11
TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g { 1 <( \S } = ~$/.uc; say $s
camelia rakudo-moar fb4252: OUTPUT«1A 2b 1C 2d␤»
TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g { 1 <( \S } = $/.uc; say $s
camelia rakudo-moar fb4252: OUTPUT«1A 2b 1C 2d␤»
lucs You wear your nick well :)
TimToady :)
03:12 mcmillhj left 03:15 Actualeyes left
TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g { 1 \S } = $/.uc; say $s 03:16
camelia rakudo-moar fb4252: OUTPUT«1A 2b 1C 2d␤»
lucs Hmm, that too right, of course (I may have overthought my regex), but your examples are instructive. 03:18
03:22 leego joined
lucs didn't know about (or probably forgot about) the s {⋯} = ⋯ form. 03:22
03:27 cog_ joined 03:30 Actualeyes joined 03:31 cognominal left, eam joined 03:37 wamba left
TimToady m: (my $s = "1a 2b 1c 2d") ~~ s:g { 1 \S } .= uc; say $s 03:38
camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed assignment operator␤at <tmp>:1␤------> 3y $s = "1a 2b 1c 2d") ~~ s:g { 1 \S } .=7⏏5 uc; say $s␤»
TimToady aww
03:39 holyghost left
lucs :) 03:39
03:40 holyghost joined
TimToady finds it odd that that doesn't parse 03:42
TEttinger what is .= ? 03:43
AlexDaniel m: my $x = ‘foo bar’; $x ~~ s:g{foo} = ‘bar’; say $x 03:44
camelia rakudo-moar fb4252: OUTPUT«bar bar␤»
AlexDaniel m: my $x = ‘hello’; $x = $x.us; say $x
camelia rakudo-moar fb4252: OUTPUT«Method 'us' not found for invocant of class 'Str'␤ in block <unit> at <tmp> line 1␤␤»
AlexDaniel m: my $x = ‘hello’; $x = $x.uc; say $x
camelia rakudo-moar fb4252: OUTPUT«HELLO␤»
AlexDaniel m: my $x = ‘hello’; $x = $x . uc; say $x
camelia rakudo-moar fb4252: OUTPUT«HELLO␤»
AlexDaniel m: my $x = ‘hello’; $x .= uc; say $x
camelia rakudo-moar fb4252: OUTPUT«HELLO␤»
TimToady m: my $x = ‘foo bar’; $x ~~ s:g{foo} ~= ‘bar’; say $x
camelia rakudo-moar fb4252: OUTPUT«foobar bar␤»
TimToady the ~= works... 03:45
lucs TEttinger: It's kind of like += : 「$x .= foo」 -> 「$x = $x.foo」 03:46
TEttinger nice
good thing to have 03:47
TimToady most often you see: my Foo $x .= new; 03:48
AlexDaniel TEttinger: basically any infix operator can be used like this 03:49
but I know it sounds weird that . is an infix op…
TimToady well, not if the type is too different
AlexDaniel right 03:50
TimToady m: my $x = 42; $x [>]= 41; say $x
camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot make assignment out of > because chaining operators are too diffy␤at <tmp>:1␤------> 3my $x = 42; $x [>]=7⏏5 41; say $x␤»
03:51 leego left
TimToady but that's why we made min and max into infixes 03:51
m: my $x = 42; $x min= 41; say $x
camelia rakudo-moar fb4252: OUTPUT«41␤»
03:52 jack_rabbit joined
TimToady m: my $x = 42; $x gcd= 120; say $x 03:53
camelia rakudo-moar fb4252: OUTPUT«6␤»
TimToady same reasoning there
03:53 ggoebel left 04:05 kid51 left 04:06 kid51 joined
BenGoldberg m: my @a = 3, 5, 10; @a gcd= 1; 04:15
camelia ( no output )
BenGoldberg m: my @a = 3, 5, 10; @a gcd= 1; say @a; 04:16
camelia rakudo-moar fb4252: OUTPUT«[1]␤»
BenGoldberg m: my @a = 3, 5, 10; @a gcd= slip; say @a;
camelia rakudo-moar fb4252: OUTPUT«[3]␤»
BenGoldberg m: my @a = 3, 5, 10; @a max= slip; say @a;
camelia rakudo-moar fb4252: OUTPUT«[3 5 10]␤»
TimToady m: my @a = 3, 5, 10; say [gcd] @a
camelia rakudo-moar fb4252: OUTPUT«1␤»
TimToady m: my @a = 3, 5, 10; say [lcm] @a
camelia rakudo-moar fb4252: OUTPUT«30␤»
BenGoldberg m: my @a = 3, 5, 10; @a .= max; say @a;
camelia rakudo-moar fb4252: OUTPUT«[10]␤»
TimToady that's a little bizarre 04:17
BenGoldberg Not really unexpected, though.
TimToady it's odd to want to put it back into the array though 04:18
BenGoldberg True :)
AlexDaniel m: my @a = 3, 5, 10; @a .= @a
camelia rakudo-moar fb4252: OUTPUT«Invocant requires a type object of type Array, but an object instance was passed. Did you forget a 'multi'?␤ in block <unit> at <tmp> line 1␤␤»
04:19 rindolf joined
AlexDaniel did I forget a ‘multi’? ;) 04:19
BenGoldberg You forgot a method
AlexDaniel that's right :)
BenGoldberg m: my $str = 'chars'; $str .= $str; 04:20
camelia rakudo-moar fb4252: OUTPUT«No such method 'CALL-ME' for invocant of type 'Str'␤ in block <unit> at <tmp> line 1␤␤»
BenGoldberg m: my $str = 'chars'; $str.$str().say; 04:21
camelia rakudo-moar fb4252: OUTPUT«No such method 'CALL-ME' for invocant of type 'Str'␤ in block <unit> at <tmp> line 1␤␤»
BenGoldberg m: my $str = 'chars'; $str .= "$str"; 04:22
camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Quoted method name requires parenthesized arguments. If you meant to concatenate two strings, use '~'.␤at <tmp>:1␤------> 3my $str = 'chars'; $str .= "$str"7⏏5;␤»
04:22 kid51 left
BenGoldberg m: my $str = 'chars'; $str .= "$str" (); 04:22
camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Quoted method name requires parenthesized arguments. If you meant to concatenate two strings, use '~'.␤at <tmp>:1␤------> 3my $str = 'chars'; $str .= "$str"7⏏5 ();␤»
BenGoldberg m: my $str = 'chars'; $str .= "$str"();
camelia ( no output )
BenGoldberg m: my $str = 'chars'; say $str .= "$str"();
camelia rakudo-moar fb4252: OUTPUT«5␤»
BenGoldberg m: infix:<.>().say; 04:26
camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed postfix call␤at <tmp>:1␤------> 3.7⏏5<EOL>␤»
TimToady it's not a real operator, quite 04:27
04:29 Cabanossi left 04:33 Cabanossi joined, BenGoldberg left 04:46 cyphase_eviltwin is now known as cyphase 04:47 rindolf left 04:51 mcmillhj joined 04:52 khw left 04:56 mcmillhj left 05:02 harovali left 05:03 mcmillhj joined 05:07 mcmillhj left 05:10 pierre__ left, pierre_ joined 05:14 mcmillhj joined 05:19 mcmillhj left 05:22 pierre_ left 05:29 skids left
AngeloMichael TIL the blue streaks in Camelia's wings are 6s... 05:31
TimToady well, only one of them is a 6, the other is a P 05:32
05:32 Possum left
hobbs A P and a 6 05:32
AngeloMichael Mind blown again, haha.
hobbs what just blew my mind is that John O'Hurley (the actor who played Mr. Peterman, the owner of the J. Peterman catalog) has since become part owner of the J. Peterman catalog in real life. 05:35
05:41 Possum joined 06:07 mcmillhj joined 06:12 mcmillhj left, rpburkholder joined 06:25 zhmylove_ left 06:26 zhmylove joined 06:28 firstdayonthejob joined 06:32 CIAvash joined 06:37 AngeloMichael left 06:38 AngeloMichael joined 06:44 firstdayonthejob left 06:53 bitmap joined 06:57 ggoebel joined 06:59 sno left
TEttinger not sure how I started thinking about this, but the concept of animal mascots having human-like properties as well as their own animal-like properties leads to interesting areas. camelia would crave sodium, as almost all butterflies and moths do. she would have a sense that humans can only begin to grasp, since butterflies have a magnetic compass in their brain. 07:09
07:11 mcmillhj joined
TEttinger put this together and camelia seems like she'd always know where the closest fast food place is, and would always ask for 20 extra packets of salt 07:12
very politely!
07:15 arrojo89 joined
arrojo89 hello all ! 07:15
07:16 mcmillhj left
arrojo89 p6: say for (1 .. 30); 07:16
camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument, or use &say to refer to the function as a noun␤at <tmp>:1␤------> 3say7⏏5 for (1 ..…» 07:17
arrojo89 p6: say $_ for (1 .. 30);
camelia rakudo-moar fb4252: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16␤17␤18␤19␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤»
AlexDaniel m: .say for 1..30 07:18
camelia rakudo-moar fb4252: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16␤17␤18␤19␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤»
arrojo89 m: say for 1..30
camelia rakudo-moar fb4252: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument, or use &say to refer to the function as a noun␤at <tmp>:1␤------> 3say7⏏5 for 1..30…»
arrojo89 m: .say for 1..30
camelia rakudo-moar fb4252: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16␤17␤18␤19␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤»
arrojo89 why with the dot AlexDaniel ?
AlexDaniel arrojo89: everything has a method .say, so you can do $_.say 07:20
m: $_.say for 1..30
camelia rakudo-moar fb4252: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16␤17␤18␤19␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤»
AlexDaniel arrojo89: but you can omit $_ in this case because it is very common
arrojo89: so it becomes just “.say”. Basically, it works very similarly to how some things default to $_ in Perl 5, but it is way more explicit and consistent 07:21
07:22 labster left, captain-adequate left
arrojo89 ok thanks AlexDaniel 07:22
07:25 labster joined 07:27 mcmillhj joined 07:29 bjz joined 07:31 darutoko joined, mcmillhj left 07:32 Psy-Q_ left, RabidGravy joined, Psy-Q joined 07:34 captain-adequate joined 07:35 rpburkholder left 07:37 zakharyas joined 07:42 bjz left, dakkar joined 07:43 mcmillhj joined
dalek line-Perl5: b2dda91 | niner++ | / (2 files):
Fix memory corruption when multiple interpreters are used

Re-ordering of the includes in p5helper.c made memory corruptions surface that should have been there all along. While we did call PERL_SET_CONTEXT as preparation for calling into the Perl 5 interpreter, we did so only after already making calls like newAV() in a bogus attempt to stick to C89 rules of keeping declarations before statements. Fix by moving the PERL_SET_CONTEXT call to the very first line of each function it occurs in.
07:46
07:47 pierre_ joined 07:48 mcmillhj left 07:51 zakharyas left 07:52 pierre_ left 07:55 bjz joined 07:58 sno joined 08:00 dogbert17 left, canopus left
lizmat clickbaits p6weekly.wordpress.com/2016/08/08/...uiet-week/ 08:04
08:05 matt_ left 08:07 canopus joined 08:13 rindolf joined 08:26 yoleaux joined, ChanServ sets mode: +v yoleaux 08:27 mcmillhj joined 08:32 mcmillhj left 08:44 harrison_ joined 08:49 jack_rabbit left 08:51 TEttinger left 08:53 harrison_ left 08:54 notostraca joined 08:55 notostraca is now known as TEttinger
gregf_ *holidays* 08:59
08:59 mcmillhj joined 09:01 TEttinger left, ribasushi left 09:02 TEttinger joined 09:04 mcmillhj left 09:06 TEttinger left 09:08 TEttinger joined 09:19 xinming_ joined 09:22 xinming left 09:26 Skarsnik joined
Skarsnik hello 09:27
09:28 kurahaupo joined 09:29 xinming_ is now known as xinming, zakharyas joined 09:31 TEttinger left 09:33 TEttinger joined 09:34 pierre_ joined
DrForr Afternoon, Skarsnik. 09:34
09:38 TEttinger left
Skarsnik hm, I had a weird issue when trying to install a module I write 6 months ago. one test fail. I tried to make sense of the error to fix it, but I had no idea what is wrong. it fail on a simple open gist.github.com/anonymous/6b244812...5b332f22a1 09:38
09:38 MorayJ joined 09:39 mcmillhj joined, TEttinger joined, pierre_ left
nine Skarsnik: the line numbers in your trace are way off. You sure you pasted the whole files? 09:42
Ah, just saw the # line 24 comment
09:44 mcmillhj left, labster left, TEttinger left 09:47 TEttinger joined 09:51 kurahaupo_ joined 09:52 kurahaupo left 09:54 mcmillhj joined
Skarsnik btw hello nine, Are you done with the pre comp hell finally? :) 09:56
nine Skarsnik: I dare not say "done", but the dust seems to settle. 09:58
09:59 mcmillhj left, TEttinger left
Skarsnik It can be 'system wide' finally? or it's still by users? 09:59
jnthn Wouldn't it be "both" since users can always install modules locally as well as system wide? 10:02
10:04 TEttinger joined
nine jnthn: true 10:04
Skarsnik I mean, root install Module A. User U use code that use A and it does not have to wait for A to be precompiled for him since root already did it (but using the test?) 10:05
nine Skarsnik: yes, that works now :)
10:05 sjohnsen- left
Skarsnik Nice :) 10:05
nine Skarsnik: even better, one can now build distro packages for modules including those precomp files. Even if the package is built by an unpriviledged user in a different build root. 10:06
10:06 MilkmanDan left
RabidGravy boom! 10:07
10:07 sjohnsen joined, bisectable left
Skarsnik nice :) 10:07
I am repeating myself 10:08
RabidGravy that's fine, I used the same 50,000 words over and over again just in a different order 10:09
10:12 bisectable joined 10:13 Actualeyes left 10:15 kurahaupo_ left 10:17 TEttinger left 10:20 MilkmanDan joined
Ulti whoa my bioinformatics tests are now down to 1.26s 10:21
RabidGravy yay!
where did they start?
Ulti two years ago 36s
6 months ago 10s
RabidGravy excellent stuff
Ulti something like that 10:22
jnthn How fast is fast enough? :)
Ulti depends
this is now fast enough for little things for sure
RabidGravy www.brewerydb.com/developers
Ulti for more realistic bioinformatics loads an order of magnitude :( but really I have got *bad* Perl 6 code here
I haven't changed it in years just so I could benchmark
10:22 TEttinger joined
Ulti I only updated for GLR and the hash/bag equivalent 10:23
stmuk media.ccc.de/v/emf2016-269-beer-for-everyone
Ulti I could probably get a lot of speedup just optimising my own code and finding more optimised routes through Rakudo
that I haven't and I've got like a 30x speedup is kind of amazing
shaving off a whole second in the last month is quite impressive given its a much bigger % change 10:24
jnthn RabidGravy: Ooh, I gotta use that in some demo :)
10:25 ribasushi joined
Ulti also the reality is bioinformatics libraries everywhere else tend to wrap C to get the perf 10:26
and Perl 6 does make that easier than most languages
jnthn How parallelizable are bioinformatics algorithms, generally? 10:27
stmuk I don't suppose anyone knows (roughly) when perl6-bench last ran 100%?
10:28 Actualeyes joined
jnthn stmuk: www.moarvm.org/measurements/perl6-bench/ has results going back to February, so if you can figure out what's working or not from that you can bisect :) 10:28
stmuk ok thanks
Ulti jnthn generally highly parallelizable
but more importantly they are trivially parallelizable usually on the outside of data you are reading 10:29
so you are doing the same thing for a billion objects rather than having lots of internal parallelism to your algorithm
jnthn Aha.
Ulti IO and memory performance is really the actual bottle neck
for some reason everyone in bioinformatics has a preference for awful text formats that are hugely bloated 10:31
so fast parsers make the difference nearly always
fairly sure if grammars got faster that would be the big thing for me now
or really the main thing is being able to define a token that the grammar can parallelize around would be amazing 10:32
I've sort of done that myself badly
so you read a chunk of file you know to split on to then parse
and you can parse in parallel if your read all those chunks quickly 10:33
not sure how grammars .parse is implemented but that did make a difference if I did that
like we have TOP could maybe have CHUNK which is used to split IO up and then TOP is matched against that chunked string over and over 10:36
arrojo89 is there a way to convert perl scripts into exe ? 10:39
10:40 TEttinger left
DrForr Not yet, at least to my knowledge. Also, usually that's a question we get for perl 5. 10:42
Ulti not yet for MoarVM but the JVM can produce a JAR for you
DrForr Ah, cool.
Ulti --target=jar iirc 10:44
RabidGravy jnthn, I was just pointed at untappd.com/api/docs as well
Ulti jnthn just looking at your grammar debugger and tracer looks like Metamodel::GrammarHOW might let me do the chunked IO nicely in a module? 10:45
unmatched} "@zoffix Pearl 6 has been an ongoing development since 2000. Yet after 14 years it is not officially done.. Its not dead its dead end" 10:47
unmatched} slowly shakes head
And from now on I'm totally gonna troll people who bring up The Name Issue by saing it's not Perl 6, but "Pearl 6" :P 10:48
RabidGravy nuke them from orbit, it's the only way to be sure
jnthn If they can't even calculate 2016 - 2000 then I don't hold much hope for them being smart enough to assess whether something is ready for them to use :P
10:48 TEttinger joined
jnthn Ulti: Thing is, you'd kinda like the results back incrementally too 10:49
Ulti: Not a single huge match object at the end.
Ulti: Or I'd guess that's what you'd want anyway
DrForr People don't "assess" languages or products anymore, they just assuem the top hit on Google is the best.
Ulti jnthn: yup you would want .parse to return a supply or something 10:50
jnthn So it may be more that we want a module that provides a role you compose into a grammar, so you get a parse-chunks and it takes a chunking operation or so
Ulti then react whenever
unmatched} Oh, quite the contrary, this person did extensive research before declaring Perl 6 a failure: "Number 6 is a sign of failure for scripting languages php6 and now perl 6"
jnthn Oh, that old chessnut :P
Ulti jnthn yup but it would be nice if the chunking rule was part of the grammar declaration too, though equally easy to just pass it in 10:51
unmatched} :)
jnthn Ulti: Well, that could be a method required by the role :)
I don't think this needs meta-programming to solve though
Just a nicely designed role
Ulti unmatched}: this is the author www.linkedin.com/in/ubereng 10:52
10:53 pierre_ joined
Ulti jnthn will give that a go, at the moment I have a weird class that sort of holds an actions and grammar class together with the chunking rule and does the IO on the outside and calls .parse lots of times 10:53
10:53 TEttinger left
Ulti would be nice to have something a little more reuseful 10:53
jnthn Yeah, it's an interesting problem :) 10:54
Ulti wasnt there chat of having a Slang which kept actions and grammar rules declaratively together at one point? 10:55
10:55 andreoss joined
RabidGravy can you have traits on grammars and their constituent parts? 10:55
jnthn RabidGravy: Sure, they're just classes/methods really 10:56
andreoss what is a function equivalent for qx``? `run("who", :out).out.slurt-rest` is noisy
*spurt 10:57
*slurp
Ulti you could have a trait for TOP where you have multiple concurrent routes through the grammar and they race to match :)
10:57 arrojo89 left 10:58 TEttinger joined
jnthn andreoss: So...why not use qx? :) 10:59
andreoss m: map { say qx`$_` }, qw/date who/ 11:00
camelia rakudo-moar ddcbae: OUTPUT«qx, qqx is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting line 1␤ in sub QX at src/RESTRICTED.setting line 11␤ in block <unit> at <tmp> line 1␤␤»
jnthn You'd need qqx to interpolate, I think
literal is there a way to pass further arguments to 'use' via the -M commandline option? specifically :from 11:01
andreoss hmm, qx`$_` hangs for some reason, probably bash
jnthn: a function would be better with .map 11:03
11:03 TEttinger left 11:04 TEttinger joined 11:11 edehont joined 11:20 canopus left 11:21 canopus joined, jameslenz joined 11:26 TEttinger left 11:29 TEttinger joined 11:30 brrt joined 11:32 sena_kun joined 11:34 pierre_ left, TEttinger left 11:35 TEttinger joined 11:39 pierre_ joined, TEttinger left 11:42 TEttinger joined, edehont left 11:44 mls_ is now known as mls 11:45 kid51 joined 11:49 TEttinger left 11:50 TEttinger joined 11:55 TEttinger left 11:57 TEttinger joined 12:05 brrt left 12:06 TEttinger left 12:07 jkramer left
unmatched} Ulti: author of what? I don't have LinkedIn 12:09
12:09 TEttinger joined 12:12 TEttinger left, TEttinger joined
unmatched} gifts TEttinger a new router 12:13
m: say "[foo" ~~ /"[" ~ "]" \w+/ 12:14
camelia rakudo-moar ddcbae: OUTPUT«Nil␤»
unmatched} The Internals Course says about the above syntax: "failure to find the closing ] produces a descriptive error message instead of just failing to match.".... what error is it talking about? 12:15
12:15 harrison_ joined 12:16 lambd0x joined
lambd0x Hi fellas! 12:16
yoleaux 7 Aug 2016 02:04Z <b2gills> lambd0x: I was trying to get you to realize it could be written as 「my %h; for $*IN.words -> $word { %h{$word}++ }」 then I was going to tell you about 「my %h := $*IN.words.BagHash」 irclog.perlgeek.de/perl6/2016-08-06#i_12978231
ilmari m: say $*IN.words.BagHash 12:17
camelia rakudo-moar ddcbae: OUTPUT«BagHash.new(Atá, do(2), I, a(8), dom(2), chúl, pilleadh, gan(3), shéimh, fóill,, bhí(2), Lúich’, le(5), coll;, ina(2), chroí., miste, seal, dhílis, cluain, feall,, B'é, dhiaidh, dhá, siúl;, Go, Meiriceá, thiomáin, 'S, ghaoil,, os, na(3), Cho…»
lambd0x lol :)
ilmari shiny :)
lambd0x ilmari: Do you know how to read just a word or a sigle number from a file? 12:18
unmatched} m: say $*IN.words[0] 12:19
camelia rakudo-moar ddcbae: OUTPUT«Céad␤»
unmatched} m: say $*IN.words.grep(/^\d+$/)[0] 12:20
camelia rakudo-moar ddcbae: OUTPUT«Nil␤»
unmatched} m: say $*IN.words.grep(/^D/)[0]
camelia rakudo-moar ddcbae: OUTPUT«Dhún␤»
lambd0x unmatched}: but doesn't that give you the first line?
unmatched}: ah
unmatched} It gives you first word from the first line
m: say $*IN.lines[1].words[0] 12:21
camelia rakudo-moar ddcbae: OUTPUT«Agus␤»
unmatched} ^ first word from second line
ilmari m: say $*IN.lines.is-lazy
camelia rakudo-moar ddcbae: OUTPUT«False␤»
ilmari huh, I'd have expected that to be True
lizmat hmmm.... that should be True
unmatched} That seems to be a bug
lizmat checks
ilmari m: say $*IN.words.is-lazy 12:22
camelia rakudo-moar ddcbae: OUTPUT«False␤»
lambd0x unmatched}: nice so words works like lines \o/
unmatched}: didn't noticed that earlier, thanks you.
*notice.
unmatched}
.oO( or do lines work like words :o )
m: say $*IN.lines[1].words[2].comb[3] 12:23
camelia rakudo-moar ddcbae: OUTPUT«a␤»
unmatched} 4th letter of 3rd word on 2nd line :)
s/letter/character/;
ilmari m: $*IN.WHAT.say
camelia rakudo-moar ddcbae: OUTPUT«(Handle)␤»
ilmari m: $*IN.lines.WHAT.say 12:24
camelia rakudo-moar ddcbae: OUTPUT«(Seq)␤»
12:24 TEttinger left
jnthn lizmat: .lines.is-lazy being False is likely correct 12:25
lizmat: Because my @lines = $*IN.lines; probably wants to be eager by default
lizmat @a.STORE is eager afaik
unmatched} How come? It does read lazily
lizmat but for $*IN.lines -> $line { } would be lazy 12:26
ilmari github.com/rakudo/rakudo/blob/nom/...le.pm#L568 # looks lazy to me
12:26 TEttinger joined
unmatched} "10GB-file".IO.lines[0..3].say # will not read the entire 10GB 12:26
lambd0x unmatched}: haha I'm surprised semantics are meaninful in perl 6. Not many languages work alike. I liked it :)
lizmat looks like it's just a matter of forgetting an "is-lazy" method in the iterator 12:27
jnthn unmatched}: That isn't what is-lazy means though. 12:28
AlexDaniel “How fast is fast enough?” – it is never fast enough
lizmat is confused now
unmatched} jnthn: oh, I thought it did 12:29
lizmat hopes for a TIL moment
jnthn No, it means "we *must* never try to evaluate more than the user absolutely asks for"
It doesn't mean "all the data is obtained before iteration starts" 12:30
12:30 harrison_ is now known as Harry
lizmat jnthn: so you're saying that making .lines.is-lazy True would make the .STORE non-eager ? 12:30
jnthn Correct
12:31 Harry is now known as Hathersage
jnthn You'd make my @a = $foo.lines; behave like my @a = lazy $foo.lines; 12:31
lizmat # Whether the iterator is lazy (True if yes, False if no). 12:32
this is the description in Iterator.pm
12:33 kid51 left
lizmat hmmm.. quite some spectest fallout with .lines / .words being lazy 12:33
dalek ecs: 2e72b5d | (Zoffix Znet)++ | html/perl-with-historical-message.css:
Display historical message based on <body> and not <html>

Fixes rendering issues on rekonq
12:36
12:36 wamba joined 12:38 TEttinger left 12:39 pierre_ left
jnthn lizmat: I figured so. Which means it'll break a bunch of real world code too I'd guess 12:39
12:40 TEttinger joined 12:41 pierre_ joined
moritz so, something for v6.d? 12:41
lizmat moritz: why ? 12:42
moritz lizmat: becaues it breaks a bunch of real world code
lizmat yeah, but I guess jnthn's point was that we *shouldn't* do this in the first place, in any version :-)
12:43 Util joined
moritz still, that's what stability means 12:43
that we don't break user's code
do we have a document yet with plans for v6.d? 12:44
12:45 TEttinger left
jnthn Yeah, I don't think we want to change it at all :) 12:46
12:49 kid51 joined 12:51 perlpilot joined 12:53 perlpilot left, noganex_ left, mcmillhj joined
Ulti unmatched}: the quote from zoffix was a quote of a blog online not zoffix 12:56
andreoss qx seems to be broken on windows 12:57
cannot handle non-ascii characters
paste.debian.net/787615/
unmatched} Ulti: ah, damn, just when I started to think Zoffix was an asshole :) 12:59
unmatched} snickers
Ulti: it's actually from someone Tweeting: twitter.com/imansaripk/status/7574...7192769536
[Coke] (doc with plans for v6.d) not yet. I think we need a general plan and then maybe also what breaking changes we're considering. 13:01
(-> -dev)
RabidGravy unmatched}, I don't know where to start: "pearl", numerology, "scripting" - I think the persons opinion can be disregarded 13:03
13:04 TEttinger joined
unmatched} I'd aim for "corrected" rather than disregarded :) I did find it by searching for "Perl 6" on Twitter, after all. 13:06
w4and0er96 php6 ? where? XD 13:09
13:09 MilkmanDan left
andreoss it occurs with code page 866, works okay with 65001 13:09
should it work with 866 too?
unmatched} What's 866, Latin-1 or something? 13:11
andreoss cyrillic
unmatched} Oh
13:11 noganex joined 13:13 MilkmanDan joined
RabidGravy but it's similar to latin-1 in that it's ascii with additional high characters 13:13
unmatched} My guess would be say qx`echo абвг` gives абвг in utf-8; so that's why it works under utf cp 13:15
I recall seeing some RT ticket about printing unicode 13:16
buggable: rt
13:16 TEttinger left
buggable unmatched}, TOTAL: 1390, UNTAGGED: 600, BUG: 425, LTA: 98, JVM: 62, NYI: 35, SEGV: 30, RFC: 28, UNI: 26, CONC: 24, PERF: 20, POD: 14, @LARRY: 14, PRECOMP: 9, TODO: 9, GLR: 6, BUILD: 5, STAR: 4, NATIVECALL: 4, WEIRD: 3, BOOTSTRAP: 3, MOARVM: 2, OSX: 2, LHF: 1, SPESH: 1, DOCS: 1, MATH: 1 Details: bug.perl6.party/1470748600.html 13:16
unmatched} This one: rt.perl.org/Ticket/Display.html?id...et-history maybe there's some relevance 13:17
13:17 cdg joined, TEttinger joined 13:18 cdg left, cdg joined
Ulti unmatched}: yeah I just posted a reply to the tweet... the guy is just trying to look smarts by copy pasting FUD from blog posts written two years ago :S 13:22
*sigh*
being a critic is one thing, but just spreading old hate is lame
13:22 TEttinger left
Ulti the latest times for my code have perked up interest at work since they've now seen 10s go down to 1.2s 13:22
RabidGravy big jumps get attention :) 13:24
13:24 TEttinger joined, mcmillhj left
Ulti yup 13:26
dalek ecs: 899560e | moritz++ | v6d.pod:
Add v6d.pod, a place to track proposed language changes for v6.d
Ulti also I posted quite a nice asynch SQL example after someone was going on about a hacker news post about a python module to do the same.... literally core Perl 6 does it all 13:27
well with DBIish
but all the asynch is just primitives that /just work/ in a couple of lines
13:28 mcmillhj joined
andreoss Proc.run doesn't work either with 866, throws Malformed UTF-8 13:29
13:29 dvh joined
dvh Hello there! 13:30
13:30 tokomer joined
RabidGravy yeah because it isn't utf-8 13:30
13:30 skids joined
dvh m: say 'hello' 13:31
camelia rakudo-moar e1205c: OUTPUT«hello␤»
moritz andreoss: you can pass :bin to Proc.run
andreoss: or specify an encodingwith :enc
docs.perl6.org/type/Proc
13:33 wamba left 13:35 TEttinger left 13:37 mohae_ joined, TEttinger joined
dvh A friend has shown me Perl 6, and I'm interested, though not interested enough yet to read the specs. The friend has directed me here. Could someone please answer some general questions? I'm particularly interested in type systems. Does Perl 6 support sum types? Can I declare an equivalent of Haskell's "data Maybe a = Nothing | Just a" and then pattern match that? So far I've been shown only pattern matching of lists, but can I match type 13:37
andreoss moritz: is there a list of encodings known to perl 6? 13:38
m: run("echo", enc => 'iso-8859-5'); 13:39
camelia rakudo-moar e1205c: OUTPUT«run is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting line 1␤ in sub run at src/RESTRICTED.setting line 14␤ in block <unit> at <tmp> line 1␤␤»
unmatched} dvh: look up Junctions for that
huggable: Junction
huggable unmatched}, Logical superposition of values: docs.perl6.org/type/Junction
unmatched} dvh: and the "specs" are historical documents. You shouldn't really read them to learn Perl 6, other than in historical context. Read the docs at docs.perl6.org instead
13:40 mohae left
ilmari m: "foo".encode(encoding => 'iso-8859-5') 13:40
camelia ( no output )
dvh ... but can I match types that aren't built-in? (for some reason I see the whole message but the archives only have part of it)
ilmari m: say "foo".encode(encoding => 'iso-8859-5')
camelia rakudo-moar e1205c: OUTPUT«utf8:0x<66 6f 6f>␤»
dvh I'll read that, thanks.
ilmari m: say "€".encode(encoding => 'iso-8859-9')
camelia rakudo-moar e1205c: OUTPUT«utf8:0x<e2 82 ac>␤»
nine dvh: there is no difference at all between types that are built-in and custom types
unmatched} dvh: this may be a bit useful: perl6.party/post/Perl-6-Types--Made-for-Humans 13:41
ilmari m: say "€".encode('iso-8859-9')
camelia rakudo-moar e1205c: OUTPUT«Unknown string encoding: 'iso-8859-9'␤ in block <unit> at <tmp> line 1␤␤»
nine dvh: also you'd get much more useful answers by asking about concrete problems you want to solve. Just asking for feature X of another language won't ever lead you to features Y and Z of Perl 6 that make the problem X solves obsolete or simply a non-issue.
unmatched} m: subset Prime of Int where .is-prime; say $_ ~~ Prime for 2, 6, 7 13:42
camelia rakudo-moar e1205c: OUTPUT«True␤False␤True␤»
andreoss ilmari: i got Unknown string encoding iso-8859-5 on Windows
dvh unmatched}: For some reason, I can't open the last link, it loads for some time and then stops without receiving a single byte.
ilmari andreoss: github.com/moarvm/moarvm/blob/mast...ps.c#L1716 13:43
13:44 MilkmanDan left, TEttinger left
andreoss ilmari: that's sad 13:44
unmatched} dvh: works fine for me. You can read the site's source on GitHub: github.com/zoffixznet/perl6.party/...-Humans.md
jnthn andreoss: Patches welcome. ;)
dvh unmatched}: I've already found the article with this name, thanks. Reading it right now. 13:45
13:46 MilkmanDan joined, TEttinger joined
RabidGravy alternative is to add the encodings you want to the github.com/sergot/perl6-encode 13:46
13:51 bjz left, bjz_ joined, ptolemarch joined 13:55 MilkmanDan left 13:56 TEttinger left 13:57 TEttinger joined 14:01 TEttinger left
dvh nine: Okay. If I have a data structure consisting of three fields -- let's say two numbers and a list -- then can I write a function which would pattern match this structure? 14:01
14:01 mr-foobar left 14:02 TEttinger joined
dvh Fox example, one can match a list this way: sub ([$x, $y, *@rest]). 14:02
ugexe create a role with the appropriate ACCEPTS? 14:03
dalek ecs: ce29255 | (Zoffix Znet)++ | v6d.pod:
Add: Signature/Attribute Defaults Based on Definedness
14:04 grondilu left
jnthn You can unpack an object using named parameters, e.g. sub ((:$x, :$y, *%rest)) 14:05
14:05 mr-foobar joined
jnthn By default, the unpack consists of the public attribute (declared has $.foo) 14:05
14:05 Sgeo_ left
jnthn Though you can actually customize how an object is unpacked/destructured by implementing a method Capture on it, that returns the argument capture it destructures into 14:05
(If the default behavior isn't good enough) 14:06
RabidGravy Ooh I didn't know that :)
14:07 TEttinger left
RabidGravy (learn something new every day,) 14:07
14:07 TEttinger joined
dvh jnthn: Thank you, that's enlightening! 14:08
14:08 grondilu joined 14:10 mavo joined 14:11 xinming left
dvh Next, let's assume I want a binary tree. I don't want to use hashes for this because each node has exactly two childs, and I wish to enforce it on the type level. Can I write a recursive class? 14:11
14:11 xinming joined
nine dvh: yes. Pretty much as you'd think it works 14:12
DrForr There's a sample binary tree in the docs for ... the 'Classes and...' section?
ugexe also rosetta code
14:13 TEttinger left 14:14 tokomer left 14:16 kid511 joined, kid51 left
dvh Now I've read the examples and I think I understand it. Thank you everyone, your explanations are appreciated! 14:19
14:19 mavo is now known as marcovorg 14:20 dvh left 14:22 brrt joined
Ulti dvh out of interest how often does the concept of "pattern matching" in data structures come up for you? I've never really worked on data structures where I didnt know what I was looking at... 14:23
14:23 TEttinger joined
Ulti even some big JSON blob usually has a schema or I take a look at it and specify exactly what to extract rather than search for it 14:23
I guess DOM manipulation is the closest I've ever come 14:24
I can see how implementing xpath or something becomes really nice with this sort of native feature in a language 14:25
unmatched} They quit IRC.
Ulti oh :(
why
did I smell
maybe they will read the logs...
sena_kun Ulti, in haskell land pattern matching is almost everywhere.
Ulti sure but I guess I'm asking why? 14:26
14:26 brrt left
Ulti it rarely comes up for me so feels a bit like there must be some deeper difference or something Haskell doesn't do well to cause it 14:26
nine Ulti: write an optimizing compiler. You'll have plenty of opportunity to pattern match :)
Ulti true enough 14:27
but again thats quite a specific example
if its everywhere in the language that means it has some deeper necessity to it
like how hashes are everywhere in Perl 14:28
14:28 cdg_ joined
sena_kun If you want to avoid a bunch of 'if's, if you want to unpack things clearly, etc. Also it's super useful with ADTs(not abstract, but algebraic) everywhere. 14:28
Ulti I think auto viv is one of the deeper reasons for that
sena_kun But I'm not a pro in haskell. 14:29
14:30 TEttinger left
Ulti I was wondering if its to do with less mutable state? so you can always expect data structures to be well structured... no one is going to just inject in something horrible in the wrong place due to the type and immutability 14:30
sena_kun It mostly defines behavior, not structure. 14:31
Ulti guess I need to see some examples
14:31 TEttinger joined
sena_kun Like, em, "If this func accepts one thing -> do something1, if some another thing -> do something2). 14:31
14:31 cdg left
sena_kun Ulti, see factorial function written with pattern matching. (: 14:32
Ulti oh thats what you call pattern matching
sena_kun Ulti, www.willamette.edu/~fruehr/haskell/...ution.html - see third and fourth examples.
Ulti, is there any pattern matching other than this? I yes, I want to know more about it. 14:33
14:34 vytas left 14:36 TEttinger left 14:37 TEttinger joined 14:38 vytas joined 14:39 cyphase left
Ulti you aren't matching a pattern in any of those examples though... its multi dispatch, list expansion and reducing a list 14:40
sena_kun Ulti, as for me(not a pro), pattern matching is useful to define behavior depending on data and is useful to unpack things. In haskell you can't really do `array[0].first_element.content`(without lenses, but it's not default haskell, I suppose), so you can de-construct your data only in the left side of a function. It works in almost any totally functional language, though.
Ulti vvv.tobiassjosten.net/haskell/facto...n-haskell/ <--- the pattern matching thing there is literally just multi dispatch and recursion in Perl and plenty of other languages 14:41
14:41 lichtkind__ joined
Ulti I think Haskell might just have a load of maths people naming things :P 14:41
multi dispatch is essentially pattern matching though 14:42
moritz it's not a bad name
Ulti especially the more advanced kind found in P6
sena_kun Util, multi-dispatch works only with a type. If you do somehting like `data Bool = True | False`, then you cannot multi-dispatch it, because every walue is Bool, You need to decompose it to see is it True literal or False literal.
14:43 lichtkind_ left
sena_kun Correct me if I'm wrong here. 14:43
*value
unmatched} m: multi foo(False){say "tis a false" }; multi foo(True) { say "tis a true" }; foo 1; foo 0
camelia rakudo-moar 9e497c: OUTPUT«Cannot resolve caller foo(1); none of these signatures match:␤ (Bool $ where { ... })␤ (Bool $ where { ... })␤ in block <unit> at <tmp> line 1␤␤»
unmatched} m: multi foo(False){say "tis a false" }; multi foo(True) { say "tis a true" }; foo True; foo False
camelia rakudo-moar 9e497c: OUTPUT«tis a true␤tis a true␤»
14:44 lambd0x left
unmatched} :S 14:44
sena_kun Wow. Cool.
jnthn True as a smart-match always matches....
But yeah, you can match values
unmatched} m: multi foo(Bool where { not so $_ }){say "tis a false" }; multi foo(Bool where { so $_ }) { say "tis a true" }; foo True; foo False
camelia rakudo-moar 9e497c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot do non-typename cases of type_constraint yet␤at <tmp>:1␤------> 3multi foo(Bool where { not so $_ }7⏏5){say "tis a false" }; multi foo(Bool wh␤»
unmatched} bah
14:45 cyphase joined
unmatched} m: multi foo($ where { not so $_ }){say "tis a false" }; multi foo($ where { so $_ }) { say "tis a true" }; foo True; foo False 14:45
camelia rakudo-moar 9e497c: OUTPUT«tis a true␤tis a false␤»
unmatched} Third time a charm
sena_kun jnthn, if you can match values and deconstruct data structures, then Perl 6 has pattern mathing, obviously(which is good).
unmatched} m: multi foo(Int $ where .is-prime){say "tis a prime" }; multi foo(Int $) { say "tis not a prime" }; foo 31337; foo 666 14:46
camelia rakudo-moar 9e497c: OUTPUT«tis a prime␤tis not a prime␤»
sena_kun How can I take first two elements of a list in a signature, btw?
Or just first. 14:47
jnthn m: sub foo([$a, $b, *@]) { say $a; say $b } foo([1..10])
camelia rakudo-moar 9e497c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3sub foo([$a, $b, *@]) { say $a; say $b }7⏏5 foo([1..10])␤ expecting any of:␤ infix␤ infix stopper…»
jnthn m: sub foo([$a, $b, *@]) { say $a; say $b }; foo([1..10])
camelia rakudo-moar 9e497c: OUTPUT«1␤2␤»
sena_kun jnthn, neat. Thanks for your example.
unmatched} m: multi foo([$type, Int $ where .is-prime]){ say "tis a $type prime" }; multi foo([$type, Int $]) { say "tis $type not a prime" }; foo ["foo", 31337]; foo ["meow", 666] 14:48
camelia rakudo-moar 9e497c: OUTPUT«tis a foo prime␤tis meow not a prime␤»
unmatched} \o/
14:48 Hathersage left
ugexe Does that differ `sub foo(@ ($a, $b, *@)) {}`? 14:48
jnthn No 14:49
ugexe or is that so you can still name the overall capture
14:49 TEttinger left
jnthn The [...] just puts a Positional constraint on the parameter 14:49
Otherwise it works just like (...)
14:49 brrt joined
ugexe ah, didnt know sub foo(@all [$a, $b, *@]) worked the same 14:51
unmatched} m: sub factorial {[*] 1..$^a}; say factorial $_ for ^10;
camelia rakudo-moar 9e497c: OUTPUT«1␤1␤2␤6␤24␤120␤720␤5040␤40320␤362880␤»
14:54 TEttinger joined 14:58 pierre_ left 15:02 TEttinger left, araujo joined
b2gills say +permutations $_ for ^10 15:04
15:04 bdmatatu joined
b2gills m: say +permutations $_ for ^10 15:04
camelia rakudo-moar 9e497c: OUTPUT«1␤1␤2␤6␤24␤120␤720␤5040␤40320␤362880␤»
15:04 setty1 joined
hoelzro o/ #perl6 15:05
[Coke] hio
15:05 TEttinger joined
hoelzro o/ [Coke] 15:06
15:07 mcmillhj left
hoelzro I am thinking of assembling some material on helping devs with Git, and since Rakudo uses Git, I thought you all might have helpful feedback. Please fill out this form if you're willing and have time: goo.gl/forms/Fi6YQcv6c9BJ86A43 15:07
b2gills hoelzro: I forget who did it, but you may want to ask the person who transferred Perl5 from Perforce to Git to look at it 15:09
15:13 marcovorg is now known as mavorg 15:15 TEttinger left
hoelzro b2gills: I didn't know Perl5 was ever on perforce...I'll do that if I can figure out who it was! 15:17
15:18 TEttinger joined 15:20 cdg_ left, awwaiid left 15:21 awwaiid joined 15:22 cdg joined, cdg left, TEttinger left 15:23 cdg joined 15:25 khw joined, TEttinger joined
unmatched} b2gills++ 15:25
15:25 mcmillhj joined 15:29 acrussell joined 15:31 wamba joined, cdg_ joined 15:34 cdg left 15:35 awwaiid left, awwaiid joined 15:36 cdg_ left 15:41 brrt left 15:49 bdmatatu left
RabidGravy and I think it was in CVS before that 15:51
15:52 kid511 left 15:55 mcmillhj left 15:58 mohae joined 16:01 mohae_ left, edwinsage joined 16:02 TEttinger left
Skarsnik hm, why panda is not installed aside the perl6 bin btw? instead of prefix/perl6/site/... 16:02
16:04 bob777 left, TEttinger joined, bob777 joined 16:15 TEttinger left 16:16 zacts joined, awwaiid left
unmatched} m: say [\*] 1..10 16:16
camelia rakudo-moar 9e497c: OUTPUT«(1 2 6 24 120 720 5040 40320 362880 3628800)␤»
16:17 awwaiid joined 16:18 TEttinger joined, TEttinger left
gregf_ m: say [*] 1..10 16:21
camelia rakudo-moar 9e497c: OUTPUT«3628800␤»
16:22 cdg joined, cdg left 16:23 mrf joined, cdg joined 16:25 TEttinger joined 16:28 spebern joined 16:30 MilkmanDan joined 16:31 rudolfoc` joined 16:35 TEttinger left 16:39 TEttinger joined 16:42 MilkmanDan left 16:43 dakkar left
edwinsage Is there a p6 construct like the p5 diamond <> ? 16:47
hoelzro edwinsage: you probably want some form of lines() 16:48
gfldex m: for lines { .say }
camelia rakudo-moar 9e497c: OUTPUT«5===SORRY!5===␤Function 'lines' needs parens to avoid gobbling block␤at <tmp>:1␤------> 3for lines { .say }7⏏5<EOL>␤Missing block (apparently claimed by 'lines')␤at <tmp>:1␤------> 3for lines { .say }7⏏5<EOL>␤␤»
gfldex m: for lines() { .say }
camelia rakudo-moar 9e497c: OUTPUT«Céad slán ag sléibhte maorga Chontae Dhún na nGall␤Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bhí gleanntáin ghlas’ G…»
edwinsage But does that automatically open files listed on the command line, or fallback to STDIN? 16:51
16:51 rudolfoc` left, mcmillhj joined
unmatched} edwinsage: no 16:52
edwinsage That's what I'm looking for.
hoelzro then you want $*ARGFILES
16:52 Actualeyes left
edwinsage Opening files or reading STDIN, with error output if the arguments aren't files. 16:52
hoelzro actually, doesn't lines() default to $*ARGFILES? 16:53
unmatched} Oh, yeah, my bad: "Without any arguments, sub lines operates on $*ARGFILES, which defaults to $*IN in the absence of any filenames."?"
16:54 spebern left 16:55 zacts left 16:56 TEttinger left, mcmillhj left 16:57 cdg_ joined 16:58 cdg_ left
edwinsage Ok, I'm seeing how that works. 16:58
16:58 TEttinger joined, cdg_ joined, pierre_ joined
unmatched} perl6 -e '.uc.say for lines' file1 file2 file3 will print uppercased lines, for example, and if you omit the filenames, it'll read from STDIN 16:58
16:59 mcmillhj joined 17:00 cdg left
edwinsage I was working on a wordcount one-liner as part of my figuring out perl6. 17:01
17:01 MorayJ left
edwinsage p6: lines().split( /\s+/, :skip-empty).elems.say; 17:01
camelia rakudo-moar 9e497c: OUTPUT«219␤»
gregf_ m: .say for lines()[1..10] 17:02
camelia rakudo-moar 9e497c: OUTPUT«Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bhí gleanntáin ghlas’ Ghaoth Dobhair, is beag nár bhris mo chroí.␤␤Ag tais…»
unmatched} m: lines.join.words.BagHash.say
camelia rakudo-moar 9e497c: OUTPUT«BagHash.new(do(2), dom(2), a(8), pilleadh, gan(3), shéimh, fóill,, miste, bhí(2), Lúich’, le(5), ina(2), seal, dhílis, cluain, feall,, dhiaidh, dhá, Meiriceá, thiomáin, os, na(3), Chontae, thriall, nuair, shaoil, chroí.Ag, mórAtá, gnéillB'é,…»
edwinsage The error output for a missing file is a lot more verbose, though.
unmatched} edwinsage: ^ something like that
17:03 cdg_ left
gfldex m: my \term:«<>» := {lines()}(); for <> { .say } 17:03
camelia rakudo-moar 9e497c: OUTPUT«Céad slán ag sléibhte maorga Chontae Dhún na nGall␤Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bhí gleanntáin ghlas’ G…»
gfldex m: my \term:«<>» := {lines()}(); while <> { .say }
camelia rakudo-moar 9e497c: OUTPUT«(timeout)(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)␤(Any)…» 17:04
gfldex m: my \term:«<>» := {lines()}(); given <> { .say }
camelia rakudo-moar 9e497c: OUTPUT«(Céad slán ag sléibhte maorga Chontae Dhún na nGall Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll; Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí I mo dhiaidh bhí gleanntáin ghlas’ Ghaoth…»
TimToady m: for <> { .say } 17:06
camelia rakudo-moar 9e497c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of <>; in Perl 6 please use lines() to read input, ('') to represent a null string or () to represent an empty list␤at <tmp>:1␤------> 3for <7⏏5> { .say }␤»
unmatched} m: lines.join.words.Bag.sort(:by(*.value)).fmt("%10s => %3d\n").say
camelia rakudo-moar 9e497c: OUTPUT« 's => 1␤ Chontae => 1␤ Céad => 1␤ Dhún => 3␤ Dobhair, => 1␤ Dobhair. => 1␤ Dobhair.Níorbh => 1␤ Dobhair.Slán! => 1␤ Domhain => 1␤ Dún => 1␤ Eireagal => 1␤ Gall, =>…»
unmatched} kinda expected that to get sorted by value :/
Oh, it's *.value not :by(*.value) 17:07
17:07 mcmillhj left
unmatched} m: lines.join.words.Bag.sort(*.value).reverse.fmt("%10s => %3d\n").say 17:07
camelia rakudo-moar 9e497c: OUTPUT« mo => 9␤ a => 8␤ is => 5␤ le => 5␤ Ghaoth => 4␤ an => 4␤ ag => 4␤ gach => 3␤ go => 3␤ i => 3␤ Dhún => 3␤ slán => 3␤ …»
TimToady why lines.join instead of slurp?
17:07 TEttinger left
TimToady and you can sort on -*.value instead of reverse 17:08
unmatched} 'cause I don't read documentation :)
I know it looks like I know how to program sometimes, but it's all an illusion :) I merely parrot things I see
17:08 jonas1 left
unmatched} m: slurp.words.Bag.sort(-*.value).fmt("%10s => %3d\n").say 17:09
camelia rakudo-moar 9e497c: OUTPUT« mo => 9␤ a => 8␤ le => 5␤ is => 5␤ ag => 4␤ an => 4␤ Ghaoth => 4␤ gan => 3␤ na => 3␤ ghlas’ => 3␤ slán => 3␤ Dhún => 3␤ …»
unmatched} TimToady++
17:09 mcmillhj joined, TEttinger joined 17:10 TEttinger left 17:11 TEttinger joined
[Coke] PARROT! GET IT! 17:12
unmatched} Where? WHERE? 17:13
Fetch the net!
17:17 kaare_ joined 17:18 lloyd__ joined 17:19 lloyd__ left
gregf_ nah, theres no more birds left.. its a camelia now ;) 17:21
17:21 hankache joined
hankache hello #perl6 17:22
unmatched} \o
hankache ohai zoffix
unmatched} m: BEGIN say "there is no syntax error there" and exit; mash the keyboard real good!!! :D 17:23
camelia rakudo-moar 9e497c: OUTPUT«there is no syntax error there␤»
gfldex m: $*IN = <peter paul marry> but role { method slurp-rest { self.Str } }; for lines() { .say } 17:24
camelia rakudo-moar 9e497c: OUTPUT«Method 'opened' not found for invocant of class 'List+{<anon|73205008>}'␤ in block <unit> at <tmp> line 1␤␤»
gfldex m: $*IN = <peter paul marry> but role { method slurp-rest { self.Str } }; for slurp() { .say }
camelia rakudo-moar 9e497c: OUTPUT«peter paul marry␤»
17:25 edwinsage left
unmatched} m: say 2 + 2; CHECK my &infix:<+> = { $^a - $^b }; say 2 + 2 17:27
camelia rakudo-moar 9e497c: OUTPUT«0␤0␤»
unmatched} How come this produces zeros? I expected it to run "at run time as late as possible" 17:28
17:28 firstdayonthejob joined
unmatched} Oh. I need coffee.. it's at *compile* time as late as possible >_<> 17:29
timotimo oh, Skarsnik is back! :) 17:30
unmatched} m: role Foo { COMPOSE { say "meow" } }; class Bar does Foo {} ;
camelia ( no output )
Skarsnik Hello timotimo 17:31
timotimo a few days ago i noticed a twitch user by the name of "skarsnikus" or something; i wondered if that was you 17:32
Skarsnik Yay, I have a 15 sec gain on the same code running with a more recent rakudo on a less powerfull cpu over a may rakudo x) 17:33
Yes, it's me
timotimo neat
Skarsnik Where did you see me? x)
timotimo i forgot 17:34
Skarsnik a speedrunner stream? x) 17:35
Not sure how it's relevant gist.github.com/anonymous/4ecd00e8...b8d7f3980d 17:37
timotimo speedrunner stream seems likely; perhaps metasigma? 17:38
Skarsnik Oh maybe
I am not often on his stream now. He had a bad attitude toward the WR holder of SoE for while 17:39
17:42 kurahaupo joined 17:47 sno left, rudolfoc` joined 17:49 rangolaf joined
rangolaf rakudo: 'say "hi"'; 17:49
camelia rakudo-moar 9e497c: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant string "say \"hi\"" in sink context (line 1)␤»
unmatched} m: say "hi"
camelia rakudo-moar 9e497c: OUTPUT«hi␤»
rangolaf m: say "hi"; 17:50
camelia rakudo-moar 9e497c: OUTPUT«hi␤»
rangolaf m: print "hi";
camelia rakudo-moar 9e497c: OUTPUT«hi»
17:50 cdg joined
unmatched} You can also /msg camelia m: say "Hi"; 17:50
17:51 cdg left
rangolaf oh thanks 17:51
my bad for using pub chan
17:51 cdg joined
unmatched} Not a problem :) 17:52
17:52 rudolfoc` left 17:55 domidumont joined 17:58 mavorg left
unmatched} m: say "foo" ~~ /<!ww>+/ 17:59
wwweeeeeeeeeeeeeeeee :)
camelia rakudo-moar 9e497c: OUTPUT«Memory allocation failed; could not allocate 978223104 bytes␤» 18:00
unmatched} What's <!ww> ?
18:00 andreoss left, spider-mario joined
unmatched} Ah "# only match when not within a word" 18:00
timotimo "is this between two different characters?" basically 18:01
oh
unmatched} Well, that's the comment in the example on docs.perl6.org/language/regexes
timotimo so what's the one that'll match if the cursor is between two identical characters?
unmatched} "negated "within word" assertion"
timotimo m: say "foo" ~~ /<ww>./ 18:02
camelia rakudo-moar 9e497c: OUTPUT«「o」␤ ww => 「」␤»
timotimo m: say "asdf" ~~ /<ww>./
camelia rakudo-moar 9e497c: OUTPUT«「s」␤ ww => 「」␤»
timotimo hm, ok
unmatched} m: say "foo" ~~ /<!ww>./
camelia rakudo-moar 9e497c: OUTPUT«「f」␤»
unmatched} neat
18:02 domidumont left 18:05 brrt joined, MilkmanDan joined 18:09 perlpilot joined
dalek c: 80c9b69 | (Zoffix Znet)++ | doc/Language/glossary.pod6:
Improve QAST

Fix broken link. Explain what Q stands for.
18:21
18:22 hankache left 18:24 cpage_ left 18:27 sno joined, telex left 18:28 telex joined 18:30 labster joined 18:36 cdg left 18:40 FROGGS joined, mr-foobar left 18:41 TEttinger left 18:42 brrt left, TEttinger joined 18:43 mr-foobar joined 18:47 cpage_ joined
harmil_wk I don't know why, but I'm having a really hard time not typing "while $*IN.lines -> $line {...}" instead of "for..." 18:48
I think it was about 10 minutes that I was trying to figure out why $line was an Seq and not a string. 18:49
18:50 TEttinger left 18:51 parabolize left, kst` is now known as kst 18:53 rangolaf left 18:55 FROGGS left 18:57 brrt joined
TimToady harmil_wk: not sure how we could help much with that failure mode 18:59
harmil_wk Me either. It's just frustrating. Perhaps you could check $*USER.is-stupid? 19:00
19:00 TEttinger joined
moritz the compiler could randomly present you an intelligence test, and give you a friendly advise to postpone coding when you're too far below your personal average 19:01
harmil_wk perl6 --go-home-youre-drunk 19:02
moritz
.oO( You're well past the Ballmer peak )
19:03
19:05 parabolize joined 19:07 darutoko left
TimToady harmil_wk: that doesn't help if you're already home and drunk 19:08
19:08 felher_ is now known as felher, mcmillhj left 19:11 mcmillhj joined, zakharyas left
harmil_wk TimToady: I'd call that a race condition, but you'd be in no condition to race 19:13
perlpilot
.oO( race to the bottom? )
19:15
19:16 mcmillhj left 19:17 TEttinger left 19:22 brrt left 19:23 notostraca joined 19:24 kaare_ left 19:26 kaare_ joined, grondilu left, mcmillhj joined 19:27 kaare_ left 19:28 kaare_ joined, notostraca left, TEttinger joined 19:31 mcmillhj left 19:33 MilkmanDan left 19:34 MilkmanDan joined
dalek c: aa997c4 | (Bill Barry)++ | doc/Language/traps.pod6:
Update traps.pod6

syntax error, missing ')'
19:36
c: d8c638c | Altai-man++ | doc/Language/traps.pod6:
Merge pull request #830 from bbarry/patch-1

Update traps.pod6
19:39 mcmillhj joined 19:40 cpage_ left 19:44 mcmillhj left 19:49 ovibos left 19:53 mcmillhj joined 19:57 cdg joined, cpage_ joined 19:58 mcmillhj left 20:05 zakharyas joined 20:07 mcmillhj joined 20:14 wamba left 20:19 dj_goku left
dalek c: 0df7524 | Altai-man++ | doc/Type/IO/ (9 files):
Make examples compile. Use table instead of code block for IO::Path. Fix and update signatures, add some examples.
20:20
20:20 dj_goku joined 20:23 mcmillhj left, mcmillhj joined 20:24 perlpilot left
mr-foobar what is the perl6 equivalent of do "file.pl" ? 20:24
hoelzro mr-foobar: EVALFILE, iirc 20:25
gfldex m: say "1-a 2-b 3-c".subst(:g, /\d/, {<one two three>[$++]}); 20:26
camelia rakudo-moar 328402: OUTPUT«one-a two-b three-c␤»
AlexDaniel mr-foobar: by the way, we have special doc files for that: docs.perl6.org/language/5to6-perlfunc#do 20:29
mr-foobar sweet thx ! 20:30
20:34 prammer joined
dalek c: dc95d9c | (Wenzel P. P. Peppmeyer)++ | doc/Language/variables.pod6:
better example for anon state scalar
20:34
gfldex i really like how closure blocks and the anon state variable make another loop redundant in that example by sneaking the block into the loop inside of subst 20:36
20:36 brrt joined, zacts joined
mr-foobar is there an equivalent of Time::HiRes for perl6 ? I want to sleep for 0.428571 seconds 20:47
timotimo then just sleep 0.428571
brrt .tell masak i'd like to discuss macros some time in the future
yoleaux brrt: I'll pass your message to masak.
mr-foobar timotimo: there is a noticable lag when I am using it in a forever loop. 20:48
timotimo perl6 isn't the fastest 20:49
geekosaur suspects that adding an external module would not be faster than a builtin 20:50
TimToady mr-foobar: if the intent is to do something at a recurring interval, you'd probably do better with a timing Supply of some sort 20:59
which should avoid drift 21:00
mr-foobar here is the gist -- gist.github.com/harsha-mudi/f8506e...88356546af 21:02
ugexe m: for (0..*) { last if $_ > 10000; sleep(0.0001); }; say time - INIT { time }
camelia rakudo-moar 328402: OUTPUT«2␤» 21:03
AlexDaniel committable: HEAD Supply.interval(0.1).tap({say now}); sleep 20
committable AlexDaniel: gist.github.com/21613554f54784f450...26cd47a5fe
mr-foobar I am trying to write code which triggers midi events.
AlexDaniel it does drift.
ugexe why are you using Thread.new?
21:04 skids left
ugexe if you dont know why, you probably want to use start { } instead 21:04
mr-foobar basically I want it to run like as a separate thread so that it doesn't interfere with previous execution.
ugexe have you seen docs.perl6.org/language/concurrency ? 21:05
AlexDaniel m: Supply.interval(0.05).tap({say (now - BEGIN now) % 0.05}); sleep ∞ 21:06
oops
committable: HEAD Supply.interval(0.05).tap({say (now - BEGIN now) % 0.05}); sleep ∞
committable AlexDaniel: gist.github.com/b5375dfa4f5c4465cd...7e362f7688
camelia rakudo-moar 328402: OUTPUT«(timeout)0.01948394␤0.01860007␤0.01871150␤0.018810360␤0.01893974␤0.01908832␤0.01919740␤0.019327999␤0.01943767␤0.019563883␤0.01970479␤0.019851825␤0.019975939␤0.020085140␤0.020210911␤0.020317997␤0.020463765␤0.020563204␤0.0…»
21:06 mcmillhj left
AlexDaniel sooo… why? 21:07
21:07 mavorg joined
ugexe your lag is almost certainly from EVALFILE 21:07
gfldex m: sub f(@a){@a is default(1); say @a[1]}; f; 21:09
camelia rakudo-moar 328402: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3sub f(@a){@a7⏏5 is default(1); say @a[1]}; f;␤ expecting any of:␤ infix␤ infix stopper␤ statement end␤ statement modi…»
gfldex is there a way to set the default of a container without a declarator?
AlexDaniel m: sub f(@a = [42,69]){ say @a[1]}; f # ? 21:10
camelia rakudo-moar 328402: OUTPUT«69␤»
AlexDaniel aahh 21:11
no
gfldex m: my @a; @a.VAR.default := 1; 21:12
camelia rakudo-moar 328402: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot use bind operator with this left-hand side␤at <tmp>:1␤------> 3my @a; @a.VAR.default := 17⏏5;␤»
AlexDaniel gfldex: interestingly, it looks like I was trying to get it to work too: irclog.perlgeek.de/perl6/2016-05-26#i_12552791 21:16
not sure why though
gfldex m: my @a; use nqp; my $descriptor := nqp::getattr(@a.VAR, @a.VAR.WHAT.^mixin_base, '$!descriptor').set_default(nqp::decont(1)); say @a[0]; 21:18
camelia rakudo-moar 328402: OUTPUT«1␤»
gfldex AlexDaniel: ^^^
AlexDaniel oh well…
gfldex m: my @a; trait_mod<is>(@a.VAR, 1, :default); 21:19
camelia rakudo-moar 328402: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤ trait_mod used at line 1␤␤»
mr-foobar here is an audio sample of the output clyp.it/bmyfclu0
I tried removing the thread .. still the same.
gfldex m: my @a; trait_mod:<is>(@a.VAR, 1, :default); 21:21
camelia rakudo-moar 328402: OUTPUT«Cannot resolve caller trait_mod:<is>(Array, Int, :default); none of these signatures match:␤ (Mu:U $child, Mu:U $parent)␤ (Mu:U $child, :$DEPRECATED!)␤ (Mu:U $type, :$rw!)␤ (Mu:U $type, :$nativesize!)␤ (Mu:U $type, :$ctype!)␤ …»
gfldex the trait is defined for Variable:D
El_Che is Perl 5 POD a subset op Perl 6 Pod? 21:23
AlexDaniel m: my $x = 42; my @a is default($x); say @a[1]
camelia rakudo-moar 328402: OUTPUT«(Any)␤»
AlexDaniel ↑ well, um… uh?
gfldex it's a compile time trait so it's called with the variable behind @a 21:24
AlexDaniel it is doc-ed correctly, but I still wonder why does it have to be so silent in this case
21:26 khw left, harovali joined
gfldex m: my @a; say @a.default; 21:27
camelia rakudo-moar 328402: OUTPUT«(Any)␤»
gfldex m: my @a; say @a.default = 1;
camelia rakudo-moar 328402: OUTPUT«Cannot modify an immutable Any␤ in block <unit> at <tmp> line 1␤␤»
gfldex m: my @a; say @a.default: = 1;
camelia rakudo-moar 328402: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix = instead␤at <tmp>:1␤------> 3my @a; say @a.default: =7⏏5 1;␤»
gfldex m: my @a; @a.default: = 1;
camelia rakudo-moar 328402: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix = instead␤at <tmp>:1␤------> 3my @a; @a.default: =7⏏5 1;␤»
gfldex m: my @a; @a.default(1);
camelia rakudo-moar 328402: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤ in block <unit> at <tmp> line 1␤␤»
AlexDaniel m: BEGIN { say ‘begin’ }; CHECK { say ‘check’ }; my @a is default(say ‘hello’); say @a[1] 21:28
camelia rakudo-moar 328402: OUTPUT«begin␤hello␤check␤True␤»
AlexDaniel so if you need a phaser that is should run between BEGIN and CHECK …
-is
21:29 zakharyas left 21:30 CIAvash left
gfldex m: my @a is default({1+1}); print @a[0].() 21:31
camelia rakudo-moar 328402: OUTPUT«2»
gfldex it would be nice to have the closure called automatically
AlexDaniel gfldex: why make it a closure if you want it to be called? 21:32
ah, so that it's not compile-time ?
gfldex yes 21:37
and call the block with self/value of the container for Array/Scalar 21:38
that would allow: 21:39
m: my @a is default({Failure.new("booboo")}); put @a[0];
camelia rakudo-moar 328402: OUTPUT«Block object coerced to string (please use .gist or .perl to do that) in block <unit> at <tmp> line 1␤␤»
gfldex m: my @a is default({Failure.new("booboo")}); put @a[0].(); 21:40
camelia rakudo-moar 328402: OUTPUT«booboo␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
21:40 prammer left 21:41 prammer joined, prammer left 21:43 avuserow_ joined
avuserow_ hi all. are there any cool options for parsing binary files in perl6? I noticed unpack was marked experimental and haven't seen anything about grammars or anything higher level 21:45
dalek rl6-bench: 9769703 | (Steve Mynott)++ | microbenchmarks.pl:
post Sep 30 2015 append replaces shift
21:46
rl6-bench: 57e34bb | (Steve Mynott)++ | microbenchmarks.pl:
lizmat++ fix broken fix
rl6-bench: fbee8cb | lizmat++ | microbenchmarks.pl:
Merge pull request #26 from stmuk/master

post Sep 30 2015 append replaces shift
21:48 Skarsnik left 21:49 mcmillhj joined 21:51 cpage_ left 21:52 rindolf left 21:53 cpage_ joined 21:54 mcmillhj left 21:55 labster left
brrt avuserow_: it's been talked about, but it isn't really there 21:55
for my part i want erlang style binary pattern matching 21:56
21:59 cpage_ left
avuserow_ I don't remember that part of erlang but sounds interesting 22:00
thanks brrt
22:00 Sgeo_ joined
brrt yw, not sure what for :-) 22:01
avuserow_ responding quickly, thoughts, etc :)
brrt that's what we're here for 22:02
if not asleep
speaking of which
22:04 chris2 joined 22:06 cpage_ joined, mcmillhj joined 22:09 zacts left 22:12 acrussell left 22:19 harmil_wk left 22:28 ptolemarch left 22:29 RabidGravy left 22:31 firstdayonthejob left 22:41 kurahaupo left 22:46 cpage_ left 22:50 rpburkholder joined 22:57 jack_rabbit joined, cpage_ joined 23:00 khw joined
gfldex lolibloggedalittle gfldex.wordpress.com/2016/08/10/sn...to-a-loop/ 23:04
23:07 setty1 left 23:09 labster joined 23:10 khw left 23:15 eyck left 23:16 eyck joined
brrt gfldex: we don't have string-to-io-handles? :-o 23:18
gfldex brrt: at least I couldn't find any
23:20 khw joined
brrt weird 23:20
23:20 BinGOs joined
gfldex could very well be the restricted setting that camelia is running with. Makes bugs and omissions hard to spot for IRC centric dev folk. :) 23:23
23:26 canopus left 23:27 spider-mario left
brrt hmm, i don't know either 23:28
23:28 pierre_ left, pierre_ joined 23:31 canopus joined
gfldex m: my UInt $a = 42; put (+^$a).base(2) 23:41
camelia rakudo-moar 328402: OUTPUT«-101011␤»
23:42 avuserow_ left
gfldex i dont't think .base should return a negative number for UInt 23:44
m: my UInt $a = 42; put (+^$a).fmt('%b') 23:45
camelia rakudo-moar 328402: OUTPUT«-101011␤»
23:46 brrt left 23:47 labster left, titsuki_ joined 23:49 titsuki left 23:51 mavorg left 23:53 labster joined 23:57 pdcawley left