Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-11-19

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:11 mattp_ joined #perl6
00:14 kyclark joined #perl6
00:25 dj_goku joined #perl6
00:25 dj_goku joined #perl6
00:31 telex joined #perl6
00:34 pierre_ joined #perl6
01:10 mohae_ joined #perl6
01:16 cooper_ joined #perl6
01:29 dalek doc: 5e0175f | seatek++ | doc/Language/regexes.pod6:
01:29 synopsebot6 Link: http://doc.perl6.org/language/regexes
01:29 dalek doc: Added POSIX character classes
01:29 dalek doc:
01:29 dalek doc: Didn't test *all* of them.
01:29 dalek doc: review: https://github.com/perl6/doc/commit/5e0175f091
01:35 travis-ci joined #perl6
01:35 travis-ci Doc build errored. seatek 'Added POSIX character classes
01:35 travis-ci https://travis-ci.org/perl6/doc/builds/177192209 https://github.com/perl6/doc/compare/87c254f10054...5e0175f0919d
01:35 travis-ci left #perl6
01:39 seatek dalek: exterminate travis
01:51 BenGoldberg Daleks only exterminate Doctors, everyone knows that.
01:54 richi235 left #perl6
01:55 gfldex viki: on it
01:55 yoleaux 18 Nov 2016 22:27Z <viki> gfldex: FYI: https://github.com/gfldex/perl6-pod-to-bigpage/issues/5
01:56 bitmap joined #perl6
02:04 gfldex does anything speak against adding IO::Socket::SSL as a dep of LWP::Simple?
02:07 dylanwh I would argue for that -- HTTP pretty much means HTTPS these days
02:07 travis-ci joined #perl6
02:07 travis-ci Doc build errored. seatek 'Added POSIX character classes
02:07 travis-ci https://travis-ci.org/perl6/doc/builds/177192209 https://github.com/perl6/doc/compare/87c254f10054...5e0175f0919d
02:07 travis-ci left #perl6
02:10 gfldex travis is happy with Pod::To::BigPage now so the next doc build should be fine
02:17 seatek don't make excuses for him. travis just hates me. DALEK!!
02:20 Xliff What is the difference between '|' and '||' in a grammar?
02:20 BenGoldberg m: use MONKEY-SEE-NO-EVAL; BEGIN 'my $fourtwo = 42;'; say $fourtwo
02:20 camelia rakudo-moar bca0ae: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$fourtwo' is not declared␤at <tmp>:1␤------> 3NO-EVAL; BEGIN 'my $fourtwo = 42;'; say 7⏏5$fourtwo␤»
02:20 Xliff seatek: EXX - TEEER - MIIIIIN - AAAATE!
02:21 Xliff Er.. *cough*... Sorry. I couldn't resist.
02:21 seatek happy happy! :)
02:21 gfldex | is longest token || is just or
02:21 Xliff seatek: joy joy! ;)
02:21 Xliff gfldex: Ah! I got it.
02:21 Xliff I think.
02:22 gfldex when it comes to grammars "I think" is pretty much the default :)
02:22 Xliff gfldex: In some cases, those can mean the same thing, right?
02:22 gfldex i think so :D
02:22 Xliff gfldex: LOL!
02:26 AlexDaniel well the idea is that you should prefer |, I think
02:27 Xliff Not really.
02:27 AlexDaniel but code blocks and other stuff actually work like if it was ||
02:27 Xliff "longest token" is important. Much of what I am doing wants "shortest token" which is "||" which has been what I have been using.
02:27 AlexDaniel ummmmm…
02:27 Xliff "longest token" I think is more appropriate to TOP, or something similar.
02:27 AlexDaniel can you show some examples?
02:27 AlexDaniel because it does not sound right
02:28 Xliff By something similar, I mean a rule that encompases many other alternative subrules.
02:28 Xliff Look at DateTime::Parse.
02:29 Xliff The TOP rule there gives a good example of using "|" over "||"
02:29 Xliff Just took the gfldex's explanation to get the bulb to light.
02:34 seatek I always use | instead of ||, and it always works, and i don't know why
02:37 seatek looks like dalek finally took care of travis. excellent.
02:46 obfusk joined #perl6
02:47 ilbot3 joined #perl6
02:47 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!
02:53 Xliff EXX - TEEER - MIIIIIN - AAAATE!
02:53 Xliff (Don't blame me! seatek said "dalek" again!!!)
02:55 Xliff Oooh!
02:55 Xliff https://www.youtube.com/watch?v=YQLbwOGT8eM&amp;ab_channel=Rabbitastic
02:55 Xliff And... with that... I'm done.
02:56 Xliff My point has been made.
02:57 Xliff (Hmm.... I may have overplayed my hand.... )
02:57 Xliff (That
02:57 Xliff (That last link might be a bit too....excessive)
02:58 seatek mmm. calming ambient background noise - thanks Xliff!
02:59 Xliff LOL!
03:07 dextertzu joined #perl6
03:10 canopus joined #perl6
03:26 Celelibi joined #perl6
03:31 samcv seatek, you mean for regex?
03:32 Steve_____ joined #perl6
03:32 samcv or anything? | will compare and not specify what order the things are checked. but || forces it to always check the same way, | is not guaranteed and can be optimized by the compilier
03:36 noganex_ joined #perl6
03:53 samcv hmm perl 6 regex section needs a part on the equivilants of things like \S which is <-ws> and \s which is <ws>. i think i might work on a section for that
03:53 samcv or maybe it would go better in another section? anybody have any opinion on that before i start working on a PR for perl6doc?
03:55 gfldex samcv: all the details should go into https://docs.perl6.org/type/Regex
03:55 samcv ok thanks gfldex :)
03:57 samcv gfldex, so it should go in type/Regex not Language/Regex?
03:57 samcv found the pod page for the type. will work on that the next few days
04:05 seatek samcv, yeah i was talking about use as tokens in grammar actually. i always use the single | there. || i usually use in normal code. i had no idea about that distinction :) thanks!
04:05 samcv np :)
04:05 samcv also it's the same for & and && fyi
04:05 samcv at least in regex
04:05 seatek i had already lept to that wild and reckless conclusion! :)
04:06 samcv heh
04:13 MasterDuke | is longest match, || is first match. so if you order your alternations from longest to shortest with ||, it should be the same as using |
04:14 AlexDaniel what's the list of exceptions for this, by the way?
04:14 seatek and what does "longest" mean in this context?
04:15 seatek length of the regex? for processing? so that the fastest processing goes first?
04:16 seatek or does it analyze the complexity of the regex... ;)
04:16 MasterDuke well, 'abc' is longer than 'ab'. i believe 'ab*' is longer than 'ab', but i'm not 100% sure
04:17 MasterDuke AlexDaniel: what do you mean exceptions?
04:17 PerlJam longest == length of the string matched.
04:18 seatek ah ok simple length - so it won't go so far as to place regexes with variables in them last necessarily
04:18 PerlJam well, not ==, but that's what it's referring to.  Whichever alternation matches the most characters, wins.
04:19 MasterDuke Xliff: i was trying to recreate your MAST::Frame bug report, but couldn't with an up-to-date moar/rakudo. do you still get it?
04:19 samcv that is true also MasterDuke as well
04:19 samcv seatek, if you want to go into the rabbit hole: https://design.perl6.org/S05.html
04:19 samcv most but not all info there is accurate
04:19 AlexDaniel MasterDuke: this kinda answers my question, but not completely: http://design.perl6.org/S05.html#Longest-token_matching
04:19 seatek no.. no i don't. i just escaped a rabbit hole. i need to get actual work done
04:20 seatek i shouldn't be looking at this window
04:20 samcv haha
04:20 samcv seatek, "Since "longest-token matching" is a long phrase, we will usually refer to this idea as LTM."
04:20 PerlJam m:  "foo" ~~ / fo | fo* /;  say $/;
04:20 camelia rakudo-moar bca0ae: OUTPUT«「foo」␤»
04:20 PerlJam m:  "foo" ~~ / fo || fo* /;  say $/;
04:20 samcv don't you feel better now?
04:20 camelia rakudo-moar bca0ae: OUTPUT«「fo」␤»
04:20 telex joined #perl6
04:20 samcv :)
04:21 AlexDaniel m:  "foooo" ~~ / foo | fo*? /;  say $/;
04:21 camelia rakudo-moar bca0ae: OUTPUT«「f」␤»
04:21 AlexDaniel ah, f
04:21 seatek i do feel better. but it might be the cake
04:21 AlexDaniel m:  "foooo" ~~ / fo | fo[o|oo] /;  say $/
04:21 camelia rakudo-moar bca0ae: OUTPUT«「fooo」␤»
04:22 AlexDaniel m:  "foooo" ~~ / fo | fo[o|[o|oo]] /;  say $/
04:22 camelia rakudo-moar bca0ae: OUTPUT«「fooo」␤»
04:22 Xliff MasterDuke: I will test. One sec.
04:22 AlexDaniel ummmmm
04:23 AlexDaniel so, what's happening there?
04:23 Xliff Rebuilding
04:23 AlexDaniel why not foooo ?
04:23 PerlJam That might be an LTM bug.  I dunno
04:24 BenGoldberg joined #perl6
04:24 AlexDaniel m:  "foooo" ~~ / fo[o|[o|oo]] /;  say $/
04:24 camelia rakudo-moar bca0ae: OUTPUT«「fooo」␤»
04:24 AlexDaniel m:  "f12345" ~~ / f1[2|[3|34]] /;  say $/
04:24 camelia rakudo-moar bca0ae: OUTPUT«「f12」␤»
04:25 PerlJam I would have expected "foooo" ~~ / foo | fo*? /; to match "foo" too
04:25 seatek pl yjsy
04:25 AlexDaniel ah my bad
04:25 AlexDaniel m:  "f12345" ~~ / f1[2|[2|23]] /;  say $/
04:25 camelia rakudo-moar bca0ae: OUTPUT«「f123」␤»
04:25 seatek oops drunk i guess
04:26 AlexDaniel PerlJam: not a bug, we're just blind
04:26 PerlJam yeah, and tired.  Long day and I just got off of a plane an hour ago
04:28 aborazmeh joined #perl6
04:28 aborazmeh joined #perl6
04:29 PerlJam I'm still not grokking how "foooo" ~~ / foo | fo*? / only matches "f".  That means the second alternation wins, but "foo" is longer than "f"
04:31 PerlJam I guess I'm not clear on what it means for *? to "stop" LTM
04:32 PerlJam anyway ... I still think it's a bug
04:36 kyclark joined #perl6
04:47 geraud joined #perl6
04:50 samcv nice seatek
04:50 samcv you and me both. though maybe not that much. yet...
04:51 samcv ugh i hate how i tell people about perl 6 and how great it is and they always tell me how old and out of date perl 5 is :( nobody knows it's a whole new language
04:51 samcv well Perl 5 people understand, but seems only people that *haven't* been a perl programmer pass horrible judgment on perl 6
04:53 perigrin generally anymore people who haven't been a Perl programmer in the last decade pass horrible judgement on Perl5 too
04:57 mayathecat joined #perl6
05:19 Cabanossi joined #perl6
05:32 samcv yeah :(
05:47 TEttinger generally people who haven't been part of the Manson Family in the last decade pass horrible judgment on the Manson Family as well.
05:47 TEttinger you can substitute a lot in thee
05:47 TEttinger there
06:00 dextertzu joined #perl6
06:04 pierre_ joined #perl6
06:04 pierre_ joined #perl6
06:18 seatek yeah it's weird how much the same perl6 is compared to perl5 - while still being very very different. it's more swooshy than pointy. more twisty than knotty
06:20 * BenGoldberg wants a magic wand which is both swooshy and pointy.
06:21 seatek :)
06:46 chaon joined #perl6
06:51 samcv Perl 6 "Inspired by Perl 5", oh btw we threw out 100% of the code. (based on a true story)
06:51 samcv they should make a movie
06:52 samcv will be just like those movies ‘based on a true story’
06:56 seatek they'll have to cut the bit about the UFOs though
06:59 ingy joined #perl6
07:03 wamba joined #perl6
07:20 samcv but that's the only true part :(
07:23 darutoko joined #perl6
07:24 ChoHag joined #perl6
07:25 samcv seatek, https://i.imgflip.com/1eg2l1.jpg made just now
07:25 samcv :3
07:29 seatek :)
07:30 zakharyas joined #perl6
07:44 chaon joined #perl6
07:45 FROGGS joined #perl6
07:53 Steve_____ left #perl6
08:04 cibs joined #perl6
08:06 Tonik joined #perl6
08:09 RabidGravy joined #perl6
08:24 firstdayonthejob joined #perl6
08:52 espadrine joined #perl6
09:17 ilbot3 joined #perl6
09:17 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!
09:27 itaipu joined #perl6
09:39 chaon joined #perl6
09:41 rindolf joined #perl6
09:55 nine Anyone managed to install HTTP::Server::Tiny on current rakudo? I get errors like "No exception handler located for catch" in the tests
09:56 amalia_ joined #perl6
09:57 bjz joined #perl6
10:03 stmuk_ nine: works for me fine with rakudobrew of 2 mins ago
10:03 nine stmuk_: odd. Ok will dig some
10:13 nine stmuk_: oh, you'll never guess this: those failures are apparently caused by my prove6 wrapper script that does prove -e 'perl6 -Ilib'
10:14 pierre_ joined #perl6
10:15 stmuk_ ha
10:16 stmuk_ "Tea CI is a continuous integration service for Windows developers, free for open source projects."
10:16 stmuk_ but
10:16 stmuk_ "Cygwin/Msys2 on Wine in order to compile Windows software"
10:16 stmuk_ :D
10:18 rpburkholder joined #perl6
10:18 espadrine joined #perl6
10:31 moritz joined #perl6
10:35 moritz good morning from the other side of an unepected VM reboot
10:39 [ptc] mornin' :-)
10:42 [ptc] moritz: how did the devops days go?
10:47 moritz [ptc]: very well. I had some interesting discussions with developers of tools that I use, with others in similar positions to mine, and so on
10:48 moritz [ptc]: and I took home some ideas to pursue
10:49 [ptc] sounds productive :-)
10:49 [ptc] when does your article appear in iX, btw?
10:49 moritz [ptc]: 01/2017
10:50 [ptc] I've looked a couple of times and haven't spotted it.
10:50 [ptc] ah, thanks
10:50 moritz it was scheduled earlier, but somehow got delayed
10:50 itaipu joined #perl6
10:50 setty1 joined #perl6
10:51 [ptc] I'd noticed a couple of iX issues with devops stuff in them and thought that the article must be in there somewhere, but wasn't.  Had thought that maybe I'd missed it somehow
10:51 setty1 joined #perl6
10:52 espadrine joined #perl6
10:53 kurahaupo__ joined #perl6
10:54 lizmat https://www.kickstarter.com/projects/1422827986/learning-perl-6 at 51% funded !
10:54 lizmat weee
10:54 lizmat :-)
10:54 [ptc] yay!
10:54 [ptc] moritz: thanks for the commit bit to community-modules.  :-)  I'm digging a bit in p6-test-builder; the docs seem a bit outdated, and I was wondering how one specifies the author now
10:55 [ptc] moritz: then I can commit some patches to e.g. the README to bring things up to date
10:56 pierre_ joined #perl6
10:58 [ptc] my guess was to mention the original author, and then add a note about the current authors being the community-modules maintainers.  Is there a standard sentence that is currently used for that?
10:58 tadzik hmm, only one dead tree reward and already taken :( I guess I'll have to buy it afterwards then, and back it anyway for now :)
11:00 moritz tadzik++
11:00 moritz [ptc]: you're welcome
11:01 moritz if anybody else wants access to the perl6-community-modules org, please let me know
11:13 dudz is this my chance to get access while they are up for grabs, my once in a limited time shot?
11:14 timotimo as long as you don't throw up mom's spaghetti on your sweater, go for it!
11:16 moritz dudz: no, it's a permanent offer :-)
11:16 moritz dudz: but do tell me your github account name
11:16 dudz :)
11:17 dudz dudzorg
11:17 dudz please don't judge me by my activity
11:17 dudz great :)
11:17 dudz i'm part of a team :D
11:18 dudz my first gang :D
11:18 moritz dudz: I've invited you to the perl6 org too (because I can)
11:18 dudz :D
11:19 dudz thanks moritz
11:20 [ptc] next silly question of the day: is ufo still used?  Should it be used?
11:20 chaon joined #perl6
11:21 timotimo i don't see a need for it any more
11:21 * moritz doesn't use ufo anymore
11:21 moritz but the README is still great
11:22 [ptc] yes :-)  I get the feeling masak had lots of fun writing it
11:23 timotimo yup
11:28 stmuk_ ufo doesn't work anymore but has been usful when panda has been broken
11:31 moritz question for the CSS geeks: on https://perlgeek.de/blog-en/automating-deployments/2016-030-git-flow-vs-continuous-delivery.html what do I have to change to prevent the signup form from aligning with the lower edge of the left sidebar?
11:31 [ptc] it's mentioned in several READMEs in the ecosystem, so I just wondered if the information was up to date.
11:31 [ptc] maybe I should submit a few patches
11:32 moritz [ptc]: I guess it was just a template circulating at that time
11:32 timotimo sounds like a plan
11:32 [ptc] come to think of it, are there any plans for something akin to p5's Makefile.PL?
11:33 [ptc] maybe I'm just showing my age, but there's something nice about being able to run 'make test', 'make dist', 'make realclean' etc.
11:33 stmuk_ and then deleting stuff not removed by realclean
11:34 [ptc] ... that's distclean, no?
11:34 stmuk_ maybe
11:34 stmuk_ mrproper!
11:34 [ptc] .oO( make mrproper )
11:43 domidumont joined #perl6
11:44 domidumont joined #perl6
11:46 [ptc] who is the copyright-holder of repos hosted under perl6-community-modules?  Is it something like: Perl6 Community Modules Team?
11:47 [ptc] just wondering how ownership/attribution/etc. works in this case
11:47 moritz I'd just write "The Perl 6 Community"
11:49 [ptc] cool, thanks!
11:49 * [ptc] retreats to his editor again
11:50 domidumont joined #perl6
11:52 cdg joined #perl6
12:09 chaon joined #perl6
12:13 pierre_ joined #perl6
12:17 pierre_ joined #perl6
12:17 khw joined #perl6
12:18 girafe joined #perl6
12:39 Unavowed joined #perl6
12:45 padal joined #perl6
12:46 RabidGravy okay that's weird, this is still working, but the rest of the internet isn't from here
12:50 chaon joined #perl6
12:51 RabidGravy joined #perl6
12:54 RabidGravy nothing that rebooting the router couldn't fixed
12:57 [ptc] anybody have anything against me merging the currently Wiki-based docs for Date::WorkdayCalendar into the repo?
12:59 [ptc] the detailed docs are in the wiki on another repo and hence can't be edited by the community, so it seems sensible to merge them into the community-based repo
13:08 RabidGravy sounds good to me
13:09 FROGGS +1
13:14 nowan joined #perl6
13:15 [ptc] okey dokey.  Ta :-)
13:36 nowan joined #perl6
13:47 viki moritz: *prevent*? Seems like it isn't aligning: http://i.imgur.com/4pyxPg4.png
13:48 viki (or did you fix it already)
13:49 viki oh that was like... 2 hours ago :)
13:51 * viki mentally does
13:51 * viki mentally does #mc_embed_signup form { padding: 0; } to avoid that irking misalignment of the signup form
13:58 moritz viki: I fixed it, sorry for not informing you
13:59 moritz turns out there were a few clear: left and clear:both that needed removing
13:59 viki Ah
14:05 chaon joined #perl6
14:08 espadrine joined #perl6
14:16 AlexDaniel joined #perl6
14:17 moritz https://perlgeek.de/blog-en/perl-6/2016-book.html it's official now :-)
14:19 moritz lizmat: ^^ would be great if you could include that in the next p6weekly
14:20 masak moritz++!
14:20 amalia_ joined #perl6
14:25 bjz_ joined #perl6
14:25 [ptc] moritz++
14:26 AlexDaniel moritz++ \o/
14:27 AlexDaniel short book to get people started, great idea!
14:28 RabidGravy moritz++ nice one
14:30 viki moritz: fwiw, the sign up form on that page shows no indication of anything happening successfully
14:30 viki (like it just goes blank after clicking submit)
14:30 moritz viki: uhm, do you use an ad blocker and/or noscript?
14:30 viki Yeah, I got AdblockPlusz
14:30 MasterDuke moritz++, btw, kyclark is also writing a book using Perl 6, https://www.gitbook.com/book/kyclark/metagenomics/details
14:30 moritz I'm afraid ad blockers might block mailchimp
14:31 viki Ah
14:31 viki OK
14:31 moritz MasterDuke: ooh, interesting, will link to it
14:31 viki moritz: hm, disabled adblock, but same result after submitting the form
14:31 viki Just goes blank
14:32 moritz viki: eeks. Does the form at https://perl6book.com/#signup work better for you?
14:33 viki Yeah, that one works.
14:34 viki Hm. I now see 3 "please confirm subscription" emails. So I guess the first form works too; it just doesn't say it does :)
14:36 moritz \o/ 3 vikis on my mailing list :-)
14:44 obfusk joined #perl6
15:00 bjz joined #perl6
15:09 [ptc] it seems I'm not a robot
15:09 moritz poor you
15:09 NeuralAnomaly joined #perl6
15:10 moritz https://docs.perl6.org/type/Array.html#(List)_method_from there are two methods "from" in here
15:10 moritz and they seem to contradict each other
15:11 [ptc] moritz: the subscribe form didn't tell me that I'd submitted anything, however that could just be due to the adblocker
15:11 [ptc] the subscribe email, however arrived :-)
15:11 * moritz hates that stuff doesn't simply work :/
15:11 [ptc] moritz: oh, and ping me as soon as you need any more proofreading done
15:11 skids joined #perl6
15:12 moritz [ptc]: sure, will do. Thanks
15:14 canopus joined #perl6
15:19 NeuralAnomaly joined #perl6
15:26 RabidGravy joined #perl6
15:41 wamba joined #perl6
15:54 Herby_ joined #perl6
15:54 Herby_ \o
15:59 NeuralAnomaly joined #perl6
16:01 viki \o
16:02 mohae joined #perl6
16:15 timotimo moritz: "between his and mind project"? :)
16:20 chris2 joined #perl6
16:23 NeuralAnomaly joined #perl6
16:31 wamba joined #perl6
16:41 stux|RC-only joined #perl6
16:48 firstdayonthejob joined #perl6
16:50 moritz timotimo: fuxed :-)
17:03 timotimo jesus christ, that change log is humongous
17:04 viki That's good :)
17:04 viki Especially considering a relatively small list of contributors for the release
17:04 brillenfux joined #perl6
17:05 timotimo clearly we get more stuff done if we have fewer people helping
17:05 * timotimo goes around kicking people out
17:05 viki :)
17:06 * timotimo kicks himself out
17:06 timotimo phew, that's better
17:11 NeuralAnomaly joined #perl6
17:15 woodruffw joined #perl6
17:21 chaon joined #perl6
17:24 moritz stmuk_: pl6anet doesn't seem to pick up my blog posts anymore; could you please look into it?
17:38 RabidGravy eek just discovered that I've been running a rabbitmq instance on the internet with the default password for three years
17:38 RabidGravy I don't think anything untoward has happened
17:45 moritz at least you can't use rabbitmq to send spam :-)
17:46 timotimo so you probably got automated data exfiltration done on it
17:46 brillenfux joined #perl6
17:47 RabidGravy yeah it could become the heart of a cracking botnet
17:48 timotimo were you yourself using it at all?
17:55 RabidGravy it's part of the radio playout system for futuremusic.fm
18:04 RabidGravy it's probably overkill for this,  the message rate doesn't even blip
18:06 * garu waves
18:06 yoleaux 13 Nov 2016 17:58Z <TimToady> garu: if you want to return multiple values from a function, you should really use binding, which will work argument by argument, rather than list assignment, which will flatten like Perl 5's list assignment
18:07 garu TimToady: thanks!
18:08 garu hi everyone! Is there a way to create a trait that bundles different traits or restricts type (but as a trait, not as a subtype)?
18:09 psch garu: traits don't consistently change the type they are applied to
18:09 psch garu: what are you trying to do?
18:10 garu psch: something like "has $!foo is awesome" having the same effect as "has Str $!foo is rw is required where { $!foo.chars > 10 } = "this is my default"
18:11 garu how should I go about doing something like that?
18:11 psch garu: i don't think you can do that without macros
18:12 garu :(
18:12 garu is there a way around it? Or... how far can I go? can "is awesome" at least mean the other traits like "is rw is required"?
18:13 garu then I can wrap the rest in a subtype I think
18:14 psch i guess that might work
18:15 psch something like sub trait_mod:<is>(Parameter $x, :$awesome) { $x is rw; $x is required }
18:15 psch but you'd have to try and it might not work
18:15 timotimo needs a ! in the signature, too
18:16 garu cool, I'll give it a try, thanks!
18:17 timotimo for examples, see the core setting, i suppose
18:19 garu can I do it the other way around, as a type? i.e. "has Awesome $!foo" meaning "has Int $!foo is rw is required = 15"?
18:24 psch i don't think so
18:24 psch the type of an Attribute doesn't know if the Attribute is required in the surrounding class
18:24 psch at least afaik
18:25 chaon joined #perl6
18:27 garu hmm
18:27 garu what can I do to achieve something like that in perl 6 then?
18:27 garu can I... create my own "has", maybe?
18:28 garu like "class MyClass { awesome $!foo; } " and have $!foo hold whatever type/constraints/traits I want?
18:28 RabidGravy well you can over-ride the attribute meta class, I can't remember the exact involcation
18:29 garu I just want a shortcut for a type+constraints+traits that might be commonly used
18:29 RabidGravy you'd have to alter the grammar to introduce an alternative to 'has' however
18:29 garu not really attached to how it's declared as long as it's short :D
18:29 psch garu: NativeCall defines it's own 'HAS', which is an inlined native attribute
18:29 psch garu: maybe checking out NativeCall.pm can give you ideas
18:30 garu hmm.. thanks! I'll have a look!
18:30 psch (although hiding a bunch of things in one keyword seems kinda too esoteric to me :) )
18:30 garu meanwhile if anyone has any ideas, I'm all ears (or eyes in this case)
18:30 petercommand joined #perl6
18:30 petercommand joined #perl6
18:31 petercommand joined #perl6
18:31 garu I was hoping I could create a type or trait that would do all that for me... not really looking forward to implementing a DSL for this :X
18:32 psch garu: my point is (1) rwness is not a type-thing, so it shouldn't hide in the type (2) default values are not a type thing, so they shouldn't hide in the type
18:33 psch garu: i'll yield that having a bunch of Attributes that all have the same default and rwness would demand such a shortcut
18:33 psch but that's what i'd put into a macro i'd define in the scope of the class that needs it
18:33 psch unfortunately our macros aren't quite there yet, from what i know
18:34 garu psch: so the best fit for this would be a class-scoped macro, but they are not implemented yet. Got it!
18:35 psch garu: that's just my opinion, you might get others from others :)
18:35 mst the trouble with perl6 actually having this stuff as features is it makes it harder to run roughshod over the design like we all do in 5land
18:36 psch dunno, i think arbitrary MOP hackery still kinda counts as 'running roughshod'
18:37 psch i mean, sure, it's the intended way to do so, but it still messes up everything everyone who doesn't know what's going would expect
18:37 psch plus replacing %*LANG<MAIN> :P
18:38 psch err, %~LANG it was i think
18:38 psch ah, but we aren't quite there yet either it seems :)
18:38 psch m: say %~LANG.keys
18:38 camelia rakudo-moar 907114: OUTPUT«(0)␤»
18:39 RabidGravy there is a variable with it
18:41 geekosaur I thought that was still being considered speculative, because the original design wasn't flexible enough
18:41 psch honestly, i'm not quite sure how useful it is in general to replace arbitrary strands of the language braid with arbitrary other languages
18:42 psch i mean, i'm not saying it wouldn't be nice just for the heck of it, like, "from now on literal strings are in python syntax!"
18:42 psch but when does one actually need the current language in any part of the braid to modify it
18:54 padal joined #perl6
18:57 jnthn Trait application is just function calls, so there's nothing to stop you implmenting a trait that just calls trait_mod:<is>(...) a bunch of times
18:59 garu jnthn: interesting!
19:00 sunnavy joined #perl6
19:17 wamba joined #perl6
19:18 wamba joined #perl6
19:25 RabidGravy actually I've got a trait that calls a bunch of other traits somewhere
19:27 psch m: multi trait_mod:<is>(Attribute \a, :$awesome!) { trait_mod:<is>(a, :required); trait_mod:<is>(a, :rw) }; class A { has $.x is awesome }
19:27 camelia rakudo-moar 907114: ( no output )
19:27 psch m: multi trait_mod:<is>(Attribute \a, :$awesome!) { trait_mod:<is>(a, :required); trait_mod:<is>(a, :rw) }; class A { has $.x is awesome }; say A.new.^attributes[0].rw
19:27 camelia rakudo-moar 907114: OUTPUT«The attribute '$!x' is required, but you did not provide a value for it.␤  in block <unit> at <tmp> line 1␤␤»
19:27 psch m: multi trait_mod:<is>(Attribute \a, :$awesome!) { trait_mod:<is>(a, :required); trait_mod:<is>(a, :rw) }; class A { has $.x is awesome }; say A.new(:1x).^attributes[0].rw
19:27 camelia rakudo-moar 907114: OUTPUT«True␤»
19:27 psch so, yeah
19:27 psch that works
19:27 ggoebel joined #perl6
19:27 psch could probably still cobble default in there somewhere as well
19:28 psch m: multi trait_mod:<is>(Attribute \a, :$awesome!) { trait_mod:<is>(a, :default($awesome); trait_mod:<is>(a, :required); trait_mod:<is>(a, :rw) }; class A { has $.x is awesome("phoeey") }; say A.new().^attributes[0].rw
19:28 camelia rakudo-moar 907114: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3>(a, :required); trait_mod:<is>(a, :rw) 7⏏5}; class A { has $.x is awesome("phoeey"␤»
19:28 psch orrr something
19:28 psch not sure about 'is required' together with a default though
19:30 geekosaur m: multi trait_mod:<is>(Attribute \a, :$awesome!) { trait_mod:<is>(a, :default($awesome)); trait_mod:<is>(a, :required); trait_mod:<is>(a, :rw) }; class A { has $.x is awesome("phoeey") }; say A.new().^attributes[0].rw
19:30 camelia rakudo-moar 907114: OUTPUT«The attribute '$!x' is required, but you did not provide a value for it.␤  in block <unit> at <tmp> line 1␤␤»
19:31 psch right, if it still needs a value even with a default...
19:31 psch sounds like dropping 'required' is reasonable
19:33 andrzejku_ joined #perl6
19:40 pecastro joined #perl6
19:45 avalenn joined #perl6
19:48 labster joined #perl6
19:52 wamba joined #perl6
19:55 pmurias joined #perl6
20:08 Ven joined #perl6
20:15 imcsk8_ joined #perl6
20:15 dj_goku_ joined #perl6
20:15 dj_goku_ joined #perl6
20:17 kurahaupo__ joined #perl6
20:22 Ven joined #perl6
20:27 AlexDani` joined #perl6
20:40 dextertzu joined #perl6
20:42 AlexDani` joined #perl6
20:44 masak oh, and today's autopun spotting -- best in a while: https://twitter.com/xaprb/status/799661720440446976
20:45 masak (might have spotted that one before. but it's worth two spottings.)
20:46 mst heh, I just pasted that into shadowcat's internal chat channel
20:46 mst it is excellent.
20:49 viki masak: what's autopun?
20:49 psch viki: http://act.yapc.eu/ye2012/talk/4206
20:49 mst a pun that uses *and* mentions its subject, basically
20:49 psch not sure the lightning talk is online though
20:50 psch ah it is
20:50 psch https://www.youtube.com/watch?v=3bxLi3Z8lGE&amp;index=6&amp;list=PLgICPKNKWlgdmqCVUI7swqWoI9mzQUZw5
20:50 psch s/list.+$// # vOv
20:51 viki what's with the sound on that thing?
20:51 psch it bad..? :S
20:51 psch +is
20:51 viki Like an out of tune radio station lots of static
20:52 psch nah, out of tune radio stations don't have that kind of static
20:52 psch it's more colorful usually
20:52 psch this is just the loose jack kind of static which adds white noise
20:52 psch well, there *is* some feedback
20:52 psch point being, radio static usually is less... static static
20:53 psch but this static has a clear resonance frequency
20:53 * viki can
20:53 * viki can't watch that
20:58 mst psch++ # welcome to #perl6, where static analysis is always on topic
21:02 masak viki: like mst hinted, it's a joke that depends on breaking the use/mention barrier.
21:03 kurahaupo_ joined #perl6
21:04 masak viki: talk slides for that lightning talk are here: http://masak.org/carl/gpw-2012-autopuns/talk.pdf
21:06 masak 'night, #perl6
21:07 psch i'm still bad at actually discerning what qualifies as an autopun
21:07 psch like e.g. https://twitter.com/aedison/status/800081718107639811
21:07 psch i'm not sure if that's just punny, or already autopunny
21:09 moritz I think that's an autopun
21:09 moritz because it uses the concept it mentions (in the "I’ve already decided it means whatever I want it to")
21:10 * geekosaur inclined to agree
21:11 geekosaur it's not a *clever* autopun, but it is an autopun
21:11 psch right, maybe i'm hung up on "clever"
21:15 cdg joined #perl6
21:17 cdg joined #perl6
21:36 mtj_ joined #perl6
21:36 garu psch++ # thanks for the examples!
21:39 eisen74 joined #perl6
21:41 eisen74 anyone know of somone working on Perl6 ML module?
21:43 [ptc] masak++: great talk :-D
21:43 Khisanth joined #perl6
21:43 moritz oh yes, that was epic
21:49 awwaiid joined #perl6
21:53 Ven joined #perl6
21:59 Cabanossi joined #perl6
22:00 rindolf joined #perl6
22:03 moritz m: say val('foo')
22:03 camelia rakudo-moar 84ef8f: OUTPUT«foo␤»
22:03 seatek joined #perl6
22:04 cdg joined #perl6
22:06 seatek m: say so 'peel9' ~~ /<alnum>+/;
22:06 camelia rakudo-moar 84ef8f: OUTPUT«True␤»
22:06 seatek m: say so 'peel9' ~~ /<word>+/;
22:06 camelia rakudo-moar 84ef8f: OUTPUT«No such method 'word' for invocant of type 'Cursor'␤  in block <unit> at <tmp> line 1␤␤»
22:07 seatek m: say so 'peel9' ~~ /<ascii>+/;
22:07 camelia rakudo-moar 84ef8f: OUTPUT«No such method 'ascii' for invocant of type 'Cursor'␤  in block <unit> at <tmp> line 1␤␤»
22:07 seatek m: say so 'peel9' ~~ /<space>+/;
22:07 camelia rakudo-moar 84ef8f: OUTPUT«False␤»
22:07 seatek m: say so 'peel9' ~~ /<lower>+/;
22:07 camelia rakudo-moar 84ef8f: OUTPUT«True␤»
22:07 seatek m: say so 'peel9' ~~ /<blank>+/;
22:07 camelia rakudo-moar 84ef8f: OUTPUT«False␤»
22:07 seatek m: say so 'peel9' ~~ /<word>+/;
22:07 camelia rakudo-moar 84ef8f: OUTPUT«No such method 'word' for invocant of type 'Cursor'␤  in block <unit> at <tmp> line 1␤␤»
22:07 seatek m: say so 'peel9' ~~ /<ascii>+/;
22:07 camelia rakudo-moar 84ef8f: OUTPUT«No such method 'ascii' for invocant of type 'Cursor'␤  in block <unit> at <tmp> line 1␤␤»
22:09 psch m: say so 'peel9' ~~ /<:ascii>+/;
22:09 camelia rakudo-moar 84ef8f: OUTPUT«True␤»
22:09 seatek oo
22:09 seatek m: say so 'peel9' ~~ /<:word>+/;
22:09 camelia rakudo-moar 84ef8f: OUTPUT«False␤»
22:09 Ven joined #perl6
22:10 seatek should that be how they are to be used in the documentation?
22:10 seatek if so i'll go change it
22:11 seatek m: say so 'peel9' ~~ /<:alnum>+/;
22:11 camelia rakudo-moar 84ef8f: OUTPUT«False␤»
22:11 psch seatek: i don't know, but i'd like to mention that i'd like "did it" to be followed by the corresponding git-ref
22:11 seatek doesnt' work consistantly
22:11 seatek m: say so 'peel9' ~~ /<:alnum>+/;
22:11 camelia rakudo-moar 84ef8f: OUTPUT«False␤»
22:11 seatek m: say so 'peel9' ~~ /<alnum>+/;
22:12 camelia rakudo-moar 84ef8f: OUTPUT«True␤»
22:12 psch seatek: note that <:...> denotes unicode properties, while <...> is builtin rules
22:12 moritz is there even a Unicode property 'word' or 'alnum'?
22:12 moritz if not, maybe that should throw an exception...
22:12 seatek m: say so 'peel9' ~~ /<alnum>+/;
22:12 camelia rakudo-moar 84ef8f: OUTPUT«True␤»
22:13 psch m: say "foo" ~~ /<:fizzlygoob>/
22:13 camelia rakudo-moar 84ef8f: OUTPUT«Nil␤»
22:13 psch we probably should throw on unknown uniprops, yeah
22:13 seatek it works :) this was taken from perl5's list of POSIX classes
22:15 seatek i don't know what they ARE but i've been thinking of them like pre-defined tokens
22:15 psch m: say uniprop "l"
22:15 camelia rakudo-moar 84ef8f: OUTPUT«Ll␤»
22:15 psch that's somewhere in <:Letter>, i suppose
22:15 psch m: say "l" ~~ /<:Letter>/
22:15 camelia rakudo-moar 84ef8f: OUTPUT«「l」␤»
22:15 psch m: say "ó" ~~ /<:Letter>/
22:15 camelia rakudo-moar 84ef8f: OUTPUT«「ó」␤»
22:16 psch m: say "ó" ~~ /<:Number>/
22:16 camelia rakudo-moar 84ef8f: OUTPUT«Nil␤»
22:16 psch m: say "2" ~~ /<:Number>/
22:16 camelia rakudo-moar 84ef8f: OUTPUT«「2」␤»
22:16 psch m: say "²" ~~ /<:Number>/
22:16 camelia rakudo-moar 84ef8f: OUTPUT«「²」␤»
22:16 seatek m: say so 'efe9' ~~ /<xdigit>+/;
22:16 camelia rakudo-moar 84ef8f: OUTPUT«True␤»
22:16 seatek m: say so 'efw9' ~~ /<xdigit>+/;
22:16 camelia rakudo-moar 84ef8f: OUTPUT«True␤»
22:16 psch m: say 'efw9' ~~ /<xdigit>+/;
22:16 camelia rakudo-moar 84ef8f: OUTPUT«「ef」␤ xdigit => 「e」␤ xdigit => 「f」␤»
22:16 seatek m: say so 'efw9' ~~ /^<xdigit>+$/;
22:16 camelia rakudo-moar 84ef8f: OUTPUT«False␤»
22:16 psch so, basically
22:17 psch there's two kinds of things going on there
22:17 psch one is unicode properties, the other is builtin character classes
22:17 psch these might in some cases overlap
22:17 psch like /<alnum>/ eqv /<:Letter>|<:Number>/ # or somesuch
22:18 psch but they are different things and don't check for the same thing
22:18 seatek do we have list of builtin character classes?
22:18 psch i'd guess somewhere in P6Regex
22:19 psch hm, maybe in QRegex
22:19 seatek yeah not there. that's actually what i was starting on with posix classes
22:19 seatek oh qregex.. i'll check
22:19 moritz is it a bug that sub MAIN doesn't support coercion types?
22:19 dalek doc: 045db37 | seatek++ | doc/Language/regexes.pod6:
22:19 synopsebot6 Link: http://doc.perl6.org/language/regexes
22:19 dalek doc: Update regexes.pod6
22:19 dalek doc: review: https://github.com/perl6/doc/commit/045db376bd
22:19 psch QRegex has 'method alpha' and 'method alnum' and a bunch more
22:19 psch m: BEGIN my @*ARGS = "5"; sub MAIN(Int(Cool) $) { }
22:19 camelia rakudo-moar 84ef8f: OUTPUT«Usage:␤  <tmp> <Cool> ␤»
22:20 psch m: say IntStr ~~ Cool
22:20 camelia rakudo-moar 84ef8f: OUTPUT«True␤»
22:20 psch m: BEGIN my @*ARGS = "5"; sub MAIN(Int $) { }
22:20 camelia rakudo-moar 84ef8f: OUTPUT«Usage:␤  <tmp> <Int> ␤»
22:20 moritz multi sub MAIN(Date(Str) $) { }; # perl6 date.p6 2016-10-01
22:20 psch m: BEGIN my @*ARGS = 5; sub MAIN(Int $) { }
22:20 camelia rakudo-moar 84ef8f: OUTPUT«Usage:␤  <tmp> <Int> ␤»
22:21 psch yeah that's probably because we kinda-sorta redo the MMD stuff and cheat around coercion or something..?
22:21 psch moritz: i'd consider the behavior as-is a bug, yes
22:21 moritz m: INIT @*ARGS = '2016-10-01'; sub MAIN(Date(Str) $x) { }
22:21 camelia rakudo-moar 84ef8f: OUTPUT«No such method 'Date' for invocant of type 'Str'␤  in sub MAIN at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
22:21 psch assuming the BEGIN hacky above works out
22:21 psch i'm not sure Date(Str) is a supporte coercion type though
22:21 BenGoldberg joined #perl6
22:22 moritz m: sub f(Date(Str) $x) { say $x }; f '2016-10-01'
22:22 camelia rakudo-moar 84ef8f: OUTPUT«No such method 'Date' for invocant of type 'Str'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
22:22 moritz pity :(
22:22 seatek ah so qregex is in nqp stuff not in normal docs
22:23 psch QRegex is an implementation detail
22:23 psch because we need it to build NQP
22:23 psch i'd say that the character classes it exposes can be considered part of Perl 6, as far as they are tested in roast at least
22:23 psch (in general, writing docs should lean onto roast more than on rakudo)
22:24 psch i do recognize that doc'ing completely unimplemented features is kinda wonky, because we might not even know yet how they work out in practice
22:24 seatek i'll dig through that eventually then an pull out the character classes for the light of day
22:24 BenGoldberg m: class ApproxCounter { has $.cnt = 0; }; multi sub prefix:<++>( ApproxCounter $c ) { for ^$c.cnt { return $c.cnt if Bool.pick }; ++$c.cnt }; my ApproxCounter $c .= new; print ++$c for ^80;
22:24 camelia rakudo-moar 84ef8f: OUTPUT«Cannot resolve caller prefix:<++>(Int); the following candidates␤match the type but require mutable arguments:␤    (Mu:D $a is rw)␤    (Int:D $a is rw)␤␤The following do not match for other reasons:␤    (ApproxCounter $c)␤    (Bool $a is rw)…»
22:24 BenGoldberg m: class ApproxCounter { has $.cnt = 0; }; multi sub prefix:<++>( ApproxCounter $c is rw ) { for ^$c.cnt { return $c.cnt if Bool.pick }; ++$c.cnt }; my ApproxCounter $c .= new; print ++$c for ^80;
22:24 camelia rakudo-moar 84ef8f: OUTPUT«Cannot resolve caller prefix:<++>(Int); the following candidates␤match the type but require mutable arguments:␤    (Mu:D $a is rw)␤    (Int:D $a is rw)␤␤The following do not match for other reasons:␤    (ApproxCounter $c is rw)␤    (Bool $a i…»
22:25 psch m: class ApproxCounter { has $.cnt is rw = 0; }; multi sub prefix:<++>( ApproxCounter $c ) { for ^$c.cnt { return $c.cnt if Bool.pick }; ++$c.cnt }; my ApproxCounter $c .= new; print ++$c for ^80;
22:25 camelia rakudo-moar 84ef8f: OUTPUT«12223333333333333334444566666666666666666666666666666666666666666666666666666666»
22:25 psch BenGoldberg: rw'ing the wrong thing there :)
22:25 BenGoldberg Ahh, thanks :)
22:26 AlexDaniel m: say ‘abcdef, test’ ~~ /<ww>+/
22:27 camelia rakudo-moar 84ef8f: OUTPUT«(timeout)»
22:27 AlexDaniel I wonder if it should be smart enough to cover stupidity of the developer in this case
22:28 psch AlexDaniel: afaik the synopses were explicit that <ww> (and <ws>) are already greedy *and* zero-width
22:28 AlexDaniel nah, it's fine
22:28 psch AlexDaniel: i'm not sure that sentiment still holds, but it seems like a trap more than like a "we die cause that's stupid"
22:28 psch DIHWIDT is a thing after all
22:29 * psch &
22:30 AlexDaniel well, you get an infinite amount of zero-width matches, that's exactly what you've asked for :)
22:31 seatek it's nice to die spectacularly sometimes
22:31 AlexDaniel m: say ‘abcdef, test’ ~~ /[<?>]+/
22:31 AlexDaniel and there are many ways to do it
22:31 camelia rakudo-moar 84ef8f: OUTPUT«MoarVM panic: Memory allocation failed; could not allocate 2052259840 bytes␤»
22:31 AlexDaniel ouch
22:32 AlexDaniel not exactly what I have expected
22:32 seatek so should i open a bug on this posix <word> and <ascii> not working? Honestly, I wouldn't mind removing <ascii> from the docs...? do we need that even any more?
22:32 seatek i suppose maybe for some obscure lingering things
22:32 AlexDaniel wtf is <word> ?
22:32 seatek \w
22:33 AlexDaniel but \w is a character, not a word
22:33 dalek joined #perl6
22:33 seatek <word> is a POSIX character class, like a token, in a regex
22:33 seatek like <alnum>
22:33 AlexDaniel why would I care about POSIX insane naming in Perl 6?
22:34 seatek i ask myself that question about things all the time
22:34 AlexDaniel dunno, perhaps it's fine to add it if people expect it, but I have a feeling that it was not added for a reason
22:34 seatek it's already in there being used, that's how i ran across it, and was asked to document it
22:35 AlexDaniel for example
22:35 seatek it doesn't work by magic. someone put it in
22:35 AlexDaniel is <ident> a 1-char token or a multichar one?
22:35 seatek ask them
22:35 AlexDaniel doesn't sound like 1 char, right?
22:36 AlexDaniel m: say ‘abcdef, test’ ~~ /<ident>/
22:36 camelia rakudo-moar 84ef8f: OUTPUT«「abcdef」␤ ident => 「abcdef」␤»
22:36 AlexDaniel and it isn't!
22:37 seatek only one i ever use from posix is <xdigit>
22:37 seatek sometimes <graph> is nice
22:37 AlexDaniel “ascii  Any character in the ASCII character set.”
22:38 seatek yeah that seems pretty much pointless
22:38 seatek but maybe not?
22:38 seatek old stuff
22:38 BenGoldberg /<foo>/ matches a regex token named foo. /[<foo>]/ matches a character which is a member of the character set foo.
22:39 BenGoldberg I think.
22:39 travis-ci joined #perl6
22:39 travis-ci Doc build passed. seatek 'Update regexes.pod6'
22:39 travis-ci https://travis-ci.org/perl6/doc/builds/177335373 https://github.com/perl6/doc/compare/5e0175f0919d...045db376bdf0
22:39 travis-ci left #perl6
22:39 geekosaur people do sometimes want to match stuff in the 0x20-0x7e subset (usually when trying to catch/fix mojibake)
22:39 AlexDaniel BenGoldberg: what is a “character set”?
22:40 AlexDaniel [<foo>] look like brackets around a subrule to me
22:40 AlexDaniel could be wrong
22:40 geekosaur I think that's supposed to be character class
22:40 geekosaur named character class
22:40 AlexDaniel ok, example?
22:43 jnthn A naemd char class would be <+foo> (or <-foo> to negate it)
22:43 geekosaur m: say 'abcdef, test' ~~ /[<xdigit>]/ # where xdigit is one of the POSIX defined classes. in p5 this would be /[[:xdigit:]]/
22:43 camelia rakudo-moar 84ef8f: OUTPUT«「a」␤ xdigit => 「a」␤»
22:44 jnthn [<foo>] is just useless use of grouping
22:44 geekosaur oh, right, I am getting confused
22:44 AlexDaniel seatek: also, \w is <alnum>
22:45 seatek AlexDaniel: <alnum>  i believe is a subset of \w
22:45 firstdayonthejob joined #perl6
22:45 AlexDaniel seatek: example?
22:45 seatek "crack_your_jaw" is not alnum
22:46 AlexDaniel m: say ‘crack_your_jaw’ ~~ /<alnum>+/
22:46 camelia rakudo-moar 84ef8f: OUTPUT«「crack_your_jaw」␤ alnum => 「c」␤ alnum => 「r」␤ alnum => 「a」␤ alnum => 「c」␤ alnum => 「k」␤ alnum => 「_」␤ alnum => 「y」␤ alnum => 「o」␤ alnum => 「u」␤ alnum => 「r」␤ alnum => 「_」␤ alnum => 「…»
22:46 AlexDaniel m: say ‘crack_your_jaw’ ~~ /<+alnum>+/
22:46 camelia rakudo-moar 84ef8f: OUTPUT«「crack_your_jaw」␤»
22:47 AlexDaniel it's weird, I agree
22:47 seatek according to perl5 docs, <word is>  alnum' + Unicode marks + connectors, like '_'   :
22:48 seatek <word> is
22:48 AlexDaniel sure, but this is Perl 6 :)
22:49 AlexDaniel if we want to keep it similar to perl 5, then yeah, maybe we can count that as a bug
22:49 seatek yeah well why don't you rewrite the regex engine then
22:51 AlexDaniel I wonder if there is any difference between <.foo> and <+foo>
22:52 jnthn Just checked S05; alnum is <+alpha+digit> and alpha "Match a single alphabetic character, or an underscore"
22:52 geekosaur and <.foo> should be <foo> without the implicit capture into $/<foo>
22:53 seatek it all works great guys -- it's just the <word> and <ascii> don't. everything else is beautiful
22:53 geekosaur (which capture is why the tests earlier output the match twice)
22:53 AlexDaniel geekosaur: and <+foo> works exactly like that? :)
22:53 geekosaur [19 22:43:44] <jnthn> A naemd char class would be <+foo> (or <-foo> to negate it)
22:53 geekosaur which was correcting my earlier misspeaking
22:54 geekosaur actually this confuses me, sounds like <+ident> should match 1 char
22:55 geekosaur since it's using the charclass not the token
22:55 geekosaur but
22:55 geekosaur m: say 'abcdef, test' ~~ /<+ident>/
22:55 camelia rakudo-moar 84ef8f: OUTPUT«「abcdef」␤»
22:55 jnthn That's...interesting :)
22:55 AlexDaniel huh
22:56 AlexDaniel ah no
22:56 AlexDaniel geekosaur: ident is not one character
22:56 geekosaur if it is a *character* class it is not multiple. *tokens* can be multicharacter
22:57 geekosaur er, stress slightly wrong there
22:57 AlexDaniel that's what I'm trying to say, it's not a character class
22:57 geekosaur ok then what about what jnthn said earlier
22:58 AlexDaniel now that's a good question :)
22:59 AlexDaniel m: say ‘fooaBcdefg’ ~~ /<+ident -lower>/
22:59 camelia rakudo-moar 84ef8f: OUTPUT«「Bcdefg」␤»
23:00 eisen74 my $FH  = open $CSVFile, :r;
23:00 eisen74 for $FH.IO.lines -> $line {
23:00 eisen74 print "line: " ~ $line ~ "\n";
23:00 eisen74 }
23:00 eisen74 doesn't seem to be recognizing carriage returns
23:00 eisen74 ^M
23:02 AlexDaniel committable6: stdin line one␤line two␤line three
23:02 committable6 AlexDaniel, STDIN is set to «line one␤line two␤line three»
23:02 RabidGravy you can set the nl when you open the file
23:02 AlexDaniel committable6: HEAD for lines -> $line { print "line: " ~ $line ~ "\n"; }
23:02 committable6 AlexDaniel, https://gist.github.com/e995d08855a2371defe1c41310e4a074
23:02 AlexDaniel committable6: HEAD for lines() -> $line { print "line: " ~ $line ~ "\n"; }
23:02 committable6 AlexDaniel, ¦«HEAD»: line: line one␤line: line two␤line: line three
23:03 jnthn .u ␤
23:03 yoleaux U+2424 SYMBOL FOR NEWLINE [So] (␤)
23:03 jnthn AlexDaniel: I guess then mean \r as the line separator
23:03 geekosaur what do you mean bu "doesn't seem to be recognizing"? if you mean the lines you receive don't have ^M at the end from a file with ^M^J terminated lines, that is expected
23:03 jnthn Or could be what geekosaur said :)
23:03 geekosaur if uyou mean ^M is the line separator (like old MacOS)... don't recall if that is currently handled
23:04 jnthn iirc, the default set of line separators is \n and \r\n
23:04 eisen74 I've tried both \r and \r\n. Still reads whole file as one line
23:04 eisen74 my $FH  = open $CSVFile, :r, nl => "\r";
23:04 MasterDuke 'any combination of "\n", "\r\n" or "\r" or any other Unicode character that has the Zl (Separator, Line) property.' according to the docs
23:04 geekosaur hm, trying to remember if there is a gotcha there
23:05 geekosaur not with the reading, but with for
23:05 cdg joined #perl6
23:05 eisen74 I am running on OS X yes
23:05 jnthn If you're having issues wiht \r\n something is weird, because that's certainly in the defaults (not to mention Windows folks woulda howled loudly by now :))
23:05 cibs joined #perl6
23:05 geekosaur I did not say OS X
23:05 geekosaur "old MacOS" is Mac OS 9 and earlier, pre-X
23:05 eisen74 Ah. ok.
23:06 AlexDaniel by the way, there is no need for .IO there
23:06 AlexDaniel $FH.lines should work
23:07 stmuk_ http://pl6anet.org/drop/ has RC Rakudo Star 2016.11 source, mac binaries and windows binaries
23:07 jnthn stmuk_: Nice! :)
23:07 seatek stmuk_++ :)
23:08 lizmat stmuk_ ++
23:09 eisen74 hmm. trying a few other things.
23:09 eisen74 my $fh  = open $CSVFile, :r, nl => "\r\n";
23:09 eisen74 say $fh.get();
23:10 eisen74 tried different nl permutations and all still think file is one line. Trying a few other files but worked fine in Perl 5
23:10 AlexDaniel m: say ‘_25cdefg’ ~~ /<+ident>/
23:10 camelia rakudo-moar 84ef8f: OUTPUT«「_25cdefg」␤»
23:10 AlexDaniel m: say ‘_25cdefg’ ~~ /<+ident -digit -[_]>/
23:10 camelia rakudo-moar 84ef8f: OUTPUT«「cdefg」␤»
23:10 AlexDaniel m: say ‘_25cdefg25_25ho’ ~~ /<+ident -digit -[_]>/
23:10 camelia rakudo-moar 84ef8f: OUTPUT«「cdefg25_25ho」␤»
23:11 AlexDaniel I have no idea. This stuff is crazy, but at the same time it is quite useful
23:12 jnthn eisen74: Very strange... Out of curiosity, what does perl6 --version output?
23:13 jnthn But...I think everything has supported \n and \r\n going back years...
23:13 geekosaur m: say ‘_25cdefg25_25ho’ ~~ /<[+ident -digit -'_>/
23:13 camelia rakudo-moar e9487d: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of - as character range; in Perl 6 please use .. for range, for explicit - in character class, escape it or place it as the first or last thing␤at <tmp>:1␤------> 3say ‘_25cdefg25_25ho…»
23:13 geekosaur er
23:13 AlexDaniel geekosaur: S05 starts with a great idea of calling this stuff “predefined rules”, but indeed talks about “character classes” a bit later. <ident> is just some sort of magic /o\
23:14 eisen74 Tried another file and it worked fine. This CSV export from Mac Excel is croaking perl 6 and Text::CSV. Trying to figure out why.
23:15 eisen74 I haven't had this kind of error since Perl 4 old Mac files. lol
23:15 eisen74 This is Rakudo version 2016.10 built on MoarVM version 2016.10
23:15 eisen74 implementing Perl 6.c.
23:17 geekosaur oh. so it probably is using ^M only :/
23:17 geekosaur open $CSVFile, :r, nl => "\r"
23:17 zacts joined #perl6
23:18 geekosaur (because Microsoft still thinks Macs are in the 1980s, or something)
23:19 eisen74 geekosaur: that was the first thing I tried. No workie workie
23:19 AlexDaniel for $FH.split(“\r”) will probably work
23:19 eisen74 Going to re-export the xls to CSV and see what happens.
23:20 AlexDaniel I can reproduce it here
23:21 eisen74 AlexDaneil: bingo, that works!
23:21 AlexDaniel yea, I know, but that's not right
23:21 eisen74 Right, this problem breaks alot of stuff.
23:21 stmuk_ classic mac line ending was \r I think
23:21 eisen74 At least for anyone with similar kind of files.
23:21 AlexDaniel that's what I did: echo -e "hello world\rtest\rend\r" > testfile
23:22 AlexDaniel committable6: HEAD say slurp tesfile
23:22 committable6 AlexDaniel, ¦«HEAD»: ===SORRY!=== Error while compiling /tmp/qQBW9vS0BZ␤Undeclared routine:␤    tesfile used at line 1␤ «exit code = 1»
23:22 AlexDaniel committable6: HEAD say slurp ‘tesfile’
23:22 committable6 AlexDaniel, https://gist.github.com/f6b2ccaf53b4a7588124b2d17d2450ce
23:22 eisen74 So question is why is my $fh  = open $CSVFile, :r, nl => "\r"; not working as expected?
23:22 AlexDaniel committable6: HEAD say slurp ‘testfile’
23:22 committable6 AlexDaniel, ¦«HEAD»: hello world␍test␍end␤
23:22 jnthn eisen74: try nl-in => "\r"
23:22 firstdayonthejob joined #perl6
23:23 AlexDaniel committable6: HEAD my $FH  = open ‘testfile’, :r, nl-in => “\r”; for $FH.lines { say ‘hello’ }
23:23 committable6 AlexDaniel, ¦«HEAD»: open is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub open at src/RESTRICTED.setting line 9␤  in block <unit> at /tmp/bSV1pMGf8a line 1␤ «exit code = 1»
23:23 AlexDaniel awww come on
23:23 jnthn https://github.com/rakudo/rakudo/blob/nom/src/core/IO/Handle.pm#L24
23:23 jnthn It is nl-in and nl-out
23:23 AlexDaniel so the docs are wrong
23:24 eisen74 my $fh  = open $CSVFile, :r, nl-in => "\r"; works
23:25 jnthn OK. Also good to know: nl-in can be given an array
23:25 eisen74 Yup, looks like docs are wrong. That's why it wasn't working.
23:25 jnthn So nl-in = ["\r", "\n", "\r\n"] would work
23:25 jnthn uh
23:25 jnthn nl-in => ["\r", "\n", "\r\n"]
23:25 geekosaur and now I am remembering some kind of argument over that because the spec said nl but the code did nl-in and nobody wanted to commit to which was right, or something dumb like that
23:26 jnthn geekosaur: I'm happy to commit to it being nl-in and nl-out
23:26 jnthn For the simple fact that an array of options makes sense for input, but not for output
23:26 eisen74 No problem. Just need to fix docs or perhaps update IO::Handle so it allows both. People writing modules are going to trip up on this. Text::CSV in particular
23:26 geekosaur I don't recall the exact argument, just that this was brought up multiple times and people just argued and nothing happened
23:27 eisen74 https://docs.perl6.org/type/IO#sub_open says nl not nl-in
23:27 dalek doc: 0414020 | (Aleks-Daniel Jakimenko-Aleksejev)++ | doc/Type/IO.pod6:
23:27 dalek doc: There is no “nl”, it is “nl-in” and “nl-out”
23:27 synopsebot6 Link: http://doc.perl6.org/type/IO
23:27 dalek doc:
23:27 dalek doc: nl-out is still not documented
23:27 dalek doc: review: https://github.com/perl6/doc/commit/0414020d1a
23:27 jnthn Heh, was about to go submit an issue
23:27 jnthn AlexDaniel++
23:28 AlexDaniel nl-out is still not documented though
23:28 eisen74 Ok, will notify module author(s)
23:28 eisen74 Who maintains Perl docs? They're incorrect on this point: https://docs.perl6.org/type/IO#sub_open
23:29 viki eisen74: it's community maintained. Submit a PR, if you spot an issue.
23:29 eisen74 k. thx.
23:29 viki eisen74: http://github.com/perl6/doc
23:29 AlexDaniel There's also this one: https://github.com/perl6/doc/issues/484
23:29 viki eisen74: in this file in particular: https://github.com/perl6/doc/blob/master/doc/Type/IO.pod6
23:29 viki (for the URL you gave)
23:30 jnthn Sleep time; 'night
23:30 viki night
23:31 eisen74 AlexDaniel tagged it. Thanks.
23:31 dalek doc: 5ade495 | (Aleks-Daniel Jakimenko-Aleksejev)++ | doc/Type/IO.pod6:
23:31 synopsebot6 Link: http://doc.perl6.org/type/IO
23:31 dalek doc: Mention nl-out as well
23:31 dalek doc:
23:31 dalek doc: It requires more documentation, but just a quick mention will do for now
23:31 dalek doc: review: https://github.com/perl6/doc/commit/5ade495093
23:32 AlexDaniel eisen74: thanks for asking the question, by the way
23:34 MasterDuke another case of silently ignoring unknown named arguments looking like a bug (:nl vs :nl-in)
23:35 AlexDaniel what about this? https://docs.perl6.org/type/Proc#method_new
23:35 MasterDuke but compounded by the docs not being quite correct
23:36 AlexDaniel https://github.com/rakudo/rakudo/blob/nom/src/core/Proc.pm#L24 hehe
23:36 AlexDaniel nl-out => $nl
23:38 cygx joined #perl6
23:38 MasterDuke https://github.com/rakudo/rakudo/blob/nom/src/core/Proc.pm#L42
23:38 MasterDuke nl-in => $nl
23:38 cygx o/
23:39 AlexDaniel this does not look right
23:39 AlexDaniel feels like it should have separate nl-in and nl-out as well
23:39 cygx re documenting &open, note that the posix-y extended open modes are also still undocumented
23:39 cygx I still might have a branch for that lying around
23:40 cygx I never finished documenting it because there were still questions to be resolved (nl-in/out, bin mode being broken)
23:41 AlexDaniel oh no, github added mass actions on issues
23:43 viki Mass actions?
23:44 * viki sees no difference
23:44 AlexDaniel viki: https://files.progarm.org/2016-11-20-014452_992x555_scrot.png
23:46 viki Intersting.
23:47 pandorax joined #perl6
23:57 AlexDaniel anyway: #130136
23:57 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130136

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

Perl 6 | Reference Documentation | Rakudo