»ö« 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.
00:03 mcmillhj left 00:06 BenGoldberg joined 00:10 skids joined 00:15 ARM9 left 00:19 _sri left 00:21 adu joined 00:23 ARM9 joined 00:24 hwcomcn joined 00:26 gblade joined 00:27 ARM9 left 00:29 ARM9 joined
gblade m: (1,'A').grep(1) 00:31
camelia rakudo-moar aa5e49: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5A' (indicated by ⏏)␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
gblade 'A'.ACCEPTS(1)
m: 'A'.ACCEPTS(1)
camelia ( no output )
gblade m: 1.ACCEPTS('A') 00:32
camelia rakudo-moar aa5e49: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5A' (indicated by ⏏)␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
gblade m: 'A' ~~ 1 00:33
camelia rakudo-moar aa5e49: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5A' (indicated by ⏏)␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
gblade I'm guessing that this is a bug?
gfldex no
the error message is LTA tho
gblade So how do you grep within dissimilar things? 00:34
gfldex you use the right matcher. If you are looking for a mix of numbers and chars use a regexp 00:35
or you use MMD or given/when
00:36 mcmillhj joined 00:37 adu left
BenGoldberg m: "Just another Perl hacker,".subst( /\w/, { ~$/ ~^ '𝒑' }, :g ).say; 00:37
camelia rakudo-moar aa5e49: OUTPUT«𝓛𝓤𝓢𝓥 𝓰𝓿𝓾𝓥𝓹𝓴𝓣 𝓁𝓴𝓣𝓽 𝓹𝓰𝓲𝓺𝓴𝓣,␤»
BenGoldberg m: "Just another Perl hacker,".subst( /\w/, { ~$/ ~^ '𝒑' }, :g ).say; 00:38
camelia rakudo-moar aa5e49: OUTPUT«𝓛𝓤𝓢𝓥 𝓰𝓿𝓾𝓥𝓹𝓴𝓣 𝓁𝓴𝓣𝓽 𝓹𝓰𝓲𝓺𝓴𝓣,␤»
gblade Is there a built-in matcher which is True iff the types match and the value is equivalent?
BenGoldberg can't type today.... 00:39
gblade m: 1 eqv 'A'
camelia rakudo-moar aa5e49: OUTPUT«WARNINGS for <tmp>:␤Useless use of "eqv" in expression "1 eqv 'A'" in sink context (line 1)␤»
gblade m: say 1 eqv 'A'
camelia rakudo-moar aa5e49: OUTPUT«False␤»
gblade m: say 'A' eqv 1
camelia rakudo-moar aa5e49: OUTPUT«False␤»
gfldex m: dd (1,'A').grep(* eqv 1) 00:40
camelia rakudo-moar aa5e49: OUTPUT«(1,).Seq␤»
gblade thanks
BenGoldberg m: "Just another Perl hacker,".trans( [ flat "A".."Z", "a".."z"] => [ flat "𝓐".."𝓩", "𝓪".."𝔃" ] ).say; # maybe this? 00:42
camelia rakudo-moar aa5e49: OUTPUT«𝓙𝓾𝓼𝓽 𝓪𝓷𝓸𝓽𝓱𝓮𝓻 𝓟𝓮𝓻𝓵 𝓱𝓪𝓬𝓴𝓮𝓻,␤»
BenGoldberg :)
gfldex steals this nice example 00:43
timotimo what are those? i only get questionmark diamonds for that
BenGoldberg Now all I have to do is figure out which font google chrome is using to display it, and tell my irc client to use it as a fallback
timotimo, Try looking at the irc log for the channel... there's a moderate chance your browser can display it even if your irc client can't 00:44
timotimo ah, of course
gfldex timotimo: imgur.com/a/ePZuG 00:45
timotimo works in the browser, indeed
gfldex timotimo: that's the font i use www.fontspace.com/gnu-freefont/freemono 00:46
00:48 wamba left
gfldex .oO( The recommended font for this irc channel is: ... ) 00:50
00:50 mcmillhj left
ShimmerFairy m: say "𝓙".uniname 00:50
camelia rakudo-moar aa5e49: OUTPUT«MATHEMATICAL BOLD SCRIPT CAPITAL J␤»
00:52 japhb joined, holyghost joined
AlexDaniel debian users might want to try this: apt install fonts-freefont-ttf ttf-unifont 00:53
00:55 hwcomcn left
gblade I'm still stuck on 'A' ~~ 1. Seems like it should at least emit a Failure rather than dying. 00:55
00:57 stmuk_ joined
gfldex m: try { 'A' ~~ 1; CATCH { when X::Str::Numeric { say .^name } } }; say 'alive'; 00:58
camelia rakudo-moar aa5e49: OUTPUT«X::Str::Numeric␤alive␤»
gfldex gblade: ^^^
gblade How would you use the try/CATCH within a given/when trying to match 1 or 'A'? 01:01
timotimo just give the given a CATCH block 01:02
you don't need to have a try to be able to use CATCH
ShimmerFairy m: given 'A' { when 1 { say "yay" }; CATCH { default { say "aw" } } } # like so, the default {...} block lets us "take" the error successfully 01:04
camelia rakudo-moar aa5e49: OUTPUT«aw␤»
gblade ah so the default goes within the CATCH
01:05 mcmillhj joined 01:06 sufrostico left 01:07 sufrostico joined
ShimmerFairy gblade: no, sorry for confusing it there. That's different from the "given" use of default. 01:09
01:10 mcmillhj left
geekosaur CATCH kinda acts like its own given/when, operating on the exception that triggered it 01:10
ShimmerFairy gblade: CATCH is a phaser, like BEGIN or INIT, which runs at exception time. While in CATCH, the exception being handled is in $_, which lets you use when/default to determine what kind of error it is. 01:11
gfldex there is also CONTROL that runs at control exception time 01:12
01:13 cdg_ joined
BenGoldberg IIRC, things such as 'return' and 'next' and 'redo' are implemented by throwing control exceptions. 01:13
gfldex return, fail, redo, next, last, take, warn, proceed and succeed.
m: CX::.keys.say 01:15
camelia rakudo-moar aa5e49: OUTPUT«(Return Last Warn Succeed Proceed Redo Next Take)␤»
gfldex m: X::.keys.say
camelia rakudo-moar aa5e49: OUTPUT«(Method NoSuchSymbol NotEnoughDimensions OS InvalidType Pairup NYI PseudoPackage EXPORTHOW IO Set Package Declaration Inheritance Redeclaration StubCode UnitScope PoisonedAlias Placeholder IllegalOnFixedDimensionArray Temporal Proc InvalidTypeSmiley Numeri…»
gfldex m: X::.keys.elems
camelia ( no output )
gfldex m: X::.keys.elems.say
camelia rakudo-moar aa5e49: OUTPUT«95␤»
gfldex there is a lot that can go wrong :) 01:16
BenGoldberg Theoretically, at least... I expect that the optimizer, at some point in time, will create some code which asks our exception handler stack whether it contains any CONTROL blocks, and if not, uses an optimized version of your code which assumes normal non-strange handling of those exceptions.
01:16 bob777 joined, cdg left 01:17 cdg_ left
ShimmerFairy gfldex: that doesn't even count subcategories! :P 01:19
gfldex it's exceptions all the way down!
BenGoldberg m: sub foo { 42 }; sub bar { 'xyzzy' }; { say foo(); say bar(); CONTROL { .perl.say; (++ $).say; .resume }; 'after'.say; 01:20
camelia rakudo-moar aa5e49: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3say; (++ $).say; .resume }; 'after'.say;7⏏5<EOL>␤»
BenGoldberg m: sub foo { 42 }; sub bar { 'xyzzy' }; { say foo(); say bar(); CONTROL { .perl.say; (++ $).say; .resume } }; 'after'.say; 01:21
camelia rakudo-moar aa5e49: OUTPUT«42␤xyzzy␤after␤»
gfldex m: for X::.values { my $name = .^name; X::($name)::.keys.say } 01:22
camelia rakudo-moar aa5e49: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Combination of indirect name lookup and call not supported␤at <tmp>:1␤------> 3values { my $name = .^name; X::($name)::7⏏5.keys.say }␤ expecting any of:␤ argument list␤»
BenGoldberg m: sub foo { CONTROL { 'bar'.say; .resume }; 42 };
camelia ( no output )
BenGoldberg m: sub foo { CONTROL { 'bar'.say; .resume }; 42 }; say foo();
camelia rakudo-moar aa5e49: OUTPUT«42␤»
BenGoldberg m: sub foo { CONTROL { default { 'bar'.say; .resume } }; 42 }; say foo(); 01:23
camelia rakudo-moar aa5e49: OUTPUT«42␤»
01:24 mcmillhj joined 01:29 mcmillhj left
gfldex m: for X::.values { ::($_.^name)::.keys.say } 01:30
camelia rakudo-moar aa5e49: OUTPUT«()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤()␤(…» 01:31
gfldex m: for X::.values { dd ::($_.^name) }
camelia rakudo-moar aa5e49: OUTPUT«X::Method␤X::NoSuchSymbol␤X::NotEnoughDimensions␤X::OS␤X::InvalidType␤X::Pairup␤X::NYI␤X::PseudoPackage␤X::EXPORTHOW␤X::IO␤X::Set␤X::Package␤X::Declaration␤X::Inheritance␤X::Redeclaration␤X::StubCode␤X::UnitScope␤X::Poison…»
gfldex exceptions are exceptionally hard to count :(
01:36 mcmillhj joined 01:38 zacts left 01:41 mcmillhj left 01:42 sufrostico left 01:48 benvejknrertbrrt joined 01:56 mcmillhj joined 02:00 mcmillhj left 02:03 cibs left 02:05 cibs joined 02:07 parabolize left, kid51 left, gblade left 02:09 parabolize joined 02:12 mcmillhj joined 02:16 mcmillhj left 02:17 Actualeyes joined 02:20 bob777 left, bob777 joined 02:31 mcmillhj joined 02:36 mcmillhj left, parabolize left 02:37 noganex joined 02:40 noganex_ left 02:44 mcmillhj joined 02:48 mcmillhj left 02:54 s34n_ joined
s34n_ I'm looking for documentation of **@ and +@ 02:55
02:58 dainis joined
Juerd s34n_: You're looking for **, +, and @ 02:58
s34n_: Can you paste the line of code so I can verify this? 02:59
s34n_ yes. ** and + as prefix operators on a list (I think) 03:00
Juerd In a signature?
s34n_ yes
03:00 mcmillhj joined
Juerd ** in a signature is documented at docs.perl6.org/type/Signature#inde...Parameters 03:01
There's not much about it.
+ is at docs.perl6.org/type/Signature#Sing...ule_Slurpy 03:02
03:02 dainis left 03:03 dainis joined
Juerd Note that these things added to parameters in signatures usually aren't called operators. This page calls them sigils, but I haven't seen them called that elsewhere as far as I can remember. 03:03
s34n_ Juerd: thanks 03:05
Juerd You're welcome :)
03:05 kaare__ joined, mcmillhj left
[Coke] "sigil" for "+@" is almost certainly a bad name. 03:06
@ is the sigil. + is more of a marker. Not sure if it has an official name. 03:07
same with *@a
Juerd In the source they're called quantifiers 03:13
03:14 mcmillhj joined
Juerd Or actually, 'quant' 03:14
Quant \Quant\, n. 03:15
A punting pole with a broad flange near the end to prevent it
from sinking into the mud; a setting pole.
[1913 Webster]
Hehe.
03:16 mengwong joined, mengwong is now known as freeside 03:19 mcmillhj left
BenGoldberg The proper term is "thingies." 03:23
Juerd [citation needed]
03:24 maybekoo2 joined
BenGoldberg Informally, you can also use the term, "wossnames" 03:24
03:28 mcmillhj joined 03:33 mcmillhj left 03:45 mcmillhj joined, khw left 03:50 parabolize joined, mcmillhj left 03:55 mcmillhj joined 04:01 mcmillhj left 04:05 andrzejku joined
andrzejku hi 04:06
04:11 johndau joined 04:13 mcmillhj joined 04:14 BenGoldberg left
s34n_ *%slurp is copy <- is that valid in a signature? 04:16
04:18 mcmillhj left 04:22 labster left
s34n_ would that make all remaining named params 'is copy'? 04:24
04:26 canopus_ joined 04:27 dainis left 04:28 mcmillhj joined 04:33 mcmillhj left
skids s34n_: it's a valid sig but only affects %slurp itself, not the contents, I think. 04:36
m: sub f (*%g) { %g<a> = 8; dd %g }; f(:a,:b);
camelia rakudo-moar aa5e49: OUTPUT«Cannot modify an immutable Bool␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
skids m: sub f (*%g s copy) { %g<a> = 8; dd %g }; f(:a,:b);
camelia rakudo-moar aa5e49: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3sub f (*%g7⏏5 s copy) { %g<a> = 8; dd %g }; f(:a,:b);␤ expecting any of:␤ constraint␤»
skids m: sub f (*%g is copy) { %g<a> = 8; dd %g }; f(:a,:b);
camelia rakudo-moar aa5e49: OUTPUT«{:a(8), :b}␤»
04:37 benvejknrertbrrt left 04:40 wbill left 04:43 mcmillhj joined 04:44 Cabanossi left 04:46 Cabanossi joined 04:47 kurahaupo joined 04:49 mcmillhj left
TimToady m: sub f (*%g is copy) { %g<a> = 8; }; my %a = :a, :b; f(|%a); dd %a 05:01
camelia rakudo-moar aa5e49: OUTPUT«Hash %a = {:a, :b}␤»
s34n_ if Array.reduce does a left fold, is there a built-in for right folds? 05:05
05:10 freeside left, canopus_ left 05:11 mcmillhj joined 05:16 mcmillhj left, canopus joined 05:18 freeside joined 05:23 mcmillhj joined 05:26 andrzejku left 05:27 freeside left, mcmillhj left 05:29 baest left 05:30 baest joined 05:38 Khisanth left 05:41 ab6tract joined 05:43 mantovani joined
skids reduce folds the way the op does, no? 05:49
(per operator associativity)
So, reverse the op e.g. "R-" 05:50
05:52 Khisanth joined, andrzejku joined 05:53 andrzejku left 05:55 rangerprice joined, rangerprice left
skids Hrm. -EDOCSWRONG 05:57
05:57 labster joined
skids or synopses obselete. 05:57
05:59 mantovani left 06:04 mantovani joined 06:06 freeside joined 06:09 mantovani left
skids m: [1,2,3,4].reduce(&infix:<R->).say; say 1 - (2 - (3 - 4)); say ((1 - 2) - 3) - 4; say ((1 R- 2) R- 3) R- 4; say 1 R- (2 R- (3 R- 4)) # I'm too tired to deal. Going to sleep. 06:10
camelia rakudo-moar aa5e49: OUTPUT«2␤-2␤-8␤2␤-2␤»
06:14 skids left 06:20 sno left 06:22 domidumont joined, domidumont left, domidumont joined 06:29 domidumont left, canopus left 06:30 mcmillhj joined 06:31 mantovani joined 06:34 mcmillhj left 06:35 abraxxa joined 06:36 firstdayonthejob joined 06:39 canopus joined 06:41 firstdayonthejob left 06:45 mantovani left, dwarring left 06:47 ab6tract left 06:51 CIAvash joined 06:54 mantovani joined 06:59 mcmillhj joined 07:01 mantovani left, ab6tract joined 07:02 canopus_ joined
ab6tract good *, #perl6 07:02
07:03 canopus left, mcmillhj left 07:08 mantovani joined 07:09 canopus_ left 07:14 darutoko joined 07:15 ab6tract left 07:19 domidumont joined 07:21 canopus joined, domidumont left, domidumont joined 07:23 mcmillhj joined 07:25 freeside left 07:27 canopus left 07:28 mcmillhj left, mohae left 07:29 mantovani left 07:31 wamba joined 07:32 AlexDaniel left 07:34 RabidGravy joined, sno joined 07:38 canopus joined 07:40 canopus left 07:41 abraxxa1 joined, abraxxa left 07:49 dsp- left, canopus joined 07:50 abraxxa1 left 07:51 abraxxa joined, freeside joined 07:52 dsp- joined 07:53 canopus left, s34n_ left 07:54 johndau left 07:55 johndau joined 08:05 pmqs left
sjn good *, #perl6 :) 08:10
I have a crazy question. Are there any ways to *modify* a method/function signature? 08:11
Meaning, someone else supplies some code containing a subroutine, and I'd like to write module that adds another parameter to it. 08:14
E.g. script A has a MAIN sub, and when module B is loaded, this MAIN sub gets another argument 08:15
08:18 mcmillhj joined
psch well, .wrap can't do that i just learned 08:19
sjn: why wouldn't adding a multi candidate for MAIN work in that case?
sjn yeah, I was thinking a little about that just now 08:20
just testing it
08:20 pmqs joined
DrForr Starting to work on the top-level parser code - At the moment it just handles 'my $a', but not for long. 08:22
08:22 mcmillhj left 08:24 wamba left 08:44 cpage_ joined, cpage_ left, cpage_ joined
sjn psch: allright, not entirely sure on how to do that.. 08:47
I have a file with a "multi MAIN (Int $c) { ... }" defined 08:48
and module Modify.pm, with another multi MAIN
I assumed running "perl6 -MMulti file.pl6" would be enough 08:49
psch sjn: well, you do need 'use' or some other importing mechanism
m: module Foo { multi MAIN($, $) is export { } }; import Foo; multi MAIN($) { }; 08:50
camelia rakudo-moar aa5e49: OUTPUT«Usage:␤ <tmp> <Any> <Any> ␤ <tmp> <Any> ␤»
psch well, and 'is export' :)
sjn psch: isn't -M equivalent to a "use"?
psch i'm not sure it is for a script, honestly
i mean, i only ever use -M for -e 08:51
08:52 mcmillhj joined
sjn oh, interesting 08:52
I get an error here
08:52 CIAvash left
psch star-m: module Foo { multi MAIN($, $) is export { } }; import Foo; multi MAIN($) { }; 08:52
camelia star-m 2016.04: OUTPUT«Usage:␤ <tmp> <Any> <Any> ␤ <tmp> <Any> ␤»
psch bisect: module Foo { multi MAIN($, $) is export { } }; import Foo; multi MAIN($) { };
sjn A symbol '&MAIN' has already been exported
bisectable psch: On both starting points the exit code is 2 and the output is identical as well
psch: Output on both points: Usage:␤ /tmp/tM9TaWqehe <Any> <Any> ␤ /tmp/tM9TaWqehe <Any>
psch bisect: good=HEAD bad=2016.01 module Foo { multi MAIN($, $) is export { } }; import Foo; multi MAIN($) { }; 08:53
bisectable psch: No build for 'bad' revision
sjn I have two different multi MAIN defined in that file
both are exported
psch i think you need an explicit proto and to export that then
sjn ah, ok
psch m: module Foo { multi foo($) is export {}; multi foo($,$) is export {} }; import Foo 08:54
camelia ( no output )
psch hm... well
maybe not - i guess pasted it? :)
-d
08:56 mcmillhj left
sjn ah, ok 08:58
hm
"Too late for unit-scoped sub definition; Please use the block form." 08:59
sammers hello from Japan 09:00
09:01 freeside left
holyghost hola Japan 09:01
sjn m: module Foo { proto foo; multi foo (Bool $yes) { ... }; multi foo (Bool $no) { ... }; } 09:02
camelia rakudo-moar aa5e49: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤A unit-scoped sub definition is not allowed except on a MAIN sub;␤Please use the block form.␤at <tmp>:1␤------> 3module Foo { proto foo;7⏏5 multi foo (Bool $yes) { ... }; multi fo␤»
sjn block form? 09:03
Am I not using that there?
sammers: hello from the Europes
sammers Hi sjn 09:04
Hi holyghost
konobi 今日はご機嫌いかがですか?
sammers is there any way to redirect Proc::Async stdout?
konobi oh yay... utf8 actually works for mew now
jnthn sjn: It's talking about the proto. The error indicator is even right on the ; pointing at where it wants the block :) 09:05
sammers hi konobi, doing good. you? 09:06
09:07 mcmillhj joined
sammers I have a processe that I spawn using Proc::Async, but it is a little noisy, so I want to filter it a bit. 09:07
09:09 ssqq joined
sjn jnthn: ah, cool. so the proto was incomplete 09:09
maybe a little LTA error message, that 09:10
a little confusing too, since the sub defenition was *not* unit-scoped
(I don't think so, at least)
psch m: sub MAIN; say "hi" 09:11
camelia rakudo-moar aa5e49: OUTPUT«hi␤»
psch sjn: the blockless form of a sub definition *is* the unit-scoped definition
09:12 mcmillhj left
jnthn This is true, however even I was surprised that you could actually use the blockless form without writing the word "unit" before it :) 09:12
sjn ok I see, and the error here is that I try to do a unit-scoped defenition inside a smaller scope
jnthn (I didn't realize it was that liberal up until a couple of weeks ago :))
psch sjn: no, the error is that only MAIN allows a unit-scoped definition 09:13
sjn eh, I'm more confused now
jnthn So it may be good to not assume that somebody writing sub foo; intended it to be unit scoped in the error, but also to point out - if the unit keyword was missing - that you can't just stub things that way also :)
sjn hm. @colleagues are calling me to go to lunch. brb
jnthn Lunch at...11:13am?! 09:14
psch boo GMT +2 normativity
jnthn Heh, I suspect sjn is in the same timezone as me :) 09:15
There are places in Europe that have lunch strangely early :)
psch m: module Foo;
camelia rakudo-moar aa5e49: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Semicolon form of 'module' without 'unit' is illegal. You probably want to use 'unit module'␤at <tmp>:1␤------> 3module Foo;7⏏5<EOL>␤»
09:15 TEttinger left
jnthn psch: Yeah, that's why I was surprised sub MAIN; is allowed rather than needing to be "unit sub MAIN;" 09:16
psch anyway, i'm not sure about requiring 'unit sub MAIN', but the error probably does need adjustment
although "if you wanted a unit-scoped declaration, [only MAIN allows that||it's too late for that]. if you wanted to stub please use the block form" is kind of unwieldy 09:17
09:19 maybekoo2 left 09:32 xinming joined, rindolf joined
literal silly question...where do I find installed modules? "panda --installed list" shows I have some installed, but I don't see them anywhere under Rakudo Star's install/ directory 09:39
stmuk_ literal: its not like perl 5 - the modules are compiled into bytecode .. the source is present but the directory tree flattened and all filenames are SHA1 hashes 09:42
literal I see, I guess they all correspond to the share/perl6/site/precomp/$whatever blobs
09:42 mcmillhj joined 09:44 dogbert2 left 09:47 mcmillhj left
jnthn I'm pretty sure I've seen somebody show a way of querying the mapping also, but I don't remember it 09:47
09:50 cpage_ left, cpage_ joined, cpage_ left
llfourn m: say ($_ with "Foo") # I think this is a new bug 09:57
camelia rakudo-moar aa5e49: OUTPUT«WARNINGS for <tmp>:␤Useless use of $_ in sink context (line 1)␤Foo␤»
llfourn wonders if our bisect thing can look for when a warning started 09:58
psch bisectable: say ($_ with "Foo") 09:59
bisectable psch: Exit code is 0 on both starting points, bisecting by using the output
psch: bisect log: gist.github.com/51a3b382dfecdad999...b34ec1d26b
psch: (2016-07-26) github.com/rakudo/rakudo/commit/5334cb7
llfourn ah the gist shows some clues psch++ 10:00
10:00 freeside joined
DrForr peers curiously at freeside. :) 10:01
llfourn oh it even got the commit that changed the output sweet
psch llfourn: huh? bisectable uses output when exit code is inconclusive, and it did point at... right :)
llfourn bisectable++ psch++
bisectable llfourn: Exit code is 1 on both starting points, bisecting by using the output
llfourn: bisect log: gist.github.com/97aee6fe2637b8b4e3...06588dc57d
llfourn: (2015-12-27) github.com/rakudo/rakudo/commit/373adc0
llfourn --bisectable 10:02
dalek c: c6e699d | (Steve Mynott)++ | doc/Language/faq.pod6:
remove extra full stop
c: 690d83d | (Steve Mynott)++ | doc/Language/faq.pod6:
mention 6.d as next release
psch ...and that's why everybody wants the colon ;)
DrForr "Good, bad, I've got the colon."
Would modules be an appropriate way to collect a bunch of classes into a single file? (I'd of course prefer separate files, but that incurs performance penalties and means I have to oen file after file to make a simple change.) 10:04
Looks that way according to the docs, /me fiddles.
10:05 kurahaupo left
llfourn .tell TimToady RT #128770 is relevant to your interests :) 10:10
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128770
yoleaux llfourn: I'll pass your message to TimToady.
10:11 parabolize left 10:15 tx0h_ joined 10:16 mcmillhj joined, tx0h left, tx0h_ is now known as tx0h
sjn <- back 10:20
jnthn: yeah, early lunch (brunch?)
10:20 ssqq left 10:21 ssqq joined, mcmillhj left 10:22 johndau left
sjn is there a way to introspect wether or not a function has been defined as a method or as a multi-method? 10:23
(alternatively, where do I look for docs/code on that?) 10:26
literal so how does "panda --installed list" find out which modules are installed? I expected there would be a manifest of some sort listing them, but I did not find one: gist.github.com/hinrik/37ddc4cd773...ca36c0f001 10:27
dalek c: bc611e2 | (Steve Mynott)++ | doc/Language/faq.pod6:
b2gills++ doc test for at least 6.c
10:29
c: 0ea7b20 | (Steve Mynott)++ | doc/Language/faq.pod6:
improve beginner install instructions
psch m: class A { method foo { }; multi method bar($) { }; multi method bar { } }; A.^can('foo')[0].is_dispatcher.say; A.^can('bar')[0].is_dispatcher.say
camelia rakudo-moar aa5e49: OUTPUT«False␤True␤»
psch sjn: ^^^
10:29 mcmillhj joined
psch m: class A { method foo { }; multi method bar { } }; A.^can('foo')[0].is_dispatcher.say; A.^can('bar')[0].is_dispatcher.say 10:30
camelia rakudo-moar aa5e49: OUTPUT«False␤True␤»
psch sjn: doesn't even have to have more than one candidate
sjn ah, cool
thanks! ^^
stmuk_ literal: I think there is a JSON file somewhere .. strace the command to look for the open 10:31
literal stmuk_: I checked all the interesting files returned by strace (see the gist), the only JSON file was one that contains metadata about Panda itself, not any other modules 10:32
10:34 mcmillhj left
dalek c: 718e058 | (Steve Mynott)++ | doc/Language/faq.pod6:
mention p5 and ruby nutshell pages
10:35
sjn psch: how would you do the A.^can('foo')[0].is_dispatcher.say on methods in the main:: namespace? 10:40
psch m: say &say.is_dispatcher;
camelia rakudo-moar aa5e49: OUTPUT«True␤»
sjn I get an "Undeclared subroutine" 10:41
ok, no way to do that via ^can()? 10:42
sjn wants to do some other introspection too
psch sjn: .^can is a method on the class meta object, to check if a given class has a method named as the argument 10:43
sjn ok
psch m: say &say.^methods
camelia rakudo-moar aa5e49: OUTPUT«(<anon> <anon> <anon> soft <anon> <anon> yada perl <anon> onlystar candidates unwrap wrap <anon> <anon> package leave <anon> <anon> cando <anon> <anon> <anon> <anon> multi <anon> <anon> add_phaser has-phaser phasers assuming WHY set_why perl of <anon> retu…»
psch sjn: so what .^can returns is almost the same as what &say represents - a Routine 10:44
sjn quite a lot of anons there
psch m: say &say.^methods.map(*.name)
camelia rakudo-moar aa5e49: OUTPUT«(<anon> <anon> <anon> soft <anon> <anon> yada perl <anon> onlystar candidates unwrap wrap <anon> <anon> package leave <anon> <anon> cando <anon> <anon> <anon> <anon> multi <anon> <anon> add_phaser has-phaser phasers assuming WHY set_why perl of <anon> retu…»
psch ...we probably should name all of them at least
the fact they exist as <anon> is because of bootstrapping
sjn psch: no, I want to distinguish different multis in order to look at their signatures
(and some other stuff) 10:45
psch m: say &say.candidates
camelia rakudo-moar aa5e49: OUTPUT«(sub say () { #`(Sub|59652856) ... } sub say (Str:D \x) { #`(Sub|59653008) ... } sub say (\x) { #`(Sub|59653160) ... } sub say (**@args is raw) { #`(Sub|59653312) ... })␤»
stmuk_ literal: share/perl6/site/panda/state although accessing it probably isn't an approved API
literal: there is also API violating code in p6doc but don't let nine catch you using it :) 10:46
10:47 pRiVi left, pRiVi joined
literal I see 10:48
10:48 mcmillhj joined 10:49 Zoffix joined
Zoffix m: class Foo { has @.foo }; Foo.new: :foo(42) 10:49
camelia ( no output )
Zoffix m: class Foo { has @.foo; submethod BUILD (:@!foo) {} }; Foo.new: :foo(42)
camelia rakudo-moar aa5e49: OUTPUT«Type check failed in binding to @!foo; expected Positional but got Int (42)␤ in submethod BUILD at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
10:49 rindolf left, labster left
Zoffix that's LTA :( 10:49
psch m: class Foo { has @.foo; submethod BUILD (:@!foo) {} }; Foo.new: :foo[42] 10:50
camelia ( no output )
stmuk_ the p6doc stuff at least works with zef and panda ... I don't think official APIs exist yet but there was recent talk of writing them .. ugexe knows about this
Zoffix Yes, I know of that, but that requires changing existing code that relies on my class
(and a 5,000+ word article :))
I guess this is a better example: 10:53
m: class Foo { has @.foo; submethod BUILD (:@!foo) {} }; Foo.new: :foo<42 45>
camelia ( no output )
Zoffix m: class Foo { has @.foo; submethod BUILD (:@!foo) {} }; Foo.new: :foo<42>
camelia rakudo-moar aa5e49: OUTPUT«Type check failed in binding to @!foo; expected Positional but got IntStr (IntStr.new(42, "42"))␤ in submethod BUILD at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
10:53 mcmillhj left
psch m: class Foo { has @.foo; submethod BUILD (:@!foo) {} }; Foo.new: :foo<42, > 10:53
camelia rakudo-moar aa5e49: OUTPUT«Type check failed in binding to @!foo; expected Positional but got Str ("42,")␤ in submethod BUILD at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
psch m: class Foo { has @.foo; submethod BUILD (:@!foo) {} }; Foo.new: :foo(42, )
camelia ( no output )
10:57 matt_ joined, Guest8704 left 10:58 matt_ is now known as Guest90166
Zoffix This one's even more messed up: 10:59
m: class Foo { has %.foo; method bar { dd %.foo } }; Foo.new(:foo(:42meow)).bar # all good
camelia rakudo-moar aa5e49: OUTPUT«Hash %!foo = {:meow(42)}␤»
Zoffix m: class Foo { has %.foo; submethod BUILD (:%!foo) {}; method bar { dd %.foo } }; Foo.new(:foo(:42meow)).bar # still good
camelia rakudo-moar aa5e49: OUTPUT«Hash %!foo = {:meow(42)}␤»
Zoffix m: class Foo { has %.foo; submethod BUILD (:%!foo) {}; method bar { dd %.foo } }; Foo.new(:foo(:42meow, :72ber)).bar # ooopsie 11:00
camelia rakudo-moar aa5e49: OUTPUT«Type check failed in binding to %!foo; expected Associative but got List ($(:meow(42), :ber(72)))␤ in submethod BUILD at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
Zoffix m: class Foo { has %.foo; method bar { dd %.foo } }; Foo.new(:foo(:42meow, :72ber)).bar # works again
camelia rakudo-moar aa5e49: OUTPUT«Hash %!foo = {:ber(72), :meow(42)}␤»
11:00 wamba joined 11:02 mcmillhj joined
Zoffix eyes a good article. 11:02
Bad publicity is good publicity, amirite?
11:03 Guest90166 is now known as matt_ 11:06 mcmillhj left 11:08 cpage_ joined 11:12 ssqq left 11:14 mcmillhj joined 11:15 rindolf joined 11:18 mcmillhj left 11:19 cpage_ left 11:21 bob777 left
jkramer is there a global flag or something I can use to make all fails/dies print a stack trace? 11:21
moritz that's, like,, the default
jkramer Hmm
There's a module I use that exits with an error message "Unhandled exception: cannot close a closed socket" and I'd like to find out where that's from 11:22
psch jkramer: that's moarvm guts, apparently 11:23
jkramer Nevermind, I think I found it github.com/tony-o/perl6-http-serve...nc.pm6#L37
psch ah, right, "where do we hit the thing that throws", not "which part of the rakudo stack throws it" :) 11:24
fwiw, it probably should get its own typed exceptions, but i don't have any idea how we do that on moar
-s
11:25 parabolize joined
jnthn Zoffix: A thing with an @ in a signature wants you to pass something that does Positional, and a thing with % wants you to pass something that does Associative. Types in Perl 6 are constraints, not coercions (except coercion types, of course, and even those pull apart into a constraint followed by a coercion). 11:26
11:26 mcmillhj joined
jnthn Zoffix: :foo{...} and :bar[...] exist for conveniently passing the right kind of thing with a pair. 11:27
llfourn m: say :foo{one => "two",three => "four"} 11:30
camelia rakudo-moar aa5e49: OUTPUT«Unexpected named parameter 'foo' passed␤ in block <unit> at <tmp> line 1␤␤»
llfourn m: (:foo{one => "two",three => "four"}).say
camelia rakudo-moar aa5e49: OUTPUT«foo => {one => two, three => four}␤»
llfourn didn't know about that
11:30 ZoffixMobile joined, mcmillhj left
moritz I recommend reading the section on colonpairs in S04 11:31
11:31 jgrabber joined
moritz it's quite extensive :-) 11:31
ZoffixMobile jnthn, sure, but then why does it work fine with attributes, when no BUILD is involved? It's inconsistency here that is the biggest ossue.
llfourn knows what he's reading this weekend 11:32
jnthn ZoffixMobile: There's no constraints going on there, just a plain assignment.
ZoffixMobile The working attributes delude you into thinking :foo<bar> is a fine way to pass args to a positional attribute. So you document it and distribute your inteface, and then the second you add BUILD your interface explodes 11:33
That's what actually happened to me, sans the distributing part because I've not published the article yet :(
llfourn m: sub goof(:%foo) { }; goof(:foo(:bar,:baz)) 11:35
camelia rakudo-moar 1751f1: OUTPUT«Type check failed in binding to %foo; expected Associative but got List ($(:bar, :baz))␤ in sub goof at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
jnthn m: class A { has @.foo; submethod BUILD(:$foo) { @!foo = @$foo; } }; A.new(:foo<1>).foo.say
camelia rakudo-moar 1751f1: OUTPUT«[1]␤»
jnthn You can preserve behavior that way
ZoffixMobile I'm gonna try when I get to a computer. IIRC, I had issues with that approach with the %.attr and passing as :foo(:42foo, :72bar) 11:36
llfourn m: class A { has %.foo; submethod BUILD(:$foo) { %!foo = %$foo; } }; A.new(:foo(:bar,:baz)).foo.say # hashified
camelia rakudo-moar 1751f1: OUTPUT«{bar => True, baz => True}␤»
ZoffixMobile thanks. 11:37
jnthn Yeah, that's another case of a binding/assignment difference.
11:38 mcmillhj joined
jnthn I guess it's one of those cases where you can't have all the consistencies... 11:38
And @!foo parameters have two different competing ideas of consistent behavior. 11:39
ZoffixMobile nods 11:40
11:42 mcmillhj left 11:43 rindolf left, jgrabber left 11:44 killbill joined 11:46 ZoffixMobile left
jkramer Eeek, I made perl6 segfault o_O 11:49
arnsholt Congrats! =)
jkramer I have a 400M core dump. Anyone interested? :D
arnsholt Possibly not. But a minimal example triggering the bug is generally appreciated =) 11:50
11:50 mcmillhj joined
moritz we tend to like instruction for reproduction better... what arnsholt++ said 11:50
arnsholt Oh, and if you're using NativeCall, it might just be a bug in your program and not a Moar bug =) 11:51
11:52 molaf joined
jkramer Minimal example is gonna be tricky, but I'll try. Also no NativeCall that I know if, unless it's in some module I use 11:52
arnsholt Then chances are good you can join the illustrious segfault-triggering-club =) 11:53
Does the segfault happen consistently, or only intermittently?
jkramer Will I get an achievement badge or something? :)
It only happened once, trying to reproduce with a smaller example now 11:54
11:54 mcmillhj left
arnsholt It's not infrequently a first step on the path to doing guts-level hacking, to be honest =) 11:55
moritz jkramer: you will get karma here :-)
jkramer That's good enough for me :) 11:56
11:57 killbill left
jkramer Yup, reproduced it :) Let me try one more time to be sure 11:57
arnsholt jkramer: Speaking of, if you're feeling adventurous and are familiar with doing this kind of stuff, you could try attaching gdb to the core dump you got and put the backtrace in a gist 11:58
jkramer Is perl6 built with debug information by default or do I need to recompile? Because I actually should do some actual work ;) 11:59
arnsholt Without -g by default, IIRC 12:00
But you should get function names, even if you don't get line numbers
jkramer Actually I think I have an educated guess about what the problem is. It takes a couple of requests to make it crash, and they get slower and slower all the time until it crashes, so might be memory leak and it crashes when it runs out 12:01
arnsholt Sounds possible
12:03 mcmillhj joined
jkramer dpaste.com/0GJBMNC - here's the sample code. Run it and in parallel do `while true; curl localhost:8118`, it crashes after ~80 requests on my machine. 12:03
"This is Rakudo version 2016.04 built on MoarVM version 2016.04" BTW 12:04
arnsholt Ah, might be an async bug too 12:05
jnthn's working on some of those these days I think
12:05 hwcomcn joined
lizmat jnthn: perhaps it's an idea to bump MoarVM / nqp ? 12:06
jnthn: or is that too soon ?
12:06 freeside left 12:07 hwcomcn left
jnthn lizmat: Should be fine, I just ran out of time/energy on Wed, and was too busy yesterday to get to it 12:07
12:07 freeside joined
literal in the "make install" step of Rakudo Star, 16 of the 32 modules cause it to try downloading projects.json, which causes it to skip installing those modules if the server doesn't have a network connection, even though the sources for all those modules are already there 12:07
12:07 mcmillhj left, Ven joined, hwcomcn joined
jnthn Well, I was going to write a test also while bumping to cover the improvement :) 12:07
lizmat jnthn: ok, then I will bump in a few minutes after I push a rather exciting optimisation :-)
jnthn But feel free to do the bump and I'll get to the test :) 12:08
lizmat ok
jnthn Please do a local spectest with the dump just in case. OSX can turn up intresting things sometimes ;)
jkramer Not sure if this is what you meant with backtrace but maybe it helps: dpaste.com/0KPHK2P
lizmat jnthn: will do
unmatched} jkramer: you should upgrade your Perl 6. 2016.04 is ancient 12:09
12:09 hwcomcn left
jkramer Oh, indeed. Didn't see 07 was out already 12:10
12:10 hwcomcn joined
literal so how can I install Rakudo Star properly without a network connection? 12:10
unmatched} It's a lot faster too.
lizmat jkramer: there's one every month :-)
unmatched} Well, to clarify: there's one Rakudo release every month. Star releases happen less frequently. 12:11
12:11 hwcomcn left
jkramer lizmat: I used the package from here rakudo.org/how-to-get-rakudo/ and before 2016.07 2016.04 was the latest for ~3 months :) 12:11
lizmat jkramer: ah, you used Rakudo Star 12:12
unmatched} literal: it should be the case by default. What OS?
lizmat ok, then you're right, 2016.04 was the previous one :-)
12:12 hwcomcn joined
literal unmatched}: CentOS 12:12
unmatched}: see the difference between the modules that install properly versus the ones that insist on a network connection: gist.github.com/hinrik/514cb479071...053412fb86
it says it's going to install DBIish from the local dir but doesn't 12:13
jkramer I was using rakudobrew some time ago but it stopped working somehow and I couldn't be bothered to look into it :)
12:13 hwcomcn left
jkramer Building 07 now, I'll report back if I can still reproduce the segfault then (or not) 12:13
12:14 hwcomcn joined
unmatched} jkramer: works fine for me. Maybe some nukage is in order? I have this alias setup: update-perl6 is aliased to `rm -fr ~/.zef; rm -fr ~/.perl6; rm -fr ~/.rakudobrew/; git clone github.com/tadzik/rakudobrew ~/.rakudobrew; rakudobrew build moar; rakudobrew build zef;' 12:14
lizmat jkramer: ok
unmatched} literal: it may be worth reporting that issue. My understanding Star should not attempt to install modules from a network connection. github.com/rakudo/star/issues/new
jkramer unmatched}: I think I tried cleaning ~/.rakudobrew and starting over, but not the other directories. Will try sometime 12:15
unmatched} m: class A { has @.foo; submethod BUILD(:$foo) { @!foo = @$foo; } }; dd A.new().foo 12:17
camelia rakudo-moar 1751f1: OUTPUT«Array @!foo = [Any]␤»
unmatched} tsk tsk
12:18 mcmillhj joined 12:19 ZoffixW joined, ZoffixW left
lizmat m: sub a(:$foo) { dd $foo }; a # unmatched} : I think that's correct 12:20
camelia rakudo-moar 1751f1: OUTPUT«Any $foo = Any␤»
lizmat m: sub a(:$foo) { dd @$foo }; a # unmatched} : I think that's correct
camelia rakudo-moar 1751f1: OUTPUT«(Any,)␤»
lizmat m: sub a(:$foo = Empty) { dd $foo }; a # unmatched} : perhaps better ?
camelia rakudo-moar 1751f1: OUTPUT«Slip $foo = slip$()␤»
lizmat m: sub a(:$foo = ()) { dd $foo }; a # unmatched} : perhaps better ? 12:21
camelia rakudo-moar 1751f1: OUTPUT«List $foo = $()␤»
lizmat m: sub a(:$foo = ()) { dd @$foo }; a # unmatched}
camelia rakudo-moar 1751f1: OUTPUT«()␤»
unmatched} It's correct in the sense that there's no bug. I was more referring to the previous conversation about the inconsistencies between plain has @.foo; and version with BUILD and @!foo = @$foo; offered as a work around, which should actually be @!foo = @$foo if $foo; to avoid this edge case where no value is passed
lizmat++ default is better yeah 12:22
12:23 mcmillhj left, Ven left 12:30 kid51 joined
lizmat jnthn: still 2 spectest to fix for my nice optimisation, so I'm checking into bumping MoarVM now first 12:30
12:34 Actualeyes left, prammer joined 12:36 wamba left 12:37 prammer left
vcv unmatched}: thanks for the alias. i always had trouble getting Perl 6 updated for some reason, but that worked flawlessly 12:38
unmatched} \o/
12:50 prammer joined, McDogfood joined 12:53 McDogfood left 12:54 user9 left, wamba joined 12:55 abraxxa left 12:57 mcmillhj joined
literal unmatched}: github.com/rakudo/star/pull/75 12:58
12:59 dalek left
unmatched} literal: are you sure that installed modules continue to work? It's telling panda not to install dependencies so they need to be manually included during the install process (that may already be the case, I don't know) 13:00
13:01 dalek joined, ChanServ sets mode: +v dalek 13:05 harmil_wk joined 13:10 sufrostico joined, luis left 13:12 luis joined
unmatched} Does anyone want to help me debug my huge and complex code? :) For some reason, if I have this line like this, giving it a Match object, my code fails: github.com/zoffixznet/perl6-buggab...ble.p6#L17 In the output it actually does print "◀▬▬ local QUIT :Leaving" where `local` is the value of $<server>, but the server doesn't quit. " 13:13
The call starts off over here: github.com/zoffixznet/perl6-IRC-Cl...nt.pm6#L85 and ends up over here: github.com/zoffixznet/perl6-IRC-Cl...t.pm6#L328 where it sends data to the socket. The last debug output dd ['ssay', $server, ~$server]; does have "local" for the ~$server so I'm confused about why it doesn't work 13:14
And if I change :$<server> to server => ~$server in the original call, everything starts to work fine: the data is shipped to the socket and I the server disconnects me. 13:15
psch m: "foo" ~~ /$<foo>=.+/; say $<foo>.WHAT 13:16
camelia rakudo-moar 02b2e3: OUTPUT«(Match)␤»
psch m: "foo" ~~ /$<foo>=.+/; say (:$<foo>).key.WHAT
camelia rakudo-moar 02b2e3: OUTPUT«(Str)␤»
psch m: "foo" ~~ /$<foo>=.+/; say (:$<foo>).value.WHAT
camelia rakudo-moar 02b2e3: OUTPUT«(Match)␤»
unmatched} m: sub foo (:$server) { put $server; my %h = $server => "bar"; put %h; put %h{$server} }; "foo" ~~ /$<server>=.+/; put $<server>; foo :$<server>
camelia rakudo-moar 02b2e3: OUTPUT«foo␤foo␤foo bar␤bar␤» 13:17
13:17 Fleurety joined
psch m: sub foo (:$server) { put $server.^name; my %h = $server => "bar"; put %h.keys; put %h{$server} }; "foo" ~~ /$<server>=.+/; put $<server>; foo :$<server> 13:18
camelia rakudo-moar 02b2e3: OUTPUT«foo␤Match␤foo␤bar␤»
psch m: sub foo (:$server) { put $server.^name; my %h = $server => "bar"; put %h.keys[0].WHAT; put %h{$server} }; "foo" ~~ /$<server>=.+/; put $<server>; foo :$<server>
camelia rakudo-moar 02b2e3: OUTPUT«foo␤Match␤Use of uninitialized value of type Str in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in sub foo at <tmp> line 1␤␤bar␤»
unmatched} And if I use '*' for server (which triggers the quit on all servers), it seems to sorta work. 13:19
psch m: sub foo (Str() :$server) { put $server.^name; my %h = $server => "bar"; put %h.keys[0].WHAT; put %h{$server} }; "foo" ~~ /$<server>=.+/; put $<server>; foo :$<server>
camelia rakudo-moar 02b2e3: OUTPUT«foo␤Str␤Use of uninitialized value of type Str in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in sub foo at <tmp> line 1␤␤bar␤»
psch m: sub foo (Str() :$server) { put $server.^name; my %h = $server => "bar"; put %h{$server} }; "foo" ~~ /$<server>=.+/; put $<server>; foo :$<server> # minus the uninit
camelia rakudo-moar 02b2e3: OUTPUT«foo␤Str␤bar␤»
harmil_wk Is there a good example out there of a way to define an operator that, itself, takes parameters? Is that even a thing? What I really want is the numbered arrow notation (e.g. ↑4) but I can't figure out how that would work. I could define the op ↑4↑ but that's too static. 13:22
jkramer So with 2016.07 the example doesn't segfault anymore, but it's super-slow (up to ~3-5 seconds per request) and eats ~400M RAM and 100% CPU
unmatched} m: sub prefix:<↑> ($what) { say "You gave me $what" }; ↑4 13:23
camelia rakudo-moar 02b2e3: OUTPUT«You gave me 4␤»
harmil_wk Right, that's the normal arrow notation that I just defined in that module I linked yesterday, but the numbered arrow notation is another level deeper
e.g. 3 ↑4 3 is equivalent to 3 ↑↑↑↑ 3 13:24
unmatched} psch++ adding a Str() coercer to :$server here solved the issue, but I don't understand why. $server is just used as a key in a hash and my eval above indicates a Match as a key does Str coersion: github.com/zoffixznet/perl6-IRC-Cl...t.pm6#L328
lizmat harmil_wk: is the 4 in your example just an example, or is there an actual range of allowable values there ? 13:26
harmil_wk n ↑x m is n ↑ (n ↑ ... m) with x ↑s is how my example should be read. It's sometimes written with superscript notation on the ↑ 13:27
unmatched} m: class Foo { has %.servers; method do-things (:$server) { %!servers{ ~$server } = 42; dd %!servers{ $server }; } }; "foo" ~~ /$<server>=.+/; Foo.new.do-things: :$<server>
camelia rakudo-moar 02b2e3: OUTPUT«Int %!servers = 42␤»
psch harmil_wk: i think that's macro territory 13:29
harmil_wk: your ↑ is a prefix that functions as an infix
or, well, maybe the other way around 13:30
harmil_wk psch: Sadly, I think you're right. It's "is parsed" kind of mummery
unmatched} Found the issue
m: "foo" ~~ /$<server>=.+/; dd [ |$<server> ] 13:31
camelia rakudo-moar 61725d: OUTPUT«[]␤»
unmatched} I have a slip there, so the match was being slipped into nothing
psch m: "foo" ~~ /$<server>=.+/; dd [ |:$<server> ]
camelia rakudo-moar 61725d: OUTPUT«[:server(Match.new(ast => Any, list => (), hash => Map.new(()), orig => "foo", to => 3, from => 0))]␤»
psch unmatched}: you didn't have the named marker?
unmatched} No, it was after it was unpacked from a pair. On this line, when it's given to for(): github.com/zoffixznet/perl6-IRC-Cl...t.pm6#L333
psch unmatched}: ah, okay 13:32
unmatched} psch++ helping :)
harmil_wk Also my example was very wrong, but only mathematically, not in terms of syntax.
n ↑x m is x arrows between n and m which expands out geometrically in terms of the number of groups of x-1 arrows and so on. 13:33
en.wikipedia.org/wiki/Knuth%27s_up...w_notation 13:34
DrForr Geometrically is a bit of an understatement.
harmil_wk Well, it's a geometric progression of the number of x-1 arrows. That only gives you a sense of how absurd it gets as you recurse. 13:35
DrForr IIRC 3↑↑3 is around 7 trillion, and 3↑↑↑3 won't fit in the known universe.
psch m: sub uparrow($a, $b, :$times = 1) { my $r = $a; for $times { $r **= $a for $b }; $r }; my &infix:<↑2> = &uparrow.assuming(*,*,:2times); say 2 ↑2 2 # this is syntactically how i'd do it
camelia rakudo-moar 61725d: OUTPUT«4␤»
psch the math seems wrong though :)
harmil_wk DrForr: from my tests is 3↑↑3, 7625597484987, "Two arrow power tower";
see github.com/ajs/perl6-Math-Arrow 13:36
"There's a module for that"
psch you can even stuff the declaration of ↑2 (and following ones) in a BEGIN for 2..$max-allowed { ... } 13:37
harmil_wk Yeah, I might do that for now
it's a fair stopgap
DrForr ~7.6 trillion, good memory :)
mst oh, wow, we have a module for 3^^3 ? 13:38
psch m: sub infix:<↑>($a, $b, :$times) { ($a + $b) * $times }; say 2 ↑ 3 :2times # alternatively this, maybe
camelia rakudo-moar 61725d: OUTPUT«10␤»
mst now I'm wondering if I need to include a torture versus dust specks joke in my ::EU talk
psch that removes you quite a bit from the classical math notation, but has the advantage that it doesn't declare lots of infix ops, and thus keeps compilation faster 13:39
although, if you have it in a module that's probably not a lot of an argument :)
DrForr The only use I know of for that is computing Graham's number.
harmil_wk Power towers are used in lots of other places.
Mostly in statistics and group theory and the like.
psch m: sub infix:<↑>($a, $b, :$times) { ($a + $b) * $times }; say 2 ↑ :2times 3 # i wonder...
camelia rakudo-moar 61725d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3 { ($a + $b) * $times }; say 2 ↑ :2times7⏏5 3 # i wonder...␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ stat…»
mst DrForr: there's a famous-to-rationalists use in the sequences 13:40
psch yeah, that eats the pair as term for the infix
mst "is one person being tortured for a year better or worse than 3^^3 people getting dust specks in their eyes? ok, now how about 3^^^3?"
DrForr True, I can see combinatorics. 13:41
13:42 pmurias joined 13:46 Ven joined
DrForr It's just amusing because G(64) (which is a vastly mind-bogglingly huge impossible-to-understand number) is an upper limit to a complex problem involving high-dimensional hypercubes. 13:46
The actual solution is most likely 6. 13:47
psch "The lower bound of 6 was later improved to 11 by Geoff Exoo in 2003,[3]"
oh, wait, wrong line
2 ↑3 6 is the best upper bound 13:48
en.wikipedia.org/wiki/Graham's_number
wikipedia, because i don't actually know math :)
i just remembered reading about it like half a year ago there, and that there was newer known bounds 13:49
DrForr Neat. The last I heard of it was a mention on a QI program where Alan Davies actually guessed the correct lower bound (at the time, 6) to the utter astonishment of ... well, most everyone involved. 13:51
13:52 mcmillhj left, mcmillhj joined 13:53 Actualeyes joined
lizmat
.oO( now we finally now why it's Perl 6)
13:55
DrForr It *would* be interesting to figure out how to enumerate red-blue graphs over the N-hypercube, but ... must finish current project. 13:56
13:57 Ven left 13:59 sufrostico left 14:05 kurahaupo joined
hoelzro [Coke]: sorry, I missed your question yesterday; what do you mean? 14:05
lizmat afk& 14:09
avar p6doc-index says "run me with build to build index" 14:12
"p6doc-index build" yields: "Too many positionals passed; expected 1 argument but got 2"
unmatched} m: @*ARGS = 'build'; multi sub MAIN('build') { say "yo" } 14:14
camelia rakudo-moar 61725d: OUTPUT«yo␤»
unmatched} weird
avar: what's the full error message?
Also, what's your Perl 6's version and how did you get p6doc-index? (I can't reproduce in a repo clone) 14:15
avar Too many positionals passed; expected 1 argument but got 2 14:16
in sub MAIN at ...site/lib/auto/Six/Rakudo/share/perl6/site/resources/EE4609FA487A07A36F49F1143C10A166727B2069 line 55
in block <unit> at ...site/lib/auto/Six/Rakudo/share/perl6/site/resources/EE4609FA487A07A36F49F1143C10A166727B2069 line 73
It's Rakudo 2016.07
14:16 hwcomcn left 14:17 robertle joined
avar You get p6doc-index when you build rakudo star and "make install" it along with p6doc 14:17
robertle hi folks, I am having some issues with a grammar. I make a change to the grammar that seems legit, and now .parse() never returns. interestingly, it starts working again if i use Grammar::Tracer. are there known problems in that area? does this need reporting? how can I learn more? 14:18
unmatched} robertle: are you sure it's not just taking forever? Does it actually return when you use Grammar::Tracer? 14:19
psch robertle: github.com/jnthn/grammar-debugger/issues/13 exists, so there is precendence
timotimo you mean precedent?
psch ...yes
timotimo :)
robertle yes, it returns when i use teh tracer, quite quickly as well. it's a small grammar and a small input...
14:20 pdcawley_ left
DrForr Putting up a gist would help. 14:20
14:21 sufrostico joined, pdcawley joined, ptolemarch joined 14:23 bob777 joined 14:24 Sgeo left 14:25 mohae joined
robertle gist.github.com/anonymous/132e16cd...0438495906 14:25
14:25 rindolf joined 14:26 Actualeyes left 14:28 skids joined 14:35 cibs left
ugexe which install-dist.pl6 14:37
14:37 user9 joined, cibs joined 14:39 Actualeyes joined 14:43 bdmatatu joined
skids m: &infix:<->.WHAT.say; &infix:<R->.WHAT.say # that explains why .reduce was confusing me last night. 14:43
camelia rakudo-moar 61725d: OUTPUT«(Sub+{<anon|69393488>}+{Precedence})␤(Block)␤»
skids m: &infix:<**>.prec.say; [2,3,4].reduce(&infix:<**>).base(16).say; (2**(3**4)).base(16).say
camelia rakudo-moar 61725d: OUTPUT«{assoc => right, prec => w=}␤200000000000000000000␤200000000000000000000␤»
unmatched} avar: just built the 2016.07 Rakudo Star on a debian box and can't reproduce. I've tested with just running `p6doc-index build`, not with Inline::Perl6 or anything like that. FWIW, the p6doc-index's repo is this: github.com/perl6/doc 14:44
skids So, synopsis are right anf docs need some work.
14:46 wamba left
bdmatatu p6: my @x := (1 ... Inf).grep(* < 10); 14:49
camelia rakudo-moar 61725d: OUTPUT«(timeout)»
bdmatatu Shouldn't the above be lazy? 14:50
psch m: say (1...Inf).grep(* < 10).is-lazy
camelia rakudo-moar 61725d: OUTPUT«False␤»
bdmatatu p6: say (1 ... Inf).map(* + 1).is-lazy 14:52
camelia rakudo-moar 61725d: OUTPUT«True␤»
unmatched} m: my $x = (1...Inf).grep(* < 10)
camelia ( no output )
unmatched} m: my @x = lazy (1...Inf).grep(* < 10)
camelia ( no output )
14:52 user9 left
bdmatatu So map is lazy but grep is not 14:52
14:52 sufrostico left
timotimo once you hit 10, you're going to have a problem anyway 14:53
because then grep will go up to infinity to try to get you another value 14:54
14:54 user9 joined
bdmatatu p6: say (1 ... Inf).grep(*.is-prime).is-lazy; 14:54
camelia rakudo-moar 61725d: OUTPUT«False␤»
unmatched} m: (1 ... Inf).grep(*.is-prime)[0..10].say 14:55
camelia rakudo-moar 61725d: OUTPUT«(2 3 5 7 11 13 17 19 23 29 31)␤»
unmatched} I've no idea why .is-lazy returns False.
bdmatatu p6: my @x := (1 ... Inf).grep(*.is-prime);
unmatched} I don't think that works. This reminds me of an old code example
camelia rakudo-moar 61725d: OUTPUT«(timeout)»
unmatched} m: my $x = (1 ... Inf).grep(*.is-prime); say $x[0..10] 14:56
camelia rakudo-moar 61725d: OUTPUT«(2 3 5 7 11 13 17 19 23 29 31)␤»
unmatched} m: my @x = lazy (1 ... Inf).grep(*.is-prime); say @x[0..10]
camelia rakudo-moar 61725d: OUTPUT«(2 3 5 7 11 13 17 19 23 29 31)␤»
14:57 pdcawley left
bdmatatu Okay, interesting...thanks 14:58
15:00 khw joined, domidumont left
dalek c: 830c485 | (Steve Mynott)++ | doc/Language/faq.pod6:
compiler version to language version jnthn++
15:04
15:05 user9 left 15:06 user9 joined, user9 left 15:07 mantovani joined 15:16 cognominal left, vendethiel left, pdcawley joined 15:17 mantovani left 15:18 parabolize left 15:22 sena_kun joined 15:26 parabolize joined 15:29 mcmillhj left 15:33 cibs left 15:34 mantovani joined 15:35 domidumont joined, cibs joined 15:36 Possum left 15:38 Possum joined 15:45 mcmillhj joined, cdg joined 15:46 pdcawley left 15:47 s34n_ joined 15:49 Possum left 15:54 canopus joined 15:55 pdcawley joined, Possum joined 15:56 ufobat left
dalek c: 8170492 | skids++ | doc/Type/List.pod6:
Streamline docs on .reduce(), and note it can be a "right fold" too.

   Not crazy about that "Practical example", but left it.
   Also using &[op] when introducing [op] is still kinda suboptimal
15:58
16:03 bdmatatu left 16:05 robertle left 16:09 mcmillhj left, pdcawley left 16:12 trnh joined, trnh left, trnh joined 16:15 canopus left, FROGGS joined 16:20 canopus joined 16:23 domidumont left 16:24 domidumont joined 16:27 sno left 16:28 canopus left 16:35 mantovani left 16:36 AlexDaniel joined 16:37 canopus joined 16:38 _4d47 joined, NEveD joined 16:39 mantovani joined 16:40 mr-fooba_ is now known as mr-foobar
_4d47 p6: constant A := Metamodel::ClassHOW.new_type( name => 'A' ); 16:43
camelia ( no output )
16:43 canopus left
timotimo oh, how do you build a 47-sided die? 16:44
_4d47 I have Method 'WHERE' not found for invocant of class 'A' in 2016.07.1 but not 2016.04 16:48
psch bisectable: constant A := Metamodel::ClassHOW.new_type( name => 'A' );
bisectable psch: On both starting points the exit code is 0 and the output is identical as well
psch: Output on both points:
timotimo oh, that's interesting. shouldn't everything have a method WHERE?
psch WHERE should get deftrap'd in methodop for everything, yeah 16:49
...i hope bisectable is ok :|
timotimo of course if you try to .^find_method('WHERE'), that's probably going to give that kind of error? 16:50
psch m: Int.^can('WHERE')
camelia ( no output )
psch m: Int.^can('WHERE').say
camelia rakudo-moar 61725d: OUTPUT«(WHERE)␤»
16:50 canopus joined
psch huh, i'm pretty sure WHERE is in deftrap 16:50
timotimo i thought i saw some WHERE implementations in some places
psch ah, no it's not
it's in Mu, my mistake
timotimo so that means everything has it, except mabye things taken over from nqp? which ClassHOW might be? 16:51
psch well, it's *also* in deftrap
timotimo i ... don't actually know what deftrap means
psch my %deftrap := nqp::hash( 16:52
in Perl6/Grammar.nqp
timotimo right ... but what is its effect?
psch lines 3274 to 3301 are where %deftrap is checked 16:53
16:53 kurahaupo left
psch it throws e.g. Syntax::Confused when something is wrong 16:53
16:53 mantovani left
timotimo oh 16:53
16:53 kurahaupo joined
skids syntactically defined pseudo-methods, I would imagine. 16:53
psch m: say 16:55
camelia rakudo-moar 61725d: OUTPUT«5===SORRY!5===␤Argument to "say" seems to be malformed␤at <tmp>:1␤------> 3say7⏏5<EOL>␤Other potential difficulties:␤ Unsupported use of bare "say"; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument, …»
psch that's one of the error via %deftrap
+s
timotimo ah, neat
psch m: say[ ] # another
camelia rakudo-moar 61725d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Use of non-subscript brackets after "say" where postfix is expected; please use whitespace before any arguments␤at <tmp>:1␤------> 3say7⏏5[ ] # another␤ expecting any of:␤ argument li…»
psch m: WHERE # and the last kind 16:56
camelia rakudo-moar 61725d: OUTPUT«5===SORRY!5===␤Argument to "WHERE" seems to be malformed␤at <tmp>:1␤------> 3WHERE7⏏5 # and the last kind␤Undeclared name:␤ WHERE used at line 1␤␤Other potential difficulties:␤ Function "WHERE" may not be called without argu…»
16:56 canopus left
psch the "may not be called without argu...", not the "undeclared name" 16:56
the "malformed" bit is deftrap too 16:57
17:02 mcmillhj joined 17:04 canopus joined 17:08 canopus left 17:11 jgrabber joined
jgrabber Hello! Is there some documentation on CompUnit::Repository::Installation.files($file, :$name!, :$auth, :$ver)? I cannot seem to find any and would like to know if it can be used here: github.com/perl6/gtk-simple/blob/m...ib.pm6#L93 17:13
17:14 firstdayonthejob joined 17:15 canopus joined
unmatched} jgrabber: there are no docs I'm aware of, but it should be fine to use the public interface. 17:15
timotimo jgrabber: you should probably look at %*RESOURCES instead 17:16
or what it's called
17:19 canopus left
TimToady unmatched}: if .grep can't propagate .is-lazy, it's just a bug 17:20
yoleaux 10:10Z <llfourn> TimToady: RT #128770 is relevant to your interests :)
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128770
unmatched} TimToady: I suspected so
jgrabber timotimo: Really sorry, but I haven't heard of %*RESOURCES and it's not listed here: docs.perl6.org/language/variables 17:21
timotimo: and my google-fu is too weak to find any further docs on %*RESOURCES as well 17:22
AlexDaniel commit releases constant A := Metamodel::ClassHOW.new_type( name => 'A' );
committable AlexDaniel: ¦«2015.10,2015.11,2015.12,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07,HEAD»:
unmatched} Ticket created: rt.perl.org/Ticket/Display.html?id=128773
TimToady m: say [\*](1 ... *).is-lazy;
camelia rakudo-moar 61725d: OUTPUT«True␤»
timotimo someone else in here ought to be able to point it out
it definitely does exist
under ... some name 17:23
TimToady we have the mechanism for propagating laziness, it's just .grep is failing to use it
unmatched} Yes, it's %*RESOURCES: docs.perl6.org/language/variables...._variables
jgrabber timotimo: It's under compile-time variables, hidden in plain sight. Sorry 17:24
timotimo OK :)
well, compile-time usually has %? instead of %*
unmatched} The docs are sparse. IIRC, you place files in resource/ (or resources/) directory of your distro and you can get filehandles for them by using %?RESOURCES<some-dir-inside-resource><the-file>
Yeah, it's %?RESOURCES sorry. 17:25
jgrabber: basically something like that ^
timotimo for the gtk thing it's a bit interesting because we ought to download the dlls (if need be) while building, otherwise it won't get registered after-the-fact for %?RESOURCES, right?
unmatched} Hmm
m: %?RESOURCES<foo><bar><ber>.say 17:26
camelia rakudo-moar 61725d: OUTPUT«Nil␤»
unmatched} No idea.
jgrabber timotimo: I really don't know if there's a way to download the dll's before rakudo populates %?RESOURCES - but using $*REPOS to construct IO::Path objects and work with them seems rather ugly to me 17:32
timotimo well, there's Build.pm
i think it ought to be able to work for this case
17:35 canopus joined 17:37 AlexDaniel left
unmatched} m: gist.github.com/zoffixznet/efa0438...bc969b2611 17:37
camelia rakudo-moar 61725d: OUTPUT«Current nick is n1␤Current nick is n2␤Current nick is n3␤Current nick is n1␤Current nick is n2␤Current nick is n3␤Current nick is n1␤Current nick is n2␤Current nick is n3␤»
unmatched} wonders what the golfed version of that code would look like.
17:37 canopus left
unmatched} Rotate a variable through values in an array, sleeping for 3 seconds when restarting the rotation. 17:37
(can't change the array) 17:38
17:38 mantovani joined
timotimo personally, i'd build a hash of "next"s 17:38
or is taht not allowed? 17:39
well, then you could just store the $idx, which you opted not to do i suppose?
timotimo BBL
17:39 jmiven left
unmatched} Yeah, any extra state would require extra class attributes and I kinda want to avoid that. 17:40
I guess it's not too bad as it is. I'm just wonder if there's some awesome Perl 6 method to greatly simplify things :)
s34n_ How do you use a reserved word as a method name? (ignoring the wisdom) 17:41
unmatched} s34n_: you just do and it should work.
m: class Foo { method join { "blah" }; } say Foo.new.join 17:42
camelia rakudo-moar 61725d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3class Foo { method join { "blah" }; }7⏏5 say Foo.new.join␤ expecting any of:␤ infix␤ infix stopper…»
unmatched} m: class Foo { method join { "blah" }; }; say Foo.new.join
camelia rakudo-moar 61725d: OUTPUT«blah␤»
17:43 dvinciguerra joined 17:45 canopus joined 17:47 freeside left
TimToady Perl 6 doesn't exactly have reserved words, at least not in the sense that they're reserved in every grammatical slot 17:47
17:48 mohae_ joined
TimToady m: xx 42 17:48
camelia rakudo-moar 61725d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤ xx used at line 1␤␤»
TimToady we slice and dice our syntactic namespaces so that doesn't occur, which is one of the reasons p6 is more extensible than most languages 17:49
17:49 dvinciguerra left 17:51 mohae left 17:57 domidumont left 18:02 canopus left, setty1 joined
NEveD Hi there, I'm having trouble understanding this behavior: 18:06
> my FatRat $a = 0.1111111111111111111111111111111111111111.FatRat
0.1111111111111111077357107952555149148649
Shouldn't be number preserved?
18:06 labster joined
unmatched} m: (0.1111111111111111111111111111111111111111).WHAT.say 18:07
camelia rakudo-moar 61725d: OUTPUT«(Rat)␤»
unmatched} m: (0.1111111111111111111111111111111111111111).say
camelia rakudo-moar 61725d: OUTPUT«0.1111111111111110938409751724975649267435␤»
unmatched} doesn't know 18:08
18:08 canopus joined
timotimo hum, we don't properly turn that literal into a FatRat? 18:08
m: my FatRat $foo .= new(0, 9); say $foo 18:09
camelia rakudo-moar 61725d: OUTPUT«0␤»
timotimo m: my FatRat $foo .= new(1, 9); say $foo
camelia rakudo-moar 61725d: OUTPUT«0.111111␤»
timotimo m: my FatRat $foo .= new(1, 9); say $foo.perl
camelia rakudo-moar 61725d: OUTPUT«FatRat.new(1, 9)␤»
timotimo ...
i think that's how you get 0.1111111111111111111111111... ?
18:10 mcmillhj left
unmatched} How come I'm getting error "Cannot call private method 'send-cmd' on package IRC::Client because it does not trust IRC::Client::Message::Ping" I've added the trust here: github.com/zoffixznet/perl6-IRC-Cl...ent.pm6#L8 18:11
And this is where the error is pointing to: github.com/zoffixznet/perl6-IRC-Cl...ge.pm6#L31
18:11 cognominal joined
NEveD I discussed with coleague of mine Rat in Perl6 and that silly example came out... Since then I searched for an answer. I understand that for Rat it makes sense, but FatRat should be "arbitrary precision". 18:12
timotimo m: say FatRat.perl 18:13
camelia rakudo-moar 7ba6db: OUTPUT«FatRat␤»
18:13 mcmillhj joined
timotimo m: say FatRat.^roles.perl 18:13
camelia rakudo-moar 7ba6db: OUTPUT«(Rational[Int,Int], Real, Numeric)␤»
18:14 sufrostico joined
unmatched} NEveD: from what I can see, you get a Rat from that literal, before it ever gets to the .FatRat 18:14
timotimo m: FatRat.new(79104570918435709182770615098527489735908477814598170438905710987437091874327509817, 1980234278590184257098714389759810243257987143570143890751043890760198374098714356897).say
camelia rakudo-moar 7ba6db: OUTPUT«0.03994707685534750313297632007293372372262079619695066518393344295200499293154109049358␤»
18:14 canopus left
unmatched} Though, I'm unsure why it doesn't just get converted 18:15
m: (0.1111111111111111111111111111111111111111.FatRat).WHAT
camelia ( no output )
unmatched} m: (0.1111111111111111111111111111111111111111.FatRat).WHAT.say
camelia rakudo-moar 7ba6db: OUTPUT«(FatRat)␤»
unmatched} m: (0.1111111111111111111111111111111111111111.FatRat).nude.say
camelia rakudo-moar 7ba6db: OUTPUT«(101010101010101010101010101010101010101 909090909090909118526002584273060626432)␤»
unmatched} m: (0.1111111111111111111111111111111111111111).nude.say
camelia rakudo-moar 7ba6db: OUTPUT«(101010101010101010101010101010101010101 909090909090909118526002584273060626432)␤»
unmatched} Oh.
So yeah, basically you get an unpresice Rat from your literal and when you convert to to FatRat, you get the unpresice FatRat 18:16
m: my FatRat $foo .= new(1, 9); say ($foo*3).nude 18:17
camelia rakudo-moar 7ba6db: OUTPUT«(1 3)␤»
unmatched} m: my FatRat $foo .= new(1, 9); say ($foo*3)
camelia rakudo-moar 7ba6db: OUTPUT«0.333333␤»
18:17 Tonik joined
unmatched} m: class Bar { ... }; class Foo { trusts Bar; method !bar { say "weeeee" } }; class Bar { method meow { my $o = Foo.new; $o!Foo::bar } }.new.meow; 18:19
camelia rakudo-moar 7ba6db: OUTPUT«weeeee␤»
unmatched} I wonder if it has to do with the modules being in separate files :/
Screw it. I ain't got time for this... Public method it is. 18:20
TimToady this is related to Zef's .999999999999999999 bug
masak today's autopun spotting: twitter.com/qntm/status/758819780325289984
TimToady m: (<0.1111111111111111111111111111111111111111>.FatRat).nude.say 18:21
camelia rakudo-moar 7ba6db: OUTPUT«(1111111111111111111111111111111111111111 10000000000000000000000000000000000000000)␤»
18:22 canopus joined
TimToady m: <0.1111111111111111111111111111111111111111>.WHAT.say 18:23
camelia rakudo-moar 7ba6db: OUTPUT«(RatStr)␤»
TimToady arguably should be a NumStr instead, if the fraction overflows 64-bit denom
m: say .99999999999999999999999 > 1 18:24
camelia rakudo-moar 7ba6db: OUTPUT«True␤»
18:24 Guest71985 joined
TimToady m: say <.99999999999999999999999> > 1 18:25
camelia rakudo-moar 7ba6db: OUTPUT«False␤»
NEveD TimToady: I see... thank you for explanation. ;)
TimToady m: say <.99999999999999999999999>.Rat.WHAT
camelia rakudo-moar 7ba6db: OUTPUT«(Rat)␤»
TimToady and arguably that should return a Num
unmatched} m: say <.99999999999999999999999> == 1 18:26
camelia rakudo-moar 7ba6db: OUTPUT«False␤»
unmatched} m: say <.99999999999999999999999>.nude
camelia rakudo-moar 7ba6db: OUTPUT«(99999999999999999999999 100000000000000000000000)␤»
unmatched} Why a Num? 18:27
TimToady because that's what Rats degrade to as soon as their denominator is > 64bits
unmatched} m: say 2**63 > 100000000000000000000000 18:28
camelia rakudo-moar 7ba6db: OUTPUT«False␤»
unmatched} Ah
TimToady that's the compromise that prevents exponential slowdown that FatRat can give
and why we never just willy-nilly upgrade you to FatRat
we assume most reasonable arithmetic that needs exact rationals will have denominators of, say 100 or 1000 or so 18:29
(64 bits should be enough for anyone!) 18:30
mst ah, so if you don't want to go floating point, you need to ask for a FatRat up front?
18:30 ely-se joined 18:33 ely-se is now known as rightfold
TimToady correct 18:33
but FatRat is "sticky" like Complex, so you really only need to inject one FatRat to taint the whole calculation :) 18:34
Guest71985 Is there an operation on FatRat that would be something like 'give me the closest FatRat that is less than X and denominator less than Y'?
TimToady wouldn't that be a round?
jonadab It would. 18:35
18:35 cpage_ joined
TimToady m: say &round.signature 18:35
camelia rakudo-moar 7ba6db: OUTPUT«($, $?)␤»
jonadab Though it's a special case because you don't necessarily know what you're rounding to the nearest of.
TimToady m: round 1,2,3
camelia rakudo-moar 7ba6db: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Calling round(Int, Int, Int) will never work with proto signature ($, $?)␤at <tmp>:1␤------> 3<BOL>7⏏5round 1,2,3␤»
TimToady would be nice to see the multi sigs there...
18:35 canopus left 18:36 cognominal left
Guest71985 I haven't thought enough about rounding a Rat to say... If there's a smaller denominator than 'Y' that gives a smaller error, then it would be nice to get that instead. 18:37
jonadab You'd almost have to iterate over the possible denominators and calculate the closest match (i.e., round) and the resulting error for each. 18:39
TimToady m: (<0.1111111111111111111111111111111111111111>.FatRat.round(0.0000000000000000001)).nude.say
camelia rakudo-moar 7ba6db: OUTPUT«(1111111111111111111 10000000000000000000)␤»
TimToady m: (<0.1111111111111111111111111111111111111111>.FatRat.round(1/(2**63)).nude.say 18:40
camelia rakudo-moar 7ba6db: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in parenthesized expression; couldn't find final ')' ␤at <tmp>:1␤------> 03111111>.FatRat.round(1/(2**63)).nude.say7⏏5<EOL>␤ expecting any of:␤ statement en…»
TimToady m: (<0.1111111111111111111111111111111111111111>.FatRat.round(1/(2**63))).nude.say
camelia rakudo-moar 7ba6db: OUTPUT«(1024819115206086201 9223372036854775808)␤»
TimToady m: (<0.1111111111111111111111111111111111111111>.FatRat.round(1/(2**64))).nude.say 18:41
camelia rakudo-moar 7ba6db: OUTPUT«Method 'nude' not found for invocant of class 'Num'␤ in block <unit> at <tmp> line 1␤␤»
TimToady m: (<0.1111111111111111111111111111111111111111>.FatRat.round(FatRat.new(1,2**64))).nude.say
camelia rakudo-moar 7ba6db: OUTPUT«(1024819115206086201 9223372036854775808)␤»
TimToady m: (<0.1111111111111111111111111111111111111111>.FatRat.round(FatRat.new(1,2**64))).nude.WHAT.say 18:42
camelia rakudo-moar 7ba6db: OUTPUT«(List)␤»
TimToady m: (<0.1111111111111111111111111111111111111111>.FatRat.round(FatRat.new(1,2**64))).WHAT.say
camelia rakudo-moar 7ba6db: OUTPUT«(FatRat)␤»
TimToady m: (<0.1111111111111111111111111111111111111111>.FatRat.round(FatRat.new(1,2**64))).Rat.say
camelia rakudo-moar 7ba6db: OUTPUT«0.11111111111111111112␤»
Guest71985 janadab: Maybe. There's probably some optimizations you could do with factorizing the denom, but if your denom is already a biggish/primish number then we might have a hard problem. 18:43
18:43 canopus joined, sena_kun left
Guest71985 Oh, right. I came in here to ask some (possibly dumb) questions about using the NCurses package on OS X. 18:44
First question: where does "panda" install packages to?
mst disk 18:46
TimToady :P
probably install/share/perl6/
wherever p6's install is
Guest71985 Ha! Trick question: Macs are all SSD all the time!!! 18:47
TimToady how do you know the ssd chip isn't disk shaped?
japhb Guest71985: ISTR there is an algorithm for finding the smallest-denominator rational that approximates a real value to some precision. In fact I think mjd blogged about it at some point
Guest71985 I installed with homebrew, so "which perl6" => "/usr/local/bin/perl6"
18:48 canopus left
Guest71985 Oh, good point. I guess I'm just assuming it's square because chip manufacturers are cheap bastards. 18:48
18:50 dvinciguerra joined
timotimo i'd like an SSD in the shape of a cat 18:50
gfldex timotimo: be careful what you wish for. It may knock your data over and pee in your folders. 18:51
FROGGS heh
yoleaux 25 Jul 2016 03:04Z <Xliff> FROGGS: Finished with 07dtd in XML::LibXML, but this one was ugly. I will be going over some of the issues this week, and hope to get a PR to you around the start of Aug.
timotimo ohai FROGGS
FROGGS Xliff++ 18:52
Guest71985 It would just end up sleeping on top of your laptop because it's warm..
18:54 girafe joined 18:55 mantovani left
Guest71985 Alright, time for the questions to get dumber. If "use NCurses;" works but fails with unable to load the .so file, does that mean that somewhere I should have a "NCurses.pm6" file? I can't 'find' one in either $HOME or /usr/local 18:55
18:55 canopus joined
gfldex Guest71985: module names are replaced by sha1s 18:57
unmatched} Guest71985: not necessarily. A module installation precomiles the module and it gets stored in a filename named with a hash
japhb Guest71985: Found the references. You represent a number as a continued fraction (en.wikipedia.org/wiki/Continued_fraction), and each successive stage of the continued fraction can be converted back to a simple rational and represents the "best" approximation of the original number, in that no smaller denominator fraction is closer to the original number.
18:58 wamba joined 18:59 Woodi left
TimToady Guest71985: silly question, but do you have ncurses.so installed on your system? 19:01
geekosaur os x, so .dylib. 19:02
ARM9 it probably means you don't have the library installed, sudo apt install libncurses5-dev
FROGGS sometimes you even need the -dev-package, because that one will install an unversioned lib
Guest71985 Sort of? "panda install NCurses" passed its tests, and "locate ncurses" gives me "/usr/lib/libncurses.5.dylib" among other thigns.
geekosaur and /usr/lib/libncurses.dylib is in the OS base
Guest71985 In the NCurses source, it's loading "libncursesw.so.5", though, so that might be the problem. 19:04
19:06 canopus left
timotimo ah, right. "wide" characters 19:09
Guest71985 The NCurses in GitHub has a fancy little "constant LIB = %*ENV<PERL6_NCURSES_LIB> || 'libncursesw.so.5';" mechanism, but setting that environment variable doesn't do anything so I'm not really sure what's up with that. 19:10
timotimo installing with panda will always grab the source from github
19:10 darutoko left
timotimo unless of course you're installing from a folder, like "panda install ." 19:11
geekosaur OS X supplies an ncurses that doesn't need a wide variant (this separate lib was made unnecessary in ncurses 5 although linux still ships a loader command file for backward compatibility)
Guest71985 No, I'm just doing "panda instal NCurses".
19:12 canopus joined, sno joined 19:14 sufrostico left 19:15 mantovani joined
Guest71985 geekosaur: that's wonderfully arcane. So specifying both the wide variant and the version 5 is somewhat redundant? 19:16
geekosaur wide variant is unneeded on OS X, and on some rare linux distributions that discontinued the wide variant when upstream ncurses did instead of supplying a backward compatibility loader command file. 19:17
the .5 *should* really be there but p6 folks love to assume that linux dev files always refer to the version they expect :/
19:17 cognominal joined 19:18 jameslenz joined
geekosaur in any case it should probably be checking the platform's shared object extension and trying both the -w and base versions in that order (and ideally testing the latter to see if it actually was built with unicode support) 19:19
Guest71985 I've downloaded the .pm6 file into ./lib. Is there an incantation that will make it load that one first? 19:20
19:20 ufobat joined
ufobat re 19:21
Guest71985 geekosaur: I'd like to make this more robust. Admittedly I'm writing perl6 as though it is perl5 with added gibberish: is there a better way to do that than having a list of variants and just doing a sort of calling ldopen on each one until it works? 19:22
19:24 canopus left 19:27 sjoshi joined
geekosaur rrrh. there;s a dynamic var thst has in it somewhere what the shared object suffix is supposed to be... not finding 19:28
19:29 itaipu joined 19:30 rightfold left 19:31 canopus joined 19:32 prammer left
unmatched} m: say $*VM.platform-library-name: "foo".IO 19:35
camelia rakudo-moar fc28b6: OUTPUT«"libfoo.so".IO␤»
Guest71985 Okay, syntactically what am I looking at here? That looks like a variable, but acts like a function? 19:39
19:40 mantovani left
moritz bascially everything is an object on which you can invoke methods 19:40
unmatched} Guest71985: no $*VM is a dynamic variable that has the VM object and you call the .platform-library-name method on it 19:41
Can be written like this too: $*VM.platform-library-name("foo".IO)
And .IO on "foo" is also a method call to convert a Str to IO::Path
Guest71985 Okay, knowing that $*VM is an object helps. The "blah: blah" as an alternate method call syntax seems Smalltalky. Maybe that's the idea? 19:43
moritz we got our ideas from everywhere :-) 19:44
19:44 spider-mario joined
unmatched} :D 19:44
19:44 Actualeyes left
Guest71985 The secret key to literacy is good plagarism. 19:44
arnsholt See also: Tom Lehrer 19:49
19:49 prammer joined
tbrowder emacs users: I just added new indices to my fork of perl6-mode. not perfect but it shows var names with sigil, classes, and subs (all types including proto); feature requests accepted (syohex is helping with good criticism); my additions are in my forks's branch "my-branch" 19:49
19:52 canopus left 19:54 jameslenz left 19:55 rightfold joined
Guest71985 Interestingly, the test in NCurses just tests that the package compiles. The library loading is deferred until the first call, which never happens in the "test". :( 19:55
19:56 yqt joined, rightfold left 19:58 canopus joined
TimToady actually, the "indirect object" syntax is mostly from English, give $dog: $bone 20:01
20:03 canopus left, Tonik left
b2gills m: say (1,2,3).reduce: sub ($a,$b) is assoc<right> {"<$a $b>"} # right fold 20:03
camelia rakudo-moar fc28b6: OUTPUT«Use of uninitialized value % of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at <tmp> line 1␤<1 <2 3>>␤»
20:04 dvinciguerra left
[Coke] ok, does anything see something dumb here? I'm getting what I think are false positives on this test: gist.github.com/coke/e1397d2971701...3a4a48e060 20:06
20:08 pmqs left 20:09 AndyBotwin joined
[Coke] rips out a bunch of the initial boilerplate... 20:11
20:11 canopus joined
hoelzro [Coke]: it looks pretty good to me 20:11
[Coke] (oh, right, I needed the len for the plan)
hoelzro I think you can simply the population of @files with my @files = qx<git ls-files doc>.lines, but that isn't a fix
*simplify
[Coke] oh, I wonder if <ws> is killing me.
yah, that's better, danke. 20:12
hoelzro have you checked to make sure that match is matching?
<ws> only comes in for rules, doesn't it?
20:12 mantovani joined
[Coke] ahahahahha, I'm an idiot. 20:14
hoelzro did you figure it out?
[Coke] there's a third Perl 5 in that file I missed.
I fixed two, but the file still failed. :)
hoelzro ahhh 20:15
[Coke] github.com/perl6/doc/blob/master/d...5.pod6#L18 - I'm assuming we shouldn't be forcing a nbsp there; 20:16
I am tempted to skip any indented lines.
20:19 TEttinger joined, canopus left, pmqs joined 20:21 dvinciguerra joined 20:22 rmmm left 20:23 Anop joined, rmmm joined, Anop left 20:25 Anop joined
Anop join 20:25
help
HELP
timotimo hello anop
please be a little more patient
20:26 AlexDaniel joined
timotimo before we can help you, we need to know what you need help with 20:26
masak Anop: is there anything we can do for you?
gfldex my guess would be he needs help with finding / on his keyboarrd/phone :->
Anop I know perl5 but can i jump to perl6 20:27
i am bioinformatics programmer
so perl6 would better option or not ? 20:28
for me
AlexDaniel Anop: it depends
gfldex Anop: it will be at some point
ARM9 what would make it not a better option in your opinion? 20:29
TimToady there is less support so far in the ecosystem, but you can get at the Perl 5 CPAN modules from Perl 6 if you need them
20:29 go|dfish joined
TimToady it's also possible to get at python modules 20:29
Perl 6 will be more expressive than Perl 5, but will likely run slower until our optimizer gets better 20:30
20:31 Guest71985 left
masak .oO( how can we get faster quicker ) 20:31
arnsholt How can we get more of our code paths to run through BLAS and LAPACK? 20:32
Which seems to be the general theme when optimizing stuff =)
20:33 ribasushi left
timotimo get faster faster! 20:35
masak while we're at it, we should try to get slower slower 20:36
20:36 jgrabber left
masak preferably not at all 20:36
arnsholt Possibly even negatively? 20:37
masak .oO( we have no idea how Perl 6 got so fast -- we just know that we applied the opposite of a lot of common performance mistakes ) 20:38
jnthn So get faster faster, we just need an optimizer optimizer. :)
20:39 ptolemarch left
Anop exit 20:39
masak Anop: \o
Anop \o
jnthn *To
jnthn apparently needs strongly typed typing too..
20:39 Anop left
masak jnthn: maybe if we use tachyons somehow, we can use a future version of the optimizer to make the current version faster 20:40
masak .oO( <TheDamian> ...will have been *being* optimized... ) 20:41
20:44 ribasushi joined
harmil_wk Okay, I feel dumb. I was calling the parenthetical meta-ops (e.g. "(-)") the "texas" operators. I didn't know that we used that name for the ascii equivs of unicode ops in general! 20:47
Boy did I misread that doc! 20:48
20:48 mcmillhj left
masak harmil_wk: yes, the "Texas" operators refer to all ASCII equivalents of Unicode ops. 20:49
("Texas" because... they're generally bigger, just like everything is in Texas)
'night, #perl6
20:50 sjoshi left
harmil_wk masak: thanks, night! 20:50
So the Unicode versions are the Monaco operators?
20:50 sufrostico joined
dalek c: eeb2f7c | coke++ | t/perl-nbsp.t:
Add a failing xtest to verify no break spaces.
20:52
20:57 andrewb joined, andrewb is now known as Guest473 20:58 trnh left 20:59 mantovani left
AlexDaniel [Coke]++ 21:00
21:00 canopus joined 21:01 jgrabber joined
[Coke] I was going to start making it pass, but am not in a position to make sure it renders right. 21:03
btw, in vim, Control-K <space> <space> gives you a nbsp.
- offline
21:05 jgrabber left 21:07 sena_kun joined 21:12 rindolf left 21:14 yqt left 21:18 kaare__ left 21:26 pmqs left 21:41 pmqs joined, prammer left 21:44 cpage_ left 21:55 cpage_ joined 21:58 trnh joined 22:00 Sgeo joined 22:11 itaipu left, sufrostico left 22:13 MahBot joined 22:14 MahBot left 22:18 canopus left
b2gills harmil_wk: generally we refer to Unicode version of the operators as being French 22:23
22:24 pmurias left 22:25 canopus joined
TEttinger b2gills: like portion sizes at french restaurants compared to at texas restaurants? 22:27
b2gills Mostly because both are seen as fancy, by Americans at least 22:28
TEttinger "a sliver of the finest steak tartare" "this steak is the size of a toddler and it tastes comparable to their smell"
22:39 sena_kun left 22:41 setty1 left, wamba left 22:42 firstdayonthejob left 22:43 harmil_wk left 22:48 dainis joined
dalek osystem: eb7ff47 | (Aaron Sherman)++ | META.list:
Add Math::Arrow to ecosystem

See github.com/ajs/perl6-Math-Arrow
22:53
osystem: 384871b | (Zoffix Znet)++ | META.list:
Merge pull request #232 from ajs/master

Add Math::Arrow to ecosystem
22:58 RabidGravy left 22:59 dvinciguerra left 23:02 girafe left 23:03 Guest473 left 23:20 ARM9 left
Zoffix .tell AlexDaniel IRC::Client's rewrite is done. perl6.party/post/IRC-Client-Perl-6-...IRC-Module 23:24
yoleaux Zoffix: I'll pass your message to AlexDaniel.
Zoffix .tell moritz I recall you being interested in a P6 IRC Client. IRC::Client should do the trick. It's poorly tested yet, but the API has been finalized: github.com/zoffixznet/perl6-IRC-Client#synopsis
yoleaux Zoffix: I'll pass your message to moritz.
Zoffix 🎺🎺🎺 New blog post "IRC::Client: Perl 6 Multi-Server IRC (or Awesome Async Interfaces with Perl 6)": perl6.party/post/IRC-Client-Perl-6-...IRC-Module 23:25
timotimo sounds like i want to port synopsebot to this? 23:31
23:32 spider-mario left
Zoffix use IRC::Client; .run with IRC::Client.new: :nick<synopsebot> :host<irc.freenode.net> :channels<#perl6 #perl6-dev> :debug :plugins(class { method irc-privmsg-channel ($ where /<< 'RT#' $<id>=\d+ >>/) { "rt.perl.org/Ticket/Display.html?id=$<id>" } }) 23:33
Ported :P
timotimo that's not all it does, though 23:38
S99:LTA
synopsebot6 Link: design.perl6.org/S99.html#LTA
Zoffix S99:blargdsasdas
synopsebot6 Link: design.perl6.org/S99.html#blargdsasdas
Zoffix use IRC::Client; .run with IRC::Client.new: :nick<synopsebot> :host<irc.freenode.net> :channels<#perl6 #perl6-dev> :debug :plugins(class { multi method irc-privmsg-channel ($ where /<< 'RT#' $<id>=\d+ >>/) { "rt.perl.org/Ticket/Display.html?id=$<id>" }; multi method irc-privmsg-channel ($ where /<< 'S99:' $<term>=\S+ >>/) { "Link: design.perl6.org/S99.html#$<term>" } }) 23:39
Ported :P
(well, you get the idea :P)
timotimo does the irc client exit when it loses connectivity to a server, as identified by not getting a ping in a given time period? 23:40
Zoffix Um, the RFC doesn't say anything about clients waiting for pings. If the server doesn't get anything from the client within X amount of time, it pings it and drops it if it doesn't get a response. 23:42
But if the connection drops, IRC::Client will reconnect: github.com/zoffixznet/perl6-IRC-Cl...haviour.md 23:43
timotimo right. but synopsebot sometimes drops off the 'net without exiting the process so it can be re-started
Zoffix ¯\_(ツ)_/¯ if I notice any problems with IRC::Client on that area, I'll make it drop and reconnect, I guess.
23:44 ufobat left
timotimo how do you mean? 23:44
Zoffix I mean that it's not part of the protocol and I've not had such issues. If I will, I'll think about how to fix it, but right now there's nothing to fix, regardless of whether synopsebot hangs or whatever it does. 23:45
timotimo hm 23:46
well, in theory, the socket should be closed anyway, and that should exit the program
i'm not entirely sure why the current implementation didn't do that
Zoffix ¯\_(ツ)_/¯
timotimo i'm willing to guess your current implementation probably handles that
Zoffix Yeah, when the socket closes, it automatically reconnects after a short delay, unless `.quit` has been called on that server. 23:47
23:49 cpage_ left
timotimo ah, neat. 23:49
TEttinger ¯¯\\__((ツツ))__//¯¯
Zoffix :) 23:50
TEttinger ¯¯¯\\\___(((ツツツ)))___///¯¯¯ 23:51
D:
geekosaur certain server failures (likely the ones that show up as lots of grouped ping timeouts instead of the ones that show as netsplits) can leave you with a socket that appears open but the other end has disappeared
timotimo wouldn't the OS at some point close the socket for you? 23:52
geekosaur tcp keepalives are terrible at this, mainly because they're mostly terrible. suggest you find some dummy operation you can use to ping the server periodically and discon/recon if it's missed
23:53 cdg left
geekosaur if there's pending data to transmit, tcp will detect an endpoint going away. if not, there's nothing to check except keepalives, which are often disabled because they trigger only over *hours* 23:53
timotimo ah, right
geekosaur (multiple retries w/backoff)
which is why ssh implemented its own keepalives in its protocol, and why various other long lived connections likewise have some way to do keepalives instead of relying on the tcp stack 23:54
timotimo right 23:55
IRC servers also do ping/pong