»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:03 firstdayonthejob left
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
what should I look into to do this?
00:13 Upasaka joined
timotimo m: say "(NAME foo bar baz)" ~~ / '(' \S+ <( <-[)]>+ )> ')' / 00:15
camelia rakudo-moar 59bb1b: OUTPUT«「 foo bar baz」␤»
timotimo m: say "(NAME foo bar baz)" ~~ / '(' \S+ \s+ <( <-[)]>+ )> ')' /
camelia rakudo-moar 59bb1b: OUTPUT«「foo bar baz」␤»
timotimo m: say <( )>.join("(NAME foo bar baz)" ~~ / '(' \S+ \s+ <( <-[)]>+ )> ')' /)
camelia rakudo-moar 59bb1b: OUTPUT«(foo bar baz)␤»
00:16 perlawhirl joined
tailgate ohhh, that's clever. Thanks 00:21
00:22 cibs left 00:24 cibs joined, kyclark_ joined
tailgate so is whitespace signifcant in a perl6 regex? 00:26
apparently not
perlawhirl m: "(NAME foo bar baz)".subst(/<?after '('> \S+\s+/, '') 00:27
camelia ( no output )
perlawhirl m: say "(NAME foo bar baz)".subst(/<?after '('> \S+\s+/, '')
camelia rakudo-moar 59bb1b: OUTPUT«(foo bar baz)␤»
perlawhirl or if you like the shorthand version of 'before'...
m: say "(NAME foo bar baz)".subst(/ '(' <( \S+\s+/, '')
camelia rakudo-moar 59bb1b: OUTPUT«(foo bar baz)␤»
perlawhirl tailgate: No it's insignificant, unless you match with m:s// 00:33
the :s stands for 'sigspace' aka 'significant space'
m: say 'this that' ~~ m/\w+ \w+/ # matches only the first word 00:34
camelia rakudo-moar 59bb1b: OUTPUT«「this」␤»
perlawhirl m: say 'this that' ~~ m:s/\w+ \w+/ # matches both
camelia rakudo-moar 59bb1b: OUTPUT«「this that」␤»
seatek is TWEAK a thing yet?
raiph m: class c { submethod TWEAK { say 42 } }.new 00:35
camelia rakudo-moar 59bb1b: OUTPUT«42␤»
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.
seatek must have 00:36
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
....... okay?!?!
i'll take it, i guess??
seatek see? it's insane at any level 00:38
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
samcv well i don't have any tests written yet :P
but i can make some later tonight
it's not mentioned in S02, but it should probably still go in S02-literals folder of roast right? 00:42
AlexDaniel samcv: I think this is the right file, check it to see if the tests are indeed not there yet: github.com/perl6/roast/blob/d1baf2.../quoting.t 00:43
samcv yeah they're not there, already looked 00:44
grepped all of roast as well for Qw and Q:w and nothin
and checked the quoting.t manually. that is where it should end up though 00:45
AlexDaniel samcv: this bit is slightly outdated but still relevant: design.perl6.org/S02.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
will add a test later tonight i think
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
has Qs Qa Qh Qf Qb and Qc
but i'll check if there's any missing 00:48
as well
AlexDaniel that would be great, yes
00:48 pierre_ joined
Xliff Uhhh... this is odd... 00:51
===SORRY!===
Expected MAST::Frame, but didn't get one
AlexDaniel Xliff: is that from some regular code? :) 00:52
Xliff AlexDaniel: From code using experimental libxslt bindings.
Not even getting out of stage parse, so it's not all code? 00:54
00:57 noganex_ joined 00:59 noganex left 01:03 MasterDuke left 01:06 felher left 01:08 felher joined 01:09 xStan3 joined
grondilu sees TBD on docs.perl6.org/language/nativecall..._and_Blobs Any news? 01:10
01:14 itcharlie joined, R_I_D joined
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:17
timotimo what dous the signature for your "method new" look like? 01:18
R_I_D method new($name) {
timotimo could it be you've got a double-quote run-away somewhere? 01:19
01:20 xStan3 left 01:21 BenGoldberg left
R_I_D in my test file i have ok my $testUser = UserId.new("rid"); 01:21
that's the only place i have a double quote
timotimo hm, OK
mind putting the code up on gist.github.com or something similar? 01:22
01:25 kyclark_ left 01:26 labster left
R_I_D gist.github.com/ridofself/3bb3a3c7...76502ded34 01:26
01:27 richi235 left, gfldex left, gfldex joined
AlexDaniel R_I_D: meathod 01:28
01:28 canopus left, richi235 joined
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
timotimo because you could have a sub named meathod and a sub named new 01:29
it'd then complain about the opening curly brace, though, if $name had been defined before 01:30
m: my $name; meathod new($name) { say "yay" }
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…»
timotimo that's the error you'd've gotten in that case
it's legal to post-declare subs 01:31
AlexDaniel right, makes sense
01:31 xStan3 joined
AlexDaniel I wonder if there is any way to improve it 01:31
timotimo if we see an undefined variable, we could try to limp along and see what the next error would be 01:32
R_I_D oh my 01:33
01:33 canopus joined
timotimo my $oh 01:36
i'm going to bed now, have a good one! :)
R_I_D thank you! good night
AlexDaniel timotimo: well, I created a ticket #130092 01:37
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130092
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
R_I_D: thanks for coming here and asking this question!
Xliff AlexDaniel: Any ideas as to why I am getting the MAST::Frame error? 01:40
AlexDaniel Xliff: I have never seen that error message personally. The error message comes from MoarVM, so there's definitely something scary happening: github.com/MoarVM/MoarVM/blob/2eed...ler.c#L590 01:44
Xliff Yeah. Trying to isolate now. 01:45
AlexDaniel that would help, yes
Xliff Damn. 01:48
All of the XML::LibXML code is now buggered after a recent update in rakudo.
Haven't touched any of that code since.... July?
Previously you were allowed to have something akin to: class C is repr('CStruct') {} 01:49
Now you can't.
samcv AlexDaniel, did a PR github.com/perl6/roast/pull/182 01:55
added Qw Qx Qww 01:56
01:59 wamba left 02:00 R_I_D left, pierre_ left
AlexDaniel great! I'll let somebody else review it 02:00
Xliff Shite. 02:03
Whole semantics have changed in rakudo that used to work.
"my class" vs. "our class" vs "class" -- the meanings have changed. 02:04
"my class ... is export" will not export but "class ... is export" does
This blows up the entirety of XML::LibXML
So here's what I have found with that MAST::Frame issue. 02:07
02:07 pierre_ joined
Xliff github.com/Xliff/p6-xslt/blob/mast...basic.t#L7 <- If I comment this line, I do NOT get the MAST::Frame error 02:08
The moment I uncomment it, I do.
github.com/Xliff/p6-xslt/blob/mast...LT/Subs.pm will pass "perl -c" with a "Syntax OK" message. 02:09
02:09 pierre_ left, pierre_ joined
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:09
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
02:10 dayangkun joined
Xliff samcv++ # Qw Qx Qww 02:10
samcv :) 02:11
glad to contribute!
and added testing how qx vs Qx handles double backslash, which i think is important as well
02:12 labster joined 02:14 MasterDuke joined
samcv Xliff, i think you can do class C is repr('CStruct') 02:15
m: class C is repr('CStruct') { his int32 $.var; }
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…»
samcv m: class C is repr('CStruct') { has int32 $.var; }
camelia ( no output )
samcv oopsie
you are saying that doesn't work though? 02:16
or is it the exporting not working 02:18
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
instead of just 'class' 02:20
Xliff And I am aware you can use dummy values in CStruct classes. I am just saying that empty classes used to be legal.
"my class" used to work.
Now "class" works
And "my class ... is export" doesn't export anything
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'?
Xliff Which means XML::LibXML will need a lot of changes to get back to where it was.
samcv :( 02:21
Xliff samcv: I have already said that it does...
samcv do you redefine classes?
Xliff Unfortunately, yes.
samcv ahhhhhhh
Xliff Have to, due to the circular nature of the C code.
samcv crap
Xliff Nevertheless, that issue is solvable. 02:22
It is the MAST::Frame errors that are problematic. And I have no idea where to start with that.
I guess I can start commenting code in Subs.pm to see if it starts working.
It could be that Subs.pm is too large. 02:23
Interesting...
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:27
Xliff I could care less about META.info 02:30
That does effect perl script operation.
I have commented everything in Subs.pm and am still getting the MAST::Frame error. 02:31
o_O
Commenting out everything in XML::LibXSLT::Subs and commenting out the "use XML::LibXSLT::Types" directive got rid of the MAST::Frame error. 02:46
02:49 xStan3 left
geekosaur how about keeping ::Subs (possibly stubbing references) and commenting out the use? 03:00
03:19 vlalaha joined
vlalaha how to `use` a module such that you can call the imported subroutines as MyModule.subroutine? 03:21
it seems that everything gets dumped in the highest scope when you import a module 03:22
geekosaur use Module (); # I think? should tell it not to import anything into the local scope 03:23
03:25 perlawhirl left, perlawhirl joined 03:28 dayangkun left
Xliff geekosaur: Still, that's using a hack to prevent an error that should not be occuring. 03:28
Nevertheless, I am willing to give it a try. So how should I invoke the module, again?
geekosaur Xliff, actually that was just doublechecking that it is the use of the Types module, and not the Subs module, that is relevant
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.
geekosaur or, just do perl6 -e 'use XML::LibXSLT::Types' and verify that it's that module yo need to check
vlalaha, what module are you "use"ing?
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:30
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
03:31 nowan left
geekosaur ok, then names are Killpage::Parser::whatever 03:31
vlalaha it works, but the subroutines are in the local scope
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.
vlalaha yeah, I tried that, it says it "Could not find the symbol"
oh, you too?
nvm i see
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
vlalaha i changed the subroutine declaration to use "our" instead and it works now, weird 03:35
03:35 nowan joined
geekosaur expected 03:35
Xliff ::Types is not causing the error.
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.
Xliff Once I go back to ::Subs it's "...MAST::Frame..." again...
Hmm... I wonder if I need to do "our sub" instead of just "sub" then.
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
03:37 Jesmaybe joined
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)
vlalaha geekosaur: now that makes a bit more sense, I was unclear about the distinction. thanks 03:38
03:38 vlalaha left
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 :)
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:39
03:40 Jesmaybe left
geekosaur basically any time you see something like MAST::whatever, you are guaranteed weirdness and difficulty trying to track it down :/ 03:41
potentially this is a bug in moarvm, more likely a bug in the nqp code generation for moarvm (which is what MAST is)
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
03:42 noganex joined 03:45 noganex_ left
Xliff geekosaur: My guess is that --ll-exception won't work in stage parse. 03:51
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
Xliff 18 22091 RMD: Performing imports for 'XML::LibXSLT::Types'
2 22091 RMD: Imports for 'XML::LibXSLT::Types' done
===SORRY!===
Expected MAST::Frame, but didn't get one
geekosaur which is paet of why I said "I suspect it won't"
Xliff That would imply that it loaded XML::LibXSLT::Types and bailed.
geekosaur: Yes. That you did. I believed you, but am grasping at straws, here.
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 pierre_ left
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.
Xliff I am beginning to think so, too. 03:54
However, I admit... I play with features on the edge.
NativeCall for one.
geekosaur NC is definitely on the edge... and demonstrating why nobody else does it that way 03:56
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:57
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...)
foreign function interface
Xliff Ah. 03:59
The only place NativeCall falls REAL short is for typedefs and macros
Actually, s/typedefs/defines/
geekosaur well, and in promising C++ support but you really need to actually use C++ to deliver on that
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.
Yeah. Doesn't P6 have a generics concept?
Actually, does it even need one
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:02
04:03 pierre_ joined 04:04 itcharlie left
Xliff Thought so. 04:05
04:05 aborazmeh joined, aborazmeh left, aborazmeh joined
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:05
That's #3. *sigh* 04:06
04:25 pierre_ left 04:32 pierre_ joined 04:37 kyclark_ joined, pierre_ left 04:41 aborazmeh left 04:46 AlexDaniel left
dudz Hello online perl6 community of active developers 04:46
p6: say 3 04:47
camelia rakudo-moar 59bb1b: OUTPUT«3␤»
dudz p6: say 3; 04:48
camelia rakudo-moar 59bb1b: OUTPUT«3␤»
dudz p6: say split(' ', @INC);
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
MasterDuke m: .say for $*REPO.repo-chain 04:57
camelia rakudo-moar 59bb1b: OUTPUT«inst#/home/camelia/.perl6␤inst#/home/camelia/rakudo-m-inst-1/share/perl6/site␤inst#/home/camelia/rakudo-m-inst-1/share/perl6/vendor␤inst#/home/camelia/rakudo-m-inst-1/share/perl6␤CompUnit::Repository::AbsolutePath.new(next-repo => CompUnit::Reposit…»
Xliff MasterDuke++ beat me to it. 04:58
MasterDuke dudz: ^^^ and search for @INC in docs.perl6.org/language/5to6-perlvar
general question, should those Perl 5 variable be searchable in the docs? because they aren't right now 04:59
04:59 cyphase left
dudz :) 04:59
Xliff MasterDuke: I should think so. 05:01
Especially @INC
JimmyZ MasterDuke: re Failed to read dirhandle, which platform? 05:03
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
Arch linux
05:04 cyphase joined
MasterDuke it does't happen all the time 05:04
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
05:06 djbkd joined
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 kyclark_ left
MasterDuke Xliff, dudz: doc issue created for searching Perl 5 variable 05:08
dudz hello MasterDuke 05:09
MasterDuke hi 05:10
JimmyZ: cool
and with that i'm outta here. later all...
dalek c: d3f3d0c | gfldex++ | doc/Language/5to6-perlvar.pod6:
index @INC and %INC
05:11
synopsebot6 Link: doc.perl6.org/language/5to6-perlvar
05:18 skids left 05:21 Cabanossi left 05:25 Cabanossi joined 05:28 cyphase left 05:33 cyphase joined, Actualeyes left 05:37 zacts left 05:44 officialsandeep8 joined 05:48 wamba left
officialsandeep8 What is the best use case scenario for Perl 6? 05:49
05:50 pierre_ joined 06:00 rurban joined, rurban left 06:02 Actualeyes joined, officialsandeep8 left, officialsandeep8 joined 06:08 officialsandeep8 left 06:09 officialsandeep8 joined
dudz a 'best' subscriber i see officialsandeep8 06:09
06:17 pierre_ left 06:19 domidumont joined 06:21 wamba joined 06:22 domidumont left, domidumont joined 06:24 pierre_ joined 06:26 wamba left, raiph left 06:27 officialsandeep8 left 06:29 pierre_ left
JimmyZ MasterDuke: just fixed it, try newer moarm :) 06:46
06:47 pierre_ joined 06:49 RabidGravy joined 06:50 domidumont left, perlawhirl left
Xliff The RT webpage is horrible. 06:57
There are no links for entering in a new ticket that I can find.
rtt
rt
perlbug
rt 06:58
JimmyZ Xliff: email to rakudobug at perl.org. 06:59
Xliff I don't want email. I need a webform. 07:00
Otherwise I would have done that and not complained about the web interface. :)
JimmyZ there is no webform
Xliff I know there is one. I've used it.
fact is, I've sent in two bugs and never used email.
I just never keep the link around. 07:01
geekosaur it was disabled due to spam iirc
Xliff Oh *snarl*
07:01 BenGoldberg left
Xliff Now I've lost the desire to go through the headache. 07:01
Will it pick up attachments, then? 07:02
And any rich text formatting (think indenting for code)
07:02 djbkd left 07:03 djbkd joined 07:05 TEttinger left 07:06 stevieb left 07:08 bjz joined 07:13 abraxxa joined 07:14 darutoko joined
Xliff Error sent. 07:16
07:21 abraxxa left 07:22 abraxxa joined, neuraload joined 07:23 domidumont joined 07:26 pierre_ left, bjz left 07:30 Louis_ left 07:31 domidumont left 07:32 pierre_ joined 07:33 broquaint left 07:36 domidumont joined, pierre_ left 07:37 domidumont left 07:40 domidumont joined 07:44 bjz joined 07:53 pierre_ joined 08:05 Vynce joined 08:06 pierre_ left 08:08 domidumont left 08:10 rurban joined 08:11 pierre_ joined 08:14 domidumont joined
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? irclog.perlgeek.de/perl6-dev/2016-...i_13559207
08:22 zakharyas joined 08:30 pierre_ left 08:36 pierre_ joined 08:38 kurahaupo__ joined 08:40 pierre_ left 08:43 araujo joined, araujo left, araujo joined 08:50 pierre_ joined 08:54 bjz_ joined, bjz left 09:06 ocbtec joined 09:11 mxco86 joined
masak antenoon, #perl6 09:14
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
it fits me very well. I definitely wouldn't have submitted ~2k tickets via a web form :P
09:16 qub joined 09:18 rindolf joined
samcv :P masak is this you rt.perl.org/Ticket/Display.html?id=130096 09:23
XD
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
16 minutes. and couldn't find it, a while back
seatek shakes fist in the air - spammers! 09:26
09:27 Vynce left
samcv i like how they attached a .jar file 09:27
masak samcv: sounds like a really good idea.
samcv: maybe [Coke] (ping) can help with adding such an instruction to the main page? 09:28
09:28 espadrine joined 09:30 jonas2 joined 09:32 domidumont left, ufobat joined 09:34 domidumont joined 09:35 dakkar joined, domidumont left
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:37
But somehow... it worked perfectly! Well, one mistake. Ok... 2 little mistakes.. one just returning True at a place... 09:38
But that's unbelievable.
I am either brilliant, or there is something freakisly magical about the way Perl 6 is making me organize things.
Dam objects. Never know whether to love them or hate them. 09:39
Very amazing though. This was my first time refactoring with Perl 6 at any decent scale. So happy. 09:40
09:41 domidumont joined 09:50 espadrine left 10:03 domidumont left 10:04 domidumont joined
samcv seatek, nice 10:08
when refactoring in perl 6 i usually discover that if i make mistakes, they're not big ones
compared to like perl 5 or other languages
where i'd be like !!@?$$???? crap 10:09
oops. but i never really was one for object oriented programming. but i like perl 6's implementation
seatek yeah i was fully prepared to shoot myself
samcv mostly painless
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
(this is for Perl6::Parser - Yes, still working onit, still a royal pain.)
*on it
samcv oh DrForr readline seems broken with readline 7.0 github.com/drforr/perl6-readline/issues/12 fyi 10:11
seatek That sort of stuff is serious puzzle material
samcv best luck about Perl6::Parser though!
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.
samcv i couldn't find anything looking myself... but
there's something going on
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
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:13
seatek You know, somebody here posted this game a while back ovolve.github.io/2048-AI/ -- what a curse that was! Is actually. Ach! I can't stop! 10:15
10:15 labster left
samcv seatek, automate it so a bot does it for you :P 10:16
though i guess you can lose. darn
seatek no, it's the hypnotic sliding of the numbers.... and their combinations.... 10:17
samcv it seems pretty neat
seatek stop while you still can 10:18
10:23 neuraload left, neuraload joined
samcv DrForr, my constant LIB = ( 'readline', Version.new('6') ); github.com/drforr/perl6-readline/b...ne.pm#L657 10:23
ah
that would do it!
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:31
10:32 wamba joined
DrForr That's what I meant by looking at library versioning. 10:34
10:34 andrzejku_ joined 10:36 andrzejku left, bjz joined, bjz_ left
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:37
10:50 cyphase left 10:54 cyphase joined 10:58 pecastro joined, wamba left 11:01 domidumont left 11:02 wamba joined 11:03 pierre_ left 11:04 domidumont joined 11:06 seatek left 11:08 cyphase left 11:09 bjz left, bjz_ joined 11:12 cyphase joined 11:17 rurban left 11:41 cyphase left 11:46 cyphase joined
geekosaur samcv, leaving out the version "just works" until you hit the reason the version changed and everything breaks 11:48
11:48 broquaint joined
geekosaur people just love to ignore that part, because they aren't affected by it until suddenly they are 11:48
samcv ah that's true geekosaur 11:49
i guess trying one version and if that fails just don't specify one could make sense. if the requested one isn't available 11:50
12:00 cyphase left 12:01 wamba left 12:06 cyphase joined
masak m: for 1..100 -> $n { say $n if $n %% 10 && $n %% 12 } 12:10
camelia rakudo-moar 59bb1b: OUTPUT«60␤»
masak m: for 1..100 -> $n { say $n && last if $n %% 10 && $n %% 12 }
camelia ( no output )
masak bug, nyes? :)
(I expected "60\n" even in the latter case) 12:11
masak submits rakudobug 12:12
rindolf Hi all! make install on rakudo stopped working properly 12:14
lizmat rindolf: which backend ? 12:15
rindolf lizmat moarvm
lizmat did you try to run Configre.pl again ?
rindolf lizmat: I did.
lizmat there were some files added, which isn't picked up by "make" 12:16
ok, then please gist the error
12:16 wamba joined
rindolf lizmat: ok 12:16
12:17 rurban joined
rindolf lizmat: see paste.debian.net/895510/ - I recall seeing it on 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?
camelia rakudo-moar 59bb1b: OUTPUT«True␤»
12:19 cyphase left
lizmat llfourn: that feels like a bug 12:19
ah no
llfourn is it because it's defined in Mu that it doesn't work?
lizmat what's the defined doing there ?
ah, ok
rindolf lizmat: this is the script that I am using to build - paste.debian.net/895511/ 12:20
llfourn I just want a junction friendly way of doing .defined
lizmat llfourn: understand now what you're doing
masak ...oh 12:21
notabug.
just listop precedence, d'oh
12:21 nadim joined
masak m: for 1..100 -> $n { say $n and last if $n %% 10 && $n %% 12 } 12:22
camelia rakudo-moar 59bb1b: OUTPUT«60␤»
12:22 mr-foobar left
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)␤»
llfourn m: say ?(Any,"foo")>>.defined.all # maybe this is the way to do it?
camelia rakudo-moar 59bb1b: OUTPUT«False␤»
12:24 cyphase joined
lizmat llfourn: testing the fallout of a fix: adding an Any candidate for the .defined method 12:24
12:25 pierre_ joined
llfourn lizmat++ sweet! 12:25
rindolf nadim: hi.
nadim: <rindolf> lizmat: see paste.debian.net/895510/ - I recall seeing it on travis-ci.org/rakudo/rakudo/builds as well 12:26
lizmat is this by any chance using a Moar > MOAR_REVISION in nqp ?
rindolf lizmat: who are you talking to? 12:27
12:27 MasterDuke_ joined
lizmat rindolf: that was addressed to you :-) 12:27
rindolf lizmat: ah,
lizmat: my script pulls git master / git nom / etc.
MasterDuke_ rindolf: github.com/MoarVM/MoarVM/commit/a94e744b44 12:28
unless you're building moar manually, someone will have to bump npq and moar required versions 12:30
dalek c: 8ca1c63 | (Samantha McVey)++ | doc/Type/Supply.pod6:
Show how to go from signal numbers to Signal objects to use with the signal method
synopsebot6 Link: doc.perl6.org/type/Supply
c: 49fc78b | (Samantha McVey)++ | doc/Type/Supply.pod6:
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
synopsebot6 Link: doc.perl6.org/type/Supply
c: 0ea8e00 | RabidGravy++ | doc/Type/Supply.pod6:
Merge pull request #1010 from samcv/signal

