Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-12-16

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:01 afresh1 joined #perl6
01:06 tbrowder .tell moritz just got my printed copy of “Parsing with Perl 6 Regexes and Grammars” and the print quality is much better than your first book. i look forward to studying it closely!
01:06 yoleaux tbrowder: I'll pass your message to moritz.
01:15 japhb Ulti++  # Very positive advent post
01:19 MasterDuke joined #perl6
01:27 aborazmeh joined #perl6
01:27 aborazmeh joined #perl6
01:30 colomon Amazon said I’d have my copy of moritz++’s new book by now, but apparently they fibbed.  Or maybe it’s out in the mailbox, too cold to check.
01:49 comborico1611 It's always exciting to get a new book.
01:57 colomon joined #perl6
02:01 Cabanossi joined #perl6
02:31 Cabanossi joined #perl6
02:57 ilbot3 joined #perl6
02:57 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
03:09 colomon joined #perl6
03:27 xinming joined #perl6
03:30 konsolebox joined #perl6
03:45 araraloren joined #perl6
03:48 araraloren o|
03:48 araraloren o/
03:48 araraloren o\\
03:49 raschipi o/
03:50 cdg joined #perl6
04:01 Cabanossi joined #perl6
04:05 Herby_ joined #perl6
04:08 ryn1x joined #perl6
04:20 araraloren eval: https://gist.githubusercontent.com/araraloren/9e088472525b6d369204db20d3d8c9ba/raw/acde467fb2395baf338141590db9c6a158a9b66d/gistfile1.txt
04:20 evalable6 araraloren, Successfully fetched the code from the provided URL.
04:20 evalable6 araraloren, rakudo-moar 370073fcd: OUTPUT: «(signal SIGHUP) OUT GET 5␤«timed out after 10 seconds»»
04:22 araraloren what happened of my script ?
04:26 piojo_ joined #perl6
04:27 colomon joined #perl6
05:00 Cabanossi joined #perl6
05:14 astronavt joined #perl6
05:17 araraloren joined #perl6
05:31 char_var[buffer] joined #perl6
05:32 char_var[buffer] joined #perl6
05:36 khisanth_ joined #perl6
05:52 Sgeo joined #perl6
05:55 john_parr joined #perl6
06:03 spider-mario joined #perl6
06:27 xcm joined #perl6
06:32 xinming_ joined #perl6
06:45 Cabanossi joined #perl6
06:50 cdg joined #perl6
07:07 teatime ugh
07:07 teatime wrong window
07:10 araraloren :)
07:18 darutoko joined #perl6
07:23 Hotkeys joined #perl6
07:30 Cabanossi joined #perl6
07:33 piojo_ joined #perl6
07:45 FiendKing04 joined #perl6
07:50 TimToady joined #perl6
07:52 natrys joined #perl6
07:56 AlexDaniel Ulti: you here?
07:56 AlexDaniel Ulti: question! What made you write “is export(*)”? :)
07:57 AlexDaniel Ulti: https://github.com/MattOates/Text--Homoglyph/blob/a7b89b506179373fc941a6a2cad6b520af02cfa8/lib/Text/Homoglyph.pm6#L100
07:57 AlexDaniel Ulti: that no longer works since https://github.com/rakudo/rakudo/commit/1668b4f0b89912c8b9988661ce2b42572cb3cb88
07:58 AlexDaniel I grepped the whole ecosystem and all chat logs since 2005 I think, nobody ever wrote something like that
08:13 domidumont joined #perl6
08:14 AlexDaniel Ulti: I created this pull request but let me know what you think: https://github.com/MattOates/Text--Homoglyph/pull/6
08:20 domidumont joined #perl6
08:37 rindolf joined #perl6
08:45 Cabanossi joined #perl6
08:48 setty1 joined #perl6
08:51 Mikasi joined #perl6
08:54 TimToady joined #perl6
09:01 moritz \o
09:01 yoleaux 01:06Z <tbrowder> moritz: just got my printed copy of “Parsing with Perl 6 Regexes and Grammars” and the print quality is much better than your first book. i look forward to studying it closely!
09:02 konsolebox joined #perl6
09:05 moritz tbrowder: ok. I didn't know there was a print quality issue with the first book; maybe it was just your copy...
09:07 Mikasi left #perl6
09:11 [ptc] moritz: I think Apress sometimes does "print on demand" and the quality isn't as good when they do that.  I've been bitten by that before; the text can be quite grey and sort of fuzzy
09:11 rindolf joined #perl6
09:11 [ptc] Amazon does that as well, so I've had to become more careful in which books I order from there
09:14 Hotkeys I just found out `@a[$i, $j] = @a[$j, $i]` is much slower than `(@a[$i], @a[$j]) = (@a[$j], @a[$i])`
09:14 yoleaux 19 Sep 2017 15:28Z <AlexDaniel> Hotkeys: I remember you liked golfing in perl 6 https://code-golf.io
09:14 Hotkeys oops has it been that long
09:14 AlexDaniel yeah
09:15 Hotkeys I'm trying to speed up this advent of code day 16 solution without changing my algorithm first
09:15 Hotkeys turns out that change up there cut my run time by 3x
09:15 AlexDaniel Hotkeys: file a PERF issue maybe?
09:16 AlexDaniel huggable: rakudobug
09:16 huggable AlexDaniel, Report bugs on https://github.com/rakudo/rakudo/issues/new    If you don't have access to GitHub, you can email your report to rakudobug@perl.org . See also: https://github.com/rakudo/rakudo/wiki/rt-introduction
09:17 traxex joined #perl6
09:23 parv joined #perl6
09:26 Hotkeys p6: my @a = [1,2]; for ^1000 { @a[0, 1] = @a[1, 0]; }; say now - BEGIN now;
09:26 camelia rakudo-moar 04eb1da6a: OUTPUT: «0.2041853␤»
09:26 Hotkeys p6: my @a = [1,2]; for ^1000 { (@a[0], @a[1]) = (@a[1], @a[0]); }; say now - BEGIN now;
09:26 camelia rakudo-moar 04eb1da6a: OUTPUT: «0.07333712␤»
09:26 Hotkeys yeah definitely quicker
09:35 wamba joined #perl6
09:45 Cabanossi joined #perl6
10:30 Cabanossi joined #perl6
10:51 sena_kun joined #perl6
10:55 RabidGravy joined #perl6
10:55 RabidGravy Boom!
10:59 RabidGravy thought I'd pop in to get myself in the mood for writing the advent article ;-)
11:00 ChoHag joined #perl6
11:08 traxex joined #perl6
11:30 AlexDaniel .pizza RabidGravy
11:30 AlexDaniel buggable: pizza RabidGravy
11:30 buggable RabidGravy, enjoy this slice of Meatzaa pizza, my friend! Yummy 🍕
11:30 RabidGravy :)
11:35 tbrowder moritz: in your first book the alignment of text blocks on some pages were a little uneven in places. also code examples don’t stand out very well from normal text. apress could do better.
11:39 teatime moritz: have you written about your process / tools / formats for writing books?
11:40 moritz teatime: not yet. Do you want the short version now?
11:41 teatime sure, if you want.  mainly curious what format the publisher accepts from you
11:42 moritz I can either use their word template, give them a PDF
11:42 moritz I chose the latter
11:42 moritz I use leanpub's markdown writing mode, with a private bitbucket repo
11:42 moritz git repo, that is
11:43 moritz and leanpub automatically renders on a git push, and puts the files into dropbox
11:43 teatime so you do all the typesetting yourself, or they go through and scrape your pdf ?
11:43 moritz they do it
11:43 moritz when the manuscript is finished, I hand them over the PDFs, one for each chapter
11:43 moritz and they put it into their own system
11:44 moritz and from there on, corrections work through their online proofing system, or through comments on PDF files
11:44 teatime interesting.  how do you like it?
11:45 teatime do they edit your grammar? :)
11:45 moritz I like it better than using MS Word :-)
11:45 moritz yes, there's a copy editing phase after typesetting
11:45 mahafyi joined #perl6
11:45 moritz and then I get to see the result, and can proof-read once again
11:46 mahafyi hello all :)
11:46 moritz and for the first book, that was it. For the second one, they screwed up a bit, and we needed 3 or 4 proof-reading + correction cycles
11:47 RabidGravy Are there any Advent articles with images (e.g. diagrams,) in ?  Wondering  what the best way to do it is.  Or whether that is a yak best left hairy
11:48 moritz RabidGravy: one of mine has book cover thumbnails in it
11:49 moritz RabidGravy: wordpress has a "media library" where you can upload images, and it gives you the URLs
11:49 moritz and then you can just <img src="..." /> in your post
11:50 RabidGravy ah, cool, just the job, cheers
11:56 rindolf joined #perl6
11:56 piojo_ joined #perl6
12:00 Cabanossi joined #perl6
12:04 mahafyi from perl6intro.com - You are free to name your identifiers as you like, but it is good practice to adopt one naming convention consistently. camelCase, kebab-case, snake_case , what is considered standard best practice? or is there no such consideration?
12:04 RabidGravy most people would prefer kebab-case
12:06 El_Che many people aren't really huge kebab-case fans, but use it becase a part of the community uses it :)
12:07 teatime I don't use it elsewhere, but it works well for perl6 for me
12:07 El_Che yes, same for me
12:08 RabidGravy well to be fair there aren't many languages that allow it
12:08 Hotkeys I don't use it elsewhere typically because elsewhere doesn't allow it :P I am a fan though
12:09 araraloren For me it only works on Perl6
12:09 araraloren :) Other language I know not support that
12:10 teatime it does get some use I suppose, now that I think about it.  css, domain names.  I use a variant for filenames sometimes
12:10 RabidGravy I get a bit confused at times at work as I do mostly Perl 5 with a bit of Scala on the side and the latter is camelCased by convention
12:10 manchicken joined #perl6
12:10 El_Che camacase is ugly, but place efficient
12:10 teatime does perl5 have a convention?
12:10 El_Che snake_case
12:11 teatime (aside: amusing it isn't camelcase)
12:11 El_Che haha
12:12 Ulti AlexDaniel: no idea, but Ill accept the PR now
12:13 AlexDaniel 👍
12:13 traxex where does the name kebab-case come from?
12:15 mahafyi traxex , it-is-text-skewered-thru-with-hyphen , heh i just red that somewhere.
12:20 manchicken What?! Decent unit tests for documentation?! Absurd(ly useful)!
12:21 manchicken Aww, that's no fun. The spellcheck test fails for words in code.
12:23 manchicken Does anybody know where the `aspell.pws` file ran off to? I don't see it in git.
12:23 manchicken Oh, no, there it is. Nevermind me.
12:25 mahafyi how can one combine a reduction operator with a range constructor - example for 5! , do [*]|(1..5) ?
12:25 teatime why the | ?
12:26 teatime m: say [*](1..5)
12:26 camelia rakudo-moar 04eb1da6a: OUTPUT: «120␤»
12:26 araraloren reduce is operator on **list** :)
12:27 mahafyi teatime, tahnks
12:29 mahafyi m: say 'thats a nice feature indeed !';
12:29 camelia rakudo-moar 04eb1da6a: OUTPUT: «thats a nice feature indeed !␤»
12:29 teatime yeah.. it's kinda weird it works now that you mention it, but it seems to dwym
12:30 Cabanossi joined #perl6
12:31 teatime guess that's the point/magic of range, it's iterable
12:44 mahafyi is there any recommended base modules install , like 'zef install these modules upon installation'
12:44 setty1 joined #perl6
12:47 AlexDaniel mahafyi: hmmm… maybe the ones that come with rakudo star https://github.com/rakudo/star/blob/master/modules/MODULES.txt
12:48 AlexDaniel hmm that's not the most useful format definitely
12:48 RabidGravy I hate it when I'm trying to describe something and notice there is a flaw in it, ho hum.
12:49 mscha joined #perl6
12:50 mscha m: $*OUT.autoflush = True; # Is there a way to set autoflush on a file handle?
12:50 camelia rakudo-moar 1da698ab0: OUTPUT: «No such method 'autoflush' for invocant of type 'IO::Handle'␤  in block <unit> at <tmp> line 1␤␤»
12:53 mahafyi how can one run a bash command from a perl6 program? example execute 'zef install uri' ?
12:53 araraloren use `shell`
12:53 mscha Specifically, $*OUT seems to autoflush when it's directed to a terminal, but not when it's redirected or piped.  Any way to set autoflush in that case?
12:54 araraloren m: say shell('ls')
12:54 camelia rakudo-moar 1da698ab0: OUTPUT: «shell is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub shell at src/RESTRICTED.setting line 15␤  in block <unit> at <tmp> line 1␤␤»
12:54 mahafyi araraloren , ty
12:54 araraloren eval: say shell('ls sandbox/*')
12:54 evalable6 araraloren, rakudo-moar 1da698ab0: OUTPUT: «sandbox/0.806238500539699.lock␤sandbox/answer␤sandbox/can␤sandbox/foofoo␤sandbox/foo.lock␤…»
12:54 evalable6 araraloren, Full output: https://gist.github.com/4c8cb5a4ffda8641df8aec0ae7f821cf
12:57 mscha m: $*OUT.out-buffer = 0; # To answer my own question...
12:57 camelia rakudo-moar 1da698ab0: ( no output )
12:57 araraloren mscha, not found it in documents :)
12:57 mahafyi shell('ls')  as an example works fine of course. The console has output that includes thi line -> Proc.new(in => IO::Pipe, out => IO::Pipe, err => IO::Pipe, exitcode => 0, signal => 0, command => ["ls -asl"])
12:58 mahafyi how can the perl6 script get that output and act upon it, example if exitcode not eq 0 , do something.
12:58 araraloren But this maybe lower performance :)
12:59 AlexDaniel mahafyi: both `run` and `shell` return a Proc object: https://docs.perl6.org/type/Proc
13:00 AlexDaniel mahafyi: also, depending on what you do, you may be better off with `run`
13:01 mahafyi AlexDanel : thanks . i want to try and read that url  https://github.com/rakudo/star/blob/master/modules/MODULES.txt, strip all comment and whitespaces and use zef install module-name, and try to do that with concurrency, and if there is a failure to install , to produce an error message to manually install it , perhaps with force.
13:02 araraloren Is zef can support concurrency install ?
13:03 araraloren maybe not :)
13:03 mahafyi araraloren : ah ok ! thanks
13:04 MasterDuke joined #perl6
13:05 araraloren You can read the MODULES line by line, use zef check if it already installed, I think it's quite simple
13:05 araraloren eval: say shell('zef info zef')
13:05 evalable6 araraloren, rakudo-moar 1da698ab0: OUTPUT: «/bin/sh: zef: command not found␤Proc.new(in => IO::Pipe, out => IO::Pipe, err => IO::Pipe, exitcode => 127, signal => 0, command => ["zef info zef"])␤»
13:08 philomath_ joined #perl6
13:09 manchicken Always fun to have unit tests which don't pass before you even start making changes...
13:15 Cabanossi joined #perl6
13:17 AlexDaniel manchicken: is that in the doc repo?
13:17 manchicken Yeah
13:18 AlexDaniel manchicken: we don't force contributors to run xt tests, so that happens sometimes
13:18 manchicken I'm trying to fix them.
13:18 AlexDaniel manchicken++
13:18 manchicken I've gotta take my boys for breakfast, so I'm going to submit a pull request with a little blurb about pre-allocating containers in C structs for nativecall, along with a few test fixes.
13:19 AlexDaniel mahafyi: maybe it's easier to go through every directory here https://github.com/rakudo/star/tree/master/modules
13:19 AlexDaniel mahafyi: and do `zef install .`
13:22 mahafyi AlexDaniel : ty, i will try. still working on shell(ls -asl) , lol , to capture exitcode with proc object, heh
13:25 Voldenet joined #perl6
13:25 Voldenet joined #perl6
13:25 brrt joined #perl6
13:31 Geth ¦ doc: manchicken++ created pull request #1715: Docfix manchicken 2017 12 12
13:31 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1715
13:31 manchicken Oh, that's a neat trick!
13:31 manchicken The Geth announce your pull requests now.
13:34 comborico1611 joined #perl6
13:43 manchicken joined #perl6
13:44 natrys joined #perl6
13:49 |oLa| left #perl6
13:53 mahafyi AlexDaniels :  how to list the modules in https://github.com/rakudo/star/tree/master/modules ? Sorry but I do not know git at all. Do we parse the HTML, or is there a git command line to do that ?
13:54 araraloren It's in https://github.com/rakudo/star/blob/master/.gitmodules
13:54 araraloren the sub modules
13:55 mahafyi araraloren, thanks!
14:00 Cabanossi joined #perl6
14:01 eliasr joined #perl6
14:04 RabidGravy I also hate it when I am half way through the article and start coming up with even cooler examples in addition to the more than plenty I already have
14:04 RabidGravy I may have to write a follow-up
14:05 AlexDaniel mahafyi: I was thinking that you can just git clone --recursive https://github.com/rakudo/star.git
14:05 AlexDaniel mahafyi: and it'll clone all submodules also
14:06 espadrine joined #perl6
14:14 mahafyi AlexDaniel: thanks
14:15 MasterDuke joined #perl6
14:16 MasterDuke Hotkeys, AlexDaniel: re slow array slicing, https://rt.perl.org/Public/Bug/Display.html?id=127881#ticket-history
14:24 mahafyi a very late question : the rakudo start distribution already has all these modules installed? https://github.com/rakudo/star/tree/master/modules
14:25 araraloren yeah, I think it is
14:25 mahafyi it is, i feel rather foolish, but anyways it was a good exercise for the day, lol.
14:30 Cabanossi joined #perl6
14:30 MasterDuke_ joined #perl6
14:39 mahafyi except DBIsh , it doesn't ship by default, everything else is there on a fresh install of rakudo-star (i have 2017.10)
14:52 RabidGravy which reminds me, does anyone have any strong feelings against deprecating the "heritage" fetch* methods in DBIish as per https://github.com/perl6/DBIish/issues/110 ? Otherwise I'll probably do it tomorrow.
14:56 moritz RabidGravy: have you looked in the ecosystem if they are in use?
14:58 RabidGravy no, I was going check that beforehand and send PRs
15:12 dogbert17 I wouldn't be surprised if there is a bot which can help out with the searching
15:15 Cabanossi joined #perl6
15:16 mahafyi m: say my %hash-1('k1','v1','k2','v2','k3','v3');
15:16 camelia rakudo-moar 1da698ab0: OUTPUT: «No such method 'CALL-ME' for invocant of type 'Int'␤  in block <unit> at <tmp> line 1␤␤»
15:17 mahafyi sorry
15:17 mahafyi m: say my %hash-one('k1','v1','k2','v2','k3','v3');
15:17 camelia rakudo-moar 1da698ab0: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤The () shape syntax in hash declarations is reserved␤at <tmp>:1␤------> 3 %hash-one('k1','v1','k2','v2','k3','v3'7⏏5);␤    expecting any of:␤        constraint␤        formal parameter␤»
15:18 mahafyi argh, pl ignore
15:19 MasterDuke joined #perl6
15:21 mahafyi m: say my %kvp1 = ('k1','v1','k2','v2','k3','v3');
15:21 camelia rakudo-moar 1da698ab0: OUTPUT: «{k1 => v1, k2 => v2, k3 => v3}␤»
15:22 mahafyi m: say my %capitals = ('India','New Delhi','UK','London','Germany','Berlin');
15:22 camelia rakudo-moar 1da698ab0: OUTPUT: «{Germany => Berlin, India => New Delhi, UK => London}␤»
15:22 mahafyi why does the order of the hashes switch like this?
15:24 AlexDaniel dogbert17: like greppable?
15:24 AlexDaniel greppable6: fetch\w
15:24 greppable6 AlexDaniel, https://gist.github.com/937a1569189fdfa33b096b4fecf75393
15:24 teatime mahafyi: it is the nature of hashes
15:24 teatime mahafyi: you get fast lookup by (usually string) key, but they don't preserve order.
15:25 mahafyi so, we should expect order to be prserved like in an array, when we use hash?
15:25 teatime a list of pairs would preserve order, but lookups would be O(n)
15:25 mahafyi should *not* i meant
15:25 AlexDaniel greppable6: fetch(row|all)
15:25 greppable6 AlexDaniel, https://gist.github.com/778fb610bd2f13bfa7f799c9bfeb0eca
15:25 AlexDaniel RabidGravy: ↑ ? :)
15:26 teatime mahafyi: right, you can't expect that, then it wouldn't be a hash (aka a hashmap, map, dictionary, key-value store), it'd be something else
15:26 MasterDuke mahafyi: internally they have no order, but if you just 'say' it, it will sort before printing
15:26 mahafyi teatime : if i define like (k1 => v1) then order will preserved, but if we expect perl6 (i assume this is 'lookup') then we cannot expect order to be preserved?
15:27 teatime mahafyi: I don't understand the question quite?  but, it's not unique to perl6
15:27 mahafyi ok , so we cannot use the order like in a array, for a hash?
15:27 mahafyi teatime : but i dont know other languages either, ha aha
15:27 RabidGravy AlexDaniel: 👍
15:27 mahafyi i get it (i think)
15:27 teatime right.  you can sort a hash, by key or value or whatever, to get a known deterministic output order
15:28 AlexDaniel RabidGravy: well, if I were you, I'd probably create a bunch of pull requests to these modules first
15:28 mahafyi ok ty
15:28 AlexDaniel RabidGravy: and then deprecate it right after that
15:28 AlexDaniel RabidGravy: otherwise unsuspecting users might see deprecation messages and stuff, which we probably don't want to happen
15:28 teatime oh I should have included "associative array" in the list of names
15:29 AlexDaniel but that'd be in an ideal world, feel free to do it any way you like :)
15:29 teatime mahafyi: https://en.wikipedia.org/wiki/Associative_array
15:29 mahafyi teatime : Thanks
15:30 dogbert17 AlexDaniel++ greppable
15:31 RabidGravy AlexDaniel, it looks like it's only https://github.com/tony-o/perl6-db-orm-quicky the rest are false positives
15:50 mahafyi m: my %h; %h<a b c d e> = 'A'..* ; say %h;
15:50 camelia rakudo-moar 1da698ab0: OUTPUT: «{a => A, b => B, c => C, d => D, e => E}␤»
15:51 mahafyi heheh, somehow these kind of things take away 'the-beginner-programming-funk'
15:51 geospeck joined #perl6
15:54 RabidGravy bear in mind that the .gist of Hash explicitly sorts the keys like that
15:57 RabidGravy I've wondered before whether that is actually sensible as it may cause people to reason incorrectly about the behaviour of hashes
16:00 * colomon is used to ordered “dictionary” type structures from his C++ programming, easy to fall into thinking P6 does that too
16:30 Cabanossi joined #perl6
16:59 timotimo i think the idea behind it is that gist is for human consumption, and if you output multiple hashes it might be helpful if all of them were sorted so coinciding keys are more apparent?
17:00 wamba joined #perl6
17:05 TimToady yes, random orderings of subhashes is really, really irritating when you just want to dump out a data structure and look at it, especially when there gets to be more than a few entries in each hash
17:06 TimToady and the worst that will arise from the misunderstanding is that something will happen in an unexpected order, which is usually benign and easily fixable
17:08 timotimo if you have code like for %myhash.pairs -> $p { given $++ { when 0 { "say $p.value() is for key 'a'" }; when 1 { "say $p.value() is for key 'b'" } } } that can be problematic :D
17:08 * timotimo BBL
17:17 brrt joined #perl6
17:31 timotimo so ... where *do* we turn postfix:<++> into prefix:<++> calls? i don't see it in the optimizer or the actions
17:32 AlexDaniel timotimo: wrong channel?
17:32 timotimo oh, yeah
17:35 troys joined #perl6
17:44 Zucker joined #perl6
17:45 Cabanossi joined #perl6
17:47 khw joined #perl6
17:49 Zucker left #perl6
17:55 espadrine joined #perl6
18:15 MasterDuke joined #perl6
18:19 raschipi joined #perl6
18:24 rindolf joined #perl6
18:27 araraloren eval: https://gist.githubusercontent.com/araraloren/9e088472525b6d369204db20d3d8c9ba/raw/ccbd1e8e8408899df182e1ef6aac64f005dd0604/gistfile1.txt
18:27 evalable6 araraloren, Successfully fetched the code from the provided URL.
18:27 evalable6 araraloren, rakudo-moar ae6177ca2: OUTPUT: «I am foo, 1␤CREATE FOO 3␤I am foo, 1␤I am foo, 3␤I am bar, 2␤I am foo, 1␤I am foo, 3␤I am bar, 2␤I am foo, 1␤I am foo, 3␤I am foo, 3␤»
18:27 araraloren An simulate OS bash on gather/take :)
18:27 araraloren Quite simple :)
18:29 yqt joined #perl6
19:00 geospeck joined #perl6
19:05 comborico1611 joined #perl6
19:05 zakharyas joined #perl6
19:07 Mikasi joined #perl6
19:30 Cabanossi joined #perl6
19:31 poohman joined #perl6
19:32 poohman hello all
19:32 poohman my $dom = DOM::Tiny.parse($content);
19:33 poohman say $dom.all-text;
19:33 evalable6 poohman, rakudo-moar ae6177ca2: OUTPUT: «(exit code 1) ===SORRY!=== Error while compiling /tmp/utWttSdBAn␤Variable '$dom' is not declared␤at /tmp/utWttSdBAn:1␤------> say ⏏$dom.all-text;␤»
19:33 poohman this works
19:33 poohman my $dom = DOM::Tiny.parse($content);
19:33 poohman my $table = $dom.at('table');
19:33 poohman say $table.all-text;
19:33 evalable6 poohman, rakudo-moar ae6177ca2: OUTPUT: «(exit code 1) ===SORRY!=== Error while compiling /tmp/d5EIlweSMo␤Variable '$table' is not declared␤at /tmp/d5EIlweSMo:1␤------> say ⏏$table.all-text;␤»
19:33 moritz poohman: please use a pastebin for pasting multiple lines of code
19:34 poohman this does not give any text even though $table contains text
19:34 poohman sorry
19:38 astronavt joined #perl6
19:38 Mikasi joined #perl6
19:40 poohman https://pastebin.com/ry9Yxgne
19:40 poohman does not print any text even though the table has text
19:42 moritz poohman: what's your input?
19:42 ctilmes joined #perl6
19:43 ctilmes This one is driving me nuts.  I can reliably produce this error, but if I make tiny changes, it goes away: https://gist.github.com/CurtTilmes/d2da15881eaf7df567e2a93cf1e91b14
19:43 yoleaux 6 Dec 2017 04:47Z <Herby_> ctilmes: ++ on the advent article
19:44 poohman https://pastebin.com/u5hZnBhz
19:45 poohman if I dont use the "at" method to narrow the tree only to table, it works
19:45 moritz poohman: uhm, I get an error response from http://www.sedar.com/FindCompanyDocuments.do
19:45 moritz and that error response contains only one table, and that table doesn't contain anx text
19:47 brrt joined #perl6
19:48 poohman https://pastebin.com/qz4nxE14
19:48 poohman this has the full file im running
19:49 poohman the formdata hash was missing last tie
19:51 poohman the grammar is not used - but i just copied everything i was running
19:53 poohman and moritz - got ur new regex ebook - by the way - pretty cool
19:54 moritz nice
19:54 moritz poohman: http://perlpunks.de/paste/show/5a3579ff.57fa.347 this is what that URL returns for me
19:55 moritz and the sole <TABLE> in there has child elements, but none of the child elements contain any text
19:55 poohman you get this even with the last pastebin i posted??
19:56 poohman strange
19:56 moritz poohman: no, I haven't run your full example, because I don't have cro installed
19:56 poohman oh ok
19:56 moritz poohman: I opened the URL in the browser, and saved the result
19:57 moritz sorry, I don't think I can help very much right now :(
19:57 greppable6 joined #perl6
19:58 poohman ok - ill look around in the code of the module - felt lazy to do that 😁
19:58 poohman thanks
20:00 ctilmes Here's a better gist demonstrating my weird error: https://gist.github.com/CurtTilmes/7f1d39f7c4df0c3c2458292fe57aae60
20:00 ctilmes If I remove the extraneous module, it works fine.
20:04 MasterDuke joined #perl6
20:05 ctilmes What does this message mean: Type check failed in assignment to $!list; expected Array[Str] but got Array[Str].new("this")
20:09 SmokeMachine Hi! Is there any kind of Hash that the key is a weakref (or something like that) and when it’s garbage collected it’s value become free to be garbage collected too?
20:12 Zoffix joined #perl6
20:13 CIAvash[m] ctilmes: Probably the same bug as https://rt.perl.org/Public/Bug/Display.html?id=127309
20:13 Zoffix ctilmes: that looks a lot like RT#128287 / RT#132525  I bet sticking `no precomp` into those modules makes it go away, eh?
20:13 synopsebot RT#128287 [open]: https://rt.perl.org/Ticket/Display.html?id=128287 [BUG] Type check `Array[Foo]` in module gets confused if `Array[Foo]` was already referenced in another precompiled module.
20:13 Hotkeys joined #perl6
20:13 synopsebot RT#132525 [open]: https://rt.perl.org/Ticket/Display.html?id=132525 [REGRESSION][PRECOMP] type constraints to Array[Pair] don't work when precompiled
20:13 ctilmes Got it.  Thank you.
20:16 ctilmes Was driving me nuts -- error seems to come and go, very difficult to reproduce
20:16 Zoffix poohman: what's the HTML code you're parsing? Dump it and pastebin it
20:16 MasterDuke looks like those three could all be combined
20:17 poohman ok wait please
20:18 Zoffix poohman: dump it from within your program, before you give it to DOM::Tiny
20:18 Zoffix (a brower may error correct and give you something different)
20:18 Herby_ joined #perl6
20:18 Herby_ o/
20:18 Zoffix |
20:18 Zoffix |\
20:19 Hotkeys o7
20:19 Mikasi joined #perl6
20:20 Herby_ Zoffix: how goes it?
20:20 Zoffix Been hunting a SEGV for ~12 hours. Giving up :)
20:21 Zoffix c: HEAD use lib '/home/bisectable/git/whateverable/sandbox/Inline-Perl5/lib'; for ^1000 { EVAL('sub { shift->() }', :lang<Perl5>)({;}) }
20:21 committable6 Zoffix, ¦HEAD(ae6177c): « «exit signal = SIGSEGV (11)»»
20:21 Herby_ never give up, never surrender!
20:21 Herby_ I'd give some sage advice if I knew what SEGV was
20:21 Zoffix heh
20:21 Zoffix Herby_: https://en.wikipedia.org/wiki/Segmentation_fault
20:22 Herby_ ahh
20:22 poohman https://pastebin.com/CEzL2MBR
20:23 poohman there you go with the html dump
20:24 * Zoffix tries
20:27 Zoffix poohman: it's not a DOM::Tiny problem. Getting same empty stuff with Perl 5's Mojo::DOM
20:28 Zoffix Ah
20:28 Zoffix poohman: first table ain't got no text
20:28 Zoffix just images
20:28 poohman ah ok
20:28 poohman sorry for the wild goose chase
20:29 SmokeMachine Any idea of how can I use (or create) a weak ref map?
20:29 Zoffix poohman: this prints all tables: perl6 -MDOM::Tiny -e 'DOM::Tiny.parse(slurp "foo.html").find("table")».all-text.say'
20:30 Zoffix SmokeMachine: don't really know what you mean, but we don't use reference counting. Objects will get GCed when they're no longer reachable
20:30 * Zoffix &
20:30 Zoffix left #perl6
20:30 poohman i did try the find method but it complained saying it was Seq
20:31 poohman i did not use the>> operator though
20:31 poohman how does it change things?
20:32 poohman the find method does not return a DOM::Tiny object??
20:33 poohman or is the all-text method not part of DOM::Tiny
20:33 poohman I could not find it in the module
20:34 Zoffix joined #perl6
20:35 Zoffix poohman: .at() returns the first element matching the selector, .find() returns a `Seq`uence of all elements matching the selection. Each element of that Seq is a DOM::Tiny object and the `».all-text` is a way to call .all-text on each of those elements
20:35 SmokeMachine I want something that frees the value to be gced when the key is gced
20:35 SmokeMachine Zoffix: ^^
20:36 poohman Seq of DOM::Tiny - ok got it - Thanks
20:36 Zoffix SmokeMachine: no idea what that means. If the object is unreachable, it'd be GCed. Kinda makes me think you shouldn't be worried about stuff like that?
20:37 Zoffix SmokeMachine: what problem are you trying to solve?
20:37 SmokeMachine Something like this: https://docs.oracle.com/javase/7/docs/api/java/util/WeakHashMap.html
20:38 poohman is there a shortcut for the smaller >> instead of the unicode values?
20:38 Zoffix SmokeMachine: that's a tool to solve a problem, not a problem in itself :)
20:39 Zoffix poohman: what do you mean?
20:39 poohman i meant in the keyboard
20:39 Zoffix >> is the ASCII version of »
20:40 DrForr poohman: Are you on Unix/Linux?
20:40 Zoffix m: <a b c>>>.uc.say; <a b c>».uc.say
20:40 camelia rakudo-moar ae6177ca2: OUTPUT: «(A B C)␤(A B C)␤»
20:40 Zoffix left #perl6
20:40 poohman Fedora
20:41 DrForr You can use the Character Map, or there may already be an xcompose alias.
20:41 DrForr Another way of saying that is "look around for compose-key"
20:42 SmokeMachine Zoffix: I’m caching stuff indexed by a  the object of a websocket supply... I want to make all the cache become garbage collected when the websocket closes...
20:42 poohman ok - ill give it a search
20:42 DrForr 'man xcompose' is a good start.
20:43 poohman ok
20:45 SmokeMachine Does it make sense?
20:45 DrForr SmokeMachine: He /part'ed a few minutes ago.
20:47 DrForr Long story short is "you can use one of your dead (unused) keys to type <windows> '>' '>' to get the guillemot."
20:47 RabidGravy Zoffix, I may be doing simply really dumb with the Markdown but the advent-highligher (sic) seems to be royally messing up the code blocks for me. It starts off alright but it seems to lose track after a while
20:47 DrForr 'compose' came about because the early DEC terminals where X started had a 'CC' key for compose-character.
20:49 DrForr (had plenty of fun with that in college...)
20:53 Zoffix joined #perl6
20:53 RabidGravy I keep meaning to make a special xcompose file for all the pwetty operators that don't already have an entry
20:54 Zoffix RabidGravy: what's your example code?
20:54 SmokeMachine DrForr: sorry, I didn’t get it... what do you mean with <windows>?
20:54 Zoffix RabidGravy: also which markdown parser are you telling it to use Perl 6 one or Perl 5?
20:54 Zoffix SmokeMachine: I would've just delete the cache from the socket close handler. That's possible isn't it?
20:54 DrForr It's a "dead key" in Linux because applications don't use it in general.
20:55 RabidGravy Zoffix, I'll look at it tomorrow now as I have, er, deadline pressure
20:56 SmokeMachine Zoffix: that’s what I’m doing now... :(
20:57 committable6 joined #perl6
20:57 RabidGravy I have Compose set to the right Alt key here
20:58 releasable6 joined #perl6
20:58 benchable6 joined #perl6
20:58 quotable6 joined #perl6
20:58 bloatable6 joined #perl6
20:58 evalable6 joined #perl6
20:58 coverable6 joined #perl6
20:58 reportable6 joined #perl6
20:58 nativecallable6 joined #perl6
20:58 bisectable6 joined #perl6
20:58 unicodable6 joined #perl6
20:58 squashable6 joined #perl6
20:58 statisfiable6 joined #perl6
20:58 DrForr RabidGravy: I was explaining for poohman.
20:59 Zoffix SmokeMachine: so, problem solved then? :)
20:59 Zoffix .tell AlexDaniel last release blocker is now resolved: https://github.com/rakudo/rakudo/issues/1308
20:59 yoleaux Zoffix: I'll pass your message to AlexDaniel.
20:59 DrForr (mine is the VirtualBox escape, I use left-Windows for compose.)
20:59 RabidGravy I have variously tried the wiindows and menu keys but the right Alt works best
21:00 Zoffix SmokeMachine: what you desribe with weakref stuff isn't making much sense in my head. How do you know "a key is no longer in use"? To me, the answer is you'd delete it from the socket close event. And once you do that, our normal GC will clean everything up, so you don't need any weekref stuff
21:01 RabidGravy Zoffix, I'm going to revert to last seasons little number, eschewing the syntax highlighting and remembering to manually remove the extraneous <p> by hand :)
21:02 Zoffix RabidGravy: OK :()
21:02 Zoffix RabidGravy: well, I was using Perl 5's Text::MultiMarkdown and it worked alright: https://github.com/zoffixznet/perl6-Acme-Advent-Highlighter#--multi-option-for-multi-markdown
21:03 Zoffix So install it and use the --multi option. I recall not liking the parse with Perl 6's Markdown module, so maybe it is it that giving you trouble
21:03 riatre joined #perl6
21:04 * Zoffix retreats to #perl6-dev
21:04 Zoffix left #perl6
21:07 kst joined #perl6
21:17 labster joined #perl6
21:18 Cabanossi joined #perl6
21:18 nightfrog joined #perl6
21:29 brrt joined #perl6
21:31 manchicken joined #perl6
21:31 TEttinger joined #perl6
21:32 manchicken Anybody from the doc team around?
21:33 raschipi Everyone
21:34 manchicken Need help with this: https://github.com/perl6/doc/pull/1715/conflicts
21:34 manchicken Wasn't sure if I should talk about this here, or in #perl6-dev
21:37 manchicken It looks like, on `master`, one of the columns demonstrating a different way of passing keys to named parameters was remove.
21:46 Geth ¦ doc: fbab8d318b | (Michael D. Stemle, Jr)++ (committed by Zoffix Znet) | 5 files
21:46 Geth ¦ doc: Docfix manchicken 2017 12 12 (#1715)
21:46 Geth ¦ doc:
21:46 Geth ¦ doc: * Adding a little clarity on pre-allocating strings.
21:46 Geth ¦ doc: * Fixed CONTRIBUTORS.md
21:46 Geth ¦ doc: * Correcting test failures.
21:46 Geth ¦ doc: * Fixing some tests.
21:46 Geth ¦ doc: * Tidied up a little.
21:46 Geth ¦ doc: review: https://github.com/perl6/doc/commit/fbab8d318b
21:47 Geth ¦ doc: ce4aefa7cc | (Zoffix Znet)++ | doc/Language/pod.pod6
21:47 Geth ¦ doc: Remove merge conflict markers
21:47 Geth ¦ doc: review: https://github.com/perl6/doc/commit/ce4aefa7cc
21:47 synopsebot Link: https://doc.perl6.org/language/pod
22:11 Geth ¦ doc: bcda499285 | MasterDuke17++ (committed using GitHub Web editor) | doc/Language/nativecall.pod6
22:11 Geth ¦ doc: Fix typo
22:11 Geth ¦ doc: review: https://github.com/perl6/doc/commit/bcda499285
22:11 synopsebot Link: https://doc.perl6.org/language/nativecall
22:14 comborico1611 joined #perl6
22:32 Geth ¦ doc: 287bd03332 | (Zoffix Znet)++ | xt/code.pws
22:32 Geth ¦ doc: Make xtest pass
22:32 Geth ¦ doc:
22:32 Geth ¦ doc: The only thing remaining is https://github.com/perl6/doc/issues/1693
22:32 Geth ¦ doc: and I don't know the right new behaviour to document it.
22:32 Geth ¦ doc:
22:32 Geth ¦ doc: P.S.: I sorted the code.pws with `sort xt/code.pws -u -o xt/code.pws`
22:32 Geth ¦ doc: which seems to move words with marks on them from the end of the file.
22:32 Geth ¦ doc: review: https://github.com/perl6/doc/commit/287bd03332
22:36 llfourn joined #perl6
22:37 markong joined #perl6
22:44 vike joined #perl6
22:44 MasterDuke joined #perl6
22:47 Hotkeys joined #perl6
23:05 moritz RabidGravy: how is your advent post coming along?
23:06 moritz it's supposed to be up in about an hour :-)
23:06 RabidGravy It'll be there or there abouts, stopped yak shaving now
23:07 moritz that's great
23:07 moritz though I won't stay up long enough to read it :-)
23:08 Hotkeys apparently `my $temp = @a[$i]; @a[$i] = @a[$j]; @a[$j] = $temp;` is even faster still than `(@a[$i], @a[$j]) = (@a[$j], @a[$i]);`
23:12 Hotkeys not on a small scale, but it saves a few seconds when it happens nearly 500,000 times
23:42 Herby_ .tell mattoates ++ on the advent article
23:42 yoleaux Herby_: I'll pass your message to mattoates.
23:47 MasterDuke joined #perl6
23:48 AlexDani` joined #perl6
23:52 MasterDuke Herby_: i think mattoates on github is Ulti her
23:55 avar joined #perl6
23:55 avar joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo