Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2013-01-24

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:39 hash_table joined #perl6
01:03 anuby joined #perl6
01:05 adu joined #perl6
01:21 hypolin joined #perl6
01:22 thou joined #perl6
01:24 dayangkun joined #perl6
01:42 ph1ur3 joined #perl6
02:10 balders_dod joined #perl6
02:19 b1rkh0ff joined #perl6
02:35 jaldhar joined #perl6
02:44 adu joined #perl6
02:50 sqirrel_ joined #perl6
02:50 FROGGS_ joined #perl6
02:52 thou joined #perl6
03:22 MikeFair_ joined #perl6
03:30 adu joined #perl6
03:41 PZt joined #perl6
03:45 SamuraiJack joined #perl6
03:49 grondilu_ joined #perl6
03:58 orafu joined #perl6
04:19 preflex_ joined #perl6
04:43 s1n joined #perl6
04:52 odoacre joined #perl6
05:21 telex joined #perl6
05:23 thou joined #perl6
05:37 telex joined #perl6
05:43 diakopter .u balloon
05:43 phenny U+2749 BALLOON-SPOKED ASTERISK (❉)
05:43 diakopter .u streamer
05:43 phenny diakopter: Sorry, no results for 'streamer'.
05:48 adu .u pile of poo
05:48 phenny adu: Sorry, no results for 'pile of poo'.
05:52 diakopter .u phenny
05:52 phenny diakopter: Sorry, no results for 'phenny'.
05:52 lue Interesting: In a Pod6 document (docs.pod6), where the first line is  =begin pod  and the last line is  =end pod  , if there is no final newline after =end pod, perl6 --doc fails miserably (i.e. "=end pod\n" == OK, "=end pod" == fail)
05:53 lue (docs.pod6 being a placeholder name, if that wasn't obvious)
06:08 moritz \o
06:09 lue o/
06:11 lue ooc, would  perl6 -MPod::To::HTML --doc document.pod6  dwim?
06:13 moritz no
06:13 moritz but --doc=HTML would
06:13 moritz and does
06:14 marloshouse__ joined #perl6
06:49 tadzik lue: oh, hm. Could you file a bug about it?
06:50 diakopter time for a Taco Bell frozen lemonade to celebrate finally fixing a bug I've been hunting for untold hours
06:58 dalek rakudo/nom: 0b5899a | moritz++ | src/core/IO/Socket/INET.pm:
06:58 dalek rakudo/nom: attempt to fix $socket.get with non-ASCII characters
06:58 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/0b5899aefb
06:58 moritz this commit works for me, but I've only tested in on parrot 5.0.0
07:12 FROGGS_ moritz: will test in a bit
07:12 FROGGS_ is the a special test for it?
07:16 kaleem joined #perl6
07:26 diakopter (#*%@ Taco Bell is no longer selling frozen lemonade. now it's this frozen blueberry baja thing. :<
07:26 diakopter so much for celebration
07:49 jnthn Using...lemonade to celebrate? I use beer! :P
07:49 jnthn morning, #perl6
07:49 jnthn -18C :D
07:49 * jnthn walked to work instead of taking the metro to see how cold it feels to walk in :)
07:54 arnsholt Yeah, that's chilly
07:54 tadzik heh, it's merely -8 here :)
07:54 arnsholt The number of days with that kind of temperatures has been limited this winter, thankfully
07:54 arnsholt Same here, tadzik
07:55 benabik It's actually -11 here, although it's the middle of the night...  Guh.  Forcast says it won't warm up any tomorrow.
07:58 arnsholt The temperatures 'round here are remarkably stable here as well
07:58 arnsholt Just a few degrees variation between day and night
07:59 moritz how many hours of light to do you have?
08:00 arnsholt Not enough? =)
08:01 arnsholt Sunrise at 0847, sunset at 1611
08:01 arnsholt So almost six and a half hours
08:02 moritz not too bad
08:03 arnsholt Yeah, it's noticeably better than early January
08:03 arnsholt It's not actually pitch black when we go to work anymore, which helps
08:25 snearch joined #perl6
08:45 FROGGS joined #perl6
08:45 FROGGS morning
08:56 moritz \o FROGGS
08:57 moritz FROGGS: with my latest patch, t/spec/S32-io/IO-Socket-INET.t should pass all tests, including the fudged ones
09:07 FROGGS moritz: k
09:20 FROGGS moritz: Result: PASS
09:20 FROGGS will check the open RT tickets
09:24 bane_ joined #perl6
09:24 FROGGS r: say 24681 * 100 / 24723
09:25 p6eval rakudo 0b5899: OUTPUT«99.830118␤»
09:25 FROGGS so we pass 99.8% of the spectests? can this be true?
09:25 tadzik yes, possible
09:25 tadzik note that we usually don't have spectests for things that aren't there :P
09:25 tadzik like threads
09:25 FROGGS hmmm
09:25 FROGGS I see
09:26 tadzik it's like panda passing 100% of its tests :P
09:26 FROGGS would be cool to have tests for things that are clear how it should be
09:26 FROGGS tadzik: haha
09:26 FROGGS tadzik++
09:29 moritz FROGGS: where did you get the number 24723 from?
09:35 fhelmberger joined #perl6
09:36 FROGGS https://github.com/coke/perl6-roast-​data/blob/master/perl6_pass_rates#L5
09:36 FROGGS I guess the diff between plan and spec are the examples and rosetta-codes
09:40 dakkar joined #perl6
09:42 Psyche^ joined #perl6
09:51 masak good forenoon, #perl6
09:52 jnthn good not-quite-afternoon masak :P
09:52 * masak .oO( that's what "forenoon" means... ) :P
09:53 jnthn .oO( when I say something, it means exactly what I want it to mean ) :P
09:53 Su-Shee this is quite an early "not quite afternoon" - in germany you'd still say "good morning" :)
09:54 moritz or just "servus" :-)
09:54 * masak .oO( waiter, come here! servus! )
09:54 Su-Shee moritz: I'm from the north, I say "Moin" anyways :)
09:54 jnthn .oO( it's still morning...servus more coffee! )
09:54 Su-Shee jnthn: HA HA HA :)
09:54 hoelzro Su-Shee: Winter is coming.
09:55 moritz Su-Shee: that's OK :-)
09:56 masak hoelzro: I always wondered what it would be like brandishing the Stark motto during early spring. wouldn't it feel a little bit silly?
09:56 hoelzro masak: Winter is coming (but not for a while).
09:56 masak I have an unexpected Perl 6 day today.
09:56 Su-Shee hoelzro: winter is already there, I had naked breasts every day under the shower AND I HAVE GOTTEN NO DRAGON STILL.
09:56 masak let's resume the .delta / postfix discussion, shall we?
09:56 jnthn masak: Do something unexpected! Like textual macros :D
09:56 hoelzro Su-Shee: only works with fire showers ;)
09:56 Su-Shee hoelzro: dammit.
09:57 hoelzro masak: maybe it's both literal and figuritive?
09:57 hoelzro kinda like saying "bad stuff is always coming"?
09:57 masak jnthn: at this point, people have been mentioning textual macros so much that *not* doing them would be the unexpected thing. :P
09:57 hoelzro Su-Shee: you also need to say "Where are my dragons?!"
09:57 Su-Shee literal programming.. i've just read again this old story about knuth's 10 pages of pascal versus the 6 lines shell script.. wonderful lesson.
09:58 Su-Shee hoelzro: I yelled it every day. Didn't help.
09:58 Su-Shee literate.
09:58 masak Su-Shee: to Knuth's defense, his solution is better. but it's better in a way that doesn't much matter.
09:59 masak Su-Shee: and isn't the reviewer, Ken Iversen, the guy who *invented* pipes? talk about "bad luck".
09:59 Su-Shee masak: you hopefully know the excellent articles by Richard Gabriel about "worse is better"?
10:00 moritz it just took me more than two hours to write 10 tests for a $work project :/
10:00 cognominal joined #perl6
10:00 masak Su-Shee: yes.
10:01 masak moritz: why? were they very long tests?
10:01 moritz masak: no, not very (more)
10:02 moritz masak: two main reasons: 1) many interdependencies 2) very slow test runs
10:02 moritz and 2) leads to 2a) distractions
10:02 Su-Shee moritz: we can totally district you some more :)
10:02 masak anyway, on reflection I find it ironic that people reacted so badly to the string in .delta(3, 'days'), as if it were a big design smell. because the named arg in .delta(:days(3)) is really no better.
10:03 masak and if we go the postfix route, we still have the ordering problem, because you can do $dt + (3days + 1months)
10:03 Su-Shee masak: uhm, I find .delta(amount, unit) pretty clear.
10:03 masak Su-Shee: I was pondering whether 'unit' could be made an enum.
10:03 jnthn masak: Just define an enum
10:03 masak hah!
10:03 Su-Shee masak: I would immediately assume .delta(57, 'minutes') would work too
10:03 masak Su-Shee: right, exactly.
10:03 jnthn masak: It's smell to me 'cus there's an obviously checkable improvement :)
10:04 masak jnthn: enum it is, then.
10:04 Su-Shee masak: also, it looks less cluttered.
10:04 * masak specs this
10:05 masak which is the lesser evil: .delta(1, 'minute'), or only accepting the plural forms like 'minutes'?
10:05 jnthn no quotes if it's an enum ;)
10:05 masak (uhm, but with enums instead. I haven't adapted yet)
10:05 masak question still stands.
10:06 jnthn minutes is right an infinite number of types. minute is right for only one value :)
10:06 jnthn *tiems
10:06 masak I know, that's why "only plural" is one of the options :)
10:06 moritz but if its method delte($amount, $unit) { }, then the $unit should be singular, no?
10:07 moritz *delta
10:07 jnthn true :)
10:07 arnsholt jnthn: Did you spec anything concrete on the REPR compose stuff?
10:07 jnthn arnsholt: yes
10:07 jnthn I commat it to the nqp repo
10:07 masak moritz: the important part is not the parameter name $unit, the important part is how it looks in code.
10:08 * arnsholt goes a-logging
10:09 masak if we support both Time::minute and Time::minutes, some people will be pleasantly surprised when they find they can write .delta(1, minute)
10:09 masak it's a little extra code with the double checks in the .delta method, but that doesn't feel so bad.
10:10 Su-Shee masak: user-wise you also don't have to remember which one it really was - singular or plural
10:10 arnsholt Feels similar to the 1st, 2nd, etc. adverbs for regex replacements
10:11 jnthn aye
10:11 jnthn and just as you can write 4st, you can write .delta(2, minute) without getting moaned at
10:13 jnthn r: say '123456' ~~ m:3nd/\d/
10:13 p6eval rakudo 0b5899: OUTPUT«「3」␤␤»
10:13 jnthn :)
10:13 jnthn ok, back to teaching :)
10:14 arnsholt jnthn++ # REPR compose docs and protocol
10:16 FROGGS r: say '123456' ~~ m:nth(4)/\d/
10:16 p6eval rakudo 0b5899: OUTPUT«「4」␤␤»
10:17 moritz r: say '123456' ~~ m:4nth/\d/
10:17 p6eval rakudo 0b5899: OUTPUT«「4」␤␤»
10:17 FROGGS r: say '123456' ~~ m:4th/\d/
10:17 p6eval rakudo 0b5899: OUTPUT«「4」␤␤»
10:17 moritz r: sub named(*%a) { say %a.perl }; named :42ed
10:17 p6eval rakudo 0b5899: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Malformed radix numberâ�¤at /tmp/hpSJJWdwN9:1â�¤------> [32mub named(*%a) { say %a.perl }; named :42[33mâ��[31med[0mâ�¤    expecting any of:â�¤        number in radix notationâ�¤Â»
10:18 FROGGS r: say '123456' ~~ m:20th/\d/
10:18 p6eval rakudo 0b5899: OUTPUT«#<failed match>␤»
10:18 FROGGS good boy
10:22 FROGGS moritz: you fixed: https://rt.perl.org/rt3/Tic​ket/Display.html?id=116302 , https://rt.perl.org/rt3/Tic​ket/Display.html?id=114866 and https://rt.perl.org/rt3/Tic​ket/Display.html?id=109306
10:24 moritz good lord, it was just four lines
10:24 masak moritz++
10:24 timotimo moritz++
10:25 masak r: say '01234567890123456789' ~~ m:20nd/\d/
10:25 p6eval rakudo 0b5899: OUTPUT«「9」␤␤»
10:25 masak mwhehehe.
10:25 masak try to read "20nd" aloud :P
10:25 timotimo r: sub named(*%a) { say %a.perl }; named :42nd
10:25 p6eval rakudo 0b5899: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Malformed radix numberâ�¤at /tmp/dYwtSQKijY:1â�¤------> [32mub named(*%a) { say %a.perl }; named :42[33mâ��[31mnd[0mâ�¤    expecting any of:â�¤        number in radix notationâ�¤Â»
10:25 timotimo this only works in regex matchings?
10:25 moritz FROGGS: though I suspect the second ticket (.recv) was your doing, not mine
10:26 bbkr joined #perl6
10:26 FROGGS moritz: hmm, maybe, thats why I took the tickets
10:27 bbkr moritz++ # socket get() fix, testing it right now
10:27 masak timotimo: yes, because :42 outside of them means radix stuff.
10:27 masak r: say :42<100>
10:27 p6eval rakudo 0b5899: OUTPUT«[31m===[0mSORRY![31m===[0m�Radix 42 out of range (allowed: 2..36)�at /tmp/1jPeJobrnH:1�------> [32msay :42<100>[33m�[31m<EOL>[0m�»
10:27 timotimo OK
10:28 timotimo r: say '01234567890123456789' ~~ m:20th/\d/
10:28 p6eval rakudo 0b5899: OUTPUT«「9」␤␤»
10:28 timotimo so you can use any of the suffixes?
10:28 timotimo r: say '01234567890123456789' ~~ m:1th/\d/
10:28 p6eval rakudo 0b5899: OUTPUT«「0」␤␤»
10:29 moritz timotimo: yes
10:35 masak I've never considered before why we're so fine with those numbers being 1-based. :)
10:40 arnsholt Huh. Good point =)
10:40 masak .truncated-to should be switched to use the enum, too.
10:41 masak heh, it currently requires exactly one named arg, like we discussed yesterday ;)
10:41 masak (but the enum idea is better)
10:47 MayDaniel joined #perl6
10:58 SmokeMachine joined #perl6
10:59 b1rkh0ff joined #perl6
11:02 masak wow, this code is a lot of fun to write :)
11:02 masak I'll gist it in a little while.
11:02 cog joined #perl6
11:02 masak then I need to take a step back and write some tests...
11:02 timotimo this code? another mini-challenge? :)
11:02 masak no, I'm hacking on DateTime.delta ;)
11:03 masak timotimo: if you want a mini-challenge, skids++' https://gist.github.com/4609751 seems suitable ;)
11:03 masak .delta is all about managing overflow. like an odometer.
11:04 masak if you .delta(100, days), suddenly questions about which month you're in and how many days the subsequent months have become important.
11:04 masak you could easily overflow on months and need a new year ;)
11:07 masak oh darn, and I need .delta to work with negative amounts, too! :)
11:07 masak but, hm. I should be able to delegate practically all of the pure Date handling logic to Date.
11:07 masak (which already does that very well)
11:08 timotimo in my head i *think* i've already figured it out perfectly and quite quickly. i bet when i go to implement it there's some kind of catch
11:10 * masak loves catches of that sort
11:11 Su-Shee joined #perl6
11:22 masak interesting about ridiculing someone's code on Twitter: http://news.ycombinator.com/item?id=5106767
11:26 daniel-s joined #perl6
11:27 Su-Shee masak: I've just initiated a day of saying nice things about projects, languages and technologies you hate :)
11:33 MikeFair__ joined #perl6
11:37 masak Su-Shee: I find many good points were made in the apology and non-apology blog posts. for example, this had nothing to do with misogeny. (the author just happened to be a woman, and they didn't know that.) most of the tweeters were criticising Node.js, but it came off sounding like criticism of the project.
11:37 masak personally I find "sed and other Unix tools already do this" to be a very weak criticism of any project.
11:37 timotimo i, too, laughed at the idea of recreating sed in an "application server" and "ick, javascript!" and only learnt the author was a woman a few minutes ago
11:38 masak the same could be said of `rename`, for example. but I'm really glad I don't have to re-implement it each time.
11:39 Su-Shee masak: it indeed didn't. I'm also kind of wary about being supposedly a professional developer working for mozilla and then not being aware of that employers reading code on github and "and then I sobbed some more" - sorry, but this is uhm.. infantile.
11:39 Su-Shee masak: but yes, I know the feeling exactly because the open source world is a really harsh one.
11:40 masak Su-Shee: yes, the "and then I sobbed some more" was so unexpected that my first reaction was to wonder whether it was ironically meant.
11:41 timotimo may just be hyperbole for "felt really bad" - also from her perspective it may have looked pretty darn overwhelming
11:41 masak seeing as it wasn't, that was a bit more sensitive than I would expect of a person of that accomplishment and rank.
11:41 masak but having said that, I wouldn't want to use my expectations in any way to invalidate her reactions to the situation.
11:42 Su-Shee masak: oh, I actually did cry more than once because someone said something which I interpreted as me being stupid.
11:42 masak just because I think "she should have expected insensitive comments" doesn't mean the comments weren't insensitive.
11:43 Su-Shee it's a socialization thing which is difficult to jump over when joining the open source world.
11:43 Su-Shee it took me a couple of years. Now I can just shrug if someone doesn't like my code..
11:43 timotimo so far i have evaded that by only contributing to low-visibility projects and doing tiny bits of stuff. that's very obviously not something most people should or would want to do, though …
11:44 timotimo (not meaning to call perl6 a low-visibility project!)
11:45 masak Su-Shee: I wonder how I'd react if someone said something hurtful about my Perl 6 code. I honestly don't know. I know my code isn't always perfect, and it would certainly be possible to criticise it in various ways.
11:46 masak Su-Shee: I think I'd try to separate the factual criticism (and try to fix or improve that) from the personal dickheadedness (and try to rationalize that in an appropriate way).
11:46 masak but maybe that's a particularly male approach to criticism. or so I've heard. ;)
11:47 sorear learning not to take comments personally was one of the hardest parts of niecza
11:47 Su-Shee masak: it's a healthy one, that's why I adopted it.
11:47 masak to his great credit, chromatic is *very* good (in Reddit comments and elsewhere) at making that separation, and simply ignoring the emotional bits.
11:48 Su-Shee masak: I had to learn it when I published my first articles and then realized that I just wrote for a mass audience. :)
11:48 masak sorear: "was"? are you already thinking about Niecza in the past tense? :/
11:49 sorear masak: I think I'm mostly over that particular bump in the road, at least.
11:50 sorear it is not, now, the hardest part by a longshot
11:50 masak good. :)
11:50 masak Variable '$minutes' is not declared. Did you mean '$minute'?
11:50 masak whoa!
11:50 masak h... how... :)
11:50 masak timotimo++
11:51 timotimo first time it's been used in production :D
11:52 masak in the sense that Rakudo is a production project, yes :)
11:53 moritz timotimo: it's been used before, it's just the first report
11:54 moritz timotimo: only when features fail do you notice how many people are acutlly using it
11:55 sorear sleep&
11:59 cog joined #perl6
12:01 am0c joined #perl6
12:04 jnthn Most of the time I hear about Grammar::Tracer is when it breaks. Though I wrote a test for it now at least... :)
12:04 jnthn So the ecosystem tests can tell me :)
12:14 timotimo moritz: seems very true :(
12:15 cog joined #perl6
12:39 bbkr moritz: your Socket.get() unicode fix works like a charm. also tested with unicode separators
12:42 moritz bbkr: great. Thanks for testing
12:49 FROGGS awesome
12:50 FROGGS moritz++
12:50 FROGGS bbkr++
12:52 SmokeMachine joined #perl6
13:04 cog joined #perl6
13:15 stevan_ joined #perl6
13:23 SmokeMachine joined #perl6
13:34 sqirrel joined #perl6
13:37 gfldex oh well: https://github.com/search?p=​6&amp;q=path%3A.ssh%2Fid_rsa
13:38 gfldex so prepare yourselves to replace your github private keys
13:38 tadzik ahahaha
13:38 moritz http://www.reddit.com/r/programming/comments/174​vfe/a_whole_new_code_search_github_blog/c82h3mg has some more nice search terms
13:38 FROGGS uhh
13:39 timotimo sigh.
13:40 moritz one can at least hope that the private keys are procted with strong passwords
13:40 BooK timotimo: I've fixed the 404, by the way
13:40 timotimo do these repos also have the known_hosts files?
13:40 timotimo BooK: oh nice! didn't realize you were here :)
13:41 gfldex no wonder why china is blocking github :)
13:41 BooK timotimo: actually look for know_hosts, because usually the id_dsa will be there too
13:42 BooK and with any luck, the config will give you the username / host pairs anyway
13:43 BooK that won't give you the passphrase, though
13:43 masak DateTime.delta submitted for early review: https://gist.github.com/4621729
13:43 masak I'm going to write tests for subtracting time now :)
13:43 masak figure I'll just take all of my addition tests and reverse them.
13:43 masak (vim macros)++
13:44 masak this feels like the first time I've used the full power of 'given' statements. succeed, proceed, the whole deal.
13:47 BooK apparently, I've never published my script to build a family tree using git
13:48 BooK every person is a commit, pointing to a tree with all related files (so checking out someone take a whole new meaning), and pointers to their parents
13:48 BooK the only slight issue is that you need to regenerate the commits for all descendants whenever you edit something about someone
13:48 masak ...just like in real life :P
13:49 masak BooK: I remember that talk. good fun.
13:49 masak BooK: though clearly what you should be storing that way is people's DNA.
13:49 BooK hehe
13:50 BooK DNA is the SHA-1 of people
13:50 masak well, wouldn't you know. all the auto-generated dualized tests for subtracting time... just passed, right off.
13:50 masak I didn't expect that :)
13:51 [Coke] masak: I would be worried.
13:51 gfldex masak: do you take leap seconds into account?
13:52 [Coke] not that you should be, but I"ve had too many cases where unexpected passing tests means I screwed up. ;)
13:52 masak gfldex: no, that's the one thing I've skipped so far. writing tests for it now.
13:52 arnsholt Yay. I was cleverer than the average bear when setting up my dotfiles repo =D
13:52 gfldex masak: and Samoa?
13:52 masak [Coke]: as far as I can see, those tests are passing for legit reasons.
13:52 gfldex well, and all the other places that changes TZ
13:53 masak gfldex: the Perl 6 approach to time zones right now is that you can specify them all you want, but you need to manage them yourself.
13:53 masak gfldex: unlike CPAN, we don't keep a register of known time zone names and DST and such.
13:54 bluescreen10 joined #perl6
13:54 masak gfldex: that is, you're never on CET with Perl 6's DateTime, you're on +01:00 or +02:00, and you have to keep track of which one.
13:55 timotimo BooK: when a person changes only slightly, the whole DNA looks completely different?
13:56 bluescreen100 joined #perl6
13:57 BooK timotimo: no, that's what masak meant
13:58 BooK whereas with my example where photos and other files related to a person change, that changes the tree and so the sha1
13:58 timotimo ah
13:58 hash_table joined #perl6
13:59 BooK regarding dotfiles repos: that means people have a bunch of symlinks in ~ pointing to that repo
13:59 BooK are there tools to manage that?
13:59 masak ln
13:59 tadzik :>
13:59 * masak loves being facetious
13:59 BooK masak: that's plumbing
14:00 BooK I was thiking porcelain :-)
14:00 masak don't go reimplementing ln! they'll laugh at you on Twitter!
14:00 gfldex masak: multi method delta(*@pairs){ for @pairs delta($amount, $unit); } # or something along the lines would be nice
14:00 masak gfldex: problem is, order matters.
14:00 BooK it would be nice though, to have soemthing to manage those symlinks for you
14:00 BooK (the somewhat difficult problem being when files are removed from the repo)
14:01 masak gfldex: oh, but you want to be able to send in an even number of positionals. I see.
14:01 masak gfldex: nah, that's not a big win over doing several different .delta calls ;)
14:02 gfldex i was told laziness is a virtue!
14:05 masak yes, but I'm wary of prematurely overloading APIs.
14:05 masak it's easier to make something too complicated than to make it too simple.
14:14 PacoAir joined #perl6
14:17 atrodo joined #perl6
14:21 PacoAir joined #perl6
14:23 Vlavv joined #perl6
14:25 * masak grumbles about those leap seconds
14:26 FROGGS time is crap, I tell you
14:26 jnthn .oO( ain't got time for dat )
14:27 masak jnthn: "ain't *nobody* got time for that!"
14:27 Su-Shee Haha. wow, now that is the single most coolest resume I've ever seen :)) http://www.phildub.com/ (scroll down, too :)
14:28 moritz leap seconds suck up your time (if you you are a developer)
14:28 masak Su-Shee: hah :)
14:29 [Coke] moritz: I've never worked on something where a leap second would impact the actual result meaningfully.
14:30 masak help me check my reasoning here. when you're delting anything *except* seconds (minutes, for example), leap seconds don't matter at all.
14:30 masak but when you're delting seconds, they matter all the time.
14:30 moritz well, what's the result of subtracting a minute when you're on a leap second?
14:31 moritz and what if you are subtracting $n days, and land on another leap second?
14:31 masak moritz: same as subtracting 60 seconds, if you ask me.
14:31 FROGGS if it is the same like when adding months, you got the same leap second, but just on another minute
14:31 masak what FROGGS said.
14:32 masak but if I'm going from May 2012 to August 2012 by just adding seconds all the time, the leap second in June 2012 matters.
14:32 vividsnow joined #perl6
14:32 FROGGS right
14:32 masak so even if I'm adding tens of thousands of seconds at a time, I need to check all the dates in the range between start date and end date.
14:33 FROGGS hmmm, really?
14:33 FROGGS if you add 10months to january, you dont care about how many days feb has
14:34 masak right.
14:34 masak we care only about the resolution of the unit we're adding/subtracting.
14:34 FROGGS you check if the date is valid after adding ten months, if it is not, you have to fiddle with days
14:34 masak which is why leap seconds don't matter *unless* we're adding seconds.
14:34 moritz depends on how you define 'matter'
14:35 FROGGS 'matter' is, what perl 5's DateTime does
14:35 moritz if you are on a leap second, and add $n days and land on another leap second, you'll end up in second 60
14:35 masak hm, I wonder if I could just convert to Instant, add the seconds, and convert back? :)
14:35 * masak tries
14:35 moritz if you add $n+1 days, you can't land on a leap second. Which second do you land on? 0 of the next minute? or 59?
14:36 moritz it's pretty much the same as adding one or two months to Jan 31
14:36 moritz and I notice that I don't know what tha does either
14:38 masak moritz: you land on 0 of the next minute.
14:38 masak moritz: the reasoning is exactly like that of days and months, like FROGGS pointed out.
14:38 masak yay, the Instant idea worked perfectly, and made the code simpler!
14:39 moritz masak: ok, thanks
14:39 masak latest code here: https://gist.github.com/4621729
14:40 masak I'm going to add a few tests about leap seconds and adding days, just to make sure it works.
14:41 masak (and yes, what we just said makes .delta non-commutating. which is why ordering matters so much.)
14:44 * moritz wonders how long the delta's commute is :-)
14:47 masak *non*-commutating :)
14:48 arnsholt Infinitely long commute, then =)
14:49 moritz masak: just means that the commutator is non-zero, which makes it interesting
14:49 * moritz had too much algebra + QM
14:49 masak ;)
14:52 masak if I add 365 days to 1972-12-31T23:59:60, what do I get?
14:53 masak or, if it helps, if I add a year to 1972-12-31T23:59:60. same question, really.
14:53 moritz 1974-01-01T00:00:00 ?
14:53 masak I'm asking because 1973-12-31 has a leap second.
14:53 moritz oh.
14:54 masak writing tests is good for the soul :)
14:54 moritz then you'll land on the leap second
14:54 masak yeah.
14:54 moritz ie 1973-12-31T23:59:60
14:54 masak it's a very special case.
14:54 masak good. we agree.
14:54 masak just wanted to check.
14:54 moritz it's why I was sceptical about the whole "does not matter" subject earlier
14:55 moritz you cannot ignore leap seconds when adding something >= minute, because you might start and you might land at one
14:55 moritz so in some sense, leap seconds do matter
14:55 masak I don't see how you could land on one without starting on one, though.
14:56 arnsholt How does Perl 5 DateTime handle this problem_
14:56 arnsholt s/_/?
14:57 masak good question. please find out :)
14:57 moritz masak: right, you can only land on one if you start from one
14:57 alec joined #perl6
14:57 moritz at least if all the minutes are integral :-)
14:58 Targen joined #perl6
14:59 arnsholt masak: Can't really. I'm supposed to be writing slides for my lecture tomorrow, but procrastinating in here instead >.<
14:59 gfldex masak: you can land on a negative leap second by starting at a leap second or by starting on a non leap second
15:00 skids joined #perl6
15:00 moritz what is a "negative leap second"?
15:00 gfldex the last minute of dec 31 or jul 31 can have only 59 seconds
15:01 moritz OH WHAT THE FUCK
15:01 gfldex happens every few dozen years because of wobbly earth orbit
15:01 masak moritz: oh, I'm *so* gonna forbid non-integral non-seconds!
15:01 gfldex so please stop rockign your chair :)
15:01 moritz I mean, why can't they just leave it be, and wait until all is back to normal?
15:01 masak moritz: and then instead of explaining when people complain about it, I'm going to *slap* them!
15:02 moritz masak: *and* delete their code :-)
15:02 masak repeatedly, if that's what it takes.
15:02 gfldex because they can't tell if it goes back to normal. Three body problems are a bitch.
15:02 gfldex they expect the earch to slow down but can't be sure about it
15:02 PerlJam gfldex: note that there has never been a negative leap second  :)
15:03 masak gfldex: have there been fun New Year's Eve celebrations with leap seconds where people had to say "three... two... one... wtf... Happy New Year!"
15:03 masak ?
15:03 gfldex let me check
15:03 masak :)
15:03 masak I know there's been 31 Decembers with leap seconds.
15:03 masak I'm asking about actual celebrations where this happened because $big-monitor was leap-second-aware.
15:03 gfldex no negative leap seconds yet
15:05 moritz oh man, we do know that earth rotation becomes slower. We just need to be patient if it comes to some oscillations.
15:05 PerlJam I'm pretty sure negative leap seconds won't actually happen given the normal friction-induced slowing of the Earth's rotation.
15:06 masak leap seconds handled. code updated. all tests pass. https://gist.github.com/4621729
15:07 masak I feel ready to add this to the spectests, to Rakudo, and to the spec.
15:07 gfldex masak: are you aware of the fact that dinosaures had one hour less per day?
15:07 stopbit joined #perl6
15:07 * gfldex giggles
15:07 masak gfldex: no, I wasn't aware.
15:07 gfldex please don't build a time machine, will ya?
15:07 PerlJam gfldex: no wonder they went extinct!  The didn't have enough time to get all of their stuff done.
15:08 masak gfldex: did the dinosaur scientists start messing with leap hours, getting all of them killed in the process? :P
15:08 gfldex they may have calculated their departure date wrongly and got hit by that big rock
15:08 adu joined #perl6
15:08 * [Coke] points masak at syfy's new time travel show to annoy him.
15:09 masak (no-one has said anything about .delta(1, week) -- but I think it's a good addition. will make sense with the .truncated-to method as well)
15:09 * PerlJam wonders what the intelligent insects that will inhabit the earth 65 million years from now will think about us.
15:09 masak [Coke]: who's syfy?
15:09 masak [Coke]: and what kind of pointer is that? I see no URL. :P
15:10 gfldex masak: i have toyed with perl 6 date arithmetics before and found that i would need two versions
15:11 gfldex one that answers questions like: when will we meet at the train station
15:11 masak should Date have a .delta method, too? I think it should.
15:11 gfldex and one that asnwers questions like: how much do i have to pay you for providing a service that you subscribed to x days ago
15:12 [Coke] masak: googling for that phrase gets you reaaaaaly close, but here's a URL: http://www.syfy.com/continuum
15:12 nwc10 You might also want to read this message, if you're considering dates & times on the scale of 65 million years from now: http://www.xray.mpe.mpg.de/mailing-lis​ts/perl5-porters/2009-02/msg00480.html
15:12 masak gfldex: why are those two different versions?
15:12 masak [Coke]: thank you.
15:13 FROGGS ppl: there is no spec about $(...) in regexes, how do I call that construct? example:
15:13 FROGGS r: say "abc" ~~ m/$($_)/'
15:13 FROGGS r: say "abc" ~~ m/$($_)/
15:13 p6eval rakudo 0b5899: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Two terms in a rowâ�¤at /tmp/jcWiC1a1N4:1â�¤------> [32msay "abc" ~~ m/$($_)/[33mâ��[31m'[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix or meta-infixâ�¤        infix stopperâ�¤        statement endâ�¤        statement modifierâ�¤      â€¦
15:13 p6eval rakudo 0b5899: OUTPUT«#<failed match>␤»
15:13 FROGGS n: say "abc" ~~ m/$($_)/
15:13 p6eval niecza v24-18-gaf64300: OUTPUT«#<match from(0) to(3) text(abc) pos([].list) named({}.hash)>␤»
15:14 gfldex masak: because when you want to meet somebody you may do some rounding (do we meet on mo or thu?) and in that case leap seconds do count as you will have to take TZ into account too
15:14 masak [Coke]: I'm currently going through Fringe episodes. this looks promising, too.
15:14 FROGGS here id the report: https://rt.perl.org/rt3/Tic​ket/Display.html?id=115298
15:14 gfldex in fact, having deltas without TZ is rather pointless because you need that to make reasonable rounding
15:16 gfldex the problem i see with your .delta is that you give a programmer a nice tool that will lead to bugs if the programmer in question doesn't know for sure what he/she is doing
15:16 gfldex and how many programmers Know For Sure(tm)?
15:16 alec joined #perl6
15:16 [Coke] masak: I ... haven't... watched fringe. bad coke.
15:17 moritz gfldex: well, it's as safe a default as we can make it, afaict
15:18 gfldex in the end i found myself to want to implement a calender and move pointers in that calendar around instead of assuming that dates are numbers i can apply arithmetics to
15:19 SmokeMachine joined #perl6
15:19 gfldex and as slashdot is telling us on a regular basis even very big companies have huge problems to get dates right
15:19 [Coke] mmm. with my worky date math, I might need to know what the date is a year from *today*, but not *this second*.
15:19 gfldex much to my amusement i have to say :)
15:20 FROGGS TimToady: what's the difference between   say "abc" ~~ m/$( $_ )/   and    say "abc" ~~ m/{ $_ }/    ? ( #115298 got a patch in queue )
15:20 [Coke] most complicated thing that's come up recently is something like "last business day before <date>" which is more complicated from keeping track of work days than anything leap secondy.
15:20 gfldex [Coke]: the problem with that is that you do the underlaying math in UTC and then convert to local TZ. So something innocent like 6 o'clock in the morning in a +6 TZ can move the underlying numbers dangerously close to midnight, and therefore close to leap seconds.
15:21 [Coke] no.
15:21 Su-Shee a short explanation: jvm, perl6 - it's "perl6 on jvm like rakudo on parrot and niecza on .net"?
15:21 [Coke] Su-Shee: sort of except that the perl6 on the jvm is the same perl6 on parrot, sort of.
15:22 adu joined #perl6
15:23 Su-Shee [Coke]: because the intermediary <?> allows to just exchange the jvm and parrot?
15:23 [Coke] gfldex: If the question is, "what date does this company in poland have to file their tax return", I'm not looking at time zones.
15:23 [Coke] basically.
15:23 cog joined #perl6
15:23 [Coke] intermediary being a dialect of perl6 called 'nqp'
15:24 gfldex if you ask that question for Samoa tho, you might end with a date that never existed
15:24 FROGGS Su-Shee: it should be possible some day to use the rakudo source for both nqp on parrot and nqp(js) on jvm
15:24 Su-Shee then I remembered correctly, thanks.
15:24 gfldex ignoring TZs is ... brave
15:25 Su-Shee FROGGS: I'm waiting for the clojure way, basically.
15:25 [Coke] gfldex: is samoa on a different calendar?
15:25 [Coke] You're looking for too much detail. If they have to file on Friday, it doesn't matter that they are 4.5 time zones away with a leap second.
15:26 gfldex no they changed TZ by skipping a day because they wanted to be in the same TZ then australia
15:27 [Coke] ... they presumably they didn't have any tax returns due that day. :)
15:27 [Coke] *then
15:27 gfldex i do not agree. If i want to query all companies that would have to pay until jul 31 but didn't I could miss out some money.
15:28 [Coke] which is a different scenario that what I posed.
15:32 masak gfldex: we don't ignore time zones so much as leave most of the handling to the programmer or non-core modules.
15:32 masak gfldex: this was a conscious decision at the time we refactored S32/Temporal back in 2010, to delimit the scope of DateTime and surrounding classes.
15:33 SunilJoshi joined #perl6
15:38 hash_table joined #perl6
15:39 stevan_ joined #perl6
15:40 stevan_ joined #perl6
15:44 FROGGS[mobile] joined #perl6
15:52 werwerwer joined #perl6
16:00 SunilJoshi joined #perl6
16:02 masak Could not find sub &infix:<+>
16:02 masak getting this when trying to compile CORE with the new enum and the .delta method.
16:02 FROGGS joined #perl6
16:04 kaare_ joined #perl6
16:07 masak seems to be emanating from within the enum declaration.
16:08 jnthn masak: Maybe you declared it too early.
16:08 SamuraiJack_ joined #perl6
16:10 masak oh huh.
16:10 jnthn Well, + is defined in the setting :)
16:10 masak Temporal.pm is fairly late, though.
16:11 jnthn Consider givign the enum keys explicit values using the pair syntax
16:11 masak ok.
16:11 jnthn See Order; that's an enum declared in the setting and it works.
16:11 masak ok.
16:14 benabik joined #perl6
16:18 jnthn hotel *
16:18 jnthn ^
16:18 jnthn no, ffs
16:18 jnthn &
16:19 diakopter ?
16:19 diakopter something about the hotel?
16:20 FROGGS a weird cat
16:25 SmokeMachine joined #perl6
16:26 masak the '^' instead of '&' is due to assuming Swedish keyboard (because of the physical keyboard) where an English keyboard applied (because of Putty/SSH) ;)
16:26 diakopter oh heh
16:26 masak I can't similarly explain the '*'.
16:27 diakopter * is beside &
16:27 diakopter so is ^
16:28 masak oh, you're right.
16:28 masak so the '*' can be explained by overcompensating.
16:29 diakopter everytime I see ffs I have to rederive what it means; for some reason I can't learn it
16:29 masak (the '&' is on the 6 on Swedish keyboard. it's on the 7 on US keyboards. the '*' is on the 8 on US keyboards.)
16:32 FROGGS get a german one, you cant mix <[&*^]> there :o)
16:37 dalek roast: 16c9071 | masak++ | S32-temporal/DateTime.t:
16:37 dalek roast: [S32-temporal] added tests for DateTime.delta
16:37 dalek roast: review: https://github.com/perl6/roast/commit/16c907131f
16:38 dalek rakudo/nom: 943ecc5 | masak++ | src/core/Temporal.pm:
16:38 dalek rakudo/nom: [core/Temporal.pm] implemented DateTime.delta
16:38 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/943ecc5115
16:38 FROGGS nr: say $(
16:39 p6eval rakudo 0b5899: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unable to parse expression in contextualizer; couldn't find final ')'â�¤at /tmp/6fnNIoqTLM:1â�¤------> [32msay $([33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        argument listâ�¤        prefix or termâ�¤        prefix or meta-prefixâ�¤      â€¦
16:39 p6eval ..niecza v24-18-gaf64300: OUTPUT«[31m===[0mSORRY![31m===[0m��Unable to parse contextualizer at /tmp/m8a9hsVxLA line 1 (EOF):�------> [32msay $([33m�[31m<EOL>[0m�Couldn't find final ')'; gave up at /tmp/m8a9hsVxLA line 1 (EOF):�------> [32msay $([33m�[31m<EOL>[0m��Parse failed�…
16:56 dalek roast: 6454b13 | masak++ | S32-temporal/DateTime.t:
16:56 dalek roast: [S32/Temporal] switched truncated-to to enum
16:56 dalek roast: review: https://github.com/perl6/roast/commit/6454b13bcd
16:58 dalek rakudo/nom: 7e10a0d | masak++ | src/core/ (2 files):
16:58 dalek rakudo/nom: switched .truncated-to to enum
16:58 dalek rakudo/nom:
16:58 dalek rakudo/nom: The exception type X::Temporal::Truncation also goes away,
16:58 dalek rakudo/nom: being replaced by ordinary parameter type checking.
16:58 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/7e10a0dfa1
17:03 cog joined #perl6
17:09 Pleiades` joined #perl6
17:15 dalek roast: eaf297e | masak++ | S32-temporal/Date.t:
17:15 dalek roast: [S32/Temporal] added tests for Date.delta
17:15 dalek roast: review: https://github.com/perl6/roast/commit/eaf297ed76
17:16 dalek rakudo/nom: b49cbe0 | masak++ | src/core/ (2 files):
17:16 dalek rakudo/nom: [core/Temporal.pm] implemented Date.delta
17:16 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b49cbe0a8d
17:17 FROGGS masak++
17:28 sjn joined #perl6
17:29 dalek specs: 9d8bc5f | masak++ | S32-setting-library/Temporal.pod:
17:29 dalek specs: [S32/Temporal] spec DateTime.delta and Date.delta
17:29 dalek specs:
17:29 dalek specs: Clarify the .truncated-to method as well; it also uses the
17:29 dalek specs: C<TimeUnit> enum, instead of named parameters.
17:29 dalek specs: review: https://github.com/perl6/specs/commit/9d8bc5fe62
17:29 masak ladies and gentlebots, we now have .delta :)
17:30 FROGGS \o/
17:39 Chillance joined #perl6
17:39 eiro joined #perl6
17:42 spider-mario joined #perl6
17:44 SmokeMachine joined #perl6
17:47 spider-mario_ joined #perl6
17:48 SmokeMac_ joined #perl6
17:48 moritz now I want .epsilon too :-)
17:49 moritz masak++ # unexpected temporal hackery
17:49 japhb masak, FWIW IIRC the original reason for Perl 5 DateTime to exist at all was to try to finally have one module that everyone could rely on that did the calculations as correct as possible.  Add-ons to it came in the form of parsers, formatters, non-Julian/Gregorian style calendars, and such.  But the basic calculations were (intended to be) rock solid, and users didn't have to think about whether they needed to pull in more modules to get
17:49 japhb stuff like DateTime + Duration correct.
17:50 japhb I still think that was a good line to draw.
17:51 japhb (None of which detracts from masak++ for doing the present work.  ;-)
17:55 SmokeMachine joined #perl6
17:56 masak japhb: I have a huge respect for the delineation drawn by DateTime the CPAN module. and yes, maybe all the world's timezones *should* be part of src/core. it's still not too late to change that. but it's too far outside my area of expertise, and as far as I know, our current delineation works too.
17:56 masak for a definition of "works" which admittedly doesn't take all the world's timezones into account.
17:59 timotimo r: say ("Foo -> Bar" ~~ m:s/ <ident> $<edgeop>=< -- -\> \<- > <ident> /) # is it unreasonable to expect this to work without escaping the <- and ->?
17:59 p6eval rakudo 7e10a0: OUTPUT«「Foo -> Bar」␤ ident => 「Foo」␤ edgeop => 「->」␤ ident => 「Bar」␤␤»
17:59 timotimo ah, apparently no space is required before the > that ends the quotewords construct
18:00 PerlJam japhb: mktime() already did the calculations correctly long before DateTime existed :)
18:01 moritz PerlJam: I don't think mktime does addition of non-second units, for example
18:01 japhb masak: I guess I fear that we seem to have an obsessive compulsion to get graphemes correct, but not timezones.  And I don't understand that difference, given that both are reflections of the craziness of human social constructs.
18:02 moritz japhb: TimToady is a linguist :-)
18:02 japhb I totally understand worry about bloat and complexity.
18:02 japhb And you're a physicist, right?  :-)
18:02 moritz japhb: yes. And as such I'm very happy to have a TAI time source in Perl 6
18:03 masak japhb: I repeat: it is still not too late to put things right, and include all the world's timezones in core. are you our man?
18:03 japhb I guess I just want us to choose the set of social constructs we are planning to address, and approaching them all with the same fervor that we do Unicode.
18:03 SmokeMac_ joined #perl6
18:04 masak agreed.
18:04 masak japhb: I'm glad we got S32/Temporal straightened up after years of fumbling in the dark.
18:05 moritz now somebody please do the same for IO :-)
18:05 japhb masak, I don't know if I am the man for that.  On the one hand, I have spent some time trying to get datetime handling "correct", but I really don't feel encyclopedic in such knowledge, and I have already committed to too many Perl 6 projects as it is.  So I am torn.  :-/
18:05 japhb (time spent on a previous project)
18:06 alec joined #perl6
18:07 japhb As for IO, I have a feeling that is going to become an implementation-first solution -- first person to create a really good IO implementation will get their design canonized.
18:07 japhb .oO( bombarded )
18:08 PerlJam japhb: isn't that how IO has always been done?  (see Unix  :)
18:09 japhb PerlJam, yes, but difference being that with very high level languages, we get to export our Unix-inspired designs to all the other OSen as well.  :-)
18:10 japhb (Bah, my command of English is sucking this morning.)
18:10 jnthn hm, I should go through the RT queue's old end at some point
18:11 jnthn A glance suggests there are some easy closes and even some easy rejects in there.
18:16 cog joined #perl6
18:27 timotimo hm, segfaults are not supposed to happen, right?
18:30 jnthn No, not unless you were doing something naughty with NativeCall :)
18:30 jnthn nom &
18:30 Pleiades` joined #perl6
18:31 arnsholt What jnthn said. OTOH, if you -are- using NativeCall, it may very well be not your fault as well
18:31 * masak .oO( NaughtyCall )
18:31 nwc10 :-)
18:32 arnsholt Hmm. Sounds like an idea for ACME::
18:32 SmokeMachine joined #perl6
18:33 Exodist joined #perl6
18:38 timotimo what's going wrong again now? trying to --gen-parrot, tells me it can't find a MANIFEST.generated and aborts the configure phase >_<
18:38 timotimo must have accidentally deleted it?!
18:39 timotimo no idea how that might have happened.
18:42 Pleiades` joined #perl6
19:00 benabik joined #perl6
19:02 xinming joined #perl6
19:03 FROGGS timotimo: IMO this is more readable:
19:03 FROGGS r: say ("Foo -> Bar" ~~ m:s/ <ident> $<edgeop>=[ '--' | '->' | '<-' ] <ident> /)
19:03 p6eval rakudo b49cbe: OUTPUT«「Foo -> Bar」␤ ident => 「Foo」␤ edgeop => 「-> 」␤ ident => 「Bar」␤␤»
19:03 FROGGS can somebody tell whats wrong with this?
19:03 FROGGS r: say ("Foo -> Bar" ~~ m:s/ <ident> $<edgeop>=< '--' '->' '<-' > <ident> /)
19:03 p6eval rakudo b49cbe: OUTPUT«â�€â�€â�€[â�€â�€â�€3â�€â�€â�€1â�€â�€â�​€mâ�€â�€â�€=â�€â�€â�€=â�€â�€â�€=â�€â�€â�€â�€â�​€â�€[â�€â�€â�€0â�€â�€â�€mâ�€â�€â�€Sâ�€â�€â�€Oâ​�€â�€â�€Râ�€â�€â�€Râ�€â�€â�€Yâ�€â�€â�€!â�€â�€â​�€â�€â�€â�€[â�€â�€â�€3â�€â�€â�€1â�€â�€â�€mâ�€â​�€â�€=â�€â�€â�€=â�€â�€â�€=â�€â�€â�€â�€â�€â�€[â​�€â�€â�€0â�€â�€â�€mâ�€â�€â�€â�¤â�€â�€â�€Uâ�€â�​€â�€nâ�€â�€â�€râ�€â�€â�€eâ�€â�€â�€câ�€â�€â�€oâ​�€â�€â�€gâ�€â�€â�€nâ�€â�€â�€iâ�€â�€â�€zâ�
19:04 masak no, but I recognize the behavior.
19:04 FROGGS is it p6eval's fault?
19:04 FROGGS because of the char right after OUTPUT
19:05 timotimo FROGGS: the version i have in "production" now is / <ident> <.ws> $<edgeop>=( '--' | '->' | '<-' ) <.ws> <ident> /
19:05 timotimo i prefer the edgeop without trailing whitespace
19:06 FROGGS ya, and quiet more readable than having backslashes there
19:07 timotimo in-very-deed
19:07 FROGGS btw, TZ +1, but one-step-after-the-other (tm)
19:09 16WAABC47 joined #perl6
19:13 [Coke] (MANIFEST.generated) you can't do a rebuild in parrot/ over every commit in parrot, sometimes you have to clean it. (cd parrot && git clean -xdf might help, as would rm -rf parrot/)
19:14 masak moritz: I'd be interested to hear what you think about the AbstractList.removeRange() example of the usefulness of protected things in this interview: http://www.artima.com/intv/blochP.html (under the heading "Trusting Subclasses")
19:22 SmokeMachine joined #perl6
19:37 rindolf joined #perl6
19:57 SmokeMachine joined #perl6
20:03 dalek perl6-roast-data: d0dec55 | coke++ | / (4 files):
20:03 dalek perl6-roast-data: today (automated commit)
20:03 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/d0dec558da
20:11 jnthn masak: Some Temoral fail in ^^
20:12 FROGGS maybe spec is new and rakudo isnt?
20:12 FROGGS I should run spectest to be sure
20:12 dduncan joined #perl6
20:13 dduncan left #perl6
20:14 jnthn FROGGS: ah, yeah, could easily be
20:15 PacoAir joined #perl6
20:15 [Coke] +S32-exceptions/misc.rakudo passed 461 unplanned test(s)
20:15 [Coke] O_o
20:16 * masak .oO( that's why it's "misc"! )
20:16 nwc10 does that translate as "the percentage for Pugs is about to get worse"?
20:16 flussence that translates into "missing plan line!"
20:18 FROGGS masak: you removed an exception type, right?
20:18 FROGGS https://github.com/perl6/roast/blob​/master/S32-exceptions/misc.t#L293
20:18 flussence (I can see why nobody wanted to count them...)
20:18 masak FROGGS: oh! yes :/
20:18 masak FROGGS: that's my fault. sorry about that.
20:19 [Coke] there's a done - guessing that one of the last things failed.
20:19 masak I thought I re-ran all the spectests after making that change. apparently not.
20:19 FROGGS np
20:19 * masak fixes
20:19 nwc10 https://github.com/perl6/roast/blob​/master/S32-exceptions/misc.t#L350 --     try eval('class TestClassFactoryInterfaceBridgeMock is TooLongOfANameToBeConsideredGoodPerl { }');
20:20 nwc10 :-)
20:20 dalek roast: 6d12d5e | masak++ | S32-exceptions/misc.t:
20:20 dalek roast: remove the mention of X::Temporal::Truncation
20:20 dalek roast:
20:20 dalek roast: The class has been removed from Rakudo.
20:20 dalek roast: review: https://github.com/perl6/roast/commit/6d12d5eaf5
20:20 skids OOh.  Add "Enterprise" to that!
20:21 timotimo "ToBeConsideredGoodEnterprisePerl"?
20:21 skids no smurfword collection is complete without "Enterprise"
20:23 flussence needs at least two or three more levels of "Factory" :)
20:24 [Coke] masak++
20:26 FROGGS .oO( ...API, ...DATA )
20:29 masak well, there's something to be said for systems with just the right layers of abstraction.
20:30 cog joined #perl6
20:30 masak things like "Factory" or "Bridge" do fill a role, but they need to pull their own weight.
20:30 FROGGS masak: t/spec/S32-temporal/calendar.t fails
20:30 FROGGS misc.t PASSES now btw
20:31 FROGGS Not enough positional parameters passed; got 1 but expected 2 in block  at t/spec/S32-temporal/calendar.t:22
20:32 skids Having a core language powerful enough that several of those types of abstractions become unworthy of code sharing is the best solution IMO :-)
20:34 timotimo would you mind if i tried adding a name to the "default constructor only takes named arguments" error message?
20:37 FROGGS timotimo: a name? what name?
20:37 timotimo the name of the class used for instance - if that is possible.
20:37 timotimo Foo.new([1, 2, 3]) would ideally complain about a Foo
20:39 FROGGS ya....
20:39 FROGGS you maybe could even list the arg names
20:40 timotimo hm, you think?
20:40 bruges_ joined #perl6
20:40 timotimo as in, "passed 5 positionals and the following nameds: ..."?
20:41 skids r: multi sub a(Int $a) { }; multi sub a(Num $a) { }; a("3");
20:41 p6eval rakudo b49cbe: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'a' will never work with argument types (str) (line 1)␤    Expected any of:␤    :(Int $a)␤    :(Num $a)␤»
20:41 skids r: class A { multi method a(Int $a) { }; multi method a(Num $a) { }; }; A.a("3")
20:41 p6eval rakudo b49cbe: OUTPUT«Cannot call 'a'; none of these signatures match:␤:(A : Int $a, Mu *%_)␤:(A : Num $a, Mu *%_)␤␤  in method a at src/gen/CORE.setting:434␤  in block  at /tmp/1Tm6fRF31Q:1␤␤»
20:41 skids second error is LTA compared to the first.
20:43 timotimo r: sub test($what, @*list) { .WHAT.^name.say for @list }; test(1, "foo", NaN);
20:43 p6eval rakudo b49cbe: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Variable '@list' is not declaredâ�¤at /tmp/k_VLeIoZf1:1â�¤------> [32mhat, @*list) { .WHAT.^name.say for @list[33mâ��[31m }; test(1, "foo", NaN);[0mâ�¤    expecting any of:â�¤        postfixâ�¤Â»
20:43 timotimo r: sub test($what, @*list) { .WHAT.^name.say for @*list }; test(1, "foo", NaN);
20:43 p6eval rakudo b49cbe: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'test' will never work with argument types (Int, Str, Num) (lines 1, 1)␤    Expected: :($what, @*list)␤»
20:43 dalek roast: eeaa7f6 | masak++ | S32-temporal/calendar.t:
20:43 dalek roast: [S32/Temporal] fixed calendar.t
20:43 dalek roast:
20:43 dalek roast: Chase the .truncated-to API change.
20:43 dalek roast: review: https://github.com/perl6/roast/commit/eeaa7f6b40
20:44 timotimo hm.
20:44 timotimo oh, yeah
20:44 * masak runs spectests himself
20:44 timotimo r: sub test($what, *@list) { .WHAT.^name.say for @list }; test(1, "foo", NaN);
20:44 p6eval rakudo b49cbe: OUTPUT«Str␤Num␤»
20:45 timotimo i suppose that could be done. however, i'm experiencing some other problems first
20:45 timotimo r: class Testclass { multi method new($, *@) { say self.WHAT.^name } }; class Subtestclass is Testclass; Testclass.new(1, 2, 3); Subtestclass.new(4, 5, 6)
20:45 p6eval rakudo b49cbe: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Too late for semicolon form of class definitionâ�¤at /tmp/iiKF1sjBDp:1â�¤------> [32me } }; class Subtestclass is Testclass; [33mâ��[31mTestclass.new(1, 2, 3); Subtestclass.new[0mâ�¤    expecting any of:â�¤        method argumentsâ�¤        p…
20:45 timotimo r: class Testclass { multi method new($, *@) { say self.WHAT.^name }; }; class Subtestclass is Testclass { }; Testclass.new(1, 2, 3); Subtestclass.new(4, 5, 6);
20:45 p6eval rakudo b49cbe: OUTPUT«Testclass␤Subtestclass␤»
20:46 timotimo this works, but the same code in src/core/Mu.pm doesn't :|
20:46 timotimo but it seems like there's a method WHICH which is exactly what i need anyway
20:49 timotimo hm, that still gives me "use of uninitialized value of type Any in string context". maybe i'm looking the wrong way
20:49 skids Maybe the "self" sugar is less fully fleshed in Mu.pm -- so see if it works with "method new($selfish : *@)"
20:50 timotimo what's the : there for?
20:50 skids It's the named invocant comma substitute
20:50 jnthn I don't think self is very sugary
20:50 timotimo mhm
20:51 skids of so I guess I meant "method new($selfish : $, *@)"
20:52 skids jnthn: one can always lick oneself to find out.
20:52 timotimo OK.
21:00 FROGGS All tests successful. \o/
21:01 * FROGGS .oO( "I love it when a plan comes together" )
21:01 * [Coke] is reminded he still hasn't see the last 10m of the ateam movie!
21:02 * tadzik still didn't see the first 10m
21:02 timotimo ooooh m(
21:02 dalek nqp-jvm-prep: b172cc3 | jonathan++ | / (3 files):
21:02 dalek nqp-jvm-prep: Implement getcurhllsym and bindcurhllsym.
21:02 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp​-jvm-prep/commit/b172cc3dd7
21:02 timotimo what did i do?
21:03 FROGGS there is an A-Team movie?
21:03 timotimo X::Constructor::Positional.new.throw(name => self.WHAT.^name)
21:03 timotimo and i was wondering why it said "use of any in string context"
21:03 jnthn The .WHAT there is redundant.
21:04 timotimo i added it after i saw that it didn't work without :P
21:05 masak jnthn: I read "getcurhllsym and bindcurhllsym" and thought "great, now jnthn is just piling consonants on top of each other!" :P
21:05 skids FROGGS: yes but Mr.T. proved irreplaceable.
21:06 * [Coke] thought it was a fun action flick that a decent job paying homage to the show.
21:06 moritz masak: re removeRange, none of the arguments contradict it being a public method
21:06 masak moritz: heh.
21:07 FROGGS skids: ahh, from 2010... since I have kids since 2009 I dont watch new films anymore :/
21:07 moritz masak: his logic is quite good, but he doesn't think it to the end
21:07 masak moritz: except that you're meant to use .clear as an external user
21:07 jnthn masak: hey, there's loads of vowels in there!
21:07 jnthn Go eat your zmrzlina :P
21:08 moritz masak: afaict .clear is higher level
21:08 moritz masak: there's no damage to exposing the lower level method too
21:09 FROGGS rn: say "test" ~~ /. ** 0/
21:09 p6eval rakudo b49cbe: OUTPUT«「」␤␤»
21:09 p6eval ..niecza v24-18-gaf64300: OUTPUT«#<match from(0) to(0) text() pos([].list) named({}.hash)>␤»
21:09 FROGGS r: say("test" ~~ /. ** 0/)
21:09 p6eval rakudo b49cbe: OUTPUT«「」␤␤»
21:11 masak masak: I see what you mean. and I think I agree.
21:12 * moritz just assumes he was meant
21:12 masak heh.
21:12 * masak .oO( even I start confusing us now )
21:12 masak I take that as the cue it's time to zzz.
21:12 masak 'night, #perl6
21:13 diakopter o/
21:14 flussence .oO( getcurhllsym sounds vaguely Welsh )
21:16 jnthn heh, it kinda does :)
21:21 skids Speaking of ".clear" does anyone know what the "KitchenSink" ".clear" method mentioned in S06 is/was supposed to do?
21:24 jnthn .oO( The dishes? )
21:26 dalek nqp-jvm-prep: 37b31a7 | jonathan++ | lib/QAST/JASTCompiler.nqp:
21:26 dalek nqp-jvm-prep: Implement QAST::VarWithFallback.
21:26 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp​-jvm-prep/commit/37b31a765d
21:26 dalek nqp-jvm-prep: f27702d | jonathan++ | t/qast_variable.t:
21:26 dalek nqp-jvm-prep: Test QAST::VarWithFallback.
21:26 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp​-jvm-prep/commit/f27702d353
21:28 dalek nqp-jvm-prep: 79a1301 | jonathan++ | docs/ROADMAP:
21:28 dalek nqp-jvm-prep: ROADMAP update.
21:28 dalek nqp-jvm-prep: review: https://github.com/jnthn/nqp​-jvm-prep/commit/79a1301fea
21:30 bluescreen100 joined #perl6
21:33 timotimo should i really add the types of the arguments for the error that gets thrown by the default constructor?
21:33 jnthn timotimo: No, that seems more info than needed and not really that helpful
21:33 FROGGS the types of the args you passed to it? no, but maybe the named args you can pass
21:36 timotimo good.
21:37 timotimo FROGGS: so, inspect self.new.candidates? is there a common method that lists the candidates with their signatures?
21:37 FROGGS like "Default constructor of 'Foo' only takes named arguments: Str host, Int port"
21:37 FROGGS timotimo: no idea
21:37 jnthn You can't easily do that.
21:37 FROGGS meh
21:37 jnthn As in, reliably.
21:37 jnthn If you know all that's there is the default constructor, you can do it.
21:38 FROGGS hmmm, true
21:38 jnthn If the user has written their own, or written a BUILD somewhere, you just don't know.
21:42 * timotimo pullrequested
21:45 nyuszika7h_ joined #perl6
21:47 FROGGS r: say "foo" ~~ m/. ** 0/
21:47 p6eval rakudo b49cbe: OUTPUT«「」␤␤»
21:48 FROGGS r: say "foo" ~~ m/. ** {0}/
21:48 p6eval rakudo b49cbe: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Quantifier quantifies nothingâ�¤at /tmp/4T0R419hH4:1â�¤------> [32msay "foo" ~~ m/. ** [33mâ��[31m{0}/[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix or meta-infixâ�¤        infix stopperâ�¤        prefix or termâ�¤        prefix or m…
21:52 dalek roast: 9a11e22 | (Tobias Leich)++ | S05-mass/rx.t:
21:52 dalek roast: RT #116415, test that /. ** 0/ doesnt match entire string
21:52 dalek roast: review: https://github.com/perl6/roast/commit/9a11e22b39
22:01 Rix joined #perl6
22:04 ph1ur3 joined #perl6
22:11 jnthn 'night, #perl6
22:12 diakopter o/
22:27 MegaTraveller joined #perl6
22:28 MegaTraveller left #perl6
22:37 [Coke] timotimo: did you test pugs on that one or just guessing? Either way, thanks!
22:40 timotimo that one, which one?
22:42 FROGGS [Coke]: I guess you mean me, I didnt tested, but similar ones are already skipped for pugs (/. ** N/ that is)
22:44 cog joined #perl6
22:44 timotimo it's weird to me. putting a pull request up and holding on to the roast changes
22:44 rindolf Hi all, is there an official Perl 6 Beginners' Site? http://www.begin-site.org/
22:44 FROGGS fiddling something else right now, otherwise I would apply locally and merge afterwards
22:45 FROGGS timotimo: you could add the tests to a branch
22:45 snearch joined #perl6
22:45 timotimo that makes some sense. could be pretty noisy, though
22:50 TimToady FROGGS: $($_) is exactly the same as $_, which matches the contents of $_ literally;  { $_ } is a mistake, since a bare closure is evaluated only for its side effects
22:52 FROGGS TimToady: thanks
22:52 TimToady <{ $_ }> would interpolate $_ as a regex
22:52 FROGGS TimToady: are the some special test cases I should add, except for working $($_) ?
22:53 TimToady probably don't need tests for bare closures since we use them frequently, but dunno about things like <{ $_ }> offhand
22:54 swarles joined #perl6
22:54 TimToady I imagine they have some tests already
22:54 FROGGS k, thank you
22:54 TimToady but yes, $($_) should work, along with $$_ and $$$$$$$_
22:55 FROGGS r: say "abc" ~~ m/ $$_ /
22:55 p6eval rakudo b49cbe: OUTPUT«「abc」␤␤»
22:55 TimToady r: say "abc" ~~ m/ <{ $_ }> /
22:55 p6eval rakudo b49cbe: OUTPUT«「abc」␤␤»
22:57 TimToady r: say "a.c" ~~ m/ <{ $_ }> /
22:57 p6eval rakudo b49cbe: OUTPUT«「a.c」␤␤»
22:57 TimToady r: say "a\wc" ~~ m/ <{ $_ }> /
22:57 p6eval rakudo b49cbe: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unrecognized backslash sequence: '\w'â�¤at /tmp/HsgBYeWV59:1â�¤------> [32msay "a\[33mâ��[31mwc" ~~ m/ <{ $_ }> /[0mâ�¤    expecting any of:â�¤        argument listâ�¤        prefix or termâ�¤        prefix or meta-prefixâ�¤        double quotesâ�¤â€¦
22:57 dalek rakudo/nom: b5a63c6 | (Timo Paulssen)++ | src/core/ (2 files):
22:57 dalek rakudo/nom: Constructor::Positional tells what class it came from.
22:57 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b5a63c6a9d
22:57 dalek rakudo/nom: ebe7eb4 | (Tobias Leich)++ | src/core/ (2 files):
22:57 dalek rakudo/nom: Merge pull request #99 from timo/positional_new_error
22:57 dalek rakudo/nom:
22:57 dalek rakudo/nom: Constructor::Positional tells what class it came from.
22:57 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/ebe7eb4532
22:57 TimToady r: say "a\\wc" ~~ m/ <{ $_ }> /
22:58 p6eval rakudo b49cbe: OUTPUT«#<failed match>␤»
22:58 timotimo oh yay :)
22:58 swarles r: say Q/'test \'\' \n test'/ ~~ /\'(<-['\\]*[\\.<-[\'\\]>*]*)\'/
22:58 p6eval rakudo b49cbe: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤regex assertion not terminated by angle bracketâ�¤at /tmp/JWmRkJHcnp:1â�¤------> [32may Q/'test \'\' \n test'/ ~~ /\'(<-['\\][33mâ��[31m*[\\.<-[\'\\]>*]*)\'/[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix or meta-infixâ�¤        i…
22:58 swarles r: say Q/'test \'\' \n test'/ ~~ /\'(<-['\\]>*[\\.<-[\'\\]>*]*)\'/
22:58 p6eval rakudo b49cbe: OUTPUT«「'test \'\' \n test'」␤ 0 => 「test \'\' \n test」␤␤»
22:58 dalek roast: b832056 | (Timo Paulssen)++ | S32-exceptions/misc.t:
22:58 dalek roast: check for X::Constructor::Positional .name attribute.
22:58 dalek roast: review: https://github.com/perl6/roast/commit/b8320565e4
22:58 swarles r: say Q/'test \'\' \n test' making sure this isn't greedy'/ ~~ /\'(<-['\\]>*[\\.<-[\'\\]>*]*)\'/
22:58 p6eval rakudo b49cbe: OUTPUT«「'test \'\' \n test'」␤ 0 => 「test \'\' \n test」␤␤»
22:58 swarles \o/
22:58 TimToady r: say 'a\wc' ~~ m/ <{ $_ }> /
22:58 p6eval rakudo b49cbe: OUTPUT«#<failed match>␤»
22:58 TimToady good
22:59 [Coke] rindolf: nope, though I imagine we'd pick some other site than one with such `blue' links.
23:00 * [Coke] chuckles at For more information about this topic, see: masak - “How Perl 6 could kill us all!”
23:00 TimToady swarles: that seems way more complicated than it needs to be...
23:00 rindolf [Coke]: well, I have yet to assign a better style for www.begin-site.org .
23:00 rindolf [Coke]: and it's not a high priority for me for now.
23:00 [Coke] rindolf: the "motherfucker" kind of puts me off.
23:00 rindolf [Coke]: heh, well that's Zed Shaw for you.
23:00 rindolf It's still a useful resource.
23:00 [Coke] *that* kind of blue, not CSS kind.
23:01 rindolf What?
23:01 swarles I was just testing another version of the expression that I found laying around the web
23:01 TimToady r: say Q/'test \'\' \n test' making sure this isn't greedy'/ ~~ /\' (\\.|.)*? \'/
23:01 p6eval rakudo b49cbe: OUTPUT«「'test \'\' \n test'」␤ 0 => 「t」␤ 0 => 「e」␤ 0 => 「s」␤ 0 => 「t」␤ 0 => 「 」␤ 0 => 「\'」␤ 0 => 「\'」␤ 0 => 「 」␤ 0 => 「\n」␤ 0 => 「 」␤ 0 => 「t」␤ 0 => 「e」␤ 0 => 「s」␤ 0 => 「t」␤␤»
23:01 TimToady r: say Q/'test \'\' \n test' making sure this isn't greedy'/ ~~ /\' (\\.|.)*?: \'/
23:01 p6eval rakudo b49cbe: OUTPUT«[31m===[0mSORRY![31m===[0m�Unrecognized regex metacharacter : (must be quoted to match literally)�at /tmp/ijXra6jjE4:1�------> [32mre this isn't greedy'/ ~~ /\' (\\.|.)*?:[33m�[31m \'/[0m�Unable to parse regex; couldn't find final '/'�at /tmp/ijXra6jjE4:1�-…
23:02 swarles r: say Q/'test \'\' \n test' making sure this isn't greedy'/ ~~ /\' (<-[\'\\]|\\.) \'/
23:02 p6eval rakudo b49cbe: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤regex assertion not terminated by angle bracketâ�¤at /tmp/Kju7FtI2dq:1â�¤------> [32mure this isn't greedy'/ ~~ /\' (<-[\'\\][33mâ��[31m|\\.) \'/[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix or meta-infixâ�¤        infix stopper…
23:02 swarles r: say Q/'test \'\' \n test' making sure this isn't greedy'/ ~~ /\' (<-[\'\\]>|\\.) \'/
23:02 p6eval rakudo b49cbe: OUTPUT«#<failed match>␤»
23:02 swarles whoops
23:02 swarles r: say Q/'test \'\' \n test' making sure this isn't greedy'/ ~~ /\' (<-[\'\\]>|\\.)* \'/
23:02 p6eval rakudo b49cbe: OUTPUT«「'test \'\' \n test'」␤ 0 => 「t」␤ 0 => 「e」␤ 0 => 「s」␤ 0 => 「t」␤ 0 => 「 」␤ 0 => 「\'」␤ 0 => 「\'」␤ 0 => 「 」␤ 0 => 「\n」␤ 0 => 「 」␤ 0 => 「t」␤ 0 => 「e」␤ 0 => 「s」␤ 0 => 「t」␤␤»
23:03 swarles Is there a way to capture with named groups?
23:03 TimToady r: say Q/'test \'\' \n test' making sure this isn't greedy'/ ~~ /\' ( [\\.|.]*? ) \'/
23:03 p6eval rakudo b49cbe: OUTPUT«「'test \'\' \n test'」␤ 0 => 「test \'\' \n test」␤␤»
23:03 TimToady r: say Q/'test \'\' \n test' making sure this isn't greedy'/ ~~ /\' $<insides>=( [\\.|.]*? ) \'/
23:03 p6eval rakudo b49cbe: OUTPUT«「'test \'\' \n test'」␤ insides => 「test \'\' \n test」␤␤»
23:03 TimToady r: say Q/'test \'\' \n test' making sure this isn't greedy'/ ~~ /\' $<insides>=[ [\\.|.]*? ] \'/
23:03 p6eval rakudo b49cbe: OUTPUT«「'test \'\' \n test'」␤ insides => 「test \'\' \n test」␤␤»
23:04 TimToady like that
23:04 swarles oh, fun.
23:04 TimToady that | should even work in the other order, given LTM
23:04 TimToady r: say Q/'test \'\' \n test' making sure this isn't greedy'/ ~~ /\' $<insides>=[ [.|\\.]*? ] \'/
23:04 p6eval rakudo b49cbe: OUTPUT«「'test \'\' \n test'」␤ insides => 「test \'\' \n test」␤␤»
23:04 TimToady yes, it does
23:05 swarles Hm, that expression seems almost too good to be true
23:05 hash_table joined #perl6
23:05 TimToady but it shows in essence why it doesn't matter what order you add your rules to your grammar, since it will always try to match the longest token
23:06 TimToady the ordering only matters on ties
23:06 japhb_ joined #perl6
23:07 TimToady the | is just a very small alternation, and a grammatical category such as "infix" is just a large alternation written a little differently so that multiple grammars can contribute to the same alternation
23:08 TimToady mind, I'd never write . | \\. because that is intentionally misleading to the reader
23:09 TimToady who will at least read the code left-to-right, even if the compiler is smart enough to match the right side first
23:10 benabik joined #perl6
23:10 TimToady the other important thing to note there is that I used *? rather than *
23:11 TimToady the . forms would not work with * very well, at least not without backtracking
23:11 TimToady often when you are using quantified . in Perl, you really want the minimal matching, not the greedy
23:12 fgomez joined #perl6
23:12 TimToady so the combination of LTM with *? is what makes the "almost too good to be true" actually guaranteed to work right
23:13 swarles hm. I didn't actually consider that
23:14 TimToady P5 regexes are always left-to-right without LTM, so there you *have* to write the \\. | . form (along with *?)
23:14 TimToady can do the same in P6 with \\. || .
23:14 TimToady the || alternation is left-to-right, like | in P5
23:15 swarles I really need to take time to read the full specification
23:16 TimToady hard to know which form will actually run faster in P6, but I'd guess the || form is likely faster in this case
23:17 swarles Well in the case of the grammar, is it only evaluated once or is it evaluated everytime it's invoked if I'm using the PCT
23:18 TimToady the alternation has to be evaluated for each "loop" of the outer quantifier, so once for each character (not counting backslashes)
23:19 TimToady your character class form might actually run faster if it can be hoisted up into the LTM regex engine
23:20 TimToady a DFA engine then would only be invoked once for the whole thing, as long as the innards are not too complicated to do in DFA
23:22 TimToady DFAs work well with * quantifiers that way, and don't really work with the *? of my "dotty" forms, so don't let me persuade you that the . form is necessarily better, at least from a performance point of view
23:23 TimToady otoh, after the LTM matcher, it still has to traverse the string in the normal way, especially if you want to capture anything, so maybe it's a wash, and you should just use the more readable form
23:24 TimToady .o(Go not to the Elves for advice, for they will say both 'yes' and 'no'.)
23:25 TimToady actually, if you're using PCT, you probably can't rely on LTM, so be sure to write \\. first
23:26 * TimToady didn't notice the "if I'm using the PCT" earlier...
23:26 timotimo good *, happy perl6 people!
23:26 dalek nqp: b8a381e | (Tobias Leich)++ | src/QRegex/P6Regex/ (2 files):
23:26 dalek nqp: allow the use of $(...) in P6Regex
23:26 TimToady what about the rest of us?
23:26 dalek nqp: review: https://github.com/perl6/nqp/commit/b8a381eef5
23:27 timotimo really looking forward to the day when i contribute something other than spectests and improved error messages x)
23:27 japhb timotimo, those are really important things
23:27 benabik timotimo++ # doing really important things
23:28 TimToady timotimo++ # for so expertly fishing for compliments :)
23:58 dalek rakudo/nom: d97ad43 | (Tobias Leich)++ | tools/build/NQP_REVISION:
23:58 dalek rakudo/nom: bump nqp rev for $(...) in regexes
23:58 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d97ad43a84
23:59 dalek roast: 5a4c6b7 | (Tobias Leich)++ | S05-mass/rx.t:
23:59 dalek roast: RT #115298, test for $( $_ )
23:59 dalek roast: review: https://github.com/perl6/roast/commit/5a4c6b7c46

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

Perl 6 | Reference Documentation | Rakudo