»ö« 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.
Herby_ if anyone has a moment, i wrote a small script to combine a folder full of CSV files into one file (assuming they have the same header row) 00:18
Herby_ pastebin.com/rwcvrWVt 00:19
Herby_ i'm open to any ways to improve or streamline it 00:19
but it works as is
timotimo you can deduplicate the innermost for loop 00:23
timotimo you have a part that comes in front if $header-inserted is 1, and a part that gets executed at the end if $header-inserted is 0 00:24
timotimo and the part in the middle is the same in both cases 00:24
Herby_ hmm ok let me tweak 00:25
Herby_ thanks for the tip. it looks a bit cleaner now: pastebin.com/XLyhpf2F 00:32
timotimo looks good, yeah 00:35
i'm going to bed now
have a good one!
Herby_ you too! 00:36
perlawhirl Herby_: more of a style choice, but $header-inserted could just be a Bool 00:47
yoleaux 10 Oct 2016 22:49Z <AlexDaniel> perlawhirl: whyyyyyyyyy? irclog.perlgeek.de/perl6/2016-10-10#i_13374587
perlawhirl declare it as False, set it to True at the end of your loop, and then just `if $header-inserted` in the middle 00:47
Herby_ good point. just updated it 00:54
metalman5 Hey, novice question: how do I reload a module after changing its source file? The commands I've tried at the REPL seem to ignore modules that have already loaded. 02:01
perlawhirl metalman5: The REPL is a probably not a good place for this. better to have it in a script (or better yet, tests) and run it after you make the changes 02:15
metalman5 I'm mostly concerned about my development environment--Emacs, in particular. In other language modes, for instance, I can reload a module under development without having to restart the interpreter. 02:18
MasterDuke metalman5: you could try EVALFILE. i haven't used it, but it might do what you want 02:23
metalman5 I'll give it a try, thanks. 02:25
lucs_ I'm getting an error in one of DBIish's files. 03:08
I'd like to place some 'print' debugging statements in it, but given precompilation (I suppose), where/how exactly?
The error is reported as 「…/rakudo/install/share/perl6/site/sources/B874A114F16EBFE5EA4815E5E20CA48A7810B32C (DBDish::mysql::StatementHandle) line 178」, but changing that file and running the program again does nothing. 03:09
MasterDuke lucs: it might be simplest to just clone the git repo, make your changes there, and explicitly include the cloned lib directory with -I</path/to/DBDish/lib> 03:14
lucs MasterDuke: Hmm... I'll try that. Will it happen to avoid precompilation? (so that I can change the code in the cloned repo more than once) 03:18
MasterDuke yeah, precomp should catch that the code has changed 03:19
lucs Okay, thanks. 03:21
lucs Um, weird result: gist.github.com/lucs/7f4dac24fa39e...b7ccc7450a 03:49
lucs & # ZZ 04:27
nine .tell nadim no progress in the last couple of weeks. Have been side tracked by work on Inline::Perl5 07:00
yoleaux nine: I'll pass your message to nadim.
tbrowder morning (CDT) #perl6 09:17
DrForr Afternoon EEDT. 09:18
sjn good *, #perl6 09:21
tbrowder ref docs and the Perl 6 Cookbook <examples.perl6.org/categories/cookbook.html>: I asked about it a couple of weeks ago and thought it was a good thing to emphasize but I was concerned about licensing issues with O'Reilly publishers and the authors of the Perl Cookbook. I contacted O'Reilly and was told use of the Table of Contents on our site was not 09:23
allowed, but any author(s) interested in producing such a book for Perl 6 should contact O'Reilly at [email@hidden.address]
That's too bad, but I believe the Perl Foundation lawyers would insist the online P6 Cookbook should be taken down. 09:24
DrForr That's a touch odd (though not unexpected) as I know they're involved in a similar project...
tbrowder Maybe so, but then I believe some here do have individual agreements with O'Reilly. 09:25
I would love to buy a P6 Cookbook! 09:26
sjn licensing issues?
DrForr I do, but not for book properties. 09:27
tbrowder Copyright/trademark. Copying the TOC from an existing book is not fair use, etc.
sjn why copy the TOC then? I'd assume when one writes a cookbook, it's completely sane to make your own... 09:32
DrForr Sane, yes, but also easier to work from a thoght-out progression rather than working ab initio. 09:33
sjn sure, it's fine to take inspiration from an existing work 09:33
sjn nothing wrong with that, and it really doesn't cost much to add/change a few of the items in the TOC so that it becomes an "independent enough" work 09:34
also, (frankly speaking) I think the Perl community has pandered WAAAY to much to O'Reilly & Assoc. 09:36
it's high time to let that leave that company behind, imho.
DrForr Well, if we can get the trademarks and websites back from... 09:39
*them.
sjn I thought that's already fixed? 09:40
sjn only thing left is the Perl 5 logo issue, which Perl 6 doesn't suffer from.. 09:40
sjn the "The Perl Conference" rights and perl.com are already in TPF's hands, I think 09:41
DrForr Right, but I was under the impression that YEF still isn't able to use the name, and the last posting on perl.com dates from 2014, which can't be helping matters. 09:43
sjn Dunno about YEF 09:43
the lack of updates on perl.com is unfortunate, yes 09:44
sjn shouldn't really complain about that, since he hasn't written anything for it either
DrForr I haven't since ~2009, but I'm more interested in writing on perl6 these days. 09:45
markk_ Perl.com is not owned by tpf iirc, we just have an agreement on the usage of it 09:53
DrForr tchrist's site, IIRC.
markk_ The same for The Perl Conference which we are allowed to use for YAPC::NA by the grace of O'Reilly, but afaik no one has approached to use the name for other Perl conferences
And it would be badly named as it has a definite article, so what do we do? The Perl Conference Europe, European Perl Conference? Or maybe Yet Another Attemmpt to Change a Brand that is 16 Years old Conference 09:54
DrForr Right, the way I understand it ORA owns the trademark but is allowing TPF to use it after ... well, all they had to do was ask. I don't think YEF has made the same request. 09:55
markk_ has some misgivings about dumping YAPC as a brand.
DrForr OSCON seems to do well with London and Austin.
markk_ DrForr: that is correct
DrForr At least last time I talked with Karen about it. 09:56
markk_ DrForr: OSCON doesn't have a community as such 09:56
I'm not objecting to a name change, I think there are ways to handle it, but only agreeing to one conference has caused some confusion 09:57
DrForr Don't I know it. It's just a higher-end excuse to drink beer with geeks than YAPC is.
DrForr Well, again, YEF and TPF are different organizations, and only TPF AFAIK has approached ORA about the trademark. 09:59
smls How can I disable MoarVM's JIT for testing/benchmarking purposes? 10:04
timotimo ask moar --help for all your disabling needs 10:05
smls ah, thanks, I was looking int `perl6 --help`. 10:05
*in
jnthn Note that even with JIT disabled, you'll still be using spesh, which will - in the absence of a JIT - do bytecode quickening 10:07
So if you want to disable all VM-level opt for Moar, MVM_SPESH_DISABLE is the way to go
("JIT compiler" is often used to mean the optimization + code-gen, in Moar, MVM_JIT_DISABLE is talking about machine-code gen only) 10:08
timotimo and disabling spesh also causes jitting to not take place
smls right, I meant spesh :P
jnthn Yeah...it all depends what you want to benchmark really :) 10:09
smls I'm trying to find out if RT #129779 is caused by spesh, and it looks like it is 10:10
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=129779
smls it seems that spesh makes the single-threaded version much faster, but the multi-threaded version actually a bit slower 10:11
timotimo allocating frames (i.e. calling functions) currently contends a per-instance (rather than per-thread) memory allocator 10:14
timotimo if the empty loop actually invokes the empty body each time 'round the loop in one of those earlier examples, it will hardly do anything but allocate and free frames 10:16
timotimo then the allocator becomes the bottleneck and would be responsible for most of the runtime 10:16
smls timotimo: I tested with the benchmark in the last comment of the RT 10:17
the recursive fibonnaci one, not empty loops
timotimo recursive function calls are also bad :)
did you try running it under some kind of profiler, like perf? 10:18
smls no
timotimo No thread: 10.4069735 10:20
Parallel: 10.92738216
the whole program spends 34% of its time inside MVM_fixed_size_alloc
an additional 7.84% of its time in MVM_fixed_size_free
and 7.44% in MVM_frame_invoke
jnthn Yeah, that'll be what's holding it up. Also, I suspect, over-subscription
Our scheduler just ain't all that smart yet
timotimo mystery solved? 10:21
i'm not exactly sure why my parallel vs no thread results are drastically better than what's in the ticket, though
smls timotimo: I get these times: gist.github.com/smls/e0f1fa2d98ec7...187bf9ae93 10:22
jnthn Will depends on number of cores, cache speeds, etc.
smls (I tested on a 4-core CPU, and the parallel test-case uses exactly 4 threads.) 10:24
timotimo i, too, have 4 cores
smls Are your times (where parallel is about as fast as no thread) with perf, or run normally? 10:25
timotimo with perf, but perf is supposed to have near zero overhead
jnthn Spesh makes quite a difference there... :)
timotimo let me try without
jnthn And yes, interesting that it gets worse; I suspect it eliminates stuff so you spend all the time contending 10:26
timotimo all times get a little smaller without perf, but not a big difference
smls: do you want to write about this allocator business on the ticket or shall i put a little explanation up? 10:27
smls I'd have just quoted your IRC comments, but you may be able to explain it better :)
timotimo i expect the irc quote would be good enough 10:27
smls ok 10:28
timotimo i'm available for any further questions, but you may have to poke me so that i notice
pmurias blogs.perl.org/users/pawel_murias/2...udojs.html - update on rakudo.js 10:53
timotimo yay!
pmurias++ 10:54
lizmat pmurias++ 10:59
timotimo oh no! there were TWO instances of that error message and i only patched one 11:13
arnsholt Then you get to write another patch 11:14
More karmapoints for you! =)
timotimo :S 11:15
moritz pmurias++ # blog post 11:19
pmurias++ # rakudo-js
llfourn I need to find the narrowest common parent of two classes/types. Does anyone know a good approach? 11:21
jnthn m: my \t1 = Int; my \t2 = Str; say t1.^mro.first({ t2 ~~ $^t }) 11:25
camelia rakudo-moar e08da9: OUTPUT«(Cool)␤»
jnthn m: my \t1 = Supply; my \t2 = Str; say t1.^mro.first({ t2 ~~ $^t })
camelia rakudo-moar e08da9: OUTPUT«(Any)␤»
jnthn Like that maybe?
llfourn jnthn: Nice. Thanks. 11:26
I'll see how it goes
I've never used .^mro
m: my \t1 = Str; say t1.^mro 11:27
camelia rakudo-moar e08da9: OUTPUT«((Str) (Cool) (Any) (Mu))␤»
jnthn It's just the parents in the order that we'll search them when doing a method dispatch
(mro = method resolution order)
llfourn ahhh gotcha
that's exactly what I need
[Coke] pmurias: are rakudo-js updates showing up in this channel? 12:51
s/updates/commits/
(and having just said that, see a flood of nqp-js commits in backlog on #perl6-dev :) 12:54
pmurias [Coke]: the rakudo-js commits are sent to the #perl6-dev channel too, most of the work is done in the nqp-js repo 13:21
[Coke] pmurias: awesome, keep up the good work 13:24
p3rln00b .tell dogbert17 would you list yourself in github.com/rakudo/rakudo/blob/nom/CREDITS ? Right now you're comming up twice when announcement is generated; as dogbert and as full name 14:10
yoleaux p3rln00b: I'll pass your message to dogbert17.
japhb pmurias++ # rakudo.js and associated blog entry 14:59
pmurias: BTW, a 'test suit' is something you try on when you're shopping for clothing. You're thinking of a 'test suite'. ;-)
japhb Idea for $zoffix: Add a bot that accepts a '.zoffix' command -- like '.tell', but PMs your current alias, so that you can remain contactable while pseudonymous. 15:01
p3rln00b I'm sure Zoffix knows when .tell Zoffix is used without bots ;)
japhb p3rln00b: But such a bot could let the sender know when it was delivered ... which is implicit with .tell delivery, but is no longer available with passive watching 15:02
japhb It just wouldn't tell who it delivered *to* 15:03
p3rln00b japhb: well, Zoffix chills in #perl6-dev, not here. Maybe that's the solution :)
japhb Interesting. So only pseudonymous in one channel. That ... I did not expect. 15:04
japhb I will say I'm finding it interesting as a case study of sorts just how leaky pseudonymity is ... 15:07
lucs I'm getting an error in the panda installed DBIish module, but can't seem to modify the relevant source to try to debug (by inserting 'print' statements for example). 15:09
I cloned the DBIish repo and tried to use that, but I get a result I just don't understand: gist.github.com/lucs/7f4dac24fa39e...b7ccc7450a
moritz that looks funny 15:10
lucs: please open an issue on github, in the perl6/dbiish project 15:11
lucs moritz: Is what I showed in the gist sufficient for the report? 15:11
p3rln00b lucs: what's your Perl 6 version?
lucs p3rln00b: This is Rakudo version 2016.09-167-gbfe6219 built on MoarVM version 2016.09-39-g688796b implementing Perl 6.c. 15:12
(I built everything from scratch yesterday)
p3rln00b japhb: yeah, it is. Basically, even if you use entirely new IPs/hosts/nicks and don't use any webservices that can be linked to your conversation, there's still the suspicion element: some new person no one ever seen all of a sudden knows a lot about Perl 6 and its tooling :) 15:14
lucs Generally speaking, given precomps and all that, what is the recommended way of debugging with 'print' statements for example?
p3rln00b lucs: cool. I just wanted to ensure it wasn't due to changes I made to Date/DateTime last night... and it isn't.
lucs p3rln00b: Actually, DBIish is trying to build a DateTime from a '0000-00-⋯' MySQL date and is complaining of a '0' month. 15:16
p3rln00b ah 15:17
dalek c/spellcheck: f548fc7 | coke++ | xt/.aspell.pws:
more words
15:19
[Coke] we have a bunch of behaviour, instead of behavior; do we have a UK vs. US pref? 15:20
(in docs)
moritz nope 15:21
as a non-native, I feel I can't be assed to remember which English I should write, or which one is which
[Coke] that's why I'm writing a test. :)
moritz writing is hard enough as is :-)
[Coke] but if we're ok with some uk english slipping in, that's fine.
dalek c/spellcheck: 6b9c42f | coke++ | xt/.aspell.pws:
allow some UK words (and more)
15:24
mst I tend to annoy absolutely everybody by picking API names in en_US and then documenting in en_UK 15:25
I do not present this as something desirable to copy
[Coke] m: 1.no-such 15:26
camelia rakudo-moar 23f2e2: OUTPUT«No such method 'no-such' for invocant of type 'Int'␤ in block <unit> at <tmp> line 1␤␤»
p3rln00b appears to have copied mst github.com/zoffixznet/perl6-Color/...json#L3-L6 15:26
dalek c: b0b4e1e | coke++ | doc/Type/X/Method/NotFound.pod6:
use actual word for method name
15:28
c/spellcheck: 657e063 | coke++ | xt/.aspell.pws:
moar words
c/spellcheck: b0b4e1e | coke++ | doc/Type/X/Method/NotFound.pod6:
use actual word for method name
c/spellcheck: d28f6fb | coke++ | doc/Type/X/Method/NotFound.pod6:
Merge branch 'master' into spellcheck
dalek c: a9abc32 | coke++ | doc/ (4 files):
fix typos
15:34
c/spellcheck: a9abc32 | coke++ | doc/ (4 files):
fix typos
15:35
c/spellcheck: 00a79ab | coke++ | doc/ (4 files):
fix typos
c/spellcheck: dc35a38 | coke++ | /:
Merge branch 'master' into spellcheck
[Coke] yay, finally snagged some actual typos. :)
p3rln00b \o/ 15:38
dalek c: bc3fc47 | coke++ | doc/ (3 files):
fix typos
15:42
c/spellcheck: 9d09fff | coke++ | xt/.aspell.pws:
moar words
c/spellcheck: bc3fc47 | coke++ | doc/ (3 files):
fix typos
c/spellcheck: b0b3389 | coke++ | doc/ (3 files):
Merge branch 'master' into spellcheck
[Coke] nice side effect of kebob case - makes it easier to indiscriminately spell check everything 15:43
dalek c: 428d506 | (Salve J. Nilsen)++ | / (2 files):
Typo fixes in about.pod6 and predef search items
16:15
c: dd6407d | Altai-man++ | / (2 files):
Merge pull request #965 from sjn/master

