Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-11-14

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:10 tailgate so I have a strings of the form (NAME foo bar baz) and I want them to be (foo bar baz). i.e. delete the first word after the paren
00:10 tailgate what should I look into to do this?
00:13 Upasaka joined #perl6
00:15 timotimo m: say "(NAME foo bar baz)" ~~ / '(' \S+ <( <-[)]>+ )> ')' /
00:15 camelia rakudo-moar 59bb1b: OUTPUT«「 foo bar baz」␤»
00:15 timotimo m: say "(NAME foo bar baz)" ~~ / '(' \S+ \s+ <( <-[)]>+ )> ')' /
00:15 camelia rakudo-moar 59bb1b: OUTPUT«「foo bar baz」␤»
00:15 timotimo m: say <( )>.join("(NAME foo bar baz)" ~~ / '(' \S+ \s+ <( <-[)]>+ )> ')' /)
00:15 camelia rakudo-moar 59bb1b: OUTPUT«(foo bar baz)␤»
00:16 perlawhirl joined #perl6
00:21 tailgate ohhh, that's clever. Thanks
00:24 cibs joined #perl6
00:24 kyclark_ joined #perl6
00:26 tailgate so is whitespace signifcant in a perl6 regex?
00:26 tailgate apparently not
00:27 perlawhirl m: "(NAME foo bar baz)".subst(/<?after '('> \S+\s+/, '')
00:27 camelia rakudo-moar 59bb1b: ( no output )
00:27 perlawhirl m: say "(NAME foo bar baz)".subst(/<?after '('> \S+\s+/, '')
00:27 camelia rakudo-moar 59bb1b: OUTPUT«(foo bar baz)␤»
00:27 perlawhirl or if you like the shorthand version of 'before'...
00:27 perlawhirl m: say "(NAME foo bar baz)".subst(/ '(' <( \S+\s+/, '')
00:27 camelia rakudo-moar 59bb1b: OUTPUT«(foo bar baz)␤»
00:33 perlawhirl tailgate: No it's insignificant, unless you match with m:s//
00:33 perlawhirl the :s stands for 'sigspace' aka 'significant space'
00:34 perlawhirl m: say 'this that' ~~ m/\w+ \w+/ # matches only the first word
00:34 camelia rakudo-moar 59bb1b: OUTPUT«「this」␤»
00:34 perlawhirl m: say 'this that' ~~ m:s/\w+ \w+/ # matches both
00:34 camelia rakudo-moar 59bb1b: OUTPUT«「this that」␤»
00:34 seatek is TWEAK a thing yet?
00:35 raiph m: class c { submethod TWEAK { say 42 } }.new
00:35 camelia rakudo-moar 59bb1b: OUTPUT«42␤»
00:35 yoleaux 13 Nov 2016 01:52Z <Xliff> raiph: Yes, but __DATA__ blocks aren't always "data" blocks in p5. They can be almost anything but are still referred to as "data blocks". I think we have the intent of the OP clear enough, just splitting hairs over names.
00:36 seatek must have
00:37 timotimo WTF, i've made a change that i had hoped would decrease scalar allocations. instead, it bumped BOOTCode allocations up a bunch, but made it do less GC runs, and made it a whole lot faster in general
00:37 timotimo ....... okay?!?!
00:37 timotimo i'll take it, i guess??
00:38 seatek see? it's insane at any level
00:41 samcv the Qw quoting construct is not testing for in roast. Is the roast git repo the proper place to submit this?
00:41 AlexDaniel samcv: you want to contribute tests for Qw? Great! Yes, roast repo is the right place
00:41 samcv well i don't have any tests written yet :P
00:41 samcv but i can make some later tonight
00:42 samcv it's not mentioned in S02, but it should probably still go in S02-literals folder of roast right?
00:43 AlexDaniel samcv: I think this is the right file, check it to see if the tests are indeed not there yet: https://github.com/perl6/roast/blob/d1baf2e7a3e56c​d6619c46040d04ed6daebc1d02/S02-literals/quoting.t
00:43 samcv yeah they're not there, already looked
00:44 samcv grepped all of roast as well for Qw and Q:w and nothin
00:45 samcv and checked the quoting.t manually. that is where it should end up though
00:46 AlexDaniel samcv: this bit is slightly outdated but still relevant: https://design.perl6.org/S​02.html#Adverbs_on_quotes
00:46 samcv yeah. Qw isn't in there, though it does mention the :w adverb. but neither Qw or Q:w are in roast
00:46 samcv will add a test later tonight i think
00:47 AlexDaniel would be cool if you also tested some other combinations
00:47 samcv well there's a bunch of combinations of Q already in there, just not the w one
00:47 samcv has Qs Qa Qh Qf Qb and Qc
00:48 samcv but i'll check if there's any missing
00:48 samcv as well
00:48 AlexDaniel that would be great, yes
00:48 pierre_ joined #perl6
00:51 Xliff Uhhh... this is odd...
00:51 Xliff ===SORRY!===
00:51 Xliff Expected MAST::Frame, but didn't get one
00:52 AlexDaniel Xliff: is that from some regular code? :)
00:52 Xliff AlexDaniel: From code using experimental libxslt bindings.
00:54 Xliff Not even getting out of stage parse, so it's not all code?
00:57 noganex_ joined #perl6
01:08 felher joined #perl6
01:09 xStan3 joined #perl6
01:10 * grondilu sees TBD on https://docs.perl6.org/languag​e/nativecall#Buffers_and_Blobs  Any news?
01:14 itcharlie joined #perl6
01:14 R_I_D joined #perl6
01:17 R_I_D When overriding the new method, and using self.bless(:$name); i get an error: variable $name is not declared. Did you mean $!name?
01:18 timotimo what dous the signature for your "method new" look like?
01:18 R_I_D method new($name) {
01:19 timotimo could it be you've got a double-quote run-away somewhere?
01:20 xStan3 left #perl6
01:21 R_I_D in my test file i have ok my $testUser = UserId.new("rid");
01:21 R_I_D that's the only place i have a double quote
01:21 timotimo hm, OK
01:22 timotimo mind putting the code up on gist.github.com or something similar?
01:26 R_I_D https://gist.github.com/ridofself​/3bb3a3c769cbd0aed935ae76502ded34
01:27 gfldex joined #perl6
01:28 AlexDaniel R_I_D: meathod
01:28 richi235 joined #perl6
01:29 timotimo hah, that's funny :)
01:29 AlexDaniel timotimo: now it's your turn, explain why it does not bail out after “meathod”
01:29 BenGoldberg joined #perl6
01:29 timotimo because you could have a sub named meathod and a sub named new
01:30 timotimo it'd then complain about the opening curly brace, though, if $name had been defined before
01:30 timotimo m: my $name; meathod new($name) { say "yay" }
01:30 camelia rakudo-moar 59bb1b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unexpected block in infix position (missing statement control word before the expression?)␤at <tmp>:1␤------> 3my $name; meathod new($name)7⏏5 { say "yay" }␤    expecting any of:␤        infix…»
01:30 timotimo that's the error you'd've gotten in that case
01:31 timotimo it's legal to post-declare subs
01:31 AlexDaniel right, makes sense
01:31 xStan3 joined #perl6
01:31 AlexDaniel I wonder if there is any way to improve it
01:32 timotimo if we see an undefined variable, we could try to limp along and see what the next error would be
01:33 R_I_D oh my
01:33 canopus joined #perl6
01:36 timotimo my $oh
01:36 timotimo i'm going to bed now, have a good one! :)
01:36 R_I_D thank you! good night
01:37 AlexDaniel timotimo: well, I created a ticket #130092
01:37 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=130092
01:38 AlexDaniel R_I_D: so yeah, if somebody has time to work on this issue perhaps the error message will be improved for this case
01:38 AlexDaniel R_I_D: thanks for coming here and asking this question!
01:40 Xliff AlexDaniel: Any ideas as to why I am getting the MAST::Frame error?
01:44 AlexDaniel Xliff: I have never seen that error message personally. The error message comes from MoarVM, so there's definitely something scary happening: https://github.com/MoarVM/MoarVM/bl​ob/2eedba88d2b0c08f94dd4426a60d0bc7​f8effa13/src/mast/compiler.c#L590
01:45 Xliff Yeah. Trying to isolate now.
01:45 AlexDaniel that would help, yes
01:48 Xliff Damn.
01:48 Xliff All of the XML::LibXML code is now buggered after a recent update in rakudo.
01:48 Xliff Haven't touched any of that code since.... July?
01:49 Xliff Previously you were allowed to have something akin to: class C is repr('CStruct') {}
01:49 Xliff Now you can't.
01:55 samcv AlexDaniel, did a PR https://github.com/perl6/roast/pull/182
01:56 samcv added Qw Qx Qww
02:00 AlexDaniel great! I'll let somebody else review it
02:03 Xliff Shite.
02:03 Xliff Whole semantics have changed in rakudo that used to work.
02:04 Xliff "my class" vs. "our class" vs "class" -- the meanings have changed.
02:04 Xliff "my class ... is export" will not export but "class ... is export" does
02:04 Xliff This blows up the entirety of XML::LibXML
02:07 Xliff So here's what I have found with that MAST::Frame issue.
02:07 pierre_ joined #perl6
02:08 Xliff https://github.com/Xliff/p6-xs​lt/blob/master/t/01-basic.t#L7 <- If I comment this line, I do NOT get the MAST::Frame error
02:08 Xliff The moment I uncomment it, I do.
02:09 Xliff https://github.com/Xliff/p6-xslt/b​lob/master/lib/XML/LibXSLT/Subs.pm will pass "perl -c" with a "Syntax OK" message.
02:09 pierre_ joined #perl6
02:09 Xliff So... it seems that the issue is in XML::LibXSLT::Subs... but I'll be damned if I know where to start looking.
02:10 Xliff I think I will leave it there, for now. When I run into these types of errors with rakudo, I find it best to take frequent breaks.
02:10 dayangkun joined #perl6
02:10 Xliff samcv++  # Qw Qx Qww
02:11 samcv :)
02:11 samcv glad to contribute!
02:11 samcv and added testing how qx vs Qx handles double backslash, which i think is important as well
02:12 labster joined #perl6
02:14 MasterDuke joined #perl6
02:15 samcv Xliff, i think you can do class C is repr('CStruct')
02:15 samcv m: class C is repr('CStruct') { his int32 $.var; }
02:15 camelia rakudo-moar 59bb1b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3class C is repr('CStruct') { his int327⏏5 $.var; }␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end…»
02:15 samcv m: class C is repr('CStruct') { has int32 $.var; }
02:15 camelia rakudo-moar 59bb1b: ( no output )
02:15 samcv oopsie
02:16 samcv you are saying that doesn't work though?
02:18 samcv or is it the exporting not working
02:19 Xliff I am saying an older mechanism for defining classed and exporting, that was used in XML::LibXML (currently work in progress) no loner works.
02:19 samcv oh with 'my' class. aha
02:19 samcv instead of just 'class'
02:19 Xliff And I am aware you can use dummy values in CStruct classes. I am just saying that empty classes used to be legal.
02:20 Xliff "my class" used to work.
02:20 Xliff Now "class" works
02:20 Xliff And "my class ... is export" doesn't export anything
02:20 samcv well. if it's an export. that doesn't make as much sense i guess, to make it 'my'. but do things work fine if you take out the 'my'?
02:20 Xliff Which means XML::LibXML will need a lot of changes to get back to where it was.
02:21 samcv :(
02:21 Xliff samcv: I have already said that it does...
02:21 samcv do you redefine classes?
02:21 Xliff Unfortunately, yes.
02:21 samcv ahhhhhhh
02:21 Xliff Have to, due to the circular nature of the C code.
02:21 samcv crap
02:22 Xliff Nevertheless, that issue is solvable.
02:22 Xliff It is the MAST::Frame errors that are problematic. And I have no idea where to start with that.
02:22 Xliff I guess I can start commenting code in Subs.pm to see if it starts working.
02:23 Xliff It could be that Subs.pm is too large.
02:23 Xliff Interesting...
02:27 samcv also there's no commenting allowed in JSON, i see in META.info you use #, that makes it invalid. but you may have done that temporarily
02:30 Xliff I could care less about META.info
02:30 Xliff That does effect perl script operation.
02:31 Xliff I have commented everything in Subs.pm and am still getting the MAST::Frame error.
02:31 Xliff o_O
02:46 Xliff Commenting out everything in XML::LibXSLT::Subs and commenting out the "use XML::LibXSLT::Types" directive got rid of the MAST::Frame error.
02:49 xStan3 left #perl6
03:00 geekosaur how about keeping ::Subs (possibly stubbing references) and commenting out the use?
03:19 vlalaha joined #perl6
03:21 vlalaha how to `use` a module such that you can call the imported subroutines as MyModule.subroutine?
03:22 vlalaha it seems that everything gets dumped in the highest scope when you import a module
03:23 geekosaur use Module (); # I think? should tell it not to import anything into the local scope
03:25 perlawhirl joined #perl6
03:28 Xliff geekosaur: Still, that's using a hack to prevent an error that should not be occuring.
03:28 Xliff Nevertheless, I am willing to give it a try. So how should I invoke the module, again?
03:28 geekosaur Xliff, actually that was just doublechecking that it is the use of the Types module, and not the Subs module, that is relevant
03:29 vlalaha hmm, I can't find a way to call the subroutine after doing that. I'm new to perl so I'm probably approaching this with a python mindset.
03:29 Xliff Well, the odd thing is that I can do a syntax check on both and get no errors.
03:29 geekosaur or, just do perl6 -e 'use XML::LibXSLT::Types' and verify that it's that module yo need to check
03:29 geekosaur vlalaha, what module are you "use"ing?
03:30 geekosaur Xliff, basically I am not suggesting workarounds, I'm trying to triage. point being that you verify that it is something in ::Types, then start commenting those out or putting 'BEGIN note something's around things in it and see what exactly is making it explode
03:31 vlalaha My own. I created one called Killpage::Parser, which gets declared in its file with "unit module Killpage::Parser". From my main file in the root of the project, I import it with "use lib 'lib'; use Killpage::Parser;"
03:31 geekosaur ok, then names are Killpage::Parser::whatever
03:31 vlalaha it works, but the subroutines are in the local scope
03:32 geekosaur oh, hm, bet the subs are 'my' scope but then exporting makes them more visible. make them explicitly 'our sub ...'
03:32 Xliff geekosaur: Well, that's what I am trying to do with no luck.
03:32 vlalaha yeah, I tried that, it says it "Could not find the symbol"
03:32 vlalaha oh, you too?
03:32 vlalaha nvm i see
03:32 geekosaur vlalaha, Xliff is getting a weird internal error, I'm talking to both of you about your different subjects because I seem to be the only one active at the moment
03:35 vlalaha i changed the subroutine declaration to use "our" instead and it works now, weird
03:35 nowan joined #perl6
03:35 geekosaur expected
03:35 Xliff ::Types is not causing the error.
03:36 Xliff I replace the use directive for ::Subs with ::Types in the .t file and it works
03:36 geekosaur vlahaha, 'sub' is by default 'my', so not visible outside its module even when qualified. 'our' is what makes it visible.
03:36 Xliff Once I go back to ::Subs it's "...MAST::Frame..." again...
03:36 Xliff Hmm... I wonder if I need to do "our sub" instead of just "sub" then.
03:37 geekosaur the import export stuff manipulates symbol table entries without exposing names, so it can drop a reference to that sub in your scope without making it visible as Module::subname
03:37 Jesmaybe joined #perl6
03:37 Xliff Actually, that can't be it because all sub definitions are commented right now in ::Subs. The only things defined are enums.
03:37 geekosaur (perl 5 did this too, by manipulating globs, but all subs were "our" scoped)
03:38 vlalaha geekosaur: now that makes a bit more sense, I was unclear about the distinction. thanks
03:38 vlalaha left #perl6
03:38 Xliff geekosaur: Are there any relevant switches or env variables I can enable to see what is going on?
03:38 geekosaur I shouldm't talk like it's past tense, esp since I use it daily :)
03:39 geekosaur Xliff, if --ll-exception doesn't work (and for moarvm level stuff I suspect it won't) then I don't know what else except ping jnthn
03:41 geekosaur basically any time you see something like MAST::whatever, you are guaranteed weirdness and difficulty trying to track it down :/
03:41 geekosaur potentially this is a bug in moarvm, more likely a bug in the nqp code generation for moarvm (which is what MAST is)
03:42 MasterDuke Xliff: i don't know what it does, but the RAKUDO_MODULE_DEBUG env variable has what seem some relevant words in it
03:42 noganex joined #perl6
03:51 Xliff geekosaur: My guess is that --ll-exception won't work in stage parse.
03:52 Xliff MasterDuke: Thanks. Tried that and am not sure if the problem is what that output would suggest it would be.
03:52 geekosaur yeh, that would not surprise me
03:52 Xliff 18 22091 RMD: Performing imports for 'XML::LibXSLT::Types'
03:52 Xliff 2 22091 RMD: Imports for 'XML::LibXSLT::Types' done
03:52 Xliff ===SORRY!===
03:52 Xliff Expected MAST::Frame, but didn't get one
03:52 geekosaur which is paet of why I said "I suspect it won't"
03:52 Xliff That would imply that it loaded XML::LibXSLT::Types and bailed.
03:52 Xliff geekosaur: Yes. That you did. I believed you, but am grasping at straws, here.
03:53 Xliff Not the first time I've come close to finishing a module only to have a weird rakudo bug derail me.
03:53 geekosaur yes, it imported them and tried to do something... not sure what, I don't know internals that well. you probably need jnthn :/
03:53 Xliff It's damned dis-heartening, is what it is.
03:53 geekosaur it is. I feel like rakudo went live way too early. I understand why, but still.
03:54 Xliff I am beginning to think so, too.
03:54 Xliff However, I admit... I play with features on the edge.
03:54 Xliff NativeCall for one.
03:56 geekosaur NC is definitely on the edge... and demonstrating why nobody else does it that way
03:57 geekosaur it works great for very simple stuff, but there's a reason that FFIs generally require C declarations to be around, not just try to bind to symbols
03:58 Xliff FFI?
03:58 geekosaur although things could get interesting if someone works out a way to extend it to is native('foo', 'foo.h') or something and it parses foo.h to figure out something resembling the right way to do things (this works only to a point, because C doesn't know the difference between pointers and arrays...)
03:58 geekosaur foreign function interface
03:59 Xliff Ah.
03:59 Xliff The only place NativeCall falls REAL short is for typedefs and macros
03:59 Xliff Actually, s/typedefs/defines/
03:59 geekosaur well, and in promising C++ support but you really need to actually use C++ to deliver on that
04:00 geekosaur because of fun like templates
04:00 Xliff And yes, you have the right of it when you say that parsing .h files is almost a necessity to get everything right.
04:00 Xliff Yeah. Doesn't P6 have a generics concept?
04:00 Xliff Actually, does it even need one
04:02 geekosaur arguably that is part of what the MOP provides, although there is not currently a convenient way to make use of it, so to that extent it doesn't really have generics yet
04:03 pierre_ joined #perl6
04:04 itcharlie left #perl6
04:05 Xliff Thought so.
04:05 aborazmeh joined #perl6
04:05 aborazmeh joined #perl6
04:05 Xliff At any rate, I doubt I will make any more progress on this thing, so on to the "unfinished due to unexpected bugs" pile this goes.
04:06 Xliff That's #3. *sigh*
04:32 pierre_ joined #perl6
04:37 kyclark_ joined #perl6
04:46 dudz Hello online perl6 community of active developers
04:47 dudz p6: say 3
04:47 camelia rakudo-moar 59bb1b: OUTPUT«3␤»
04:47 dudz p6: say 3;
04:48 camelia rakudo-moar 59bb1b: OUTPUT«3␤»
04:48 dudz p6: say split(' ', @INC);
04:48 camelia rakudo-moar 59bb1b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@INC' is not declared␤at <tmp>:1␤------> 3say split(' ', 7⏏5@INC);␤»
04:52 wamba joined #perl6
04:57 MasterDuke m: .say for $*REPO.repo-chain
04:57 camelia rakudo-moar 59bb1b: OUTPUT«inst#/home/camelia/.perl6␤inst#/home/cam​elia/rakudo-m-inst-1/share/perl6/site␤inst#/hom​e/camelia/rakudo-m-inst-1/share/perl6/vendor␤in​st#/home/camelia/rakudo-m-inst-1/share/perl6␤Co​mpUnit::Repository::AbsolutePath.new(next-repo => CompUnit::Reposit…»
04:58 Xliff MasterDuke++ beat me to it.
04:58 MasterDuke dudz: ^^^ and search for @INC in https://docs.perl6.org/language/5to6-perlvar
04:59 MasterDuke general question, should those Perl 5 variable be searchable in the docs? because they aren't right now
04:59 dudz :)
05:01 Xliff MasterDuke: I should think so.
05:01 Xliff Especially @INC
05:03 JimmyZ MasterDuke: re Failed to read dirhandle, which platform?
05:04 MasterDuke JimmyZ: uname-a # Linux alexandria 4.8.7-1-ARCH #1 SMP PREEMPT Thu Nov 10 17:22:48 CET 2016 x86_64 GNU/Linux
05:04 MasterDuke Arch linux
05:04 cyphase joined #perl6
05:04 MasterDuke it does't happen all the time
05:06 MasterDuke but i was doing a make install of rakudo and the m-install part failed and i had it run it a couple time manually before it worked
05:06 djbkd joined #perl6
05:07 JimmyZ MasterDuke: just got it
05:07 MasterDuke also t/spec/S11-repository/curli-install.t always fails (plus some others, don't remember which)
05:08 MasterDuke Xliff, dudz: doc issue created for searching Perl 5 variable
05:09 dudz hello MasterDuke
05:10 MasterDuke hi
05:10 MasterDuke JimmyZ: cool
05:10 MasterDuke and with that i'm outta here. later all...
05:11 dalek doc: d3f3d0c | gfldex++ | doc/Language/5to6-perlvar.pod6:
05:11 synopsebot6 Link: http://doc.perl6.org/language/5to6-perlvar
05:11 dalek doc: index @INC and %INC
05:11 dalek doc: review: https://github.com/perl6/doc/commit/d3f3d0cb8d
05:25 Cabanossi joined #perl6
05:33 cyphase joined #perl6
05:44 officialsandeep8 joined #perl6
05:49 officialsandeep8 What is the best use case scenario for Perl 6?
05:50 pierre_ joined #perl6
06:00 rurban joined #perl6
06:02 Actualeyes joined #perl6
06:02 officialsandeep8 joined #perl6
06:09 officialsandeep8 joined #perl6
06:09 dudz a 'best' subscriber i see officialsandeep8
06:19 domidumont joined #perl6
06:21 wamba joined #perl6
06:22 domidumont joined #perl6
06:24 pierre_ joined #perl6
06:27 officialsandeep8 left #perl6
06:46 JimmyZ MasterDuke: just fixed it, try newer moarm :)
06:47 pierre_ joined #perl6
06:49 RabidGravy joined #perl6
06:57 Xliff The RT webpage is horrible.
06:57 Xliff There are no links for entering in a new ticket that I can find.
06:57 Xliff rtt
06:57 Xliff rt
06:57 Xliff perlbug
06:58 Xliff rt
06:59 JimmyZ Xliff: email to rakudobug at perl.org.
07:00 Xliff I don't want email. I need a webform.
07:00 Xliff Otherwise I would have done that and not complained about the web interface. :)
07:00 JimmyZ there is no webform
07:00 Xliff I know there is one. I've used it.
07:00 Xliff fact is, I've sent in two bugs and never used email.
07:01 Xliff I just never keep the link around.
07:01 geekosaur it was disabled due to spam iirc
07:01 Xliff Oh *snarl*
07:01 Xliff Now I've lost the desire to go through the headache.
07:02 Xliff Will it pick up attachments, then?
07:02 Xliff And any rich text formatting (think indenting for code)
07:03 djbkd joined #perl6
07:08 bjz joined #perl6
07:13 abraxxa joined #perl6
07:14 darutoko joined #perl6
07:16 Xliff Error sent.
07:22 abraxxa joined #perl6
07:22 neuraload joined #perl6
07:23 domidumont joined #perl6
07:32 pierre_ joined #perl6
07:36 domidumont joined #perl6
07:40 domidumont joined #perl6
07:44 bjz joined #perl6
07:53 pierre_ joined #perl6
08:05 Vynce joined #perl6
08:10 rurban joined #perl6
08:11 pierre_ joined #perl6
08:14 domidumont joined #perl6
08:20 TimToady Xliff++ # persistence
08:20 yoleaux 13 Nov 2016 18:52Z <MasterDuke> TimToady: i think i figured out that i needed a regex, but i'm having some problem implementing it with some further discussion here, does this look like a bug to you? https://irclog.perlgeek.de/pe​rl6-dev/2016-11-13#i_13559207
08:22 zakharyas joined #perl6
08:36 pierre_ joined #perl6
08:38 kurahaupo__ joined #perl6
08:43 araujo joined #perl6
08:50 pierre_ joined #perl6
08:54 bjz_ joined #perl6
09:06 ocbtec joined #perl6
09:11 mxco86 joined #perl6
09:14 masak antenoon, #perl6
09:15 masak intellectually I can understand that people want a web form. as for me, I'm really happy there's the email route to submitting RT tickets.
09:15 masak it fits me very well. I definitely wouldn't have submitted ~2k tickets via a web form :P
09:16 qub joined #perl6
09:18 rindolf joined #perl6
09:23 samcv :P masak is this you https://rt.perl.org/Ticket/Display.html?id=130096
09:23 samcv XD
09:25 samcv masak, would be nice if on the main page of rt.perl.org told you to submit bugs email to a list of email addresses, i was looking for a way to submit there for like
09:25 samcv 16 minutes. and couldn't find it, a while back
09:26 * seatek shakes fist in the air - spammers!
09:27 samcv i like how they attached a .jar file
09:27 masak samcv: sounds like a really good idea.
09:28 masak samcv: maybe [Coke] (ping) can help with adding such an instruction to the main page?
09:28 espadrine joined #perl6
09:30 jonas2 joined #perl6
09:32 ufobat joined #perl6
09:34 domidumont joined #perl6
09:35 dakkar joined #perl6
09:37 seatek OK, I just went all over the place making some pretty big changes to the way things are doing in this little system here. One of those times where you dread running tests afterward because you know you'll be spending forever knocking down mistakes one after another.
09:38 seatek But somehow... it worked perfectly! Well, one mistake. Ok... 2 little mistakes.. one just returning True at a place...
09:38 seatek But that's unbelievable.
09:38 seatek I am either brilliant, or there is something freakisly magical about the way Perl 6 is making me organize things.
09:39 seatek Dam objects. Never know whether to love them or hate them.
09:40 seatek Very amazing though. This was my first time refactoring with Perl 6 at any decent scale. So happy.
09:41 domidumont joined #perl6
10:04 domidumont joined #perl6
10:08 samcv seatek, nice
10:08 samcv when refactoring in perl 6 i usually discover that if i make mistakes, they're not big ones
10:08 samcv compared to like perl 5 or other languages
10:09 samcv where i'd be like !!@?$$???? crap
10:09 samcv where i'd be like !!@?$$???? crap
10:09 samcv oops. but i never really was one for object oriented programming. but i like perl 6's implementation
10:09 seatek yeah i was fully prepared to shoot myself
10:09 samcv mostly painless
10:10 DrForr Speaking of refactoring I took the evening to give in and do a second pass to add whitespace rather than trying to do it inline.
10:10 DrForr (this is for Perl6::Parser - Yes, still working onit, still a royal pain.)
10:10 DrForr *on it
10:10 samcv oh DrForr readline seems broken with readline 7.0 https://github.com/drforr/perl6-readline/issues/12 fyi
10:11 seatek That sort of stuff is serious puzzle material
10:11 samcv best luck about Perl6::Parser though!
10:12 seatek mine was macro details rather than micro
10:12 DrForr samcv: Thanks; I need to see how we're doing library versioning first before digging back intothat.
10:12 samcv i couldn't find anything looking myself... but
10:12 samcv there's something going on
10:12 samcv i even recompiled nqp rakudo and moar and same problem. but i was mostly sure it used nativecall and those shouldn't be an issue anyway
10:13 samcv idk how many perl 6 people run arch, but readline 7 will be out of testing repo in a few days so. others could hit this quite soon
10:15 seatek You know, somebody here posted this game a while back http://ovolve.github.io/2048-AI/ -- what a curse that was! Is actually. Ach! I can't stop!
10:16 samcv seatek, automate it so a bot does it for you :P
10:16 samcv though i guess you can lose. darn
10:17 seatek no, it's the hypnotic sliding of the numbers....  and their combinations....
10:17 samcv it seems pretty neat
10:18 seatek stop while you still can
10:23 neuraload joined #perl6
10:23 samcv DrForr,   my constant LIB = ( 'readline', Version.new('6') ); https://github.com/drforr/perl6-readl​ine/blob/master/lib/Readline.pm#L657
10:23 samcv ah
10:23 samcv that would do it!
10:31 samcv changing that to a 7 makes it work 👍 gonna have to let it use either i guess.. dunno if you can try/catch that and try a different version? not the most elegant solution though
10:32 wamba joined #perl6
10:34 DrForr That's what I meant by looking at library versioning.
10:34 andrzejku_ joined #perl6
10:36 bjz joined #perl6
10:37 samcv can't you just leave out the version? at least that works fine for me, i just removed the version parameter. or was there a reason you specified the version?
10:54 cyphase joined #perl6
10:58 pecastro joined #perl6
11:02 wamba joined #perl6
11:04 domidumont joined #perl6
11:09 bjz_ joined #perl6
11:12 cyphase joined #perl6
11:46 cyphase joined #perl6
11:48 geekosaur samcv, leaving out the version "just works" until you hit the reason the version changed and everything breaks
11:48 broquaint joined #perl6
11:48 geekosaur people just love to ignore that part, because they aren't affected by it until suddenly they are
11:49 samcv ah that's true geekosaur
11:50 samcv i guess trying one version and if that fails just don't specify one could make sense. if the requested one isn't available
12:06 cyphase joined #perl6
12:10 masak m: for 1..100 -> $n { say $n if $n %% 10 && $n %% 12 }
12:10 camelia rakudo-moar 59bb1b: OUTPUT«60␤»
12:10 masak m: for 1..100 -> $n { say $n && last if $n %% 10 && $n %% 12 }
12:10 camelia rakudo-moar 59bb1b: ( no output )
12:10 masak bug, nyes? :)
12:11 masak (I expected "60\n" even in the latter case)
12:12 * masak submits rakudobug
12:14 rindolf Hi all! make install on rakudo stopped working properly
12:15 lizmat rindolf: which backend ?
12:15 rindolf lizmat moarvm
12:15 lizmat did you try to run Configre.pl again ?
12:15 rindolf lizmat: I did.
12:15 lizmat there were some files added, which isn't picked up by "make"
12:16 lizmat ok, then please gist the error
12:16 wamba joined #perl6
12:16 rindolf lizmat: ok
12:17 rurban joined #perl6
12:18 rindolf lizmat: see http://paste.debian.net/895510/ - I recall seeing it on https://travis-ci.org/rakudo/rakudo/builds as well
12:18 llfourn m: say defined all(Any,"foo") # Why is this true? Shouldn't it autothread?
12:18 camelia rakudo-moar 59bb1b: OUTPUT«True␤»
12:19 lizmat llfourn: that feels like a bug
12:19 lizmat ah no
12:19 llfourn is it because it's defined in Mu that it doesn't work?
12:19 lizmat what's the defined doing there ?
12:19 lizmat ah, ok
12:20 rindolf lizmat: this is the script that I am using to build - http://paste.debian.net/895511/
12:20 llfourn I just want a junction friendly way of doing .defined
12:20 lizmat llfourn: understand now what you're doing
12:21 masak ...oh
12:21 masak notabug.
12:21 masak just listop precedence, d'oh
12:21 nadim joined #perl6
12:22 masak m: for 1..100 -> $n { say $n and last if $n %% 10 && $n %% 12 }
12:22 camelia rakudo-moar 59bb1b: OUTPUT«60␤»
12:23 llfourn m: ?(Any,"foo")>>.defined.all # maybe this is the way to do it?
12:23 camelia rakudo-moar 59bb1b: OUTPUT«WARNINGS for <tmp>:␤Useless use of "?" in expression "?(Any,\"foo\")>>.defined.all" in sink context (line 1)␤»
12:23 llfourn m: say ?(Any,"foo")>>.defined.all # maybe this is the way to do it?
12:23 camelia rakudo-moar 59bb1b: OUTPUT«False␤»
12:24 cyphase joined #perl6
12:24 lizmat llfourn: testing the fallout of a fix:  adding an Any candidate for the .defined method
12:25 pierre_ joined #perl6
12:25 llfourn lizmat++ sweet!
12:25 rindolf nadim: hi.
12:26 rindolf nadim: <rindolf> lizmat: see http://paste.debian.net/895510/ - I recall seeing it on https://travis-ci.org/rakudo/rakudo/builds as well
12:26 lizmat is this by any chance using a Moar > MOAR_REVISION in nqp ?
12:27 rindolf lizmat: who are you talking to?
12:27 MasterDuke_ joined #perl6
12:27 lizmat rindolf: that was addressed to you  :-)
12:27 rindolf lizmat: ah,
12:27 rindolf lizmat: my script pulls git master / git nom / etc.
12:28 MasterDuke_ rindolf: https://github.com/MoarVM/MoarVM/commit/a94e744b44
12:30 MasterDuke_ unless you're building moar manually, someone will have to bump npq and moar required versions
12:30 dalek doc: 8ca1c63 | (Samantha McVey)++ | doc/Type/Supply.pod6:
12:30 synopsebot6 Link: http://doc.perl6.org/type/Supply
12:30 dalek doc: Show how to go from signal numbers to Signal objects to use with the signal method
12:30 dalek doc: review: https://github.com/perl6/doc/commit/8ca1c63099
12:30 dalek doc: 49fc78b | (Samantha McVey)++ | doc/Type/Supply.pod6:
12:30 dalek doc: Add link to enum type. Put the signal number -> Signal section on its own paragraph to keep it from getting lost in the preceding text
12:30 synopsebot6 Link: http://doc.perl6.org/type/Supply
12:30 dalek doc: review: https://github.com/perl6/doc/commit/49fc78b663
12:30 dalek doc: 0ea8e00 | RabidGravy++ | doc/Type/Supply.pod6:
12:30 synopsebot6 Link: http://doc.perl6.org/type/Supply
12:30 dalek doc: Merge pull request #1010 from samcv/signal
12:30 dalek doc:
12:30 dalek doc: Show how to go from signal numbers to Signal objects to use with the signal method
12:30 dalek doc: review: https://github.com/perl6/doc/commit/0ea8e002e1
12:31 rindolf MasterDuke_: I have a script - http://paste.debian.net/895511/
12:32 rindolf Samantha McVey reminds me of "Oy vey"
12:32 rindolf well, the name at least
12:33 lizmat llfourn: please rakudobug it for now, easy fix doesn't fix it  :-)
12:33 llfourn lizmat: rgr
12:33 masak (Samantha McVey)++ # contribution karma from a human :)
12:35 masak rindolf: something tells me we should avoid making fun of the names of new contributors, if we can... :/
12:35 jkramer left #perl6
12:36 * lizmat refrains from making remarks about red noses
12:37 masak :P
12:37 rindolf masak: I was not. :-(
12:37 masak ok, got it.
12:39 rindolf lizmat: actually, I am the evil twin brother of Rudolph and Randolph, Santa's goody two shoes reindeer (who are among my arch enemies).
12:39 lizmat :-)
12:39 lizmat .oO( who has the red nose now  :-)
12:40 rindolf lizmat: I have very Evil plans for this christmas
12:41 lizmat is it evil enough for an advent post ?
12:42 timotimo masak: your "say $n && last" thing looks like unexpected precedence to me
12:42 timotimo masak: i'd expect the argument to say being ($n && last ...) so it'll jump out of the loop before say can even run
12:42 timotimo oh, you already saw
12:42 timotimo okay!
12:42 rindolf lizmat: it's too much Evil™ for that
12:42 kurahaupo__ joined #perl6
12:43 timotimo m: for 1..100 -> $n { say $n and last if $n %% all(10, 12) }
12:43 camelia rakudo-moar 59bb1b: OUTPUT«60␤»
12:43 timotimo y u no use junkshon :)
12:43 rindolf MasterDuke_: lizmat : seems to install fine now - thanks!
12:43 rindolf Not it's Benchmarking Time!
12:43 kurahaupo__ joined #perl6
12:46 mr-foobar joined #perl6
12:47 rindolf lizmat: what is the Dutch word for "wolf"?
12:48 lizmat wolf
12:48 rindolf lizmat: ah.
12:48 lizmat as it is in German
12:48 lizmat masak will be able to tell what's it in Swedish
12:48 lizmat but I would guess something like "wolf"  :-)
12:52 rindolf lizmat: ok.
12:53 rindolf lizmat: in Hebrew it is "Ze'ev"
12:53 rindolf זאב
12:54 cyphase joined #perl6
12:56 rindolf I wonder if I should exit out of KDE Plasma 5 to benchmark the two perl6's properly
12:59 arnsholt Wolf is "ulv" in Norwegian and Danish, "varg" in Swedish
12:59 rurban left #perl6
12:59 arnsholt (I think, for .dk and .se)
13:00 lizmat eh, more dissimilar than I thought
13:00 arnsholt Nah, not that different
13:01 arnsholt At least Danish and Norwegian
13:01 arnsholt Swedish is a different root, clearly
13:02 arnsholt The -v corresponds to unvoiced -f in continental Germanic, and leading w- is generally lost in Scandinavian IIRC
13:02 jnthn "vlk" in Czech :)
13:02 jnthn Who needs a vowel! :P
13:02 arnsholt Which is related to "ulv" and friends!
13:03 arnsholt Ah, Wiktionary delivers:
13:04 arnsholt PIE *wlkwos > Germ. *wulfaz > Norse ulfr
13:04 arnsholt Whereas Slavic has kept the resonant l syllable nucleus
13:05 timotimo position independent executable?
13:05 arnsholt Same root gives lupus in Latin and lykos in Greek
13:05 arnsholt timotimo: =p
13:05 timotimo but the mascot of lycos was a dog!
13:06 arnsholt There's a Sanskrit reflex of the same root as well...
13:07 arnsholt Aha: vrka
13:13 lizmat and warg in elfish ?
13:14 lizmat afk&
13:14 stmuk and GoT
13:15 moritz and vararg in Cish :-)
13:17 cyphase joined #perl6
13:19 wamba joined #perl6
13:26 domidumont joined #perl6
13:35 domidumont joined #perl6
13:40 canopus joined #perl6
13:43 pmurias joined #perl6
14:02 [Coke] masak: (add pointer to email on RT site) all I can do is open a request with the bug admins. I would defer this to mst, as he's dealing with the issue that caused the button to go away.
14:02 viki FWIW, if you search for "slurpy" on docs site the "Reference" link no longer finds the anchor it's meant to link to. (I'm guessing the new thing is https://docs.perl6.org/type/Signature#Slurpy_(A.K.A._Variadic)_Parameters )
14:02 yoleaux 11 Nov 2016 21:53Z <stmuk_> viki: thanks! I think you are right (and that 2016.10 problem fixed by a moar bump)
14:03 viki And it's linking to https://docs.perl6.org/type/Signature#inde​x-entry-parameter_*%40-parameter_*%2525_sl​urpy_argument_%28Signature%29-Slurpy_%28A.K.A._Variadic%29_Parameters
14:04 domidumont joined #perl6
14:08 cdg joined #perl6
14:10 pmurias local rakudo.js just passed t/01-sanity/01-literals.t :)
14:11 viki \o/
14:11 viki pmurias++
14:11 timotimo \o/
14:11 kyclark_ joined #perl6
14:14 domidumont joined #perl6
14:21 skids joined #perl6
14:32 kyclark_ joined #perl6
14:34 [Coke] .u èè
14:34 yoleaux U+00E8 LATIN SMALL LETTER E WITH GRAVE [Ll] (è)
14:47 vytas joined #perl6
14:51 viki samcv: are you asquare?
14:53 viki PSA: when submitting roast PRs, please run your changes to ensure the new tests pass. You can do that by running make t/spec/your-test-file.t in Rakudo's checkout.
15:01 [Coke] Was someone interested in being a bugadmin for perl 6 RT? You'll need an RT account, and to ping me.
15:01 viki [Coke]: dogbert17 was
15:05 kyclark_ Given http://pastie.org/10962119
15:06 kyclark_ Can I use “given” as a function to set $pause?  E.g., my $pause = given $letter {…}?
15:06 viki kyclark_: do given
15:06 kyclark_ I mean, I know the language won’t let me, but is there a way to do what I want?
15:06 kyclark_ Is that the best?  I don’t like having “$pause = “ in each “when”
15:07 gregf_ joined #perl6
15:07 viki m: my $x = do given rand { when * > .5 { "large" }; when * <= .5 { "small" } }; dd $x
15:07 camelia rakudo-moar 189cb2: OUTPUT«Str $x = "small"␤»
15:08 AlexDaniel joined #perl6
15:08 viki sleep do given { ... } even. No need for $pause at all
15:12 rindolf joined #perl6
15:12 viki kyclark_: also, doesn't seem like there's much point in two loops. Just stick the .comb instead of lines
15:12 viki kyclark_: like https://gist.github.com/zoffixznet​/f7f556ccb4e1a1a3de5ccc5d70e961ae
15:13 * viki would write it as https://gist.github.com/zoffixznet​/35b76f043fc13676585e7748cd6815f6 instead of given/when stuff
15:13 kyclark_ Cool stuff!
15:14 kyclark_ Much better.
15:14 viki Well, betternment can be argued either way. Your way requires more reading but less thinking.
15:17 Lucas_One joined #perl6
15:22 kyclark_ I’ll present both.
15:22 wamba joined #perl6
15:25 nadim_ joined #perl6
15:28 * moritz is disappointed that viki didn't come up with a mathematical function that mapped codepoint number to sleep time :-)
15:30 kyclark_ http://blogs.perl.org/users/ken_youens​-clark/2016/11/movie-file-reader.html
15:30 kyclark_ Thanks for the suggestions.
15:33 viki kyclark_++ # writing blogs about Perl 6
15:33 viki :chomp(False) can also be written as :!chomp
15:33 kyclark_ Thanks.  I don’t feel qualified to hack the language, but I can be an advocate and educator.
15:33 kyclark_ Ooo, shiny!
15:35 viki I don't feel qualified either, but I still like to submit a commit or two once in a while ;)
15:40 viki "X::Multi::NoMatch exception produced no message" .oO( you know you're doing it wrong when... )
15:45 viki m: use nqp; my $a = nqp::radix_I(10, "10", 0, 0, Int); say $a[2] == 2;
15:45 camelia rakudo-moar 189cb2: OUTPUT«X::Multi::NoMatch exception produced no message␤  in block <unit> at <tmp> line 1␤␤»
15:45 viki m: use nqp; my $a := nqp::radix_I(10, "10", 0, 0, Int); say $a[2] == 2;
15:45 camelia rakudo-moar 189cb2: OUTPUT«True␤»
15:46 kyclark_ Might there come a day when Perl 6 might compile to a native executable?
15:47 viki heh
15:48 viki Well, such an executable would include in itself Rakudo AND MoarVM inside of it, I'm guessing :)
15:49 TimToady m: say 10 lcm 12  # masak, much easier way to do that :P
15:49 camelia rakudo-moar 189cb2: OUTPUT«60␤»
15:49 kyclark_ Right.  I was playing around with Haskell and Stack, and to start a new project it wanted to download something like 130M of Haskell to isolate the install/libraries
15:50 kyclark_ I guess even a trivial program like the one above would be quite large.
15:52 mspo just p6pack would be nice
15:53 timotimo what's that, exactly?
15:54 rindolf joined #perl6
15:54 mspo a thing I just made up
15:54 mspo timotimo: you know perlpacker?
15:54 mspo http://search.cpan.org/~rschupp/P​AR-Packer-1.035/lib/PAR/Packer.pm
15:55 mspo think.. jar file :)
15:56 timotimo i don't know it, but yeah, that'd be neat. i imagine a custom CUR could do the trick.
15:56 timotimo imagine having a perl6 script up front and a zip file concatenated to the end
15:56 mspo timotimo: it's how mojolicious is a single thing to download
15:56 timotimo we'd need a good way to signal the parser "don't you dare try to parse anything beyond this point. just ignore it completely."
15:56 pmurias joined #perl6
15:56 kyclark_ __END__
15:57 mspo the java system of creating a pseudo-filesystem from the .jar is pretty slick
15:57 timotimo kyclark_: it'd be =finish in perl6
15:57 kyclark_ Noted
15:57 mspo I thought p6 didn't have a working __DATA__
15:57 timotimo kyclark_: but i'm afraid that probably still makes the parser chomp through to the EOF
15:57 mspo wasn't there a blog about that recently?
15:57 kyclark_ I do miss my __DATA__
15:57 kyclark_ I can deal, tho
15:58 mspo nice things perl has that make tons of sense: __DATA__, phasers, perl packer :)
16:00 mspo I f-ing love phasers
16:00 timotimo they're good, yeah
16:01 mspo they're so practical it makes me sick that other languages don't adopt them
16:01 mspo like, here's a super obvious and immediately useful flow control paradigm you can bolt on
16:01 timotimo just like comefrom! ;) ;)
16:02 timotimo so i'm trying to run a .p6 file that's just the line =finish and about 3.8 gigabytes of video data (just a random big file i had on my disk)
16:02 timotimo MoarVM panic: Memory allocation failed; could not allocate 18446744073457369097 bytes
16:06 timotimo alas, we don't have lazy strings yet
16:07 Lucas_One joined #perl6
16:07 timotimo also, when running perl6 on a file that has an mp3 file concatenated to it, it says "invalid utf-8"
16:07 timotimo that's certainly true ...
16:08 timotimo we could look for a \n=finish\n in the source and parse up to that point if it turns out to not be inside a different language (say, quoted string, regex, ...) and potentially stop parsing right there
16:08 timotimo but we don't have a good way to say "oops, i done goofed up. here, take this extra piece of string that was meant to be part of the whole thing all along"
16:14 rindolf Hi all! Any idea why this branch is slightly slower in my benchmark than master? It should be faster. https://github.com/perl6/nqp/compar​e/master...shlomif:optimize-sprintf
16:15 timotimo how big is the difference?
16:16 [Coke] (and how did you measure it)
16:24 timotimo rindolf: ^ ?
16:25 rindolf timotimo: let me see.
16:26 rindolf timotimo: 0:52.87elapsed before and 0:53.19elapsed after
16:26 telex joined #perl6
16:26 rindolf [Coke]: I used sudo_renice and time on a program using sprintf
16:27 [Coke] how many times did you run it?
16:29 [Coke] that's a .6% difference on elapsed time, which seems like noise.
16:30 [Coke] I think you might need a better measuring tool before worrying about timings.
16:30 rindolf [Coke]: on this commit - https://github.com/perl6/perl6-examples/comm​it/182078b33afba3deb85509febe988574d160f285
16:30 [Coke] not sure if perl 6 has a Benchmark module yet.
16:30 timotimo try using callgrind to get a more reliable instruction count
16:30 rindolf [Coke]: ah.
16:30 timotimo that'll make timing and scheduling differences less
16:32 MasterDuke_ https://github.com/tony-o/perl6-bench
16:32 viki What's the most idiomatic way to cut a string into two pieces, if I know the index where cut should occur? Two substrs()?
16:33 mspo substr()
16:33 awwaiid fold the string so the two ends meet and then you stretch it and use scissors at the fold point
16:33 timotimo use .prematch and .postmatch :P :P :P
16:34 [Coke] m: say "hello world".comb(6).perl
16:34 camelia rakudo-moar 189cb2: OUTPUT«("hello ", "world").Seq␤»
16:34 jnthn I'd probably do something like (.substr(0, $idx), .substr($idx)) given $the-str or so
16:34 [Coke] ^^
16:34 AlexDaniel m: say (‘hello’ ~~ /(.**2) (.*)/)».Str
16:34 camelia rakudo-moar 189cb2: OUTPUT«(he llo)␤»
16:34 viki OK. Thanks.
16:34 jnthn m: say "hello world i have a lot to say".comb(6).perl # ;)
16:34 camelia rakudo-moar 189cb2: OUTPUT«("hello ", "world ", "i have", " a lot", " to sa", "y").Seq␤»
16:34 jnthn m: say "hello world i have a lot to say".comb(6, 2).perl # ;)
16:34 camelia rakudo-moar 189cb2: OUTPUT«("hello ", "world ").Seq␤»
16:34 jnthn heh ;)
16:34 [Coke] jnthn: curses. :)
16:34 viki .comb was my first take, but it doesn't work well on edge cases, where you end up with 1 item
16:35 mspo substr is the fastest sting op in p5
16:35 viki m: say "hello world i have a lot to say".comb(0, 2).perl
16:35 camelia rakudo-moar 189cb2: OUTPUT«("e", "l").Seq␤»
16:35 viki m: say "hello world i have a lot to say".comb(0, 0).perl
16:35 [Coke] and that's why you have an exhaustive test suite, kids!
16:35 camelia rakudo-moar 189cb2: OUTPUT«().Seq␤»
16:35 * viki is slightly annoyed nqp::radix_I chose -1 to represent failure mode :/
16:36 viki m: use nqp; say nqp::radix_I(10, "1X", 0, 0, Int)[2]
16:36 camelia rakudo-moar 189cb2: OUTPUT«1␤»
16:36 viki m: use nqp; say nqp::radix_I(10, "X", 0, 0, Int)[2]
16:36 camelia rakudo-moar 189cb2: OUTPUT«-1␤»
16:36 viki c'mon, zero is right there for the taking!
16:36 viki m: use nqp; say nqp::radix_I(10, "", 0, 0, Int)[2]
16:36 camelia rakudo-moar 189cb2: OUTPUT«-1␤»
16:37 FROGGS joined #perl6
16:37 FROGGS o/
16:37 viki \o\
16:46 [ptc] \o
16:46 timotimo o\
16:51 viki |
16:51 viki bah
16:52 timotimo oh no
16:59 viki m: say :16("FF")
16:59 camelia rakudo-moar 189cb2: OUTPUT«255␤»
16:59 viki Does anyone know where ^ that feature is documented?
17:00 timotimo https://docs.perl6.org/type/Int.html
17:00 timotimo (i did this)
17:00 viki Thanks
17:01 viki m: :16('FF.FF').^name.say; # nitpicking
17:01 camelia rakudo-moar 189cb2: OUTPUT«Rat␤»
17:02 timotimo oh, good point.
17:02 timotimo it should go there, too
17:02 timotimo feel free to write it up :)
17:04 japhb joined #perl6
17:04 MasterDuke_ also here https://docs.perl6.org/syntax/Number%20literals
17:05 timotimo oooooh, yes.
17:06 timotimo good catch, i hadn't seen that
17:06 viki Thanks.
17:07 girafe joined #perl6
17:15 MasterDuke_ and here https://docs.perl6.org/routine/base
17:22 dalek doc: 06707c8 | MasterDuke17++ | doc/Type/Real.pod6:
17:22 dalek doc: Better example of base() rounding
17:22 dalek doc: review: https://github.com/perl6/doc/commit/06707c8ebe
17:22 synopsebot6 Link: http://doc.perl6.org/type/Real
17:24 maybekoo2 joined #perl6
17:31 Actualeyes left #perl6
17:31 dalek doc: 4b9944d | (Zoffix Znet)++ | doc/Type/Str.pod6:
17:31 dalek doc: Document parse-base()
17:31 dalek doc:
17:31 dalek doc: Added to Rakudo in
17:31 dalek doc: https://github.com/rakudo/rakudo/commit/​b1cbb8b8771a5d317bab5c369f4a5b4fa572023e
17:31 synopsebot6 Link: http://doc.perl6.org/type/Str
17:31 dalek doc: review: https://github.com/perl6/doc/commit/4b9944d69f
17:32 ugjka joined #perl6
17:34 xinming joined #perl6
17:36 MasterDuke_ viki: it might be good to add some tests for parse-base() with unicode digits. those were initially broken in the literal syntax, but were fixed a while ago
17:36 AlexDaniel m: 1337.base(32).parse-base(32).say
17:36 camelia rakudo-moar b1cbb8: OUTPUT«1337␤»
17:36 AlexDaniel m: :32(1337.base(32)).say
17:36 camelia rakudo-moar b1cbb8: OUTPUT«1337␤»
17:37 viki MasterDuke_: those aren't supported are they?
17:38 viki m: "١"
17:38 camelia rakudo-moar b1cbb8: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant string "١" in sink context (line 1)␤»
17:38 viki m: "١".base(10).say
17:38 camelia rakudo-moar b1cbb8: OUTPUT«No such method 'base' for invocant of type 'Str'␤  in block <unit> at <tmp> line 1␤␤»
17:38 viki m: "١".parse-base(10).say
17:38 camelia rakudo-moar b1cbb8: OUTPUT«1␤»
17:38 viki Oh, nm
17:38 Xliff vikiZoffixBorg: Did you get my response to your email on RT #130095?
17:38 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=130095
17:38 AlexDaniel m: say :10(١)
17:38 camelia rakudo-moar b1cbb8: OUTPUT«This call only converts base-10 strings to numbers; value 1 is of type Int, so cannot be converted!␤  in block <unit> at <tmp> line 1␤␤»
17:39 viki m: say :10<١>
17:39 camelia rakudo-moar b1cbb8: OUTPUT«1␤»
17:39 dalek doc: 5991c34 | coke++ | doc/Type/Str.pod6:
17:39 dalek doc: remove trailing whitespace
17:39 dalek doc: review: https://github.com/perl6/doc/commit/5991c3482f
17:39 synopsebot6 Link: http://doc.perl6.org/type/Str
17:39 AlexDaniel right
17:39 viki Xliff: unsure, but I see nothing on the ticket itself: https://rt.perl.org/Ticket/Display.html?id=130095
17:40 Xliff I replied to the email. I just noticed that said reply did not propagage to the RT system.
17:40 bazzaar joined #perl6
17:40 bazzaar o/ perl6
17:40 Xliff I have now updated ticket with response.
17:40 bazzaar m: grammar REST { token TOP { <command> } ; proto token command {*} ; token command:sym<create> { :ignorecase <sym> } } ; my $m = REST.parse('create');
17:40 camelia rakudo-moar b1cbb8: ( no output )
17:41 xstan joined #perl6
17:41 viki m: (^0xFFFF).grep(*.uniprop eq "Nd")».chr.join.parse-base(10).say
17:41 camelia rakudo-moar b1cbb8: OUTPUT«12345678901234567890123456789012345678​901234567890123456789012345678901234567890123​456789012345678901234567890123456789012345678​901234567890123456789012345678901234567890123​456789012345678901234567890123456789012345678​90123456789012345678901234567890123456…»
17:41 viki \o/
17:41 timotimo fantastic
17:41 Xliff viki: Long story short -- you should be able to use the attached scripts. If you still get XML::LibXML errors, you should be able to comment out any references and you will still encounter the bug.
17:41 viki OK. Thanks.
17:43 bazzaar m: grammar REST { token TOP { <command> } ; proto token command {*} ; token command:sym<create> { :ignorecase <sym> } } ; say REST.parse('create');
17:43 camelia rakudo-moar b1cbb8: OUTPUT«「create」␤ command => 「create」␤  sym => 「create」␤»
17:43 bazzaar m: grammar REST { token TOP { <command> } ; proto token command {*} ; token command:sym<create> { :ignorecase <sym> } } ; say REST.parse('CREATE');
17:43 camelia rakudo-moar b1cbb8: OUTPUT«Nil␤»
17:44 setty1 joined #perl6
17:44 bazzaar anyone know if :ignorecase works in grammars?
17:46 Xliff m: grammar REST { token TOP { <command> } ; proto token command {*} ; token command:sym<create> { [:i <sym> ] } } ; say REST.parse('create');
17:46 camelia rakudo-moar b1cbb8: OUTPUT«「create」␤ command => 「create」␤  sym => 「create」␤»
17:47 Xliff m: grammar REST { token TOP { <command> } ; proto token command {*} ; token command:sym<create> { [:i <sym> ] } } ; say REST.parse('CREATE');
17:47 camelia rakudo-moar b1cbb8: OUTPUT«Nil␤»
17:47 Xliff Hrm.
17:47 viki m: say grammar { token TOP { :ignorecase 'create'  }  }.parse: 'CREATE';
17:47 camelia rakudo-moar b1cbb8: OUTPUT«「CREATE」␤»
17:47 viki Well, it works...
17:47 viki Wonder if it's the protoregex that's messing it up
17:48 FROGGS m: grammar REST { token TOP { <command> } ; proto token command {*} ; token command:sym<create> { [:i 'create' ] } } ; say REST.parse('CREATE');
17:48 camelia rakudo-moar b1cbb8: OUTPUT«「CREATE」␤ command => 「CREATE」␤»
17:48 FROGGS it does not like <sym>
17:48 viki m: grammar REST { token TOP { <command> } ; proto token command {*} ; token command:sym<create> { :i 'CREATE' } } ; say REST.parse('CREATE');
17:48 Xliff Oooh
17:48 camelia rakudo-moar b1cbb8: OUTPUT«「CREATE」␤ command => 「CREATE」␤»
17:49 Xliff That seems bugalicious.
17:49 viki m: grammar REST { token TOP { :i <command> }; token command { 'create' } } ; say REST.parse('CREATE');
17:49 camelia rakudo-moar b1cbb8: OUTPUT«Nil␤»
17:49 viki Well, it seems like the modifiers aren't passed into other tokens.
17:50 bazzaar figured it might be a bug
17:50 jnthn :i works lexically
17:51 viki .oO( me is waiting for some of the Wise Antients to tell us the syntax for passing modifiers to tokens )
17:51 viki Ah, makes sense.
17:51 jnthn (Since tokens are compiled, and modifiers apply at compilation time of the token.)
17:51 jnthn We could arguably make <sym> a special case here, since it's already a special form.
17:52 jnthn Though not all things that are easy enough to implement are consistent language design choices. :)
17:52 jnthn (<sym> just compiles into a literal)
17:56 lizmat joined #perl6
17:57 viki .u half zero
17:57 yoleaux U+0F33 TIBETAN DIGIT HALF ZERO [No] (༳)
17:57 bazzaar maybe disallow the use of <sym> in the regex?
17:57 viki m: "༳".parse-base(10).say
17:57 camelia rakudo-moar 5c40b1: OUTPUT«Invalid base-10 character: 7⏏5༳␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
17:59 viki bazzaar: that would break core code :) What would be the purpose of disallowing <sym>?
18:00 bazzaar <sym> is used that way in the perl6 grammar tutorial
18:02 bazzaar viki: doesn't <sym> just provide a shorthand way of writing the literal explicitly?
18:03 timotimo sounds like a docbug, or a rakudobug
18:03 timotimo but kicking out <sym> is not going to happen
18:03 viki bazzaar: no, it also gives you a capture to work on in your action.
18:04 viki bazzaar: I'm a bit confused how you connect :i being lexical with disallowing <sym> token :)
18:05 bazzaar viki: no I understand that, <sym> is great for the capture, it's just <sym> in the regex is the same as typing the token name
18:07 bazzaar viki: but then maybe, I don't understand at all :)
18:07 maybekoo2 joined #perl6
18:13 firstdayonthejob joined #perl6
18:15 viki bazzaar: even if it were just that, you're already elimitating duplication of the thing you're trying to match (so you avoid typos).
18:16 viki bazzaar: but as I've said, <sym> also creates a capture, so it's more like writing $<sym>='your thing'
18:16 viki m: grammar { token TOP { <command> }; proto token command {*}; token command:sym<create> { <sym> } }.parse: 'create', :actions(class {method TOP ($/) { say "running command `{$<command><sym>.uc}`" } })
18:16 camelia rakudo-moar 5c40b1: OUTPUT«running command `CREATE`␤»
18:18 pyrimidine joined #perl6
18:19 bazzaar m: grammar { token TOP { <command> }; proto token command {*}; token command:sym<create> { <sym> } }.parse: 'create', :actions(class {method TOP ($/) { say "running command `{$<command>.uc}`" } })
18:19 camelia rakudo-moar 5c40b1: OUTPUT«running command `CREATE`␤»
18:19 viki You're just cheating here by making <command> match just the <sym>
18:20 bazzaar viki: any 'sym's that match get assigned to <command> don't they?
18:21 viki bazzaar: they would be in <sym> named capture of the <command> Match object, yes
18:21 viki cpan@perlbuild2~/CPANPRC/rakudo (nom)$ grep -FR '<sym>' src/Perl6/Grammar.nqp | wc -l
18:21 viki 387
18:21 zacts joined #perl6
18:21 viki ^ 387 instances in Rakudo's source code. I don't think a useless feature worth removing would be the ubiquoutoues
18:21 viki can't type today. need sleeps >:(
18:22 bazzaar viki: but also in the <command>  named capture?
18:22 viki bazzaar: no
18:23 viki bazzaar: picture it like a tree... The $/ received by TOP contains a Match object. That object has a named capture named "command" that contains another Match object... the stuff matched by <command>. THAT Match object contains a named capture named "sym" that contains a yet another Match object... stuff matched by <sym> token
18:24 firstdayonthejob joined #perl6
18:25 bazzaar m: grammar { token TOP { <command> }; proto token command {*}; token command:sym<create> { <sym> '_test' } }.parse: 'create_test', :actions(class {method TOP ($/) { say "running command `{$<command>.uc}`" } })
18:25 camelia rakudo-moar 5c40b1: OUTPUT«running command `CREATE_TEST`␤»
18:26 bazzaar m: grammar { token TOP { <command> }; proto token command {*}; token command:sym<create> { <sym> '_test' } }.parse: 'create_test', :actions(class {method TOP ($/) { say "running command `{$<command><sym>.uc}`" } })
18:26 camelia rakudo-moar 5c40b1: OUTPUT«running command `CREATE`␤»
18:27 viki There's a module called Grammar::Tracer. `use` it and then run the grammar
18:28 viki m: m: grammar { token TOP { <command> }; proto token what {*}; token what:sym<!> { <sym> }; token what:sym<.> { <sym> }; proto token command {*}; token command:sym<create> { <sym><what> } }.parse: 'create!', :actions(class {method what:<!> ($/) { make 'running' }; method what:<.> ($/) { make 'walking' }; method TOP ($/) { say "{$<command><what>.made} command `{$<command><sym>.uc}`" } })
18:28 camelia rakudo-moar 5c40b1: OUTPUT«Use of uninitialized value of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤  in method TOP at <tmp> line 1␤ command `CREATE`␤»
18:28 viki heh
18:28 viki Well, no idea why it's not getting the made stuff.
18:29 bazzaar viki: I have been using Grammar::Debugger, but I will go away and think on what you all have said. I appreciate your help very much.
18:30 viki You're basically working with a tree of objects.
18:31 viki (or graphs?)
18:31 viki *graph of objects
18:33 viki Ah no, tre
18:33 viki THE TRE OF OBJECTS! :D
18:37 TEttinger joined #perl6
18:40 * viki giggles
18:40 viki AlexDaniel: why so bitter in your tickets? :) https://rt.perl.org/Ticket/Displ​ay.html?id=130081#ticket-history
18:40 viki To me that looks like a clear bug
18:41 pyrimidine joined #perl6
18:41 viki m: say grammar { regex TOP { <foo> }; token foo { [‘a’ || ‘abc’] } }.parse: 'abc'
18:41 camelia rakudo-moar 5c40b1: OUTPUT«Nil␤»
18:41 viki star: say grammar { regex TOP { <foo> }; token foo { [‘a’ || ‘abc’] } }.parse: 'abc'
18:41 camelia star-m 2016.10: OUTPUT«Nil␤»
18:42 viki commitable: 2016.04 say grammar { regex TOP { <foo> }; token foo { [‘a’ || ‘abc’] } }.parse: 'abc'
18:42 committable6 viki, ¦«2016.04»: Nil
18:42 AlexDaniel viki: Yeah, I probably should not do that. But I guess that this happens when I have a gut feeling that a serious issue is not going to be fixed.
18:42 AlexDaniel viki: see this: https://irclog.perlgeek.de/​perl6/2016-11-13#i_13560371
18:43 andrzejku joined #perl6
18:45 zakharyas joined #perl6
18:48 viki AlexDaniel: hm. Well, I'll give in to TimToady's expertise, but IMO that's too much of a wat, since I *am* using a regex, which is supposed to backtrack
18:48 viki (well, not above, but I did try with a regex too locally)
18:48 pyrimidine joined #perl6
18:48 domidumont joined #perl6
18:49 viki m: say grammar { token TOP { <foo> }; regex foo { [ ‘a’ || ‘abc’ ] } }.parse: 'a'
18:49 camelia rakudo-moar 5c40b1: OUTPUT«「a」␤ foo => 「a」␤»
18:49 viki m: say grammar { regex foo { [ ‘a’ || ‘abc’ ] } }.parse: 'a', :rule<foo>
18:49 camelia rakudo-moar 5c40b1: OUTPUT«「a」␤»
18:49 viki wat
18:49 viki oh no abc in input
18:50 viki m: say grammar { regex  { [ ‘a’ || ‘abc’ ] } }.parse: 'abc', :rule<TOP>
18:50 camelia rakudo-moar 5c40b1: OUTPUT«No such method 'TOP' for invocant of type '<anon|75736624>'␤  in block <unit> at <tmp> line 1␤␤»
18:50 viki damn. doing too many things at onmce :)
18:53 MasterDuke_ m: say grammar { regex foo { [ ‘a’ || ‘abc’ ] } }.parse: 'abc', :rule<foo>
18:53 camelia rakudo-moar dfb58d: OUTPUT«Nil␤»
18:54 MasterDuke_ m: say grammar { regex foo { [ ‘a’ | ‘abc’ ] } }.parse: 'abc', :rule<foo>
18:54 camelia rakudo-moar dfb58d: OUTPUT«「abc」␤»
18:54 MasterDuke_ m: say grammar { regex foo { [ ‘abc’ || ‘a’ ] } }.parse: 'abc', :rule<foo>
18:54 camelia rakudo-moar dfb58d: OUTPUT«「abc」␤»
18:54 viki Right
18:54 viki m: say grammar { regex TOP { <foo> 'foo' }; token foo { [ ‘a’ || ‘abc’ ] } }.parse: 'abcfoo'
18:54 camelia rakudo-moar dfb58d: OUTPUT«Nil␤»
18:54 viki m: say grammar { regex TOP { <foo> 'foo' }; regex foo { [ ‘a’ || ‘abc’ ] } }.parse: 'abcfoo'
18:54 camelia rakudo-moar dfb58d: OUTPUT«「abcfoo」␤ foo => 「abc」␤»
18:55 viki ^ so backtracking works here, but if it's a top rule, then we add an extra requirement of an anchor... and reasoning for that is "grammar smell is bad"?
18:55 viki That's what I gather from this so far :)
18:56 rurban joined #perl6
18:56 andrzejku joined #perl6
18:58 andrzejku left #perl6
18:59 vendethiel joined #perl6
19:00 pyrimidine joined #perl6
19:00 dalek doc: ba3ed8f | (Zoffix Znet)++ | doc/Language/objects.pod6:
19:00 dalek doc: Remove versioning mention for TWEAK
19:00 synopsebot6 Link: http://doc.perl6.org/language/objects
19:00 dalek doc:
19:00 dalek doc: IMO it doesn't really belong in a main text, especially mentions of specific compilers.
19:00 dalek doc:
19:00 dalek doc: If anything, this type of stuff should be in a separate document, similar to what perldoc perldelta does.
19:00 dalek doc: review: https://github.com/perl6/doc/commit/ba3ed8f61b
19:01 dalek doc: 52fab9f | (Zoffix Znet)++ | doc/Language/objects.pod6:
19:01 dalek doc: Add indexer marker for TWEAK
19:01 synopsebot6 Link: http://doc.perl6.org/language/objects
19:01 dalek doc: review: https://github.com/perl6/doc/commit/52fab9f183
19:04 cognominal a question about async writing. Is there a buffer size of pending write. Is it adjustable ? Or one can blow memory by excessive writing ?
19:05 [Coke] zoffix: I would actually love to have a javadoc like "introduced in " "deprecated in" "removed in" version that we could tie to pretty much everything... but we don't do that for anything yet.
19:06 jonas2 joined #perl6
19:07 cognominal Apparently there is no protection against excessive writing : https://github.com/MoarVM/MoarVM/​blob/master/src/io/procops.c#L537
19:08 buharin joined #perl6
19:08 buharin hey guys
19:08 buharin :)
19:08 [Coke] o/
19:09 pyrimidine joined #perl6
19:10 cognominal anyway, jnthn++ for writing all this code. A pleasure to read once we get it  :)
19:15 pyrimidine joined #perl6
19:15 chris2_ joined #perl6
19:21 pyrimidine odd, there is definitely a timed drop in access to IRC on my end (about every 15 minutes I get a disconnect)
19:22 AlexDaniel viki: thanks for your comment. Generally, I think “let's get rid of traps instead of documenting them” idea should be taken more seriously
19:23 canopus joined #perl6
19:23 AlexDaniel but for that some people who tend to scream “no, there's no trap, this thing fits MY way of thinking, so there is no trap!” should calm down a little bit…
19:30 [Coke] people are screaming?
19:31 AlexDaniel ok-ok fair point
19:33 jonadab screaming is a trap
19:34 Tonik joined #perl6
19:41 lostinfog joined #perl6
19:43 domidumont joined #perl6
19:43 labster joined #perl6
19:48 viki Well, to be fair I *was* screaming about the -1² "trap" :)
19:53 mspo m: -1^2
19:53 camelia rakudo-moar c196af: OUTPUT«WARNINGS for <tmp>:␤Useless use of "^" in expression "-1^2" in sink context (line 1)␤»
19:54 mspo m: say -1²
19:54 camelia rakudo-moar c196af: OUTPUT«-1␤»
19:55 mspo m: say -1**2
19:55 camelia rakudo-moar c196af: OUTPUT«-1␤»
19:55 AlexDaniel viki: since then I was showing it to different people. About 50% of them get it wrong. Sooo… still not convinced that just documenting it is the way to go, but honestly I don't know what would be the best solution…
19:56 kyclark What is the status of Jupyter notebooks for Perl 6?  I could really use those.
19:56 mspo that does seem like a trap
19:56 viki AlexDaniel: well, 50% of people can't solve 4 + 5 * 6 + (4/5*3) right either.
19:56 viki ^ another child left behind.
19:57 viki I even seen people get it wrong and argue that they're right because of PEBKAS (or whatever it is) acronym that makes them think multiplication and division have difference precedence.
19:57 mspo m: (-1)**2
19:57 camelia rakudo-moar c196af: OUTPUT«WARNINGS for <tmp>:␤Useless use of "**" in expression "(-1)**2" in sink context (line 1)␤»
19:57 AlexDaniel viki: I was assuming that people I was asking could solve it, but… fair enough
19:57 viki The trap is people suck at math.
19:57 mspo m: say (-1)**2
19:57 geekosaur kyclark, last I heard nobody had time
19:57 camelia rakudo-moar c196af: OUTPUT«1␤»
19:57 mspo hey there you go
19:57 moritz https://perl5.git.perl.org/perl.git/commit​/cdd6375d6dbc0eea3676faa4e615af1ae28bb103 # p5 gets a form of indented heredocs
19:58 viki mst: ^ glad to watch p5 catching up ;) We steal both ways :)
19:58 kyclark Maybe I should make time.  I see this: https://github.com/timo/iperl6kernel
19:58 kyclark Is that timotimo?
19:58 viki kyclark: yes
19:58 geekosaur yes, yes, and incomplete/nonworking as I understand it
19:58 AlexDaniel viki: by the way, how is -Inf thing going?
19:58 mspo haskell does the same thing
19:58 kyclark If I were feeling so bold, would that be a good starting point?
19:59 geekosaur haskell's unary minus is a well known multiple trap though
19:59 geekosaur kyclark, he was begging for someone to pick it up a couple weeks ago :)
19:59 mst viki: too right
19:59 AlexDaniel mspo: long story short: it's not wrong, that's how it is in math! But it looks kinda ambiguous, so a lot of people read it incorrectly…
19:59 kyclark I'm sure this is well above my skill level, but I'll try to bang my head against it for a bit
20:00 mst viki: I just wish we'd stolen smartmatch after you completely redesigned it, not before
20:00 mspo AlexDaniel: (-1)**2 is 1
20:00 mspo AlexDaniel: isn't it just that the '-' in '-1' is being evaluated at the wrong time?
20:00 geekosaur mst, pretty sure you did. I was confused as to why the older one got in instead of the newer one
20:00 viki AlexDaniel: I'll answer with a visual aid: http://i.imgur.com/pCPU4CC.png
20:00 AlexDaniel viki: aw, that sucks :)
20:01 mst geekosaur: because nobody on perl5-porters realised it was an older one until larry tested the day after we shipped 5.10.0 and went "uh, guys?"
20:01 geekosaur (I was in on the older one blowing up and getting replaced --- it was almost a decade ago, 2007)
20:01 mst viki: quite how nobody on p5 thought to keep an eye on p6, and nobody on p6 thought to warn us you've changed it, and nobody played with the RCs enough to realise
20:01 viki mspo: -1² = -1 by rules of mathematics.
20:01 mst I really don't knpw
20:01 AlexDaniel mspo: no, not really
20:01 geekosaur (was trying to implement the file test operator smartmatches in pugs)
20:01 mspo is -1 special vs -2?
20:01 viki mspo: no
20:01 viki mspo: power operations are higher precedence than subtraction.
20:02 AlexDaniel mspo: in fact, let's assume (for some crazy reason) that it is wrong, what you gonna do? Go against all other languages out there?
20:02 mst geekosaur: I'm filing it under 'once in a while, everybody manages to roll a 1 on the same turn', basically
20:02 viki I even recall teachers scamming students by asking to solve "simple" equations like f(x) = -y⁴
20:02 viki And waiting for them to mess up the order of operations
20:02 mst geekosaur: but bear in mind 5.10 had been in development for quite a while
20:02 mspo is there a paper I can read somewhere?
20:02 AlexDaniel mspo: the point was that we can force people to use parens here (by throwing a warning), but this idea didn't get anywhere because of strong opposition :)
20:03 moritz viki: and waiting for them to to provide only 1 instead of 4 solutions
20:03 viki mspo: I dunno pop open any 3rd grade mathematics book :)
20:03 AlexDaniel I don't think that powers are actualy part of 3rd grade, but…
20:04 AlexDaniel did anybody create a module that changes perl 6 grammar to use reverse polish notation?
20:04 viki I recall doing quadratics in 5th grade, which in normal countries would be 4th grade...
20:04 mspo ic
20:05 mspo viki: I don't think that's going to be in any 3rd grade math book
20:05 viki Looks like North American curriculum has them in 7th grade: http://www.mathfox.com/learn/powers-expone​nts-catapult-game-for-7th-grade-children/
20:06 viki mspo: I'd bet $5 it'd be in a Russian math book :)
20:06 mspo viki: probably
20:06 moritz :-)
20:06 mspo viki: US math books no longer use numbers or regular math problems
20:06 mspo just poorly explained word problems
20:07 mspo which read like they were written by russian TA's
20:07 viki :o
20:07 mspo (not kidding)
20:08 geekosaur you sure they were russian? also, the bane of my college existence wasn't the russian TAs but the ones from india :p
20:08 canopus joined #perl6
20:08 viki I'm not surprised. When I moved to US, in 10th grade I got 104.5% final average for the class. Everyone though I was a genius, but I've just learned it at an earlier grade :)
20:08 geekosaur rapid-fire incomprehensible <mumble>
20:08 viki *thought
20:09 stmuk
20:09 stmuk ops
20:10 geekosaur (granting that when I was in college, it was still rather difficult for people to get out of russia...)
20:11 timotimo kyclark: if you're interested in working on iperl6kernel, feel free to just go ahead and do anything you'd like ... it's in an extremely bare state and quite outdated
20:11 timotimo kyclark: last time i worked on it we didn't have multithreading stuff, so i couldn't implement the heartbeat thing that a jupyter kernel ought to have
20:12 awwaiid been on my TODO list to mess with iperl6kernel also, but hasn't gotten to the top yet
20:12 mst jupyter, ah, yes, rebranding on ipython, awesome
20:12 awwaiid ya
20:12 awwaiid for polyglotness
20:18 timotimo food, yay
20:20 dalek gtk-simple: 2f31fd3 | RabidGravy++ | lib/GTK/Simple/DrawingArea.pm6:
20:20 dalek gtk-simple: need GTK::Simple::ConnectionHandler
20:20 dalek gtk-simple:
20:20 dalek gtk-simple: May address #69
20:20 dalek gtk-simple: review: https://github.com/perl6/gt​k-simple/commit/2f31fd3ffb
20:28 espadrine joined #perl6
20:30 nadim joined #perl6
20:34 ggoebel joined #perl6
20:35 stmuk https://twitter.com/briandfoy_perl
20:36 viki that cover is so dull
20:42 Praise joined #perl6
20:42 Praise joined #perl6
20:56 kyclark I'm playing with creating a DNA class.  I know I can create a "method Str" to handle the stringification of the object.  Is there a similar method for creating a RegEx to match with e.g., "AACTAG" ~~ DNA?
20:57 RabidGravy ACCEPTS
20:58 kyclark Thanks!
20:59 MasterDuke_ kyclark: btw, i think tbrowder was also interested in the jupyter notebook
20:59 RabidGravy m: class DNA { multi method ACCEPTS(Str $f) {  $f ~~ /AA/ }; };   say  "AACTAG" ~~ DNA.new
20:59 camelia rakudo-moar 26e351: OUTPUT«「AA」␤»
20:59 RabidGravy m: class DNA { multi method ACCEPTS(Str $f) {  so $f ~~ /AA/ }; };   say  "AACTAG" ~~ DNA.new
20:59 camelia rakudo-moar 26e351: OUTPUT«True␤»
21:00 RabidGravy m: class DNA { multi method ACCEPTS(Str $f) {  so $f ~~ /AA/ }; };   say  "BBCTAG" ~~ DNA.new
21:00 camelia rakudo-moar 26e351: OUTPUT«False␤»
21:00 RabidGravy obviously adjusting to taste :)
21:02 tbrowder yes, very interested, but it is lower on my toit list at the moment...
21:02 yoleaux 9 Nov 2016 11:42Z <ilmari> tbrowder: I don't care about the actual naming, I was just snarking at the meaninglessness of the original one
21:02 tbrowder ilmari, i understand, and am in the process of renaming before release...
21:03 cdg joined #perl6
21:08 kyclark How do you fail out of BUILD?  E.g., you were passed some bogus data and so don't want to create the object?
21:09 Lucas_One joined #perl6
21:10 viki I think you need to override .new instead. You can try fail()ing and see what that looks like
21:11 lizmat kyclark: if you are in BUILD, the object already exists
21:11 lizmat otherwise you wouldn't be a able to set attributes  :-)
21:11 kyclark Ah, is there a place to intervene earlier then?
21:11 viki method new
21:11 lizmat kyclark: what viki said
21:12 lizmat create your own .new, and only call self.bless(%named) if you're sure
21:12 kyclark Is it a "method" or a "submethod" then?  BUILD has to be submethod, right?
21:13 viki method new is a method
21:14 viki right BUILD is a submethod, so if you subclass your object, it still gets called
21:15 canopus joined #perl6
21:15 labster joined #perl6
21:16 pyrimidine joined #perl6
21:22 kyclark Are there docs/examples for overriding "new"?  What should I return?
21:22 kyclark Calling "fail" seems to do what I expect/want.
21:24 lizmat m: class A { method new(*%_) { Bool.pick ?? self.bless(|%_) !! fail "duh" } }; dd A.new
21:24 camelia rakudo-moar 26e351: OUTPUT«Failure.new(exception => X::AdHoc.new(payload => "duh"), backtrace => Backtrace.new)␤»
21:24 lizmat m: class A { method new(*%_) { Bool.pick ?? self.bless(|%_) !! fail "duh" } }; dd A.new
21:24 camelia rakudo-moar 26e351: OUTPUT«Failure.new(exception => X::AdHoc.new(payload => "duh"), backtrace => Backtrace.new)␤»
21:24 lizmat m: class A { method new(*%_) { Bool.pick ?? self.bless(|%_) !! fail "duh" } }; dd A.new
21:24 camelia rakudo-moar 26e351: OUTPUT«A.new␤»
21:25 pyrimidine joined #perl6
21:25 lizmat s/Bool.pick/ your logic /  :-)
21:25 lizmat kyclark: ^^^
21:25 kyclark Ah, I didn't know I needed the "|" before the args to "bless" -- that's a Slip, right?
21:26 lizmat yep
21:26 lizmat it converts the hash back into named arguments
21:26 lizmat although technically in that context it isn't a slip, but that really doesn't matter
21:27 lizmat conceptually it will slip in the named parameters  :-)
21:27 kyclark Ah, good to know.  If I instead wanted to define "class DNA is Str," how would I create the object?  Looks like it still wants a named arguments, but what is it called?
21:27 lizmat in the Str case, it's "value" afaik
21:27 lizmat m: dd Str.new(value => "foo")
21:27 camelia rakudo-moar 26e351: OUTPUT«"foo"␤»
21:28 kyclark Is there a way to get "DNA.new($str);" to work?
21:29 lizmat sure:
21:29 canopus joined #perl6
21:30 harmil_wk joined #perl6
21:30 lizmat m: class DNA is Str { method new($str) { self.bless( value => $str ) } }; dd DNA.new("foo")
21:30 camelia rakudo-moar 26e351: OUTPUT«"foo"␤»
21:32 toolforger1 joined #perl6
21:36 kyclark Cool, lizmat!  Now, teach me, please, how to use CATCH to gracefully handle when I try to create a DNA object with bad input.  That is, I am "fail"ing inside my "new" when the string is bad.  Outside of the object, how do I incorporate CATCH?
21:36 setty1 joined #perl6
21:37 pyrimidine joined #perl6
21:40 kyclark Ah, I figured it out.  Needed to put CATCH inside a try block.
21:42 lizmat kyclark: that works but isn't needed
21:43 pyrimidine joined #perl6
21:43 kyclark OK, what's a better way?
21:43 kyclark Here's what I have: http://pastie.org/10962373
21:43 [Coke] -a- block is needed.
21:44 geekosaur (or, more precisely, a *scope* is needed. a block is the easiest way to get that scope)
21:45 [Coke] geekosaur++
21:48 toolforger1 left #perl6
21:52 kyclark If I remove my "try" block then my CATCH isn't caught.  I just get a raw "Failure".
21:56 jnthn Note that `try` blocks also fatalize failures that are returned
21:56 jnthn So there is a difference between a bare block with a CATCH and a try block with a CATCH.
21:59 canopus joined #perl6
22:06 xstan joined #perl6
22:08 xstan joined #perl6
22:10 xstan joined #perl6
22:11 kyclark Is there a way around this?
22:11 jnthn A way around what?
22:11 kyclark m: my $meth = 'chars'; put 'foo'.$meth;
22:11 camelia rakudo-moar 26e351: OUTPUT«No such method 'CALL-ME' for invocant of type 'Str'␤  in block <unit> at <tmp> line 1␤␤»
22:11 jnthn Oh, I thought it was about try/CATCH :P
22:11 jnthn .$meth means "call the code object in $meth"
22:12 xstan joined #perl6
22:12 jnthn ."$meth" is how you use $meth as a name
22:12 jnthn m: my $meth = 'chars'; put 'foo'."$meth"()
22:12 camelia rakudo-moar 26e351: OUTPUT«3␤»
22:13 xstan joined #perl6
22:14 lizmat and another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/201​6/11/14/2016-46-tweaking-cheaters/
22:14 kurahaupo__ joined #perl6
22:16 kyclark Yep, ok, thanks.
22:21 bjz joined #perl6
22:23 kurahaupo_ joined #perl6
22:29 canopus joined #perl6
22:36 uvb joined #perl6
22:46 canopus joined #perl6
22:47 diakopter joined #perl6
22:50 raiph joined #perl6
22:51 rurban joined #perl6
22:52 harmil_wk That example seems like an ideal place for a warning, such as "'object.$variable' syntax is not method invocation by-name. Did you mean object."$variable"()?"
22:57 harmil_wk Then again, why isn't it invocation by name? If $variable is not a code object, I don't understand why we wouldn't try to massage it into one (e.g. by name)
23:03 TimToady we never confuse symbolic reference with hard reference in Perl 6; they always have different syntax
23:03 TimToady that was a Perl 5 mistake, which is why we don't do it :)
23:04 TimToady as a result, we never need 'use strict refs'
23:05 TimToady thunk &
23:10 nicq20 joined #perl6
23:10 canopus joined #perl6
23:12 mohae_ joined #perl6
23:12 samcv lizmat, best part of the week :)
23:26 canopus joined #perl6
23:41 canopus joined #perl6
23:46 harmil_wk TimToady: Fair enough... which seems to point us in the direction of a warning...
23:51 skids joined #perl6

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

Perl 6 | Reference Documentation | Rakudo