»ö« 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:00 Rawriful left 00:06 BenGoldberg joined 00:09 Actualeyes joined 00:12 pierre joined, pierre left 00:17 pierre joined 00:22 tmtowtdi left 00:49 margeas left 00:55 cyphase left 01:00 cyphase joined 01:01 khw joined 01:14 cyphase left 01:19 cyphase joined, pierre left 01:26 pierre joined 01:30 pierre left 01:41 avenj left 01:42 kid51 left 01:44 kalkin- left, kalkin-_ joined, pierre joined 01:46 ilbot3 left 01:47 ilbot3 joined 01:48 freezerburnv joined 01:49 holyghost left, pierre left, holyghost joined 01:52 lambd0x left 01:57 pierre joined
vcv Any modules or tricks for pretty printing .gist output? 02:02
02:03 holyghost left 02:04 Leamas joined 02:07 sufrosti1o left, sufrostico left
gfldex vcv: there are 2 modules in the eco system that dump data 02:10
02:19 holyghost joined, Zoffix joined
Zoffix m: class Foo { has $.bar }; say "The code is in {.file} on line {.line}" given Foo.^can('bar')[0]; 02:21
camelia rakudo-moar 4693a5: OUTPUT«concatenate requires a concrete string, but got null␤ in block <unit> at <tmp> line 1␤␤»
Zoffix Is there a way to get where the attribute is defined at? The line and number?
vcv Thanks 02:22
02:30 noganex joined
dalek c: 25ce0e5 | (Aleks-Daniel Jakimenko-Aleksejev)++ | / (3 files):
Minor fixes
02:30
02:32 wamba joined
dalek href="https://modules.perl6.org:">modules.perl6.org: cd7572b | (Zoffix Znet)++ | README.md:
s/browers/browsers/
02:32
href="https://perl6.org:">perl6.org: fa1f145 | (Zoffix Znet)++ | README.md:
s/browers/browsers/
02:33 noganex_ left
gfldex .oO( Did you mean "brewers"? ) 02:34
AlexDaniel m: brewerse 02:35
camelia rakudo-moar 4693a5: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤ brewerse used at line 1. Did you mean 'reverse'?␤␤»
AlexDaniel by the way, this is a good one: 🤦 02:36
Zoffix Well, that's interesting.... 02:45
m: class Foo { has $.bar; method bar('foo') {} }; say "The code is in {.file} on line {.line}" given Foo.^can('bar')[0];
camelia rakudo-moar 4693a5: OUTPUT«The code is in <tmp> on line 1␤»
Zoffix oh :S locally it gives me 'The code is in gen/moar/m-CORE.setting on line 587' 02:46
Ah 02:47
m: class Foo { has $.bar; multi method bar('foo') {} }; say "The code is in {.file} on line {.line}" given Foo.^can('bar')[0];
camelia rakudo-moar 4693a5: OUTPUT«The code is in gen/moar/m-CORE.setting on line 587␤»
Zoffix m: class Foo { multi method bar('foo') {} }; say "The code is in {.file} on line {.line}" given Foo.^can('bar')[0]; 02:50
camelia rakudo-moar 4693a5: OUTPUT«The code is in gen/moar/m-CORE.setting on line 587␤»
Zoffix 😿
m: class Foo { proto method bar(|) {}; multi method bar('foo') {} }; say "The code is in {.file} on line {.line}" given Foo.^can('bar')[0]; 02:51
camelia rakudo-moar 4693a5: OUTPUT«The code is in <tmp> on line 1␤»
Zoffix m: class Foo { ␤␤multi method bar('foo') {}␤␤␤ multi method bar('meow') {} }; say .^can('bar')[0].cando(\($_, 'meow'))[0].line given Foo 02:53
camelia rakudo-moar 4693a5: OUTPUT«6␤»
Zoffix m: class Foo { has $.bar;␤␤multi method bar('foo') {}␤␤␤ multi method bar('meow') {} }; say .^can('bar')[0].cando(\($_)) given Foo 02:54
camelia rakudo-moar 4693a5: OUTPUT«()␤»
Zoffix m: class Foo { has $.bar }; say Foo.^can('bar')[0]; 02:55
camelia rakudo-moar 4693a5: OUTPUT«bar␤»
Zoffix :/
m: class Foo { ␤␤␤␤has $.bar }; say Foo.^can('bar')[0].cando(\(Foo))[0].line; 02:56
camelia rakudo-moar 4693a5: OUTPUT«1␤»
Zoffix Something is really stinks in this code path.
m: class Foo { has $.bar = 42;␤␤multi method bar('foo') {}␤␤␤ multi method bar('meow') {} }; Foo.new.bar
camelia rakudo-moar 4693a5: OUTPUT«Cannot resolve caller bar(Foo.new(bar => 42): ); none of these signatures match:␤ (Foo $: Str $ where { ... }, *%_)␤ (Foo $: Str $ where { ... }, *%_)␤ in block <unit> at <tmp> line 6␤␤»
Zoffix :/ 02:57
02:59 kid51 joined
Zoffix I guess it sees I provided a `bar` method so it doesn't auto-generate an accessor. 03:01
03:05 canopus left 03:10 TEttinger left 03:11 canopus joined 03:19 avenj joined 03:21 skids left 03:23 canopus left 03:31 khw left, canopus joined 03:33 Leamas left 03:36 wamba left 03:43 kid51 left 04:06 ovibos left 04:07 freezerburnv left
AlexDaniel m: say WHAT ‘.’.IO.absolute 04:28
camelia rakudo-moar 4693a5: OUTPUT«(Str)␤»
AlexDaniel m: say WHAT ‘.’.IO.abspath
camelia rakudo-moar 4693a5: OUTPUT«(Str)␤»
AlexDaniel something is wrong here
committable: releases say WHAT ‘.’.IO.absolute
committable AlexDaniel: ¦«2015.10,2015.11,2015.12,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07,HEAD»: (Str)
AlexDaniel yeah, well… yeah
m: say WHAT ‘.’.IO.relative 04:29
camelia rakudo-moar 4693a5: OUTPUT«(Str)␤»
AlexDaniel m: say WHAT ‘.’.IO.parent
camelia rakudo-moar 4693a5: OUTPUT«(Path)␤»
04:33 BenGoldberg left 04:37 Cabanossi left 04:39 Cabanossi joined 04:41 AlexDaniel left 04:43 cibs left 04:45 cibs joined 04:55 s34n left 05:06 andrzejku joined 05:08 pierre left 05:13 beatdown left 05:15 ShimmerFairy left 05:26 ovibos joined 05:37 ufobat joined 05:56 TEttinger joined
ufobat morning 06:15
06:18 movl joined 06:27 dwarring left 06:35 andrzejku left 06:37 firstdayonthejob joined, leedo left, leedo joined 06:42 firstdayonthejob left 06:45 holyghost_ joined
moritz good moarning 06:49
holyghost_ gm 06:50
06:50 holyghost_ is now known as holyghostoo 06:51 CIAvash joined 06:52 sno left 06:56 sno joined 07:03 RabidGravy joined 07:09 sno left 07:19 darutoko joined 07:44 holyghostoo left 07:46 dakkar joined 07:48 zakharyas joined 07:58 trnh joined 08:02 jonas2 joined 08:08 sno joined 08:10 wbill left 08:15 bjz joined
ufobat my perl6 terminates :/ 08:42
08:42 cooper left
ufobat gist.github.com/ufobat/5a12692130b...17fc7c1eca 08:43
and sometimes segfaults
08:47 margeas joined 08:56 margeas left, marcovorg joined, marcovorg is now known as margeas
ufobat *** Error in `/home/martin/.rakudobrew/moar-2016.07.1/install/bin/moar': double free or corruption (fasttop): 0x00007f23d00c1f10 *** 09:02
09:17 cyphase left 09:18 trnh left 09:20 cyphase joined 09:27 andrewalker joined 09:30 Rawriful joined 09:39 holyghost left 09:40 holyghost joined 09:50 NEveD left 09:53 pierre_ joined, mcmillhj joined 09:56 tbrowder joined 09:58 mcmillhj left 10:05 mcmillhj joined 10:10 mcmillhj left
tbrowder /whois Zoffix 10:14
10:15 labster left
moritz I've often asked myself who I am; I wonder why an IRC server should know 10:18
10:19 mcmillhj joined 10:24 mcmillhj left, cpage_ left
Zoffix heh 10:25
DrForr The shad^opers know. 10:27
10:28 rindolf joined 10:33 mcmillhj joined 10:35 TEttinger left 10:38 araujo joined 10:39 mcmillhj left, araujo left 10:41 kaare_ joined 10:46 mcmillhj joined 10:48 pierre_ left 10:49 pierre_ joined 10:50 mcmillhj left
dalek c: 851909c | (Tom Browder)++ | doc/Language/about.pod6:
Add onfo on this doc and its overview status

Reference *CONTRIBUTING.md* and *S26* as the primary sources of this info.
10:52
10:52 pierre_ left
dalek c: 36a9232 | (Tom Browder)++ | doc/Language/about.pod6:
fix typo
10:53
tbrowder moritz: I was just reading about irc commands, i guess /whois and such don't work here (at least in this entry place in my irc client). What is the most used irc client here I wonder? 10:55
Zoffix Works here. I think you typed / twice, because it's not meant to show up in the channel 10:56
tbrowder I think it's my client.
Zoffix Oh, there's actually a space before it. Type it with / as the very first character 10:57
moritz tbrowder: right, IRC commands typically have to start with a slash, no spaces before it allowed
Zoffix WHOIS is part of the IRC protocol, so I'd be very suspicious of an IRC client that doesn't support it :P
lizmat works fine in Textual :-) 10:58
10:58 rindolf left
tbrowder Okay, that works, another finger fumble trying one-finger typing on an iPad with MS trying to tell me what I'm trying to say... 10:59
11:00 pierre_ joined 11:01 mcmillhj joined 11:03 kid51 joined 11:05 pierre_ left 11:06 mcmillhj left
dalek c: d9ae2fc | (Tom Browder)++ | doc/Language/about.pod6:
some tweaks
11:10
11:27 cooper joined 11:28 jkramer joined
jkramer Ahoy! 11:28
What's the HTTP client module of choice these days for P6? I found a few on modules.perl6.org, but all of them are apparently about to be completely rewritten or don't support HTTPS. 11:30
11:32 cooper left
dalek c: b876885 | (Tom Browder)++ | doc/Language/about.pod6:
change case of HTML for consistency on the page
11:37
11:43 ZoffixMobile joined, NEveD joined
ZoffixMobile jkramer, I use HTTP::UserAgent 11:43
LWP::Simple has a nasty bug in it, rendering it useless. There's HTTP::Tinyish, but it uses 'curl' under the hood and fails if it's not installed. 11:44
And last, but not least, there's Mojo::UserAgent:from<Perl5> 11:45
jkramer I just tested Tinyish, it fails on HTTPS URLs for some reason. Weird that it uses curl, because curl obviously supports https 11:51
timotimo has anybody been using PRE and POST blocks in production code? 11:56
11:59 CIAvash left 12:01 bjz left 12:02 pierre_ joined 12:05 bjz joined 12:07 pierre_ left 12:08 smls joined
[Coke] "moaty nine"++ 12:18
12:18 smls_ joined, smls left 12:20 canopus left, sena_kun joined
tbrowder ref panda and zef: both show LTA msgs when asked to (1) install a module that cannot be found or (2) install a module that is already installed (panda is the more voluble of the two). 12:23
12:24 smls_ is now known as smls 12:25 canopus joined
timotimo %) 12:31
masak tbrowder: sounds like something that could be reported to the github issue queues, perhaps. 12:33
awwaiid I cant' remember and google is failing -- is there a magical var that has the current for loop count? like for @something -> $n { ... var has 1, 2, 3, ... } 12:34
smls awwaiid: Not exactly, but you can use $++ 12:35
yoleaux 2 Aug 2016 17:11Z <TimToady> smls: you can autogen the function directly: my &prod = &prefix:<[*]>; say prod 1..5
2 Aug 2016 17:31Z <TimToady> smls: and the reason we don't have a .product to go with .sum is that .sum can be heavily optimized for huge ranges like sum 1 .. 10¹⁰⁰⁰ whereas heavy use of factorials would probably just cache the sequence from [\*]
ufobat gist.github.com/ufobat/68979f84a48...878436d782 :-)
awwaiid smls: $++ not in docs.perl6.org index :( 12:36
perlpilot m: my @a = "a".."z"; for @a.kv -> $i, $v { say "$i: $v" }
camelia rakudo-moar 1488b3: OUTPUT«0: a␤1: b␤2: c␤3: d␤4: e␤5: f␤6: g␤7: h␤8: i␤9: j␤10: k␤11: l␤12: m␤13: n␤14: o␤15: p␤16: q␤17: r␤18: s␤19: t␤20: u␤21: v␤22: w␤23: x␤24: y␤25: z␤»
smls awwaiid: $ is an implicitly declared state variable. You can use it like any other state variable, e.g. increment it with ++ :)
perlpilot Using .kv is more better though ;) 12:37
awwaiid smls: implicit to what scope?
perlpilot: ah .kv; I kept trying to just do @stuff -> $a, $n but got htem two at a time. forgot about .kv 12:38
12:38 freezerburnv joined
smls awwaiid: Each instance of $ is its "own" scope 12:39
m: for ^5 { say $++; say $++ }
camelia rakudo-moar 1488b3: OUTPUT«0␤0␤1␤1␤2␤2␤3␤3␤4␤4␤»
perlpilot awwaiid: you can also do: my @a = "a".."z"; for @a.pairs -> $p { say "{$p.key}: {$p.value}" }
awwaiid m: for <a b c> -> $a { say "$a - {$++} {$++}" ; for @stuff -> $b { say "inner $b - {$++}" } } # fascinating
camelia rakudo-moar 1488b3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@stuff' is not declared␤at <tmp>:1␤------> 3c> -> $a { say "$a - {$++} {$++}" ; for 7⏏5@stuff -> $b { say "inner $b - {$++}" } ␤»
12:39 itaipu joined
awwaiid m: my @stuff = <a b c>; for @stuff -> $a { say "$a - {$++} {$++}" ; for @stuff -> $b { say "inner $b - {$++}" } } # fascinating 12:39
camelia rakudo-moar 1488b3: OUTPUT«a - 0 0␤inner a - 0␤inner b - 1␤inner c - 2␤b - 1 1␤inner a - 3␤inner b - 4␤inner c - 5␤c - 2 2␤inner a - 6␤inner b - 7␤inner c - 8␤»
12:40 pierre_ joined
awwaiid so implicit to most local block. gotchya 12:40
vcv Having a brain fart here... is there a way to shorten this? @a = sort *<foo>, @a;
jnthn @a .= sort *<foo>
12:41 kent\n left
smls jnthn: Isn;t there a colon missing after 'sort' 12:41
or parens
12:42 kent\n joined, kent\n left, kent\n joined
jnthn ah, yes 12:42
@a .= sort(*<foo>)
vcv ah there it is. i had tried without the parens. thanks! 12:43
12:43 Sgeo__ left 12:44 lichtkind__ joined 12:46 ZoffixMobile left, zakharyas left 12:47 wamba joined 12:48 lichtkind_ left 12:52 zakharyas joined 12:57 sufrostico joined 12:58 AlexDaniel joined 13:05 skids joined
ufobat i am disapointed :( my perl6 segfaults so often :( 13:06
jnthn Have you golfed the problem and reported it? 13:07
ufobat no :-( i dont know how, its a lot of supplies and stuff
jnthn Can you at least write up instructions for how it can be reproduced and file those? :) 13:08
13:08 mcmillhj joined
jnthn That's a starting point for others to be able to golf/solve it 13:08
ufobat there are a couple of github repos involved, all with changes ... *sigh* 13:10
i am playing around with p6w
jnthn, i will try :-) 13:12
jnthn ufobat: OK, thanks.
13:15 margeas left 13:18 santhosh_k joined
ufobat i am afraid that i will add quite a useless bug report :/ 13:19
13:20 santhosh_k left
jkramer What's the name of that P5 module that took a list of words and return "word1, word2, word3 and word4"? 13:20
And what's the easiest way to do that in P6? :)
Found it, Text::Conjunct :) 13:22
moritz would have expected Lingua::EN::Enumeration or something like that 13:24
nine wouldn't be surprised if both existed 13:29
mst and at least one more in a really bizarre namespace ... that will eventually turn out to be better 13:30
nine As long as there's no ::ButMaintained version of it... 13:31
[Coke] tries out 'task' again based on awwaiid's suggestion
::Butt::Maintained 13:32
smls jkramer: This seems to work... gist.github.com/smls/98e28d5c23783...25b6bb1e15
too bad a signature like ($conj, *@words, *$word) is not allowed in Perl 6... 13:34
unmatched} jkramer: the easiest way would be to use the Perl 6 module for it :) modules.perl6.org/dist/Lingua::Conjunction 13:35
moritz [Coke]: unmaintained butts can quickly lead to the proverbial pain in the butt :-) 13:36
jkramer smls: Nice, guess I'll use that then. I was playing with the Z operator to find the most awesome shortest way to do it, but can't come up with something clever that actually works :) 13:37
unmatched}: That's even better cleverer :) 13:38
13:40 ptolemarch joined
AlexDaniel m: say WHAT ‘.’.IO.absolute; say WHAT ‘.’.IO.abspath 13:40
camelia rakudo-moar 1488b3: OUTPUT«(Str)␤(Str)␤»
AlexDaniel can somebody comment on this ↑ ? 13:41
docs claim that .absolute should return a Path object
which is a bit confusing because .abs*path* is possibly a better candidate for that behavior
unmatched} bisect: say WHAT ‘.’.IO.abspath 13:42
bisectable unmatched}: On both starting points (good=2015.12 bad=1488b39) the exit code is 0 and the output is identical as well
unmatched}: Output on both points: (Str)
AlexDaniel but none of these is actually returning a Path, so what's the actual problem?
unmatched} I'd expect IO too, especially since it stringifies to a Str anyway
AlexDaniel is it a documentation bug? Or is it a rakudo bug? And if that's the problem with rakudo, what would be the right expected behavior?
unmatched} Unless I'm misremembering, I think there was a conversation on this topic, and the argument was that internally the first result would be a Str, so that's returned and if the user wants an IO, they'd call .IO. Returning an .IO would require turning the .Str to .IO and if the user wanted a Str, there'd be this unwanted shuffling between Str -> IO -> Str. 13:44
moritz then the docs should be updated
AlexDaniel there are some tests that do 「.absolute.IO」, which *maybe* means that indeed it should be a Str… couldn't find any tetst for .abspath :(
tests*
moritz I dimly recall that the return type changed at some point
tbrowder masak: WILCO 13:45
AlexDaniel committable: releases say WHAT ‘.’.IO.abspath
committable AlexDaniel: ¦«2015.10,2015.11,2015.12,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07,HEAD»: (Str)
AlexDaniel committable: releases say WHAT ‘.’.IO.absolute
committable AlexDaniel: ¦«2015.10,2015.11,2015.12,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07,HEAD»: (Str)
AlexDaniel unmatched}: interestingly, the way I stumbled upon this is because I had somethisg like this in the code: ‘…’.IO.abspath.IO 13:48
this .IO….IO looked weird, so I started looking for alternatives
after all, it is a bit weird to have two methods that return exactly the same thing 13:51
unmatched} Yeah, that's LTA and the returned type can be argued both ways.
I actually see I've tacked on a spurious .IO call on a return value of a .child due to this issue. 13:52
(in one of my recent codes)
benchable: for ^10000 { my $x = "foo".IO } 13:53
benchable unmatched}: ¦«for»:Cannot find this revision
unmatched} benchable: HEAD for ^10000 { my $x = "foo".IO } 13:54
benchable unmatched}: ¦«HEAD»:0.2336
unmatched} benchable: HEAD for ^10000 { my $x = "foo".IO.Str }
benchable unmatched}: ¦«HEAD»:0.2350
smls unmatched}: "internally the first result would be a Str" -- wouldn't that be true for all IO functions?
tbrowder mazak: issue was already there for panda, new issue filed for zef
unmatched} If there were voting, I'd vote for all such methods to return an IO::Path rather than a plain string
smls Seems like a dubious reason to avoid returning an IO in this one case.
yeah, what unmatched} said. 13:55
perlpilot unmatched}: I would vote the same
AlexDaniel m: ‘test’.IO.abspath.say
camelia rakudo-moar 1488b3: OUTPUT«/home/camelia/test␤»
AlexDaniel m: ‘-test’.IO.abspath.say 13:56
camelia rakudo-moar 1488b3: OUTPUT«␤»
AlexDaniel what the f
m: ‘-test’.IO.absolute.say
camelia rakudo-moar 1488b3: OUTPUT«␤»
AlexDaniel so .absolute actually calls .abspath
13:57 atta joined
perlpilot AlexDaniel: huh ... there's an explicit check for $!path.starts-with('-') 13:58
smls Why does it not like filenames that starty with dashes?
AlexDaniel perhaps someone wanted to handle ‘-’ specially
and wrote starts-with instead?
OK rakudobugging this, but don't know what to do with .absolute vs .abspath thing 13:59
smls Does it have to do with $*PROGRAM returning "-e".IO in case of oneliners? 14:00
lizmat refrains from commentary
unmatched} wonders how come 14:01
AlexDaniel you can still use ‘./-foo’ to make it work, but come on…
14:01 freezerburnv left
smls AlexDaniel: Yeah, I hope it's a bug and not a "feature", because this is the kind of thing that security exploits are made of. 14:03
perlpilot It's a "feature" that's been there since 2014 when the code read: $!path.substr(0,1) eq '-' instead of using starts-with() 14:06
Still not sure what that's about other than smls's guess.
AlexDaniel perlpilot: the first commit seems to be 5870906, but that's still in 2014, yeah 14:07
also, that's when .absolute was changed to return Str
nine One day I'm gonna have a close look at the newio branch and figure out, what exactly we missed out on. And will probably light a candle.
smls $ mkdir test; cd test; touch -- -a; perl6 -e 'dd dir[0].absolute' 14:08
""
perlpilot smls: aye, that's an unfortunate side-effect 14:09
smls perlpilot: I had hoped that maybe at least dir() is aware of it and produces "./-e".IO, but no. 14:14
14:15 freezerburnv joined
smls If this isn't fixed, I forsee it'll become an attack vector against server applications etc. written in Perl 6... :( 14:15
14:19 NEveD left, freezerburnv left
AlexDaniel #128840 14:20
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128840
AlexDaniel by the way, does text/html bug reports work OK for everyone?
ufobat jnthn, rt.perl.org/Public/Bug/Display.html?id=128839 14:21
AlexDaniel ufobat++
14:23 hcit joined
unmatched} AlexDaniel: looks fine on my box 14:23
14:24 hcit left
AlexDaniel by the way, maybe it's not too bad because ‘’.IO is not valid 14:30
ugexe .absolute will always give the absolute path while .Str will give the path that the path was originally created with. And .abspath is not documented
AlexDaniel ugexe: docs.perl6.org/type/IO$COLON$COLON...od_abspath
ugexe ah i meant speculations. see github.com/rakudo/rakudo/pull/666 14:33
14:33 nightfrog left 14:35 margeas joined 14:36 rindolf joined
smls what kind of URL is "type/IO$COLON$COLONPath" o.O 14:37
AlexDaniel rt.perl.org/Ticket/Display.html?id=126262
14:38 margeas is now known as vittooz
AlexDaniel ok, given that there's a pull request #666 and also a bug report, not going to submit anything. 14:39
unmatched} smls: docs.perl6.org/type/IO::Path#method_abspath also works :)
smls: as for the reason for the URL being so colonically-inclined, it's a side effect of making files not contain any special characters.
(so they don't conflict on the server side, since they're all just static files on disk) 14:40
[Coke] : is technically reserved or somehow not allowed.
lizmat AlexDaniel: github.com/rakudo/rakudo/commit/02fdcf9a1f
unmatched} : can't be used in filenames on Windows and I think linux uses them as PATH separators too 14:41
AlexDaniel lizmat: that was quick. Thanks!
[Coke] (er, my comment was for URLs). but filenames, also, yes, can be problematic. 14:42
lizmat afk&
14:45 cdg joined
ugexe the one thing i would have liked most from newio was IO::Huh 14:56
14:56 RabidGravy left 15:02 wamba left 15:06 benchable left 15:08 benchable joined, pierre_ left 15:09 salva_ left 15:10 BrassLantern joined, BrassLantern left, BrassLantern joined 15:15 RabidGravy joined
jkramer docs.perl6.org/language/operators#prefix_temp - can anyone explain what is true? > "temporizes" the variable passed as the argument, which means it is reset to its old value on scope exit. (This is similar to the local operator in Perl 5, except that temp does not reset the value). 15:18
Does it reset or not? :)
And if not, what's the point of it?
15:19 cdg left
unmatched} jkramer: my $x = "foo"; { temp $x; say $x; $x = "bar"; say $x }; say $x; in P6 will print "foo bar foo", but when using local in P5 it'll print "[uninitialized variable warning] bar foo" 15:19
jnthn m: my $a = 42; { temp $a; say $a; $a++; say $a; }; say $a
camelia rakudo-moar 02fdcf: OUTPUT«42␤43␤42␤»
jnthn And then what unmatched} said :) 15:20
unmatched} It's reset *to old value* when scope is left, but unlike P5, it's NOT reset to an undefined value inside the scope
15:20 cdg joined
jkramer Ah, I get it. Thanks! 15:20
gfldex the reference to P5 doesn't belong there 15:21
jast it could probably be clarified apart from that
unmatched} jkramer: feel free to improve it by submitting a PR:
jkramer: github.com/perl6/doc/blob/master/d...pod6#L1112
gfldex: agreed
All P5 references should be confined to 5to6 guides IMO 15:22
jast actually I guess it's clear enough if you simply remove the remark about P5
jkramer jast: Agreed, that was the only confusing part about it really :) 15:23
jast minor clarification about exactly what old value it is reset to might be good (value at the time the variable is temporized, presumably)
AlexDaniel unmatched}: I agree
jast m: my $a = 42; { $a++; temp $a; $a++; say $a; }; say $a 15:24
camelia rakudo-moar 02fdcf: OUTPUT«44␤43␤»
AlexDaniel hm, how many references to other languages are there?
15:24 cdg left
AlexDaniel possibly none 15:25
15:26 acrussell joined 15:31 nightfrog joined 15:39 mspo joined
Xliff .tell FROGGS all tests in 07dtd now pass. Thanks! 15:43
yoleaux Xliff: I'll pass your message to FROGGS.
15:45 NEveD joined 15:50 cdg joined
unmatched} star: say .parts.join.split("g")[*-1] // .Str given $*PERL.compiler.version 15:51
camelia star-m 2016.04: OUTPUT«20164␤»
unmatched} Oh... never mind. I was about to ask a question, but then realized where my mistake is at :) 15:52
gregf_ m: say $*PERL.compiler.version
camelia rakudo-moar 02fdcf: OUTPUT«v2016.07.1.126.g.02.fdcf.9␤»
gregf_ m: say .split("-").map(&tclc) given "foo-bar-baz" 15:53
camelia rakudo-moar 02fdcf: OUTPUT«(Foo Bar Baz)␤»
unmatched} m: say .Str ~~ /"g"/ ?? .parts.join.split("g")[*-1] !! .Str given $*PERL.compiler.version 15:56
camelia rakudo-moar 02fdcf: OUTPUT«2fdcf9␤»
unmatched} star: say .Str ~~ /"g"/ ?? .parts.join.split("g")[*-1] !! .Str given $*PERL.compiler.version
camelia star-m 2016.04: OUTPUT«2016.04␤»
unmatched} (that's what I was going for, if anyone was curious; the commit or tag for the currently running Rakudo build)
15:57 nightfrog left, nightfrog joined 16:03 mcmillhj left 16:14 cdg left
AlexDaniel is there any way to tweak the priority of a multi? 16:15
psch what does "priority" mean there?
hahainternet here's a stupid question, i'm designing a litte storage class (actually in Go but that's besides the point) and i'd like a way to key items that isn't a string, but is as close to a string as possible. ie a ruby symbol 16:16
unmatched} Move it in the source
hahainternet that way it cannot trivially be mistaken for a string 16:17
i see on the perl6 from ruby page that colon pair syntax is a 'workaround' for this behaviour
but is there anything nicer?
unmatched} m: multi foo ($ where * < 10) { say "meow" }; multi foo ($ where * < 100) { say "moo" }; foo 9 16:18
camelia rakudo-moar 02fdcf: OUTPUT«meow␤»
unmatched} m: multi foo ($ where * < 100) { say "moo" }; multi foo ($ where * < 10) { say "meow" }; foo 9
camelia rakudo-moar 02fdcf: OUTPUT«moo␤»
unmatched} hahainternet: "actually in Go".... 16:19
hahainternet heh that's a very nice compromise, and i assume lexical declarations will overtake globals?
unmatched} presses the "Flamewar" button
hahainternet unmatched}: i write it for my day job
unmatched} Traitor! :P
hahainternet but just in case anyone asked for code samples
go has no symbols, nor any succinct way of creating a non string stringy thing
so, whenever i come across a scenario like this i turn to perl6 and usually find it solved elegantly and succinctly 16:20
unmatched} hahainternet: not sure what you're asking my multis above were an example related to AlexDaniel's question.
hahainternet unmatched}: i know, see my question above your replies :) 16:21
16:21 NEveD left
psch hahainternet: fwiw, the thing we use keys most for in perl6 is hashes, which coerce their keys to Str 16:21
hahainternet: having non-Str keys is what takes extra work
hahainternet psch: oh i didn't even realise they were coerced
unmatched} hahainternet: sure, but wouldn't the folks in #go-lang know more about how to solve it? The Perl 6 way is to parametarize the hash to not Str its keys, but I'm unsure how that can be translated into Go 16:22
psch m: sub f { }; my %h; %h{&f} = "foo"; say %h.keys
camelia rakudo-moar 02fdcf: OUTPUT«Sub object coerced to string (please use .gist or .perl to do that) in block <unit> at <tmp> line 1␤(f)␤»
hahainternet unmatched}: oh i already know the answer in Go
psch hahainternet: see the warning :)
hahainternet psch: so is there an easy non string keyed hash declaration?
psch m: sub f { }; my %h; %h{&f} = "foo"; # just to prove its not the enumeration
camelia rakudo-moar 02fdcf: OUTPUT«Sub object coerced to string (please use .gist or .perl to do that) in block <unit> at <tmp> line 1␤»
psch m: my %h{Any}; sub f { }; %h{&f} = "foo"; 16:23
camelia ( no output )
psch hahainternet: FSDO "easy"
16:23 dakkar left
unmatched} m: my %hash{Any}; %hash{&say} = 'tis a say sub'; say %hash.keys; say %hash{&say} 16:23
camelia rakudo-moar 02fdcf: OUTPUT«(sub say (| is raw) { #`(Sub|71440392) ... })␤tis a say sub␤»
hahainternet haha no i get Any, but the question is more about what's the stringiest but non string type in perl6
psch hahainternet: the RHS-y way is :{}
m: say Stringy
camelia rakudo-moar 02fdcf: OUTPUT«(Stringy)␤»
hahainternet i guess that wasn't clear from my previous question sorry
psch ...probably?
hahainternet i'd imagine that matches a string though 16:24
16:24 NEveD joined
psch m: say 5 ~~ Stringy 16:24
camelia rakudo-moar 02fdcf: OUTPUT«False␤»
psch m: say "5" ~~ Stringy
camelia rakudo-moar 02fdcf: OUTPUT«True␤»
psch well, Str are Stringy..?
hahainternet i'm looking for something that is not
psch m: say Stringy.^mro
camelia rakudo-moar 02fdcf: OUTPUT«Method 'mro' not found for invocant of class 'Perl6::Metamodel::ParametricRoleGroupHOW'␤ in block <unit> at <tmp> line 1␤␤»
hahainternet a symbol and a string in ruby are distinct
i mean obviously this is doable a billion different ways with a few characters 16:25
but that's no fun
16:25 MilkmanDan left
psch afaik symbols in perl6 are Str keys that point to (some type of) container in a Stash 16:25
m: say CORE::.WHAT
camelia rakudo-moar 02fdcf: OUTPUT«(PseudoStash)␤»
psch m: say CORE::<&say>.key
camelia rakudo-moar 02fdcf: OUTPUT«Method 'key' not found for invocant of class 'Sub'␤ in block <unit> at <tmp> line 1␤␤»
psch m: say CORE::.keys
camelia rakudo-moar 02fdcf: OUTPUT«(SIGSEGV WhateverCode Slip &callframe Pair SIGHUP &flat &RETURN-LIST utf8 &infix:<∖> CurrentThreadScheduler PromiseStatus StringyEnumeration Distribution &splice &postcircumfix:<{ }> &callsame &GATHER Backtrace PF_INET6 &sinh &infix:<lt> &print &asech NF…» 16:26
psch m: say CORE::.keys[0].WHAT
camelia rakudo-moar 02fdcf: OUTPUT«(Str)␤»
16:26 MilkmanDan joined, zacts joined
psch so what i guess the difference between symbols and strings is in ruby is solved by parser state in perl6 16:26
hahainternet in pseudocode: my %h{Symbol-like-type}; %hash{:symbol-syntax}; %hash<whatever> # <-- compile time error (ideally) 16:27
psch well, plus some workarounds, like ."foo"()
hahainternet also wow i went from %h to %hash, i'm tired 16:28
psch maybe enums fit that symbol-like-type..?
hahainternet yeah an enum would be fine, just requires declaration ahead of time i think 16:29
enums-on-demand i guess
psch you can also type a hash to a specific type and use subtypes as key i suppose
16:29 NEveD left
hahainternet or the pair hack on the ruby to perl6 wiki page, but that's just a hack 16:29
psch although that's probably a slightly different direction that the original intent
hahainternet psch: oh sure, but my question is really all about succinctness 16:30
how to do it in the fewest characters
strikes me as a particularly nice feature in ruby, i initially hated it
but now see its appeal
course i bet ruby doesn't catch it at compile time but i may be wrong
16:30 sufrostico left
psch m: my %h{Pair}; %h{:foo} = 1; say %h.perl; %h<foo> # well, the syntax works :P 16:33
camelia rakudo-moar 02fdcf: OUTPUT«(my Any %{Pair} = (:foo) => 1)␤Type check failed in binding to key; expected Pair but got Str ("foo")␤ in block <unit> at <tmp> line 1␤␤»
psch it's not compile time though, but that seems to be a thing we general don't do
harmil_wk oh hey, should I be rakudobugging that file/line issue on Int.^methods from yesterday? I can't recall if that was something folks wanted. 16:34
unmatched} harmil_wk: I'd say no. I'm currently writing a blog post on the topic and will release a module that makes stuff like that easier 16:35
Probably will be done today.
harmil_wk: it'd be: .sourcery.say for Int.^methods;
And it'll give you correct file/location of actual Rakudo source files along with a link to GitHub 16:36
AlexDaniel m: class Foo { multi method foo ($ where * < 10) { say "meow" } }; class Bar is Foo { multi method foo ($ where * < 100) { say "moo" } }; Bar.new.foo(5) 16:37
camelia rakudo-moar 02fdcf: OUTPUT«moo␤»
AlexDaniel unmatched}: how can I move it here?
harmil_wk Hmm... is post-processing really the right approach? Then, to find out where my stuff is defined I look at MyClass.^methods, but for core stuff (well, some core stuff) I need a module?
unmatched} harmil_wk: not exactly. For core stuff you *do* get the correct location where the stuff is defined, it's just not too useful if you want to *develop* rakudo and I see no issues with using a module as a helper feature for core development rather than returning false information for core subs 16:38
AlexDaniel: no idea. There's actually a ticket from Ovid on the topic.
unmatched} tries to find it
buggable: rt
buggable unmatched}, TOTAL: 1364, UNTAGGED: 615, BUG: 417, LTA: 94, JVM: 62, NYI: 32, SEGV: 28, RFC: 26, UNI: 25, PERF: 19, POD: 14, CONC: 11, @LARRY: 10, TODO: 9, PRECOMP: 8, GLR: 6, BUILD: 5, STAR: 4, WEIRD: 3, MOARVM: 2, OSX: 2, CPP: 1, SPEC: 1, LIST: 1, LHF: 1, SPESH: 1, DOCS: 1, NATIVECALL: 1 Details: bug.perl6.party/1470328748.html 16:39
AlexDaniel unmatched}: by the way, this question is related to IRC::Client. I can't get “help” command to work in bisectable because bisectable treats it like a source to execute
unmatched}: of course I can change the regex to ignore [help|source|url]‘?’? but that's a bit LTA 16:40
unmatched} AlexDaniel: there, placing it first in the source should work. 16:41
harmil_wk unmatched}: Well, I don't know what your module does, so I can't really speak in an informed way. It just feels like when as user wants to know, "hey, how exactly is this defined," it's logical to expect that they get that answer the same way for Int as for MyClass.
unmatched} In buggable I did a whole new plugin for such stuff
AlexDaniel unmatched}: well, not really, because “help” is in the base class, and bisectable itself is a subclass
16:42 avenj left
unmatched} harmil_wk: but that's my point, they *do* get that answer right now. The `.line` and `.number` aren't bogus for Int.^methods, they point to the actual, existing, and correct location in the setting file. 16:42
AlexDaniel maybe that's not how it should be, I'm not sure now. But it worked great until I stumbled upon this
unmatched} That's really a Perl 6 limitation and I think an area that should be more defined and maybe more featureful 16:43
AlexDaniel hm
unmatched} (I can't find the ticket on the ticket page, but searching for tickets from Ovid will give it)
16:44 smls left
unmatched} m: "{&say.file}:{&say.line}".say; 16:44
camelia rakudo-moar 02fdcf: OUTPUT«gen/moar/m-CORE.setting:29424␤»
16:44 cooper joined
unmatched} harmil_wk: ^ so here, if you open m-CORE.setting file on line 29424 you'll find the definition for sub `say`, but if we instead return src/core/io_operators.pm:17, that location does not refer to any actual files or line numbers on user's disc. It refers to the location in Rakudo's source and the user would have to obtain that source *at the correct commit* to view the definition. I can't see the rationale for 16:45
doing so.
AlexDaniel: here: rt.perl.org/Ticket/Display.html?id=123577 16:47
Though I don't think what he argues for is possible. We can't know which where {} is more specific in cases like * < 100 vs * < 10 given 9 16:48
So the simplest solution is like now, to go by source position. This creates an edge case where we don't know what the source position is, so... 16:49
harmil_wk unmatched}: isn't that a bit like saying, "it points to the correct post-C-preprocessor pile of unreadable mash that your program got turned into" when working in C? I'll grant that m-CORE.setting is much more readable than most post-C-preprocessor droppings, but still...
unmatched} refrains from proposing any possibly-stupid ideas here
ilmari harmil_wk: that's why the c preprocessor inserts #line directives, so that error messages refer to the input files
AlexDaniel unmatched}: thanks
16:49 pierre_ joined
jnthn Maybe for CORE.setting we simply should not show line numbers unless some I'm-a-Rakudo-developer environment flag is set. Then people can't be confused by them. :P 16:50
unmatched} harmil_wk: I don't care about C. m-CORE.setting is nothing more than @all-source-files.join("#line 1 $_.filename"), so the readability argument is a poor one.
I rather have the location in a 40,000-line file than just an essentially random filename I'd have trouble locating. 16:51
And that argument assumes there isn't a CoreHackers::Sourcery that can give you all the nice details, which there will be tonight :)
harmil_wk In fact, settings already has directives like "#line 1 src/core/core_prologue.pm" so really the work is done on the generation side, we just need $?FILE and $?LINE to play ball. 16:52
AlexDaniel yeah, I also don't think that it is possible. But 123577++ anyway because it raises some very good questions 16:53
unmatched} harmil_wk: play ball how? What will you be doing exactly with those $?FILE and $?LINE?
16:53 wamba joined, mcmillhj joined
harmil_wk unmatched}: let me see if I can dredge up the perl6-language list discussion about this. I think it will be illustrative. We've been around this particular mulberry bush a few times in the past. 16:54
unmatched} harmil_wk: those $?FILE and $?LINE don't refer to any specific entitiy. You need the commit number or the tag for the specific Rakudo build that generated those $?FILE and $?LINE and even when you do have that commit number, you have to obtain the source code at that specific commit, for the information contained in those variables to be of any use. 16:55
By comparison, the current .line and .file do refer to the actual source code
[Coke] unmatched}: where is the code for buggable? 16:56
unmatched} buggable: source
buggable unmatched}, See: github.com/zoffixznet/perl6-buggable
harmil_wk unmatched}: I'm not sure why you're talking about source control, here. I thought we were talking about files, not version control metadata. My copy of rakudo might be in CVS source control...
16:56 pierre_ left
harmil_wk rushes to hide his CVS checked out copy of rakudo under some books... 16:56
unmatched} :)
16:57 cooper left
unmatched} harmil_wk: OK. Then what file would $?FILE refer to? 16:57
For example, for &.say
My module gives me src/core/io_operators.pm, line 20, at commit c843682 and if I combine those three bits of info, I get the actual entity and indeed that's the definition of sub say() for the current compiler I'm running on: github.com/rakudo/rakudo/blob/c843...ors.pm#L20 16:58
16:59 Actualeyes left
unmatched} If I run {say "{.file}:{.line}" given &say}, it gives me gen/moar/m-CORE.setting:28036 and indeed, if I open that file, I get the location of where the sub say() is defined. 16:59
harmil_wk I'm having trouble finding the conversation. I have a vague memory it was in the mid 2000s, but I think the idea was that $?FILE and $?LINE should be settable lexically so that you can describe where the Perl 6 you're currently parsing was generated from. Then each subsequent line should increase $?LINE. This is almost exactly what the CPP does, but it uses comments.
As far as things like commits... I think that's a great place for a module to come into play 17:00
unmatched} harmil_wk: sure, that's probably doable, but I my point is that were it done, the information contained in $?FILE $?LINE would be somewhat useless.
17:00 cooper joined
harmil_wk unmatched}: If it seemed like I was saying that your module wasn't worth writing, I'm absolutely not. I think it's great. You want more metadata, and that's wonderful. 17:01
unmatched} And that's why I'm talking about commits. You need to know which commit the setting was compiled from to make sense of what such $?FILE and $?LINE are talking about
harmil_wk: no, that's not how I interpreted it.
As I've said, even without the module, I feel that changing Rakudo to give original source locations rather than setting location for core subs would provide less information than we currently do. 17:03
And would introduce the inconsistency for .file and .line's behaviour 17:04
unmatched} leaves to do $work
17:05 hankache joined
hankache hola #perl6 17:05
AlexDaniel o/ 17:06
17:09 kalkin-_ is now known as kalkin- 17:10 PapaChub joined 17:13 spider-mario joined 17:24 mohae joined 17:26 mohae_ left 17:27 dsp-_ joined 17:28 dsp- left 17:33 setty1 joined 17:34 Fleurety left 17:41 Fleurety joined
dalek c: a92017a | nsvedberg++ | doc/Language/nativecall.pod6:
Change 'mayor' to 'major' in my_version pointers example
17:43
c: 6d12e31 | (Aleks-Daniel Jakimenko-Aleksejev)++ | doc/Language/nativecall.pod6:
Merge pull request #795 from nsvedberg/nativecall-typo-fix