Show how to go from signal numbers to Signal objects to use with the signal method
synopsebot6 Link: doc.perl6.org/type/Supply
rindolf MasterDuke_: I have a script - paste.debian.net/895511/ 12:31
Samantha McVey reminds me of "Oy vey" 12:32
well, the name at least
lizmat llfourn: please rakudobug it for now, easy fix doesn't fix it :-) 12:33
llfourn lizmat: rgr
masak (Samantha McVey)++ # contribution karma from a human :)
12:34 wamba left
masak rindolf: something tells me we should avoid making fun of the names of new contributors, if we can... :/ 12:35
lizmat refrains from making remarks about red noses 12:36
masak :P 12:37
rindolf masak: I was not. :-(
masak ok, got it.
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 :-)
.oO( who has the red nose now :-)
rindolf lizmat: I have very Evil plans for this christmas 12:40
lizmat is it evil enough for an advent post ? 12:41
timotimo masak: your "say $n && last" thing looks like unexpected precedence to me 12:42
masak: i'd expect the argument to say being ($n && last ...) so it'll jump out of the loop before say can even run
oh, you already saw
okay!
rindolf lizmat: it's too much Evil™ for that
12:42 kurahaupo__ left, kurahaupo__ joined
timotimo m: for 1..100 -> $n { say $n and last if $n %% all(10, 12) } 12:43
camelia rakudo-moar 59bb1b: OUTPUT«60␤»
timotimo y u no use junkshon :)
12:43 kurahaupo__ left
rindolf MasterDuke_: lizmat : seems to install fine now - thanks! 12:43
Not it's Benchmarking Time!
12:43 kurahaupo__ joined 12:46 mr-foobar joined
rindolf lizmat: what is the Dutch word for "wolf"? 12:47
lizmat wolf 12:48
rindolf lizmat: ah.
lizmat as it is in German
masak will be able to tell what's it in Swedish
but I would guess something like "wolf" :-)
12:49 cyphase left
rindolf lizmat: ok. 12:52
lizmat: in Hebrew it is "Ze'ev" 12:53
זאב
12:54 cyphase joined
rindolf I wonder if I should exit out of KDE Plasma 5 to benchmark the two perl6's properly 12:56
12:57 kurahaupo__ is now known as kurahaupo
arnsholt Wolf is "ulv" in Norwegian and Danish, "varg" in Swedish 12:59
12:59 rurban left
arnsholt (I think, for .dk and .se) 12:59
lizmat eh, more dissimilar than I thought 13:00
arnsholt Nah, not that different
At least Danish and Norwegian 13:01
Swedish is a different root, clearly
The -v corresponds to unvoiced -f in continental Germanic, and leading w- is generally lost in Scandinavian IIRC 13:02
jnthn "vlk" in Czech :)
Who needs a vowel! :P
arnsholt Which is related to "ulv" and friends!
Ah, Wiktionary delivers: 13:03
PIE *wlkwos > Germ. *wulfaz > Norse ulfr 13:04
Whereas Slavic has kept the resonant l syllable nucleus 13:05
timotimo position independent executable?
arnsholt Same root gives lupus in Latin and lykos in Greek
timotimo: =p
timotimo but the mascot of lycos was a dog!
arnsholt There's a Sanskrit reflex of the same root as well... 13:06
Aha: vrka 13:07
13:12 cyphase left
lizmat and warg in elfish ? 13:13
afk& 13:14
stmuk and GoT
13:14 rindolf left
moritz and vararg in Cish :-) 13:15
13:17 cyphase joined 13:19 wamba joined 13:24 domidumont left 13:26 domidumont joined 13:33 canopus left, domidumont left 13:35 domidumont joined 13:40 canopus joined 13:43 pmurias joined 13:52 wamba left
[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 docs.perl6.org/type/Signature#Slur...Parameters )
yoleaux 11 Nov 2016 21:53Z <stmuk_> viki: thanks! I think you are right (and that 2016.10 problem fixed by a moar bump)
viki And it's linking to docs.perl6.org/type/Signature#inde...Parameters 14:03
14:03 domidumont left 14:04 domidumont joined 14:08 cdg joined
pmurias local rakudo.js just passed t/01-sanity/01-literals.t :) 14:10
viki \o/ 14:11
pmurias++
timotimo \o/
14:11 kyclark_ joined 14:12 domidumont left 14:14 domidumont joined 14:21 skids joined 14:29 kyclark_ left 14:32 kyclark_ joined
[Coke] .u èè 14:34
yoleaux U+00E8 LATIN SMALL LETTER E WITH GRAVE [Ll] (è)
14:47 vytas joined
viki samcv: are you asquare? 14:51
14:53 pierre_ left
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. 14:53
14:58 Lucas_One left
[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
kyclark_ Given pastie.org/10962119 15:05
Can I use “given” as a function to set $pause? E.g., my $pause = given $letter {…}? 15:06
viki kyclark_: do given
kyclark_ I mean, I know the language won’t let me, but is there a way to do what I want?
Is that the best? I don’t like having “$pause = “ in each “when”
15:07 gregf_ joined
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
viki sleep do given { ... } even. No need for $pause at all 15:08
15:12 rindolf joined
viki kyclark_: also, doesn't seem like there's much point in two loops. Just stick the .comb instead of lines 15:12
kyclark_: like gist.github.com/zoffixznet/f7f556c...5d70e961ae
viki would write it as gist.github.com/zoffixznet/35b76f0...48cd6815f6 instead of given/when stuff 15:13
kyclark_ Cool stuff!
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
kyclark_ I’ll present both. 15:22
15:22 wamba joined 15:25 rindolf left, nadim_ joined 15:27 pmurias left
moritz is disappointed that viki didn't come up with a mathematical function that mapped codepoint number to sleep time :-) 15:28
15:29 nadim left
kyclark_ blogs.perl.org/users/ken_youens-cla...eader.html 15:30
Thanks for the suggestions.
viki kyclark_++ # writing blogs about Perl 6 15:33
:chomp(False) can also be written as :!chomp
kyclark_ Thanks. I don’t feel qualified to hack the language, but I can be an advocate and educator.
Ooo, shiny!
viki I don't feel qualified either, but I still like to submit a commit or two once in a while ;) 15:35
"X::Multi::NoMatch exception produced no message" .oO( you know you're doing it wrong when... ) 15:40
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␤␤»
viki m: use nqp; my $a := nqp::radix_I(10, "10", 0, 0, Int); say $a[2] == 2;
camelia rakudo-moar 189cb2: OUTPUT«True␤»
kyclark_ Might there come a day when Perl 6 might compile to a native executable? 15:46
viki heh 15:47
Well, such an executable would include in itself Rakudo AND MoarVM inside of it, I'm guessing :) 15:48
15:48 Lucas_One left
TimToady m: say 10 lcm 12 # masak, much easier way to do that :P 15:49
camelia rakudo-moar 189cb2: OUTPUT«60␤»
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
I guess even a trivial program like the one above would be quite large. 15:50
mspo just p6pack would be nice 15:52
timotimo what's that, exactly? 15:53
15:54 rindolf joined
mspo a thing I just made up 15:54
timotimo: you know perlpacker?
search.cpan.org/~rschupp/PAR-Packer.../Packer.pm
think.. jar file :) 15:55
timotimo i don't know it, but yeah, that'd be neat. i imagine a custom CUR could do the trick. 15:56
imagine having a perl6 script up front and a zip file concatenated to the end
mspo timotimo: it's how mojolicious is a single thing to download
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
kyclark_ __END__ 15:57
mspo the java system of creating a pseudo-filesystem from the .jar is pretty slick
timotimo kyclark_: it'd be =finish in perl6
kyclark_ Noted
mspo I thought p6 didn't have a working __DATA__
timotimo kyclark_: but i'm afraid that probably still makes the parser chomp through to the EOF
mspo wasn't there a blog about that recently?
kyclark_ I do miss my __DATA__
I can deal, tho
mspo nice things perl has that make tons of sense: __DATA__, phasers, perl packer :) 15:58
I f-ing love phasers 16:00
timotimo they're good, yeah
mspo they're so practical it makes me sick that other languages don't adopt them 16:01
like, here's a super obvious and immediately useful flow control paradigm you can bolt on
timotimo just like comefrom! ;) ;)
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
MoarVM panic: Memory allocation failed; could not allocate 18446744073457369097 bytes
16:05 neuraload left
timotimo alas, we don't have lazy strings yet 16:06
16:07 Lucas_One joined
timotimo also, when running perl6 on a file that has an mp3 file concatenated to it, it says "invalid utf-8" 16:07
that's certainly true ...
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
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"
rindolf Hi all! Any idea why this branch is slightly slower in my benchmark than master? It should be faster. github.com/perl6/nqp/compare/maste...ze-sprintf 16:14
timotimo how big is the difference? 16:15
[Coke] (and how did you measure it) 16:16
timotimo rindolf: ^ ? 16:24
16:24 telex left
rindolf timotimo: let me see. 16:25
timotimo: 0:52.87elapsed before and 0:53.19elapsed after 16:26
16:26 telex joined
rindolf [Coke]: I used sudo_renice and time on a program using sprintf 16:26
[Coke] how many times did you run it? 16:27
that's a .6% difference on elapsed time, which seems like noise. 16:29
I think you might need a better measuring tool before worrying about timings. 16:30
rindolf [Coke]: on this commit - github.com/perl6/perl6-examples/co...74d160f285
[Coke] not sure if perl 6 has a Benchmark module yet.
timotimo try using callgrind to get a more reliable instruction count
rindolf [Coke]: ah.
timotimo that'll make timing and scheduling differences less
MasterDuke_ 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()?
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
timotimo use .prematch and .postmatch :P :P :P
[Coke] m: say "hello world".comb(6).perl 16:34
camelia rakudo-moar 189cb2: OUTPUT«("hello ", "world").Seq␤»
jnthn I'd probably do something like (.substr(0, $idx), .substr($idx)) given $the-str or so
[Coke] ^^
AlexDaniel m: say (‘hello’ ~~ /(.**2) (.*)/)».Str
camelia rakudo-moar 189cb2: OUTPUT«(he llo)␤»
viki OK. Thanks.
jnthn m: say "hello world i have a lot to say".comb(6).perl # ;)
camelia rakudo-moar 189cb2: OUTPUT«("hello ", "world ", "i have", " a lot", " to sa", "y").Seq␤»
jnthn m: say "hello world i have a lot to say".comb(6, 2).perl # ;)
camelia rakudo-moar 189cb2: OUTPUT«("hello ", "world ").Seq␤»
jnthn heh ;)
[Coke] jnthn: curses. :)
viki .comb was my first take, but it doesn't work well on edge cases, where you end up with 1 item
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
camelia rakudo-moar 189cb2: OUTPUT«("e", "l").Seq␤»
[Coke] and that's why you have an exhaustive test suite, kids!
viki m: say "hello world i have a lot to say".comb(0, 0).perl
camelia rakudo-moar 189cb2: OUTPUT«().Seq␤»
viki is slightly annoyed nqp::radix_I chose -1 to represent failure mode :/
m: use nqp; say nqp::radix_I(10, "1X", 0, 0, Int)[2] 16:36
camelia rakudo-moar 189cb2: OUTPUT«1␤»
viki m: use nqp; say nqp::radix_I(10, "X", 0, 0, Int)[2]
camelia rakudo-moar 189cb2: OUTPUT«-1␤»
viki c'mon, zero is right there for the taking!
m: use nqp; say nqp::radix_I(10, "", 0, 0, Int)[2]
camelia rakudo-moar 189cb2: OUTPUT«-1␤»
16:37 FROGGS joined
FROGGS o/ 16:37
viki \o\
[ptc] \o 16:46
timotimo o\
viki | 16:51
bah
timotimo oh no 16:52
16:53 domidumont left 16:55 abraxxa left
viki m: say :16("FF") 16:59
camelia rakudo-moar 189cb2: OUTPUT«255␤»
viki Does anyone know where ^ that feature is documented?
timotimo docs.perl6.org/type/Int.html 17:00
(i did this)
viki Thanks
m: :16('FF.FF').^name.say; # nitpicking 17:01
camelia rakudo-moar 189cb2: OUTPUT«Rat␤»
timotimo oh, good point. 17:02
it should go there, too
feel free to write it up :)
17:03 kyclark_ left 17:04 japhb joined
MasterDuke_ also here docs.perl6.org/syntax/Number%20literals 17:05
timotimo oooooh, yes.
good catch, i hadn't seen that 17:06
viki Thanks.
17:07 girafe joined
MasterDuke_ and here docs.perl6.org/routine/base 17:15
dalek c: 06707c8 | MasterDuke17++ | doc/Type/Real.pod6:
Better example of base() rounding
17:22
synopsebot6 Link: doc.perl6.org/type/Real
17:24 maybekoo2 joined 17:27 jonas2 left 17:29 ugjka left 17:31 Actualeyes left
dalek c: 4b9944d | (Zoffix Znet)++ | doc/Type/Str.pod6:
Document parse-base()