Typo fixes in about.pod6 and predef search items
smls To create an immutable value type (like the built-in Int/Str/Pair/Set), is it safe to just define a `method WHICH { ::?CLASS.^name ~ "|" ~ $!id }` ? 16:24
Or are there other things I have to consider? 16:25
timotimo well, you should also take care that immutability is guaranteed by not letting anything change the $!id 16:26
smls of course 16:29
Is is okay to just return a string from WHICH, instead of an ObjAt? 16:33
smls m: say 42.WHICH.perl 16:33
camelia rakudo-moar 23f2e2: OUTPUT«ObjAt.new("Int|42")␤»
timotimo i don't know anything about that, tbh 16:35
smls Also, that whole system is just preliminary, right?
m: say set("a Str|b") === set("a", "b")
camelia rakudo-moar 23f2e2: OUTPUT«True␤»
smls ^^ seeing how its rather unreliable...
p3rln00b m: .WHICH.say for set("a Str|b"), set("a", "b") 16:36
camelia rakudo-moar 23f2e2: OUTPUT«Set|Str|a Str|b␤Set|Str|a Str|b␤»
p3rln00b heh
jnthn Yes, it's not going to survive in this state too much longer... 16:37
smls ok 16:38
cygx so, what are we supposed to stick into a META6.json source-url field to we point to the correct version? 16:43
does panda/zef support git branches/tags as URL fragments? 16:44
p3rln00b cygx: seems tbrowder is experimenting with something on that topic: github.com/perl6/ecosystem/blob/ma...#L730-L731 16:46
cygx the META file points to the .zip files on github 16:47
p3rln00b Doesn't seem to be installable with zef: "No candidates found matching: Net::IP::Lite:ver('0.1.4')" 16:49
moritz p3rln00b: twitter.com/briandfoy_perl/status/...1614814208 more Perl 6 book work going on, it seems :-) 16:58
p3rln00b moritz: :) 17:08
p3rln00b moritz: so is there a plan already for ours? Is there any writing to do? 17:08
dalek osystem: 395b9a1 | cygx++ | META.list:
Add Unicode::GCB

