»ö« 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.
tailgate m: gist.github.com/ahalbert/42668ccb1...969cffc88f 01:39
camelia ( no output )
tailgate The problem I'm having is that when the multi method visit($node), there are items in $node.content, but nothing gets output 01:41
iBakeCake tailgate: so nothing hits that multi then? 02:12
tailgate: what are you expecting it to receive? I see you already got one for Str and for Pod stuff
tailgate no, if you print $node it'll run it 02:13
m: gist.github.com/ahalbert/42668ccb1...969cffc88f
camelia rakudo-moar 8d357a: OUTPUT«Pod::Block::Para␤ The use of ␤ Pod::FormattingCode{:type("A")}␤ PME␤ is subject to the terms and conditions laid out by ␤ Pod::FormattingCode{:type("A")}␤ VENDOR␤ , as specified at ␤ Pod::FormattingCode{:type("A")}␤ TERMS_…»
tailgate it's only in $node.contents.map that nothing happens 02:14
iBakeCake tailgate: what output are you expecting?
tailgate it'll say each item in $node.contents
iBakeCake tailgate: what version of perl you got? There was a laziness bug with .mapo
semi-recently 02:15
tailgate This is Rakudo version 2016.07.1 built on MoarVM version 2016.07
iBakeCake tailgate: I get this output when I run it: gist.github.com/zoffixznet/b51b420...f8809ec14a
tailgate implementing Perl 6.c.
Oh, it's not being run in doc mode
m: gist.github.com/ahalbert/42668ccb1...969cffc88f 02:16
camelia rakudo-moar 8d357a: OUTPUT«[The use of Pod::FormattingCode{:type("A")}␤ PME␤ is subject to the terms and conditions laid out by Pod::FormattingCode{:type("A")}␤ VENDOR␤ , as specified at Pod::FormattingCode{:type("A")}␤ TERMS_URL␤ .]␤»
tailgate so, it's clear there's an array there 02:17
iBakeCake OK
tailgate: just use a proper for loop or put eager before the map
m: gist.github.com/zoffixznet/8863849...f33dd050c8 02:18
camelia rakudo-moar 8d357a: OUTPUT«The use of ␤Pod::FormattingCode{:type("A")}␤ PME␤␤ is subject to the terms and conditions laid out by ␤Pod::FormattingCode{:type("A")}␤ VENDOR␤␤, as specified at ␤Pod::FormattingCode{:type("A")}␤ TERMS_URL␤␤.␤»
iBakeCake m: gist.github.com/zoffixznet/bd00805...34e355004a 02:19
camelia rakudo-moar 8d357a: OUTPUT«The use of ␤Pod::FormattingCode{:type("A")}␤ PME␤␤ is subject to the terms and conditions laid out by ␤Pod::FormattingCode{:type("A")}␤ VENDOR␤␤, as specified at ␤Pod::FormattingCode{:type("A")}␤ TERMS_URL␤␤.␤»
iBakeCake tailgate: map returns a lazy list and I'm guessing whatever receives the return value of visit doesn't make it eager
iBakeCake returns to murdering Terrans
For the swarm!
:}
tailgate iBakeCake: what would be the best workaround then? 02:20
iBakeCake tailgate: I'd use a for loop
tailgate =)
thanks
iBakeCake tailgate: map is to translate a list of values into a different list, so it's weird to use it just for side effects (even though internally for {} loops get converted into maps) 02:21
nadim good morning P6 09:24
yoleaux 12 Oct 2016 07:00Z <nine> nadim: no progress in the last couple of weeks. Have been side tracked by work on Inline::Perl5
tbrowder hi, nadim 11:31
masak hi, #perl6 11:56
moritz \o 11:57
[ptc] o/ 12:12
hahainternet it was mentioned yesterday that when testing a bool via given/when, you can use :so and :not, but are these adverbs? if so, what are they being passed to? smartmatch? also is there a nice way to find this out via the repl? i've not played much with introspection / dispatch etc 12:15
moritz hahainternet: yes, they are adverbs, and simply create a pair 12:16
m: dd (:so)
camelia rakudo-moar e0619f: OUTPUT«:so␤»
moritz m: say (:so).^name
camelia rakudo-moar e0619f: OUTPUT«Pair␤»
moritz hahainternet: and given/when smartmaches 12:16
RabidGravy boom! 12:17
moritz hahainternet: so now you can look into the smartmatch table, and see what smart-matching agains a Pair does
hahainternet aah ok, that makes sense
RabidGravy ptc++ # nice one on the PRs for the travis configurations :)
moritz (hint: it's pretty crazy or ingenious, depending on how you see it)
hahainternet moritz: is there a nice table somewhere, or you mean in the source? 12:18
moritz hahainternet: S03 has a table; maybe doc.perl6.org too
design.perl6.org/S03.html#Smart_matching 12:19
hahainternet yeah i'm there, so in this case it'd be testing the attribute, that makes sense 12:19
moritz actually it just calls the method of the same name 12:20
(because attributes are exposed through methods)
sammers_ hello perl6 12:48
moritz hi sammers_ 12:50
sammers_ hi moritz 12:51
moritz oh no, not another kernel security update in Debian... :( 12:52
sammers_ is there a way to capture or group with subst and use the match in as part of the replacement? 13:01
something like this: say '11 : 11 : 11 ; 11'.subst(/ \s? (<[:;]>) \s? /, $0, :g); 13:02
sammers_ where I want to replace the match, including the spaces, with the character (either ; or :) that matched. 13:03
iBakeCake m: '11 : 11 : 11 ; 11'.subst(/ \s? (<[:;]>) \s? /, -> { $0 }, :g).say 13:05
camelia rakudo-moar e0619f: OUTPUT«11:11:11;11␤»
sammers_ ah 13:06
that is great
I will bake you a cake 13:07
colomon o/ 13:44
Where does panda install bin scripts these days? I don’t seem to be getting them in .rakudobrew/bin any more. 13:45
timotimo you need to "rakudobrew rehash" to get them 13:46
the stuff in rakudobrew/bin is just scripts that rakudobrew keeps updated to point at the right rakudo installation when you switch over, but rakudobrew doesn't get told by panda when there's new stuff
colomon timotimo++ 13:47
simple thing, but having .rakudobrew/bin not working has been a thorn in my side for months. :) 13:50
timotimo the readme of rakudobrew doesn't point that out :\ 13:52
colomon wouldn’t have helped, as I’m not in the habit of reading readmes for tools I have been using successfully for years. :)
moritz I'll submit a pull request anyway
colomon moritz++ 13:53
moritz github.com/tadzik/rakudobrew/pull/105 13:57
my 4th PR this month, so I should get another Hacktoberfest t-shirt this year :-)
it's been surprisingly difficult, because I have direct push access to most repos I contribute to 13:58
moritz oh wait, forgot one I did for $work, so likely at 5 now 13:58
timotimo tbrowder: the readme for perl6 read/write tests doesn't mention you have to manually create the large files before you run the tests :( 14:02
mst moritz: do within-repo PRs for code review? 14:03
moritz mst: I would if I wanted the code review; I won't open PRs just to get my count up 14:04
(not saying I generally don't want code review, just not particularly for the changes I did this month)
mst moritz: I often do informal reviews via IRC, so it occurred to me maybe you had the same; ah well 14:06
moritz mst: I do; mostly I ask for them if I feel uncertain about some decisions in the patch 14:09
mst moritz: just thinking during this period moving said informal reviews to PRs might work 14:10
never mind
moritz never minds 14:11
mst sometimes I feel like we end up actually agreeing but with slightly different phrasing and both being too polite to break the impasse
(you because you're naturally polite, me because I turn my emulation layer on in here, obv. ;)
moritz mst: I think we often agree in spirit, but come to different conclusions 14:13
colomon woah, Math::Polynomial has some severe bitrot 14:14
colomon rolls up sleeves to fix
colomon … or I was just testing .bak files fixed in a previous iteration. 14:16
colomon how do I convert a Num to a num64? my old code was num.new($a.Num) — it seems like that’s working, but it also seems less than fully correct? 14:23
moritz m: say my num64 $ = 42e0 14:25
camelia rakudo-moar e0619f: OUTPUT«42␤»
colomon moritz: you reckon that’s it? so my calls should be something like erfc(my num64 $ = $a.Num) ? 14:27
moritz colomon: how is erfc declared? 14:31
colomon moritz: erfc(num64) returns num64 is native(Str) 14:33
timotimo wow, writing an ascii-only string that contains a newline repeatedly to a file is slower when it's :enc<ascii> than when it's the default encoding (utf8) 14:35
or maybe it's inside noise
tbrowder: i'm getting create-large-file.p6 for a 2 G file to run in 1:05 instead of 1:29 when i encode the $str into a buf only once, then .write-ing it instead of .print-ing the string 14:36
colomon afc # helping H with homework 14:38
timotimo tbrowder: if $mul %% 100 { $str = $str x 100 } gets me down to 6.46user 1.03system 0:07.50elapsed 99%CPU with strings 14:40
timotimo my system is having a bit of trouble writing the file faster; it makes my twitch stream i'm watching on the side hang, and it ends up only taking 5% cpu time 14:41
0.57user 4.35system 0:29.12elapsed 16%CPU 14:43
moritz colomon: then I don't think you need an explicit conversion, do you? 14:44
colomon: I mean just calling it with $foo.Num should be enough
timotimo tbrowder: what do you think about these optimizations? should they go in, or are they "cheating"? :) 14:45
timotimo wow, holy hell, somehow the "run-rw-tests.p6" script is able to absolutely trash my vim when scrolling through it 16:26
actually, maybe things are just totally kaput in general? 16:34
andrzejku hello perl6 :) 16:48
RabidGravy erp 17:00
I'm thinking that "--install-suggests" when installing liquidsoap in travis would be a mistake, it seems to bring on the entire kitchen department 17:01
stmuk_ if anyone comes into the channel with odd os x build problems .. they have to type "clang" and agree to Apple's crap after an update
AlexDaniel huh 17:09
bbkr hi. can time() and nqp::time_n() be overwritten globally? 17:18
[ptc] RabidGravy: how did you configure liquidsoap locally? On my box it seems to need some script under /etc/liquidsoap in order to run, and I'm not familiar with it enough to know what to do here 17:20
bbkr i'm looking for P6 equivalent for "*CORE::GLOBAL::time = sub { ... }" in P5 17:21
RabidGravy [ptc], that's odd, if it's started as a daemon I think it does want some script, but the tests for Audio::Liquidsoap actually start it itself with some configuration that allows it to interact 17:23
timotimo bbkr: overriding nqp::time_n will require a change to the QAST compiler that's in use. but it is possible. time() is much easier to override 17:24
m: sub term:<time>() { say "hello, this is my own time!"; nqp::time_n % 60 }; say time
camelia rakudo-moar c94259: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Could not find nqp::time_n, did you forget 'use nqp;' ?␤at <tmp>:1␤------> 3lo, this is my own time!"; nqp::time_n %7⏏5 60 }; say time␤ expecting any of:␤ infix␤ infix stoppe…»
timotimo m: use nqp; sub term:<time>() { say "hello, this is my own time!"; nqp::time_n % 60 }; say time 17:25
camelia rakudo-moar c94259: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3lo, this is my own time!"; nqp::time_n %7⏏5 60 }; say time␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ stateme…»
timotimo m: use nqp; sub term:<time>() { say "hello, this is my own time!"; nqp::time_n() % 60 }; say time
camelia rakudo-moar c94259: OUTPUT«hello, this is my own time!␤14.1249108314514␤»
timotimo bbkr: ^ you need to override term:<time>, because time is a term, not a sub
(that's why you can have time % 10, instead of being forced to write time() % 10)
bbkr timotimo: awesome, thanks. I didn't know the difference between term and sub earlier in this case, that's why all my attempts failed :) 17:26
timotimo :)
[ptc] RabidGravy: hrm, ok, maybe I need to turn off the script I set up. I'm getting connection errors. Probably only PEBKAC...
RabidGravy [ptc], but it seems that the debian one may be different, I'm going to have to make a VM to test this I think 17:27
I also am using a bang up to the minute liquidsoap that I installed with opam (fedora doesn't even have it as a package) 17:28
[ptc] I've upped the sleep period for the script to wait for the server to settle. Still doesn 17:29
't want to connect
RabidGravy yeah, let me get a VM with whatever it is OS that the travis uses 17:30
[ptc] I'm using 1.1.1-7+b1 from Debian-Jessie
ok
bbkr timotimo: how can I make this custom time visible by other modules? this change seems to be lexically scoped. I've tried wrapping it in BEGIN phaser before loading module but this doesn't work. 17:32
RabidGravy is export 17:34
timotimo yeah, like you would make any sub visible
it's just a sub with a funny name, just like operators for example
bbkr perl6 -I . -e 'sub term:<time> () is export {666}; time.say; use A; A.new.foo.say' # this does not work either. A is 17:38
class that has foo method that just returns time
timotimo yeah, exact same thing as with other subs
you can wrap the general sub term:<time> if you want
GTGBBL
RabidGravy I don't suppose anyone has a Docker image based on ubuntu precise with latest rakudo already? 17:46
RabidGravy good lord, I think this ones even older 17:49
root@3f7e4a767778:/# liquidsoap --version
Liquidsoap 1.0.0
but yes that is the one it gets 17:50
[ptc] oh dear, that is pretty old 17:56
RabidGravy also docker is being an arse I may have to go full VM on this one 17:58
[ptc] and it turns out that the Ubuntu on Travis doesn't have silan, even though Debian-Jessie does. *sigh* 17:59
oh well, I'll try building it from source
RabidGravy I was wondering about an Alien::Silan for that, it doesn't seem widely packaged
I think I built it from source here
RabidGravy basically a module that has a Build.pm which builds silan into its resources (as PREFIX) if it isn't already installed then has a method that returns the path to the binary 18:02
[ptc] RabidGravy: it's interesting; you seem to be dominating of the Audio:: namespace ;-)
timotimo back much later
[ptc] *most of 18:03
RabidGravy I guess no-one else is quite so crack-addled or optimistic as I am :) 18:04
[ptc] :-) 18:08
[ptc] is amazed at how many tunnels there are between Nuremberg and Hannover... 18:16
RabidGravy pfui, even xenial only has 1.1.1 18:32
let's try with that one and work backwards
RabidGravy is a job on travis-ci basically run as 'root' ? 19:07
which may explain the Audio::Liquidsoap tests not working, it doesn't like running as root at all 19:09
which is good, but not convenient in this case
moritz [ptc]: going to Nuremberg? wann come visit? :-) 19:16
AlexDaniel m: sub foo(‘blah’) { say 42 }; foo(‘blah’) 19:18
camelia rakudo-moar c94259: OUTPUT«42␤»
AlexDaniel m: sub foo(‘blee’ | ‘blah’) { say 42 }; foo(‘blah’) 19:19
camelia rakudo-moar c94259: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3sub foo(‘blee’ |7⏏5 ‘blah’) { say 42 }; foo(‘blah’)␤ expecting any of:␤ constraint␤»
AlexDaniel why not?
m: sub foo($ where ‘blee’ | ‘blah’) { say 42 }; foo(‘blah’) 19:23
camelia rakudo-moar c94259: OUTPUT«42␤»
sjn m: sub foo('blah' | 'blee') { say 42 }; foo(‘blah’) 19:49
camelia rakudo-moar c94259: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3sub foo('blah' |7⏏5 'blee') { say 42 }; foo(‘blah’)␤ expecting any of:␤ constraint␤»
sjn hm. I get a different result with 2016.10-32-g8d357af 19:50
m: say $*PERL.compiler 19:52
camelia rakudo-moar c94259: OUTPUT«rakudo (2016.10.35.gc.942593)␤»
sjn recompiles
AlexDaniel committable6: 8d357af sub foo('blah' | 'blee') { say 42 }; foo(‘blah’) 19:53
committable6 AlexDaniel, ¦«8d357af»: ===SORRY!=== Error while compiling /tmp/LfULA1ffFK␤Malformed parameter␤at /tmp/LfULA1ffFK:1␤------> sub foo('blah' |<HERE> 'blee') { say 42 }; foo(‘blah’)␤ expecting any of:␤ constraint «exit code = 1»
AlexDaniel sjn: nope
m: say &infix:<!=> 19:56
camelia rakudo-moar c94259: OUTPUT«sub infix:<!=> (Mu $?, Mu $?) { #`(Sub+{<anon|67373360>}+{Precedence}|35767856) ... }␤»
AlexDaniel is there any way to get != out of it as a Str?
m: say &infix:<!=>.name 19:57
camelia rakudo-moar c94259: OUTPUT«infix:<!=>␤»
mst m: say &infix:<!=>.Str 19:59
camelia rakudo-moar c94259: OUTPUT«Sub+{<anon|67373360>}+{Precedence} object coerced to string (please use .gist or .perl to do that)␤ in block <unit> at <tmp> line 1␤infix:<!=>␤»
mst m: say &infix:<!=>.perl
camelia rakudo-moar c94259: OUTPUT«sub infix:<!=> (Mu $?, Mu $?) { #`(Sub+{<anon|67373360>}+{Precedence}|48100848) ... }␤»
mst m: say &infix:<!=>.gist
camelia rakudo-moar c94259: OUTPUT«sub infix:<!=> (Mu $?, Mu $?) { #`(Sub+{<anon|67373360>}+{Precedence}|57185776) ... }␤»
mst bah
geekosaur you get the name as a function; "operator" is essentially a concept within the parser 20:00
so you would need to deconstruct the function name to get an operator name 20:01
[ptc] moritz: went to Nuremberg, and came back on the same day; my wife was at a course there and I met her there and we came back together tonight 20:15
moritz: had wondered if you were wandering around the central part of the city today :-) 20:16
moritz [ptc]: I ould have, had I know it in advance :-) 20:37
*could
RabidGravy [ptc], well I have it at least not-failing on Travis travis-ci.org/jonathanstowe/Audio-.../169802261 20:55
RabidGravy I suspect that the failure to start the server is down to some version thing 21:09
[ptc] RabidGravy: strange that the server started for the first set of tests, but not for the second set 21:34
[ptc] all I could get it to do was to say that it couldn't start the server... 21:35
RabidGravy yeah it's odd as it isn't making any output on STDERR either 21:36
[ptc] I guess it's hard to get a VM to behave like a real computer, including audio stuff 21:42
RabidGravy the script in the second test doesn't do anything that would require audio hardware, it even uses the dummy output 21:48
[ptc] I'm trying to work out how to get Audio::Silan to test on Travis. It needs access to various devices that don't exist, which make for interesting testing
*which makes 21:49
RabidGravy silan shouldn't need any devices, it just reads from files 21:50
that's quite odd if it does that
[ptc] sorry, got myself confused. I meant Audio::PortMIDI 21:51
RabidGravy yeah that's a tricky one 21:52
[ptc] that module generates so much output that Travis won't save it all in the web-viewable logs; one has to download it to see it all
RabidGravy: see e.g. travis-ci.org/paultcochrane/Audio-.../169783495 21:54
RabidGravy I'd be inclined to skip thw synopsis test if there aren't any devices 21:58
[ptc] yeah, that might be an idea. Hate skipping tests though... 22:03
[ptc] RabidGravy: catch ya tomorrow. Thanks for the fast turnaround on my PRs! 22:03
RabidGravy it would be possible to add a dummy default sequencer device but pfui 22:04
RabidGravy frankly I think that skip would be entirely reasonable, I'm inclined to do it anyway :) 22:09