Added to Rakudo in
  github.com/rakudo/rakudo/commit/b1...4fa572023e
17:31
synopsebot6 Link: doc.perl6.org/type/Str
17:32 ugjka joined 17:33 xinming left 17:34 xinming joined
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
camelia rakudo-moar b1cbb8: OUTPUT«1337␤»
AlexDaniel m: :32(1337.base(32)).say
camelia rakudo-moar b1cbb8: OUTPUT«1337␤»
viki MasterDuke_: those aren't supported are they? 17:37
m: "١" 17:38
camelia rakudo-moar b1cbb8: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant string "١" in sink context (line 1)␤»
viki m: "١".base(10).say
camelia rakudo-moar b1cbb8: OUTPUT«No such method 'base' for invocant of type 'Str'␤ in block <unit> at <tmp> line 1␤␤»
viki m: "١".parse-base(10).say
camelia rakudo-moar b1cbb8: OUTPUT«1␤»
viki Oh, nm
Xliff vikiZoffixBorg: Did you get my response to your email on RT #130095?
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130095
AlexDaniel m: say :10(١)
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␤␤»
viki m: say :10<١> 17:39
camelia rakudo-moar b1cbb8: OUTPUT«1␤»
dalek c: 5991c34 | coke++ | doc/Type/Str.pod6:
remove trailing whitespace
synopsebot6 Link: doc.perl6.org/type/Str
AlexDaniel right
17:39 dakkar left
viki Xliff: unsure, but I see nothing on the ticket itself: rt.perl.org/Ticket/Display.html?id=130095 17:39
Xliff I replied to the email. I just noticed that said reply did not propagage to the RT system. 17:40
17:40 bazzaar joined
bazzaar o/ perl6 17:40
Xliff I have now updated ticket with response.
bazzaar m: grammar REST { token TOP { <command> } ; proto token command {*} ; token command:sym<create> { :ignorecase <sym> } } ; my $m = REST.parse('create');
camelia ( no output )
17:41 xstan joined
viki m: (^0xFFFF).grep(*.uniprop eq "Nd")».chr.join.parse-base(10).say 17:41
camelia rakudo-moar b1cbb8: OUTPUT«1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456…»
viki \o/
timotimo fantastic
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.
viki OK. Thanks.
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」␤»
bazzaar m: grammar REST { token TOP { <command> } ; proto token command {*} ; token command:sym<create> { :ignorecase <sym> } } ; say REST.parse('CREATE');
camelia rakudo-moar b1cbb8: OUTPUT«Nil␤»
17:44 setty1 joined
bazzaar anyone know if :ignorecase works in grammars? 17:44
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«「create」␤ command => 「create」␤ sym => 「create」␤»
Xliff m: grammar REST { token TOP { <command> } ; proto token command {*} ; token command:sym<create> { [:i <sym> ] } } ; say REST.parse('CREATE');
camelia rakudo-moar b1cbb8: OUTPUT«Nil␤»
Xliff Hrm.
viki m: say grammar { token TOP { :ignorecase 'create' } }.parse: 'CREATE';
camelia rakudo-moar b1cbb8: OUTPUT«「CREATE」␤»
viki Well, it works...
Wonder if it's the protoregex that's messing it up
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」␤»
FROGGS it does not like <sym>
viki m: grammar REST { token TOP { <command> } ; proto token command {*} ; token command:sym<create> { :i 'CREATE' } } ; say REST.parse('CREATE');
camelia rakudo-moar b1cbb8: OUTPUT«「CREATE」␤ command => 「CREATE」␤»
Xliff Oooh
That seems bugalicious. 17:49
viki m: grammar REST { token TOP { :i <command> }; token command { 'create' } } ; say REST.parse('CREATE');
camelia rakudo-moar b1cbb8: OUTPUT«Nil␤»
viki Well, it seems like the modifiers aren't passed into other tokens.
bazzaar figured it might be a bug 17:50
jnthn :i works lexically
viki
.oO( me is waiting for some of the Wise Antients to tell us the syntax for passing modifiers to tokens )
17:51
Ah, makes sense.
jnthn (Since tokens are compiled, and modifiers apply at compilation time of the token.)
We could arguably make <sym> a special case here, since it's already a special form.
Though not all things that are easy enough to implement are consistent language design choices. :) 17:52
(<sym> just compiles into a literal)
17:53 maybekoo2 left 17:55 lizmat left 17:56 lizmat joined
viki .u half zero 17:57
yoleaux U+0F33 TIBETAN DIGIT HALF ZERO [No] (༳)
bazzaar maybe disallow the use of <sym> in the regex?
viki m: "༳".parse-base(10).say
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␤␤»
viki bazzaar: that would break core code :) What would be the purpose of disallowing <sym>? 17:59
bazzaar <sym> is used that way in the perl6 grammar tutorial 18:00
viki: doesn't <sym> just provide a shorthand way of writing the literal explicitly? 18:02
timotimo sounds like a docbug, or a rakudobug 18:03
but kicking out <sym> is not going to happen
viki bazzaar: no, it also gives you a capture to work on in your action.
bazzaar: I'm a bit confused how you connect :i being lexical with disallowing <sym> token :) 18:04
18:05 zakharyas left
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:05
viki: but then maybe, I don't understand at all :) 18:07
18:07 maybekoo2 joined 18:13 firstdayonthejob joined
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:15
bazzaar: but as I've said, <sym> also creates a capture, so it's more like writing $<sym>='your thing' 18:16
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}`" } })
camelia rakudo-moar 5c40b1: OUTPUT«running command `CREATE`␤»
18:18 firstdayonthejob left, pyrimidine joined
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`␤»
viki You're just cheating here by making <command> match just the <sym>
bazzaar viki: any 'sym's that match get assigned to <command> don't they? 18:20
viki bazzaar: they would be in <sym> named capture of the <command> Match object, yes 18:21
cpan@perlbuild2~/CPANPRC/rakudo (nom)$ grep -FR '<sym>' src/Perl6/Grammar.nqp | wc -l
387
18:21 zacts joined
viki ^ 387 instances in Rakudo's source code. I don't think a useless feature worth removing would be the ubiquoutoues 18:21
can't type today. need sleeps >:(
bazzaar viki: but also in the <command> named capture? 18:22
viki bazzaar: no
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:23
18:24 firstdayonthejob joined
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`␤»
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`␤»
viki There's a module called Grammar::Tracer. `use` it and then run the grammar 18:27
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`␤»
viki heh
Well, no idea why it's not getting the made stuff.
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:29
viki You're basically working with a tree of objects. 18:30
(or graphs?) 18:31
*graph of objects
Ah no, tre 18:33
THE TRE OF OBJECTS! :D
18:37 TEttinger joined 18:39 xstan left
viki giggles 18:40
AlexDaniel: why so bitter in your tickets? :) rt.perl.org/Ticket/Display.html?id...et-history
To me that looks like a clear bug
18:41 pyrimidine left, pyrimidine joined
viki m: say grammar { regex TOP { <foo> }; token foo { [‘a’ || ‘abc’] } }.parse: 'abc' 18:41
camelia rakudo-moar 5c40b1: OUTPUT«Nil␤»
viki star: say grammar { regex TOP { <foo> }; token foo { [‘a’ || ‘abc’] } }.parse: 'abc'
camelia star-m 2016.10: OUTPUT«Nil␤»
viki commitable: 2016.04 say grammar { regex TOP { <foo> }; token foo { [‘a’ || ‘abc’] } }.parse: 'abc' 18:42
committable6 viki, ¦«2016.04»: Nil
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.
viki: see this: irclog.perlgeek.de/perl6/2016-11-13#i_13560371
18:43 andrzejku joined 18:45 andrzejku left, zakharyas joined 18:46 pyrimidine left
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
(well, not above, but I did try with a regex too locally)
18:48 bazzaar left, pyrimidine joined, domidumont joined
viki m: say grammar { token TOP { <foo> }; regex foo { [ ‘a’ || ‘abc’ ] } }.parse: 'a' 18:49
camelia rakudo-moar 5c40b1: OUTPUT«「a」␤ foo => 「a」␤»
viki m: say grammar { regex foo { [ ‘a’ || ‘abc’ ] } }.parse: 'a', :rule<foo>
camelia rakudo-moar 5c40b1: OUTPUT«「a」␤»
viki wat
oh no abc in input
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␤␤»
viki damn. doing too many things at onmce :)
18:52 pyrimidine left
MasterDuke_ m: say grammar { regex foo { [ ‘a’ || ‘abc’ ] } }.parse: 'abc', :rule<foo> 18:53
camelia rakudo-moar dfb58d: OUTPUT«Nil␤»
MasterDuke_ m: say grammar { regex foo { [ ‘a’ | ‘abc’ ] } }.parse: 'abc', :rule<foo> 18:54
camelia rakudo-moar dfb58d: OUTPUT«「abc」␤»
MasterDuke_ m: say grammar { regex foo { [ ‘abc’ || ‘a’ ] } }.parse: 'abc', :rule<foo>
camelia rakudo-moar dfb58d: OUTPUT«「abc」␤»
viki Right
m: say grammar { regex TOP { <foo> 'foo' }; token foo { [ ‘a’ || ‘abc’ ] } }.parse: 'abcfoo'
camelia rakudo-moar dfb58d: OUTPUT«Nil␤»
viki m: say grammar { regex TOP { <foo> 'foo' }; regex foo { [ ‘a’ || ‘abc’ ] } }.parse: 'abcfoo'
camelia rakudo-moar dfb58d: OUTPUT«「abcfoo」␤ foo => 「abc」␤»
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
That's what I gather from this so far :)
18:55 vendethiel left 18:56 rurban joined, andrzejku joined 18:58 andrzejku left 18:59 domidumont left, vendethiel joined 19:00 pyrimidine joined, chris2 left
dalek c: ba3ed8f | (Zoffix Znet)++ | doc/Language/objects.pod6:
Remove versioning mention for TWEAK

IMO it doesn't really belong in a main text, especially mentions of specific compilers.
If anything, this type of stuff should be in a separate document, similar to what perldoc perldelta does.
19:00
synopsebot6 Link: doc.perl6.org/language/objects
c: 52fab9f | (Zoffix Znet)++ | doc/Language/objects.pod6:
Add indexer marker for TWEAK
19:01
synopsebot6 Link: doc.perl6.org/language/objects
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:04
19:04 pyrimidine left
[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:05
19:06 jonas2 joined
cognominal Apparently there is no protection against excessive writing : github.com/MoarVM/MoarVM/blob/mast...ops.c#L537 19:07
19:08 buharin joined
buharin hey guys 19:08
:)
[Coke] o/
19:09 pyrimidine joined
cognominal anyway, jnthn++ for writing all this code. A pleasure to read once we get it :) 19:10
19:13 pyrimidine left 19:15 canopus left, pyrimidine joined 19:16 chris2_ joined 19:17 zakharyas left
pyrimidine odd, there is definitely a timed drop in access to IRC on my end (about every 15 minutes I get a disconnect) 19:21
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:22
19:23 canopus joined
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:23
[Coke] people are screaming? 19:30
AlexDaniel ok-ok fair point 19:31
jonadab screaming is a trap 19:33
19:34 Tonik joined, darutoko left 19:39 cdg left 19:41 lostinfog joined, lostinfog left 19:43 domidumont joined, labster joined 19:44 chris2_ is now known as chris2
viki Well, to be fair I *was* screaming about the -1² "trap" :) 19:48
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)␤»
mspo m: say -1² 19:54
camelia rakudo-moar c196af: OUTPUT«-1␤»
mspo m: say -1**2 19:55
camelia rakudo-moar c196af: OUTPUT«-1␤»
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…
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
viki AlexDaniel: well, 50% of people can't solve 4 + 5 * 6 + (4/5*3) right either.
^ another child left behind.
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
camelia rakudo-moar c196af: OUTPUT«WARNINGS for <tmp>:␤Useless use of "**" in expression "(-1)**2" in sink context (line 1)␤»
AlexDaniel viki: I was assuming that people I was asking could solve it, but… fair enough
viki The trap is people suck at math.
mspo m: say (-1)**2
geekosaur kyclark, last I heard nobody had time
camelia rakudo-moar c196af: OUTPUT«1␤»
mspo hey there you go
moritz perl5.git.perl.org/perl.git/commit...1ae28bb103 # p5 gets a form of indented heredocs
viki mst: ^ glad to watch p5 catching up ;) We steal both ways :) 19:58
kyclark Maybe I should make time. I see this: github.com/timo/iperl6kernel
Is that timotimo?
viki kyclark: yes
geekosaur yes, yes, and incomplete/nonworking as I understand it
AlexDaniel viki: by the way, how is -Inf thing going?
mspo haskell does the same thing
kyclark If I were feeling so bold, would that be a good starting point?
geekosaur haskell's unary minus is a well known multiple trap though 19:59
kyclark, he was begging for someone to pick it up a couple weeks ago :)
mst viki: too right
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…
kyclark I'm sure this is well above my skill level, but I'll try to bang my head against it for a bit
mst viki: I just wish we'd stolen smartmatch after you completely redesigned it, not before 20:00
mspo AlexDaniel: (-1)**2 is 1
AlexDaniel: isn't it just that the '-' in '-1' is being evaluated at the wrong time?
geekosaur mst, pretty sure you did. I was confused as to why the older one got in instead of the newer one
viki AlexDaniel: I'll answer with a visual aid: i.imgur.com/pCPU4CC.png
AlexDaniel viki: aw, that sucks :)
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)
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
viki mspo: -1² = -1 by rules of mathematics.
mst I really don't knpw
AlexDaniel mspo: no, not really
geekosaur (was trying to implement the file test operator smartmatches in pugs)
mspo is -1 special vs -2?
viki mspo: no
mspo: power operations are higher precedence than subtraction.
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
viki I even recall teachers scamming students by asking to solve "simple" equations like f(x) = -y⁴
And waiting for them to mess up the order of operations
mspo is there a paper I can read somewhere?
mst geekosaur: but bear in mind 5.10 had been in development for quite a while
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 canopus left
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 :)
AlexDaniel I don't think that powers are actualy part of 3rd grade, but…
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...
mspo ic
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: www.mathfox.com/learn/powers-expone...-children/
mspo: I'd bet $5 it'd be in a Russian math book :) 20:06
mspo viki: probably
moritz :-)
mspo viki: US math books no longer use numbers or regular math problems
just poorly explained word problems
which read like they were written by russian TA's 20:07
viki :o
mspo (not kidding)
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
20:08 canopus joined
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>
viki *thought
stmuk 20:09
ops
geekosaur (granting that when I was in college, it was still rather difficult for people to get out of russia...) 20:10
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
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
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
awwaiid ya
for polyglotness
20:18 domidumont left
timotimo food, yay 20:18
dalek k-simple: 2f31fd3 | RabidGravy++ | lib/GTK/Simple/DrawingArea.pm6:
need GTK::Simple::ConnectionHandler

May address #69
20:20
20:27 rurban left 20:28 espadrine joined 20:30 nadim joined, nadim_ left 20:34 ggoebel joined
stmuk twitter.com/briandfoy_perl 20:35
viki that cover is so dull 20:36
20:38 FROGGS left 20:42 Praise joined 20:47 ufobat left 20:50 Lucas_One left
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:56
20:57 Tonik left
RabidGravy ACCEPTS 20:57
kyclark Thanks! 20:58
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
camelia rakudo-moar 26e351: OUTPUT«「AA」␤»
RabidGravy m: class DNA { multi method ACCEPTS(Str $f) { so $f ~~ /AA/ }; }; say "AACTAG" ~~ DNA.new
camelia rakudo-moar 26e351: OUTPUT«True␤»
RabidGravy m: class DNA { multi method ACCEPTS(Str $f) { so $f ~~ /AA/ }; }; say "BBCTAG" ~~ DNA.new 21:00
camelia rakudo-moar 26e351: OUTPUT«False␤»
RabidGravy obviously adjusting to taste :)
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
tbrowder ilmari, i understand, and am in the process of renaming before release...
21:03 cdg joined 21:04 MasterDuke_ left 21:07 canopus left
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:08
21:09 Lucas_One joined
viki I think you need to override .new instead. You can try fail()ing and see what that looks like 21:10
lizmat kyclark: if you are in BUILD, the object already exists 21:11
otherwise you wouldn't be a able to set attributes :-)
kyclark Ah, is there a place to intervene earlier then?
viki method new
lizmat kyclark: what viki said 21:12
create your own .new, and only call self.bless(%named) if you're sure
kyclark Is it a "method" or a "submethod" then? BUILD has to be submethod, right?
viki method new is a method 21:13
right BUILD is a submethod, so if you subclass your object, it still gets called 21:14
21:15 canopus joined, pyrimidine left, labster left 21:16 labster joined, pyrimidine joined 21:17 buharin left 21:20 canopus left 21:22 pyrimidine left
kyclark Are there docs/examples for overriding "new"? What should I return? 21:22
Calling "fail" seems to do what I expect/want.
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)␤»
lizmat m: class A { method new(*%_) { Bool.pick ?? self.bless(|%_) !! fail "duh" } }; dd A.new
camelia rakudo-moar 26e351: OUTPUT«Failure.new(exception => X::AdHoc.new(payload => "duh"), backtrace => Backtrace.new)␤»
lizmat m: class A { method new(*%_) { Bool.pick ?? self.bless(|%_) !! fail "duh" } }; dd A.new
camelia rakudo-moar 26e351: OUTPUT«A.new␤»
21:25 pyrimidine joined
lizmat s/Bool.pick/ your logic / :-) 21:25
kyclark: ^^^
kyclark Ah, I didn't know I needed the "|" before the args to "bless" -- that's a Slip, right?
lizmat yep 21:26
it converts the hash back into named arguments
although technically in that context it isn't a slip, but that really doesn't matter
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?
lizmat in the Str case, it's "value" afaik
m: dd Str.new(value => "foo")
camelia rakudo-moar 26e351: OUTPUT«"foo"␤»
kyclark Is there a way to get "DNA.new($str);" to work? 21:28
lizmat sure: 21:29
21:29 canopus joined, pyrimidine left 21:30 harmil_wk joined
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:31 espadrine left 21:32 toolforger1 joined 21:33 TEttinger left 21:36 setty1 left
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
21:36 setty1 joined 21:37 pyrimidine joined
kyclark Ah, I figured it out. Needed to put CATCH inside a try block. 21:40
21:41 wamba left, pyrimidine left
lizmat kyclark: that works but isn't needed 21:42
21:43 pyrimidine joined
kyclark OK, what's a better way? 21:43
Here's what I have: pastie.org/10962373
[Coke] -a- block is needed.
21:44 ocbtec left
geekosaur (or, more precisely, a *scope* is needed. a block is the easiest way to get that scope) 21:44
[Coke] geekosaur++ 21:45
21:48 toolforger1 left, jonas2 left 21:49 pecastro left
kyclark If I remove my "try" block then my CATCH isn't caught. I just get a raw "Failure". 21:52
21:52 canopus left 21:54 kurahaupo left
jnthn Note that `try` blocks also fatalize failures that are returned 21:56
So there is a difference between a bare block with a CATCH and a try block with a CATCH.
21:56 bjz_ left 21:57 skids left 21:59 canopus joined 22:06 xstan joined, xstan left 22:08 xstan joined, xstan left 22:10 xstan joined, xstan left
kyclark Is there a way around this? 22:11
jnthn A way around what?
kyclark m: my $meth = 'chars'; put 'foo'.$meth;
camelia rakudo-moar 26e351: OUTPUT«No such method 'CALL-ME' for invocant of type 'Str'␤ in block <unit> at <tmp> line 1␤␤»
jnthn Oh, I thought it was about try/CATCH :P
.$meth means "call the code object in $meth"
22:12 xstan joined
jnthn ."$meth" is how you use $meth as a name 22:12
22:12 xstan left
jnthn m: my $meth = 'chars'; put 'foo'."$meth"() 22:12
camelia rakudo-moar 26e351: OUTPUT«3␤»
22:13 xstan joined, xstan left
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2016/11/14/...-cheaters/ 22:14
22:14 kurahaupo__ joined
kyclark Yep, ok, thanks. 22:16
22:17 RabidGravy left 22:21 bjz joined 22:22 canopus left 22:23 kurahaupo_ joined 22:24 kurahaupo_ left 22:25 kurahaupo__ left 22:29 canopus joined, kyclark left 22:30 bjz left, pyrimidine left 22:36 uvb joined 22:37 canopus left 22:46 canopus joined 22:47 setty1 left, diakopter joined 22:50 raiph joined 22:51 rurban joined
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:52
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) 22:57
TimToady we never confuse symbolic reference with hard reference in Perl 6; they always have different syntax 23:03
that was a Perl 5 mistake, which is why we don't do it :)
as a result, we never need 'use strict refs' 23:04
23:04 canopus left
TimToady thunk & 23:05
23:10 nicq20 joined, canopus joined 23:12 mohae_ joined
samcv lizmat, best part of the week :) 23:12
23:14 mohae left 23:19 canopus left 23:22 maybekoo2 left 23:26 canopus joined 23:27 pmurias left 23:33 firstdayonthejob left, canopus left 23:41 canopus joined
harmil_wk TimToady: Fair enough... which seems to point us in the direction of a warning... 23:46
23:51 skids joined, nicq20 left 23:53 canopus left, rindolf left