See github.com/cygx/p6-unicode-gcb
17:24
moritz p3rln00b: we have to make a plan :-) 17:26
timotimo make a list, check it twice? 17:27
moritz p3rln00b: I'll create a repo somewhere, and come up with a very, very rough outline as starting point for discussion
p3rln00b Sounds good 17:28
DrForr I'd probably better chime in on this action :) 17:29
moritz DrForr: please /msg me an ssh pubkey 17:31
p3rln00b: same here (unless I should take the one from your hack account in ~/.ssh/authorized_keys)
p3rln00b p3rln00b: yeah use that one 17:34
I mean, moritz yeah use that one 17:35
heh
dalek c/spellcheck: 428d506 | (Salve J. Nilsen)++ | / (2 files):
Typo fixes in about.pod6 and predef search items
17:38
c/spellcheck: dd6407d | Altai-man++ | / (2 files):
Merge pull request #965 from sjn/master

Typo fixes in about.pod6 and predef search items
c/spellcheck: 3a613df | coke++ | xt/.aspell.pws:
more words
c/spellcheck: 2588009 | coke++ | / (2 files):
Merge branch 'master' into spellcheck
moritz p3rln00b, DrForr: git clone [email@hidden.address] 17:39
p3rln00b works 17:40
DrForr Likewise. 17:41
moritz gitolite ftw! 17:42
timotimo indeed
moritz afk
DrForr Nod. 17:48
timotimo the heartbeat thing seems to have finished growing at 140 MB RSS 17:50
samcv could anybody recommend something on Proc::Async? or maybe it's not the right thing for me to be using 17:53
timotimo "something on"?
you mean documentation or examples?
samcv i have an irc bot right now using perl5, i want to switch the bot to use a different method and thought that perl6 might be good, for what i'm trying to do
basically the bot has a helper script, that i processes the irc messages 17:54
and accepts stdin and outputs anything to channel as stdout
i want the helper script to be constantly running, and be able to print to stdin on that
and still have the rest of the script functioning while the helper is open
there might be something else i'm not seeing that can run something and do stdin and out but i am unsure 17:57
p3rln00b is confused about what's needed. 17:58
samcv: you want to proxy STDIN to IRC?
... and print channel messages to STDOUT, right? 17:59
samcv well the main thing i need to do is only to open a program, read stdout and write to stdin
mspo he wants to proxy IRC to stdin of his helper and then take stdout into irc
samcv i can handle the irc part, i just need help with doing the script part
the irc part is not relevant just in so that it can't lock up everything while the secondary thing is running 18:00
mspo Proc::Async sounds right 18:01
p3rln00b samcv: well, the IRC part is easy. Just use IRC::Client module. For the second thing, just pop it open with my $p = Proc::Async.new: 'prog', 'args'; $p.start; and then you can write to its STDIN with $p.print; and get its STDOUT by tapping to .stdout: $p.stdout.tap: { $irc.send: $^input } 18:02
mspo docs.perl6.org/language/concurrency#Proc::Async ?
samcv ok :)
p3rln00b samcv: actually, with IRC::Client you don't even need Proc::Async. Just do a normal `run` of the command and return a Promise from the event handler. So basically, it'd be something like multi method irc-to-me ($ where /^ trigger $/) { start { my $proc = run "command", "arg", :out, :in; $proc.in.print: "some input"; $proc.out.slurp-rest: :close; }} 18:05
And it'll handle the non-blocking part.
samcv hm
timotimo has grown to 142 megs, but the growth has significantly slowed 18:12
samcv p3rln00b, do i need the where part? if i want every message to trigger it? 18:15
timotimo in that case you don't need it 18:16
samcv ok i'm probably doing this wrong but: vpaste.net/1BzIf 18:17
samcv i've only ever used qqx/command/ before :| 18:18
well at least in perl6. i have done several other ways in perl5
p3rln00b What's the wrong thing about it?
samcv it doesn't compile :')Unable to parse quote-words subscript; couldn't find right angle quote. at ./perlbot.pl6:58 18:20
------> <BOL>⏏<EOL> expecting any of: postfix
timotimo yeah 18:21
you need to escape the < after $bot_username
pukku Hi! I'm sorry to be a bother, but I have two quick questions: 1. is p6doc supposed to be the equivalent of perldoc, and if so, how do I make in work under the home-brew environment? 2. Is LWP::Simple the right place to start for downloading a JSON resource, or is there some other place I should start?
timotimo m: my $test; say "hello >$test<";
camelia rakudo-moar faba64: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse quote-words subscript; couldn't find right angle quote␤at <tmp>:1␤------> 3my $test; say "hello >$test<";7⏏5<EOL>␤ expecting any of:␤ postfix␤»
timotimo m: my $test; say "hello >$test\<";
camelia rakudo-moar faba64: OUTPUT«Use of uninitialized value $test of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤ in block <unit> at <tmp> line 1␤hello ><␤»
timotimo m: my $test = "hi there"; say "hello >$test\<";
camelia rakudo-moar faba64: OUTPUT«hello >hi there<␤»
timotimo see the difference?
samcv oo ok :) thanks 18:22
timotimo that's because you can have this:
timotimo m: my %dada = foo => "bar"; say "hello %dada<foo>" 18:22
camelia rakudo-moar faba64: OUTPUT«hello bar␤»
geekosaur < is a subscript character that does quoting, basically
samcv ah, even in quotes. ok thanks :)
geekosaur foo<x> is the same as foo{'x'}
samcv yeah i know that, didn't know it applied in quotes too
p3rln00b pukku: yeah, LWP::Simple is OK. But you may want to use HTTP::UserAgent for something where you can do proper error checking. You'll also need somethign like JSON::Fast for decoding JSON. For p6doc, yeah, eventually it's meant to be like perldoc, but right now it's much less developed
perlpilot wouldn't be much good if they didn't work within double quoted strings.
p3rln00b P6Bot: capit lulz this is awesome! 18:23
P6Bot p3rln00b, LULZ THIS IS AWESOME!
geekosaur well, one expects to be able to print/expand a particular list or hash element, not just the whole thing 18:23
p3rln00b samcv: ^ that P6Bot is this code. Seems to work as far as starting a program and reading from it goes: gist.github.com/zoffixznet/51c0a92...d727fd208d
[Coke] m: say roundrobin.WHAT 18:24
camelia rakudo-moar faba64: OUTPUT«(Seq)␤»
p3rln00b is a bit bummed $/ doesn't propagate to that start block :(
pukku OK, thanks. I think there must be an issue with the homebrew environment for p6doc, because none of the examples seem to work (p6doc faqs, p6doc Str, etc.). Is there an online version that I can use to read the documentation for modules? Clicking on a module on modules.perl6.org takes me to the git repository, and nothing on docs.perl6.org seems obviously correct. 18:25
timotimo pukku: very probably you're missing something in your $PATH
p3rln00b pukku: what do you mean nothing's obviously correct? 18:26
pukku: you can try using modules.zef.pm/modules for module docs.
pukku timotimo: probably; I think the homebrew environment may be weird because it's trying to install things in their own directories. I may play around with this later, when I have more time. 18:27
p3rln00b samcv: you also may want to use irc-privmsg-channel or some other event if you want to listen to all channel traffic and not just commands addressed to the bot.
samcv yeah 18:28
p3rln00b Event map: github.com/zoffixznet/perl6-IRC-Cl...#event-map
pukku p3rln00b: docs.perl6.org seems to be all about the core language, not modules, which is quite fair. The second link looks like it would be correct, except that I guess LWP::Simple doesn't have POD? I'll have to look at the source. Oh well. 18:29
Thanks for all the help!
p3rln00b pukku: yup. Just checked. LWP::Simple's author is a lazy bum who wrote no docs :) There are a couple of examples though: github.com/perl6/perl6-lwp-simple/...master/bin 18:30
smls Do we have something like Perl 5's `use warnings FATAL => ...` ? 18:43
samcv p3rln00b, how do i do processing by line on the output? vpaste.net/82rWI
timotimo we have "use fatal"
not sure it's the same thing 18:44
other than that you can "CONTROL { when CX::Warn { die $_ } }"
hm. will probably have to die with something else than the $_
smls m: use fatal; say "" ~ Nil; say "alive"
camelia rakudo-moar faba64: OUTPUT«Use of Nil in string context␤ in block <unit> at <tmp> line 1␤␤alive␤»
p3rln00b hehe 18:45
geekosaur that doesn't affect warnings, it affects `fail`
geekosaur which normally throws when sunk or doesn't throw if introspected for fail/success state, but with "use fatal" in scope throws immediately 18:46
p3rln00b samcv: your code doesn't make any sense :) The start {} block starts a non-blocking promise. And you're not setting your $line to anything.
samcv yes i know :) 18:46
how do i set my line to something :)
smls m: say "" ~ Nil; say "alive"; CONTROL { when CX::Warn { die $_ } }
camelia rakudo-moar faba64: OUTPUT«Use of Nil in string context␤ in block at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
smls ^^ seems to work, thanks timotimo 18:47
p3rln00b samcv: I suspect you want to .out.slurp-rest(:close).lines.grep(*.starts-with: "%").map: {$.irc.send: :where($channel) :what(.substr: 1)}; 18:48
samcv ok i was thinking something.lines
but i wasn't sure the exact syntax
p3rln00b The .out.slurp-rest(:close) gives you the STDOUT of the program you're running. 18:49
samcv ah ok
samcv wait p3rln00b what variables does that put it into $_ is that where the lines go into? 18:50
because i sometimes need to process the line too. 18:51
if it's a pm the synax is q($) . $pm_who . q(%) . $pm_text . "\n"
p3rln00b samcv: you can do processing in the .map block. The $_ is the current line 18:51
p3rln00b .out.slurp-rest(:close) gives you all of STDOUT, .lines breaks it up into lines, .grep filters for those that start with '%', .map (in this case) removes the '%' and sends that to channel 18:52
samcv ok. and this whole thing will leave the script running after it's done?
or does it close it?
the close is confusing me 18:53
p3rln00b samcv: which script, the program you're starting?
samcv yes
p3rln00b Yeah, it'll close it. :} 18:54
samcv aww
p3rln00b Does the program's output give you the channel where to send the message to?>
samcv well it has %Linetoprinttochannel, or $nick%linetotellthatnick 18:55
p3rln00b So you don't plan to have this bot running in multiple channels, then? 18:56
samcv idealy i want each call to irc-privmsg-channel to check if the script has been been modified when irc-privmsg-channel is called and then if so to reloa'd it
nope
but i could always change it to have additional parameters anyway
that's just how it works atm
samcv i could just change it to always do $channel/nick%message and then print to channel if it starts with a hash 18:56
or ampersand 18:57
tho freenode doesn't have ampersand channels but
dalek c: a85f4dd | coke++ | doc/HomePage.pod6:
use standard spelling
18:57
c/spellcheck: 6b15254 | coke++ | xt/.aspell.pws:
more words
18:58
c/spellcheck: a85f4dd | coke++ | doc/HomePage.pod6:
use standard spelling
c/spellcheck: 7bb820d | coke++ | doc/HomePage.pod6:
Merge branch 'master' into spellcheck
c/spellcheck: c99738b | coke++ | xt/.aspell.pws:
more words
samcv i mean could we start the script outside of irc-privmsg and have that going and have some way
to to print to the channel if you get output from the second script
p3rln00b samcv: one way to do it is to use irc-started event to start a Proc::Async with your script and store it in an attribute of the plugin class. Tap its stdout and add the output processor to it and you'll have $.irc.send: in it to send the output where you want it to. In irc-privmsg-channel send input to the Proc and return Nil from handler. so it'd be something like $!proc.write: $e.text; Nil 18:58
samcv and to write stdin on the script to the channel messages
i think i'm going to take a nap. then i'll do some more learning about attributes and some more about perl6 and objects and such 19:01
i haven't really done any object oriented programming before, but now is as good a time to learn as any 19:02
p3rln00b samcv: untested, but something like this: gist.github.com/zoffixznet/97e5668...6a64f322cc 19:03
dalek c: a3d2dff | coke++ | doc/Language/experimental.pod6:
fix typo
19:03
samcv ok, thank you so much for all yor help p3rln00b
i've been trying to learn some basic perl6 the last few days and now that i'm retrofitting my irc bot i think this will be a good chance to learn more 19:04
p3rln00b samcv: actually this one. irc-started is triggered before we're connected: gist.github.com/zoffixznet/2f028fa...4ff34beab8
samcv wouldn't be the worst thing ever if it started the script early. but thanks :)
p3rln00b So here we use irc-connected and setup $!proc only if it's not already setup 19:05
pukku Would it be reasonable to ask that someone look at a small program I wrote in Perl 6 to see if there are ways to make it more perl6-y?
p3rln00b pukku: yes, ask away
pukku Thanks! I put it at gist.github.com/remorse/896cb98f07...cdd9b6674d . It's just a small program to write an HTML file for printing out XKCD cartoons that I like. I got tired of filling out the various things myself, and thought this would be a good way to dip my toes into Perl6... 19:07
p3rln00b My EYES! 19:08
Just kidding :}
pukku Hopefully it's not that bad :-) 19:09
p3rln00b p3rln00b: looks alright to me. I'd use more chaining and interpolation though. Like this block gist.github.com/remorse/896cb98f07...l6-L11-L17 I'd write as just my $info = from-json LWP::Simple.new.get: "www.xkcd.com/$comic/info.0.json" 19:10
dalek c: fd24062 | coke++ | doc/Language/modules-extra.pod6:
use slightly preferred variant
19:11
geekosaur why are you talking to yourself :p
p3rln00b I'm a good company :P
pukku: ^ that was meant to be for you :P 19:12
pukku Thanks! I inferred that, and am trying it out...
Cool -- the examples weren't clear if I could chain calls to new and get for LWP::Simple, but it works just fine. 19:14
pukku I guess that I could get rid of the "$fname" variable as well then, and just put the replace inline? 19:14
pukku p3rln00b: sorry, I guess I should prefix these to you... 19:15
harmil_wk I just came upon the behavior of MAIN with respect to formulating the program name into the default usage.
Is there a reason that the dirname prefix of the script filename is stripped only when the script is in the PATH? 19:16
p3rln00b pukku: you could, though the replace is complex enough that it can be left on its own. You could write as spurt "$outdir$info<safe_title>.lc.subst(/\W/, '_', :g).html", $output_text; 19:17
pukku: this is also an option: spurt "$outdir$_.html", $output_text given $info<safe_title>.lc.subst: /\W/, '_', :g;
smls harmil_wk: Well, it's called a "Usage" message, so I guess it prints the name/path you actually have to use to run the program... 19:18
pukku p3rln00b: that last one is interesting. I think you're correct that it gets too complex to make it entirely in the quotes -- I think I would get confused that '.html' doesn't trigger an error. Can "given" as a postfix operator assign to a named variable, or only to $_? 19:19
harmil_wk Interesting take. I never thought of the usage message as being that literal, but I guess that's a better answer than none. 19:19
p3rln00b pukku: only to $_
m: { $^foo.say } given 42; 19:20
camelia rakudo-moar faba64: OUTPUT«42␤»
p3rln00b Oh, well, you can do that, apparently.
(the block curlies are needed)
But then, may as well use prefix given
pukku Cool 19:21
p3rln00b: (sorry, I'm still getting the hang of prefixing things)
pukku p3rln00b: For the calls to the template engine, would it be more idiomatic to do `given ($tmpl) { .find('title').text(...); .find('body h1').text(...); ... }`? 19:26
p3rln00b pukku: given ($tmpl) { .('title')... ; .('body h1') will likely work 19:27
dalek c/spellcheck: 90a0b05 | coke++ | xt/.aspell.pws:
moar words
19:28
c/spellcheck: a3d2dff | coke++ | doc/Language/experimental.pod6:
fix typo
c/spellcheck: f13065d | coke++ | doc/Language/experimental.pod6:
Merge branch 'master' into spellcheck
c/spellcheck: 5541431 | coke++ | xt/aspell.t:
add overview comment, search only docs
c/spellcheck: 24bbc64 | coke++ | xt/.aspell.pws:
more words
c/spellcheck: fd24062 | coke++ | doc/Language/modules-extra.pod6:
use slightly preferred variant
moritz p3rln00b, DrForr: Shall we resurrect #perl6book?
c/spellcheck: bf0fa6c | coke++ | doc/Language/modules-extra.pod6:
Merge branch 'master' into spellcheck
p3rln00b moritz: sure 19:29
DrForr Why not. 19:30
pukku p3rln00b: nice! That seems much clearer to me. 19:31
pukku p3rln00b: I just tried something, and I'm now getting an error -- I changed `.attrib(src => $info<img>)` to `.attrib('src' => $info<img>)` (i.e., I added quotes around the 'src' part). It now fails with "too many positionals passed; expected 1 argument but got 2". I'm not sure why adding quotes changes this? Where would I look in the documentation? 19:34
p3rln00b pukku: because without quotes it's a named argument, but with quotes it's a positonal argument (a Pair) 19:35
geekosaur is this documented as a gotcha?
p3rln00b shrugs
geekosaur (this business is an outright hack, sadly)
p3rln00b likes it
Has that distinct perlish taste to it :)
geekosaur this strikes me as the sort of perl-ism that perl 6 was trying to get rid of, though :/ 19:36
mst geekosaur: I dunno, auto-quoting and symbol/string equivalency are a lot more regular in 6 19:37
p3rln00b pukku: FWIW, you can write it as .attrib: :src($info<img>) 19:39
arnsholt geekosaur: It's a somewhat hairy problem 19:39
geekosaur I know 19:40
arnsholt On the one hand, you want the convenient syntax for passing named parameters, on the other sometimes a Pair is a positional =( 19:40
pukku p3rln00b: Are you sure that without the quotes it's a named attribute? The method is defined as `method attrib(*%attribs)`, which I think must mean that it's taking pairs?
arnsholt Programming in SmallTalk these days, I'm coming up against something with a similar-ish vibe
geekosaur sometimes I wish it had been decided to use the :foo(bar) as named param and foo => bar as Pair 19:41
p3rln00b pukku: it's taking any number of named args
geekosaur changing the quoting on foo vs. 'foo' is just Weird
p3rln00b pukku: * is a slurpy and slurpy on a hash takes named things
arnsholt The way control structures are implemented in plain ST is really neat, but it makes it really awkward to make if/elsif/elsif/elsif/else or case-like structures
pukku p3rln00b: ok. I'm confused why an arbitrary set of pairs isn't a hash, but I'll take your word for it.
p3rln00b m: class { method attrib(*@pos, *%named) { dd [ @pos, %named] } }.attrib: foo => "bar" 19:42
camelia rakudo-moar faba64: OUTPUT«[[], {:foo("bar")}]␤»
p3rln00b m: class { method attrib(*@pos, *%named) { dd [ @pos, %named] } }.attrib: "foo" => "bar"
camelia rakudo-moar faba64: OUTPUT«[[:foo("bar")], {}]␤»
arnsholt geekosaur: I guess, but those constructs are supposed to be equivalent too =(
p3rln00b pukku: ^
geekosaur yes, that's the point. we outclevered ourselves into a syntax trap :/
p3rln00b pukku: because Pair is a type. It's also used in types other than a Hash, so to me it makes good sense.
arnsholt Right, right 19:44
I see what you mean now
pukku p3rln00b: ok
p3rln00b: does this mean that pairs are flattened in function calls? Or why did the error become that it received two arguments? 19:45
p3rln00b pukku: you got the error because the method isn't looking for any positionals
m: class { method attrib(*%named) { dd [ %named] } }.attrib: "foo" => "bar" 19:46
camelia rakudo-moar faba64: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤ in method attrib at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
smls geekosaur: You're not the only one. I think lizmat wanted to actually make that happen before the 6.c release, but it was decided against.
p3rln00b & debugging IE8 problems for customer who apparently loves using insecure, unsupported software ~_~
geekosaur arnsholt, basically the other discussion in here is the example of why it's a problem
arnsholt Yeah, clearly
smls geekosaur: I do like that the => syntax allows me to horizontally line up named args like this: gist.github.com/smls/fab2c620dc5fc...89b12e4a9d 19:47
smls I think I would have liked `key: value` even more, but that conflicts with the indirect method-call syntax, and possibly other things. 19:48
s/key: value/named-argument: value/
pukku p3nrln00b: hm. So why isn't the error message 'too many positionals: expected 0, but got 1'? 19:49
geekosaur yeh
pukku, the other positional is "self"
pukku geekosaur: ah. OK, I see. 19:50
pukku p3nln00b: Thanks muchly for helping me! I have to run off now, but I think I've got a (very slight) bit more familiar with perl6. And my small program looks a lot nicer! 19:56
[Coke] hurm. aspell doesn't like "pragma's", but is ok with 'pragma' and 'pragmas' 20:56
guess you need to be really explicit when you're adding to a skiplist 20:57
geekosaur agrees with aspell, actually 21:00
will sometimes write pragma-s
jonadab [Coke]: In order to know that attaching the clitic makes any sense, you have to know that the word is a noun.
Either that or list the possessive form separately, which is probably what most spelling dictionaries do. 21:01
dalek c: 6f130d4 | coke++ | doc/Type/Backtrace.pod6:
avoid typo, change word slightly
[Coke] jonadab: yup - hadn't realized I had already listed the other two in the local dict.
jonadab [Coke]: The really interesting question is, why isn't the plural pragmata? 21:04
I mean, it isn't; I've never seen it as "pragmata" ever. But I don't know _why_ it isn't.
[Coke] I for one am happy not to encourage pluralizations based on where we stole the word from. 21:06
geekosaur I have but usually from people trying to sound clever
harmil_wk geekosaur: I think that's "clevera" 21:10
[Coke] clevera sounds like a FF spell. 21:11
perlpilot_ jonadab: "pragmata" is in the Perl 5 docs in several places 21:14
jonadab perlpilot_: Huh. Interesting. 22:07
jonadab [Coke]: My preferred rule is, if the singular form has an obvious clear singular ending on it that gives away the etymology and declension, then the plural form should follow that. Otherwise not. 22:09
So I don't really care where the root _came from_ if the singular form is Anglicized: the plural form should be too in that case. 22:10
It is on this basis that I reject the ridiculous "octopodes" -- because if that were the plural, the singular should be "octopous", and it ain't.
jonadab (I accept both "octopuses" and "octopi".) 22:11
profan octopoudies
TEttinger cephalapods. 22:12
cephalopods.
escape artist jar-dwellers
en.wikipedia.org/wiki/Paul_the_Octopus Love these things. 22:15
timotimo escape artist jar-dweller sounds like a java malware 22:27
Herby_ o/ 22:49
7IZAAARNG ? 22:51
geekosaur services outage => weird nick renames 22:55
Herby__ ahh ok
I can now say that I'm using Perl 6 in production. Wrote a parser for a coworker who was tallying up months worth of data by hand 22:56
progress! 22:58
timotimo oh wow 22:59
yeah, that helps
[Coke] Herby__++ 23:17