Change 'mayor' to 'major' in my_version pointers example
unmatched} harmil_wk: one thing I'm thinking is for .file/.line on core stuff to return an object that stringifies to settings.file/line, but has properties that refer to the original file/line (including the commit). That's just thoughts on the interface; I've no idea what sort of implementation/performance details we're looking at 17:44
m: &say.file.^name.say
camelia rakudo-moar 02fdcf: OUTPUT«Str␤»
unmatched} Another contender for returning IO::Path rather than plain Str ^
m: use Test; &is.file.say 17:45
camelia rakudo-moar 02fdcf: OUTPUT«perl#sources/C712FE6969F786C9380D643DF17E85D06868219E (Test)␤»
unmatched} hm.... or maybe not
17:46 cdg joined 17:47 labster joined
unmatched} (keeping in mind the location in original sources is different from offset from `#line 1 src/core/foo.pm6` line, due to backend-specific clauses and stripped comments) 17:47
17:47 vittooz left
[Coke] don't we have the rakudo tag in the compiler version? 17:47
unmatched} Yeah 17:50
m: my $where = .Str ~~ /g/ ?? .parts.join.split("g")[*-1] !! .Str given $*PERL.compiler.version;
camelia ( no output )
unmatched} m: say .Str ~~ /g/ ?? .parts.join.split("g")[*-1] !! .Str given $*PERL.compiler.version;
camelia rakudo-moar 02fdcf: OUTPUT«2fdcf9␤»
unmatched} star: say .Str ~~ /g/ ?? .parts.join.split("g")[*-1] !! .Str given $*PERL.compiler.version;
camelia star-m 2016.04: OUTPUT«2016.04␤»
17:59 sno left, acrussell left, webstrand left 18:00 firstdayonthejob joined 18:12 AlexDaniel left 18:14 lostinfog joined 18:16 khw joined 18:17 webstrand joined 18:20 jonas2 left 18:28 FROGGS joined
harmil_wk unmatched}: sounds reasonable 18:30
18:34 AndyBotwin joined, acrussell joined, AndyBotwin left
grondilu m: say $*PROGRAM 18:36
camelia rakudo-moar 02fdcf: OUTPUT«"<tmp>".IO␤»
18:38 avenj joined
moritz note that camelia fudges the name of tempfiles in output 18:43
18:52 shlomif joined, sno joined 18:53 rindolf left 18:56 shlomif is now known as rindolf 18:57 sno left 18:59 zacts left 19:09 sno joined
dalek c: 82a3be5 | (Jan-Olof Hendig)++ | doc/Type/Setty.pod6:
Added docs for Setty.Bag
19:11
19:14 darutoko left 19:18 sjoshi joined 19:23 stv joined 19:24 zakharyas left 19:25 stv left
unmatched} downloads the sound of a pin dropping 19:32
19:34 sjoshi left
dalek c: f50b20a | (Jan-Olof Hendig)++ | doc/Type/Setty.pod6:
Added docs for Setty.BagHash
19:37
c: 40d8a1e | coke++ | doc/Language/about.pod6:
use nbsp
19:49
19:54 rindolf left 20:02 kaare_ left, mcmillhj left 20:15 khw left 20:17 acrussell left 20:18 AngeloMichael joined 20:20 zakharyas joined 20:23 skids left 20:24 skids joined 20:27 xfix joined 20:28 FROGGS left 20:29 rindolf joined 20:30 khw joined 20:39 espadrine joined 20:44 Khisanth left 20:48 Zoffix left, rindolf left 20:54 ufobat left 20:57 rindolf joined, Khisanth joined 21:02 mcmillhj joined, zakharyas left 21:04 _28_ria joined 21:07 vittooz joined, rindolf left
RabidGravy ha, DARPA project called CAMELIA www.defenseone.com/technology/2016/...it/130488/ 21:08
hankache ha!
21:12 rindolf joined 21:13 skids left, mcmillhj left, sufrostico joined
Xliff m: $*PERL.compiler.version.say 21:17
camelia rakudo-moar 02fdcf: OUTPUT«v2016.07.1.126.g.02.fdcf.9␤»
Xliff star: $*PERL.compiler.version.say 21:19
camelia star-m 2016.04: OUTPUT«v2016.04␤»
21:21 vittooz left, vittooz joined 21:23 itaipu left 21:25 margeas joined 21:26 vittooz left 21:29 PapaChub left 21:36 cdg left 21:40 itaipu joined, margeas left 21:44 margeas joined 21:46 tbrowder left 21:47 NEveD joined, lostinfog left 21:49 margeas left, margeas joined 21:54 hankache left 21:57 wamba left 21:58 PapaChub joined 22:01 Sgeo__ joined 22:10 cdg joined 22:13 BrassLantern left 22:15 cdg left 22:19 TEttinger joined 22:20 ptolemarch left 22:27 Zoffix joined 22:29 firstdayonthejob left, sufrostico left 22:30 freezerburnv joined 22:31 skids joined 22:38 RabidGravy left 22:47 spider-mario left 22:49 labster left 22:52 labster joined 23:13 kurahaupo joined 23:14 rindolf left 23:23 sufrostico joined 23:36 pierre_ joined 23:38 freezerburnv left, pierre_ left 23:47 freezerburnv joined 23:50 BenGoldberg joined 23:53 espadrine left 23:57 pierre_ joined