Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-10-11

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:00 mempko joined #perl6
00:05 bwisti joined #perl6
00:05 tardisx joined #perl6
00:07 kjk joined #perl6
00:07 mcmillhj joined #perl6
00:08 pilne joined #perl6
00:08 cdg joined #perl6
00:09 traxex joined #perl6
00:11 benchable6 joined #perl6
00:15 kjk it seems a captured group is lost when interpolating a variable into a regex:  p6: my $p = 'ab(.+)ef'; 'abcdef' ~~ rx/<{$p}>/; $/[0]
00:15 kjk p6: my $p = 'ab(.+)ef'; 'abcdef' ~~ rx/<{$p}>/; $/[0]
00:15 camelia rakudo-moar a72214: ( no output )
00:15 kjk p6: my $p = 'ab(.+)ef'; 'abcdef' ~~ rx/<{$p}>/; say $/[0]
00:15 camelia rakudo-moar a72214: OUTPUT: «Nil␤»
00:16 kjk p6: 'abcdef' ~~ rx/ab(.+)ef/; say $/[0]
00:16 camelia rakudo-moar a72214: OUTPUT: «「cd」␤»
00:16 kjk is that expected behavior?
00:18 rba joined #perl6
00:22 kyan joined #perl6
00:23 Cabanossi joined #perl6
00:23 Xliff m: my @a = <a b c de>; say @a.map( .tc );
00:23 camelia rakudo-moar a72214: OUTPUT: «No such method 'tc' for invocant of type 'Any'␤  in block <unit> at <tmp> line 1␤␤»
00:23 Xliff m: my @a = <a b c de>; say @a.map( *.tc );
00:23 camelia rakudo-moar a72214: OUTPUT: «(A B C De)␤»
00:23 MasterDuke p6: my $p = 'ab(.+)ef'; 'abcdef' ~~ rx/<$p>/; say $/[0]
00:23 camelia rakudo-moar a72214: OUTPUT: «Nil␤»
00:23 mcmillhj joined #perl6
00:26 BenGoldberg joined #perl6
00:26 kjk btw, what's the difference between  rx/<$p>/  vs   rx/<{$p}>/ ?
00:26 traxex joined #perl6
00:28 itaipu joined #perl6
00:28 MasterDuke <$p> should interpolate $p and interpret it as a regex
00:29 MasterDuke <{$p}> should run $p as code and match (i.e., proceed to the rest of the regex) based on what it evaluates to
00:30 kjk gotcha, thanks MasterDuke
00:30 MasterDuke if i remember correctly
00:30 kjk though I'm still puzzled why the captured group is lost
00:31 epony joined #perl6
00:31 MasterDuke hm, i might have that slightly wrong. <{ }> runs the code inside and then interpolates the result of that into the regex
00:31 rba_ joined #perl6
00:33 MasterDuke m: say "foo" ~~ /<{' o ** 2 '}>/
00:33 camelia rakudo-moar a72214: OUTPUT: «「oo」␤»
00:33 pilne i must again confess my lovehate of perl6 for ruining every other language out there for me...
00:34 pilne everything else feels like i'm fighting my brain to get code out in a way that appeases the runtime
00:34 pilne perl6 doesn't always do what I want, but it's my fault still at this point cuz i just guess based on what i've already learned 99% of the time :D
00:35 tushar p6: my $p = rx/ab(.+)ef/; 'abcdef' ~~ $p; say $/[0];
00:35 yoleaux 2 Oct 2016 12:31Z <perlawhirl> tushar: like this? https://gist.github.com/0racle/abbc0d2f7c7e8110abbd987aacc7a5f8
00:35 camelia rakudo-moar a72214: OUTPUT: «「cd」␤»
00:36 cdg joined #perl6
00:37 kjk p6: 'abcdef' ~~ rx/<{'ab(.+' ~ ')ef' }>/; say $/[0]
00:37 camelia rakudo-moar a72214: OUTPUT: «Nil␤»
00:39 mcmillhj joined #perl6
00:42 tushar @kjk.. can you please explain your regular expression pattern that you used in your last try? Also, can you please briefly explain what are you trying to achieve?
00:43 tushar If you merely try to capture a group of words.. your last example can be rewritten as p6: 'abcdef' ~~ rx/ab(.+)ef/; say $/[0]
00:43 tushar 'abcdef' ~~ rx/ab(.+)ef/; say $/[0]
00:43 tushar p6: 'abcdef' ~~ rx/ab(.+)ef/; say $/[0]
00:43 camelia rakudo-moar a72214: OUTPUT: «「cd」␤»
00:49 traxex joined #perl6
00:49 llfourn joined #perl6
00:50 ugexe m: "abcdef" ~~ rx/$<foo>=<{"ab(.+" ~ ")ef"}>/; say $/; # a named capture will get its 0 match set though...?
00:50 camelia rakudo-moar a72214: OUTPUT: «「abcdef」␤ foo => 「abcdef」␤  0 => 「cd」␤»
00:55 mcmillhj joined #perl6
00:57 MasterDuke committable6: releases "abcdef" ~~ rx/$<foo>=<{"ab(.+" ~ ")ef"}>/; say $/;
00:57 committable6 MasterDuke, ¦releases (23 commits): «「abcdef」␤ foo => 「abcdef」␤  0 => 「cd」»
01:07 Cabanossi joined #perl6
01:10 tushar joined #perl6
01:14 mcmillhj joined #perl6
01:16 traxex joined #perl6
01:16 bdmatatu joined #perl6
01:24 kjk joined #perl6
01:26 ryn1x joined #perl6
01:30 mcmillhj joined #perl6
01:32 kyan Hi, in a loop like for $code.split("", :skip-empty) -> $char { …, can I have it so the value is assigned to $char and $_, without having to separately write $_ = $char;?
01:40 MasterDuke kyan: i don't think that's possible
01:41 kyan MasterDuke: Ok, thanks! Figured I'd ask, since it might be hiding somewhere in all the cool features :)
01:41 audiatorix joined #perl6
01:42 audiatorix Hey folks
01:53 audiatorix how difficult would it be to change array/list deconstruction
01:53 bitrauser joined #perl6
01:53 audiatorix as it stands now, `my (@a, $b) = (1, 2), 3;` doesn't have the expected result
01:53 audiatorix I see why it doesn't, just wondering why that is how it is, or if there's no particular reason, how big of a change it would be
01:53 darkmorph joined #perl6
01:54 ilbot3 joined #perl6
01:54 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:03 mcmillhj joined #perl6
02:04 kjk left #perl6
02:15 haxmeister left #perl6
02:16 aindilis` joined #perl6
02:18 mcmillhj joined #perl6
02:20 agwind_ joined #perl6
02:22 Cabanossi joined #perl6
02:24 karthyk joined #perl6
02:36 mcmillhj joined #perl6
02:36 noganex_ joined #perl6
02:40 ufobat___ joined #perl6
02:43 Xliff m: my %h = ( a >= 1, b => 2, c => 3); my @a; @a.push: %h; @a.push: %h; dd @a;
02:43 camelia rakudo-moar a72214: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix >= instead␤at <tmp>:1␤------> 3my %h = ( a >=7⏏5 1, b => 2, c => 3); my @a; @a.push: %h;␤»
02:43 Xliff m: my %h = ( a => 1, b => 2, c => 3); my @a; @a.push: %h; @a.push: %h; dd @a;
02:43 camelia rakudo-moar a72214: OUTPUT: «Array @a = [{:a(1), :b(2), :c(3)}, {:a(1), :b(2), :c(3)}]␤»
02:44 Xliff m: my %h = ( a => 1, b => 2, c => 3); my %a; %a<a>.push: %h; %a<a>.push: %h; %h<b>.push: %h; dd %a;
02:44 camelia rakudo-moar a72214: OUTPUT: «Cannot resolve caller push(Int: Hash); none of these signatures match:␤    (Any:U \SELF: |values is raw)␤  in block <unit> at <tmp> line 1␤␤»
02:44 Xliff m: my %h = ( a => 1, b => 2, c => 3); my %a; %a<a>.push: %h; %a<a>.push: %h; %a<b>.push: %h; dd %a;
02:44 camelia rakudo-moar a72214: OUTPUT: «Hash %a = {:a($[{:a(1), :b(2), :c(3)}, {:a(1), :b(2), :c(3)}]), :b($[{:a(1), :b(2), :c(3)},])}␤»
02:47 simcop2387 joined #perl6
02:47 mcmillhj joined #perl6
02:54 jeek joined #perl6
02:59 mcmillhj joined #perl6
03:01 AlexDaniel- audiatorix: somehow I don't think there's a good well-thought-out reason why
03:01 AlexDaniel- audiatorix: in fact, I'd love to see a ticket for this, if there's no ticket already
03:01 AlexDaniel- audiatorix: *even if* it is supposed to be this way, I think it'd be a good idea to show a warning saying that $b is kinda useless there
03:02 AlexDaniel- and maybe with some clues on how to make that work
03:02 AlexDaniel- in fact, what the hell is this?
03:02 AlexDaniel- m: my ((@a), $b) = [1, 2], 3; dd @a; dd $b
03:02 camelia rakudo-moar a72214: OUTPUT: «Mu␤Int $b = 3␤»
03:03 AlexDaniel- ok we got $b right, but where did [1, 2] go?
03:06 AlexDaniel- I'd expect normal destructuring to work there
03:09 pilne m: my (@a, $b) = (1, 2), 3;
03:09 camelia rakudo-moar a72214: ( no output )
03:10 pilne m: my (@a, $b) = (1, 2), 3; say @a
03:10 camelia rakudo-moar a72214: OUTPUT: «[(1 2) 3]␤»
03:10 pilne i see it too, but it is definitely a "gotcha" unless i too am missing something
03:12 mcmillhj joined #perl6
03:13 BenGoldberg m: ((my @a), my $b) = (1, 2), 3; dd @a;
03:13 camelia rakudo-moar a72214: OUTPUT: «Array @a = [(1, 2), 3]␤»
03:14 BenGoldberg m: ((my @a), my $b) = [1, 2], 3; dd @a;
03:14 camelia rakudo-moar a72214: OUTPUT: «Array @a = [[1, 2], 3]␤»
03:14 pilne :m ((my @a), my $b = ((1, 2), 3; dd @a; dd $b;
03:14 AlexDaniel- I don't think there's anything missing
03:14 pilne did i blow it up?
03:14 AlexDaniel- one way or another, but it's a bug
03:14 pilne no i typod
03:14 pilne m: ((my @a), my $b = ((1, 2), 3; dd @a; dd $b;
03:14 camelia rakudo-moar a72214: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Cannot use variable $b in declaration to initialize itself␤at <tmp>:1␤------> 3(my @a), my $b = ((1, 2), 3; dd @a; dd $7⏏5b;␤    expecting any of:␤        argument list␤        term␤»
03:16 pilne m: my ((@a), $b) = ((1, 2), 3); dd @a; dd $b;
03:16 camelia rakudo-moar a72214: OUTPUT: «Mu␤Int $b = 3␤»
03:16 wamba joined #perl6
03:21 lucs joined #perl6
03:24 mcmillhj joined #perl6
03:35 Geth ¦ doc: W4anD0eR96++ created pull request #1600: Fix broken link to ACCEPTS
03:35 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1600
03:36 someuser joined #perl6
03:39 mcmillhj joined #perl6
03:44 Geth ¦ doc: 708d7ae73f | (Alex Wander)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
03:44 synopsebot Link: https://doc.perl6.org/language/operators
03:44 Geth ¦ doc: Fix broken link to ACCEPTS
03:44 Geth ¦ doc:
03:44 Geth ¦ doc: mentioned in #1599
03:44 Geth ¦ doc: review: https://github.com/perl6/doc/commit/708d7ae73f
03:44 Geth ¦ doc: dc6564869d | (Aleks-Daniel Jakimenko-Aleksejev)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
03:44 Geth ¦ doc: Merge pull request #1600 from W4anD0eR96/patch-3
03:44 Geth ¦ doc:
03:44 Geth ¦ doc: Fix broken link to ACCEPTS
03:44 Geth ¦ doc: review: https://github.com/perl6/doc/commit/dc6564869d
03:51 Cabanoss- joined #perl6
03:52 evalable6 joined #perl6
03:59 mcmillhj joined #perl6
04:07 duff joined #perl6
04:07 duff anyone here!?
04:08 duff I'm looking to learn Perl, and not sure if I should start learning Perl 5 or Perl6
04:08 duff Anyone have any advice?
04:09 duff I have programmed in python, java, C languages, pretty much everything else
04:10 TEttinger hi duff
04:10 duff Hi
04:10 AlexDaniel- duff: any project you have in mind? It really depends on what you are going to use it for
04:11 duff I don't know.  Perl seems like a fun language to code in.  Just looking to "learn perl", whatever that may mean.
04:11 TEttinger perl5 and perl6 are rather different languages, though both are good for text handling. perl 6 will do much better than perl 5 on Unicode-heavy text, like anything with emoji or non-English languages
04:11 duff Hobbyist
04:11 duff Ok
04:11 duff I'm pretty much tired of coding in python and looking for another language.  Ruby didn't do it for me.
04:12 TEttinger perl 6 has a powerful grammar system with few competitors in other areas
04:12 duff Thought I'd try perl, just trying to figure out if I should use Perl 5 and it's massive modules/library or go with the future.
04:12 TEttinger the grammars are one way that sub-languages can be built inside perl6, if that's an interest of yours
04:12 duff that sounds pretty cool actually
04:13 AlexDaniel- duff: well, technically use can use perl5 and python modules from perl6 via Inline::Perl5 and Inline::Python
04:13 duff Is 5 ever going to be deprecated?  Or will they split forever as two separate languages
04:13 mcmillhj joined #perl6
04:13 AlexDaniel- duff: they already did. These are two completely separate languages now
04:13 TEttinger I haven't used perl6 or perl5 enough to give a recommendation, though I did use some NQP (not quite perl) when I was trying to implement a language on the same VM as Perl 6
04:13 duff Ok
04:13 AlexDaniel- although similar in some ways
04:13 AlexDaniel- s/use/you/ :)
04:14 duff If you wanted to use a language to code in as your primary, over a number of years, would you go with 6?  Is it that much improved, or just "different".  Are there any major improvements in Perl6 that make it an absolute must?
04:14 pilne getting perl5 outta the core of linux distros will be even more painful than transitioning from python 2 to 3 was for most (all?) distros :D
04:14 duff I don't know Perl 5, so I don't know if Perl 6 is correcting mistakes or fixing bad design
04:14 AlexDaniel- duff: that's an interesting question to ask on #perl6 :)
04:14 pilne neither, it's fixing the growing pains of a scripting language becomming a general purpose language
04:14 someuser_ joined #perl6
04:15 duff Ok I see
04:15 pilne considering it's origins and what it has adapted to, perl5 is fucking incredible
04:15 duff I heard it's incredibly fast, and blows languages like python out of the water.  Is this true?
04:15 TEttinger no
04:15 pilne but perl6 took those experiences from developing perl5 (and looking at other languages), to make perl6
04:15 duff But has a steeper learning curve, so all those start-up babies choose an easier language like python
04:15 duff Ok
04:15 pilne perl5 can be quite fast, but just like to make fast python, yer getting into black magic
04:16 pilne perl6 is currently working on improving it's performance
04:16 TEttinger perl6 is getting faster as more people work on it
04:16 TEttinger it's a main goal
04:16 duff Is Perl6 complete enough to make serious projects with?  Is it stable enough?
04:16 duff Or still a long way out
04:16 duff ?
04:16 pilne it has a great architecture for achieving great speeds from what I can tell, it just needs some tweaking (that is completely outta my brain-level)
04:17 TEttinger I think the JIT compiler is less than excellent currently, but at least there is one, which python and lua default to not using (PyPy and LuaJIT are JIT compilers for python and Lua that do an amazing speedup)
04:17 AlexDaniel- duff: it is stable enough, but there are some rough edges here and there. Whether you're going to notice them or not really depends on what you're going to use it for
04:18 duff Ok, thanks guys.  I'm going to do some research and see which one really fits me.
04:18 duff Take care
04:18 TEttinger Ruby may have a JIT now? it may be why it isn't painfully slow parsing comments of all things
04:18 pilne there's no harm in learning both either :D espeically with inline::perl5
04:18 pilne i think they are working on a JIT based on eclipse ORM for ruby
04:19 piojo joined #perl6
04:19 pilne err eclipse OMR
04:19 pilne https://developer.ibm.com/open/2017/03/01/ruby-omr-jit-compiler-whats-next/
04:19 AlexDaniel- that was a really hard question actually. Someone comes and asks if they should use X or something you've put a lot of hours into
04:20 AlexDaniel- and go come up with an unbiased answer…
04:20 pilne i *love* working in perl6 for things i'm doing locally
04:20 pilne like, idgaf if it has spinup time personally
04:21 AlexDaniel- yoleaux: time
04:21 AlexDaniel- .time
04:21 AlexDaniel- argh
04:21 pilne i also *like* perl5, not as much as perl6, but a lot (: i've always kept my toes in it, ruby and python, without much preference for them, always "liked" reading good perl5 code the most out of them, i'm wierd though.
04:22 AlexDaniel- anyway, I think we have a stagnated build on docs.perl6.org
04:22 pilne but perl6 makes it very hard for me to "enjoy" the syntax/semantics of other languages
04:22 itaipu_ joined #perl6
04:22 AlexDaniel- yeah…
04:22 AlexDaniel- that's true
04:23 pilne and after way too many years dicking around with code in at least a half-dozen languages, i've come to really "respect" how much an enjoyable syntax/semantics matter in terms of my blood pressure (:
04:23 pilne i'm a hobbysit/dabbler by trade in programming
04:23 AlexDaniel- pilne: I feel you
04:24 wamba joined #perl6
04:24 pilne completely non-tech job for bills and health insurance (other than being the dude who they see if they can get to fix the computer problem without having to call our outsourced tech support, lol)l
04:25 AlexDaniel- ah ok, now it's updated!
04:25 pilne but yeah, perl6 is the first thing i've been stupidly excited by since i really started to understand what made lisps and haskell special (not that i'm any good in those languages,just the moment when what they are doing "clicked")
04:27 AlexDaniel- pilne: have you tried Prolog?
04:29 mcmillhj joined #perl6
04:30 pilne i have read some things about it
04:30 pilne never written code
04:33 AlexDaniel- pilne: it's a very enjoyable mind-bending thingie. Try it maybe :)
04:33 AlexDaniel- (not very practical though, but very fun)
04:34 AlexDaniel- m: my ((@a), $b) = [1, 2], 3; say @a.^name; dd $b
04:34 camelia rakudo-moar a72214: OUTPUT: «VMNull␤Int $b = 3␤»
04:34 AlexDaniel- right…
04:34 AlexDaniel- pilne: RT #126857
04:34 synopsebot RT#126857 [open]: https://rt.perl.org/Ticket/Display.html?id=126857 [BUG] Bogus array subsignature in declaration `my ([$a]);` binds variable to VMNull
04:36 piojo Does anyone here work on the MongoDB driver?
04:48 mcmillhj joined #perl6
04:49 kid51 joined #perl6
05:04 thou joined #perl6
05:06 Cabanossi joined #perl6
05:09 mcmillhj joined #perl6
05:15 Xal joined #perl6
05:23 wamba joined #perl6
05:24 mcmillhj joined #perl6
05:28 araujo joined #perl6
05:28 araujo joined #perl6
05:30 xtreak joined #perl6
05:36 mcmillhj joined #perl6
05:36 Cabanossi joined #perl6
05:51 andrzejku joined #perl6
05:51 mcmillhj joined #perl6
05:55 HoboWithAShotgun joined #perl6
05:55 domidumont joined #perl6
05:56 bdmatatu joined #perl6
06:00 domidumont joined #perl6
06:00 Wiertek joined #perl6
06:00 Piotr_ joined #perl6
06:02 someuser_ joined #perl6
06:04 domidumont joined #perl6
06:07 mcmillhj joined #perl6
06:21 mcmillhj joined #perl6
06:23 patrickz joined #perl6
06:27 xtreak joined #perl6
06:37 mcmillhj joined #perl6
06:45 darutoko joined #perl6
06:51 mcmillhj joined #perl6
06:53 nadim_ joined #perl6
06:54 wamba joined #perl6
07:00 lowbro joined #perl6
07:00 lowbro joined #perl6
07:01 jonas1 joined #perl6
07:01 pecastro joined #perl6
07:02 samebchase joined #perl6
07:06 samebchase left #perl6
07:06 aborazmeh joined #perl6
07:06 aborazmeh joined #perl6
07:06 xtreak joined #perl6
07:07 mcmillhj joined #perl6
07:08 samebchase joined #perl6
07:08 rurban joined #perl6
07:09 cdg joined #perl6
07:26 mcmillhj joined #perl6
07:30 abraxxa joined #perl6
07:30 cdg joined #perl6
07:39 mcmillhj joined #perl6
07:43 jsimonet joined #perl6
07:55 mcmillhj joined #perl6
08:02 curan joined #perl6
08:10 zakharyas joined #perl6
08:11 mcmillhj joined #perl6
08:16 dakkar joined #perl6
08:21 Cabanossi joined #perl6
08:23 piojo left #perl6
08:23 piojo joined #perl6
08:27 mcmillhj joined #perl6
08:36 xtreak joined #perl6
08:37 kerframil joined #perl6
08:44 mcmillhj joined #perl6
08:57 mcmillhj joined #perl6
09:00 robertle joined #perl6
09:02 parv joined #perl6
09:04 wamba joined #perl6
09:05 xtreak joined #perl6
09:06 rgrau joined #perl6
09:14 Aaronepower joined #perl6
09:18 epony joined #perl6
09:24 xtreak_ joined #perl6
09:27 traxex_ joined #perl6
09:28 xtreak joined #perl6
09:39 traxex joined #perl6
09:45 someuser joined #perl6
09:46 cdg joined #perl6
09:52 traxex joined #perl6
09:52 varada joined #perl6
09:58 tyil I dont work on it, but I have a project using it
10:03 rba joined #perl6
10:05 eliasr joined #perl6
10:05 steeznson joined #perl6
10:06 buggable New CPAN upload: Config-1.2.2.tar.gz by TYIL https://cpan.metacpan.org/authors/id/T/TY/TYIL/Perl6/Config-1.2.2.tar.gz
10:12 Aaronepower joined #perl6
10:19 margeas joined #perl6
10:29 leont joined #perl6
10:33 dustinm` joined #perl6
10:38 piojo tyil: what's your experience? Does it work well?
10:39 tyil it gets the job done, it lets me put stuff in a database :p
10:39 tyil https://github.com/scriptkitties/perl6-Shinrin/blob/master/lib/Shinrin/Controllers/V1.pm6 this file does some inserting into MongoDB
10:40 tyil my only remaining issue with it was that I cant find any clear doc on how to insert a proper timestamp
10:54 araujo joined #perl6
10:55 piojo tyil: you mean an arbitrary time, or a "last modified" timestamp for data modifications?
10:58 tyil either, I can store a timestamp as a string just fine, but MongoDB supports storing them as ISODate objects too
10:58 bdmatatu joined #perl6
11:00 piojo tyil: I haven't looked at what it's doing under the hood, but I did successfully translate the mongodb example about inserting a last-modified timestamp as you change the data:
11:01 piojo my BSON::Document $req .= new: ( update => 'users', updates => [ ( q => (guid => $user,), u => ('$set' => (:meaning(42),), '$currentDate' => (lastModified => True),),), ],);
11:01 tyil interesting
11:04 Spot__ joined #perl6
11:04 lumimies joined #perl6
11:06 skaji joined #perl6
11:16 melezhik joined #perl6
11:20 W4RL0RD joined #perl6
11:29 traxex_ joined #perl6
11:30 HoboWithAShotgun joined #perl6
11:31 Grrrr joined #perl6
11:35 salva0 joined #perl6
11:43 atroxaper joined #perl6
11:46 pmurias joined #perl6
11:47 Aaronepower joined #perl6
11:53 Geth ¦ ecosystem: Tyil++ created pull request #374: Remove App::MPD::AutoQueue, now available on CPAN
11:53 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/pull/374
11:53 Geth ¦ ecosystem: 1f6dd69e98 | (Patrick Spek)++ | META.list
11:53 Geth ¦ ecosystem: Remove App::MPD::AutoQueue, now available on CPAN
11:53 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/1f6dd69e98
11:53 Geth ¦ ecosystem: c5fca77d50 | (Patrick Spek)++ (committed using GitHub Web editor) | META.list
11:53 Geth ¦ ecosystem: Merge pull request #374 from Tyil/master
11:53 Geth ¦ ecosystem:
11:53 Geth ¦ ecosystem: Remove App::MPD::AutoQueue, now available on CPAN
11:53 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/c5fca77d50
11:59 jameslenz joined #perl6
12:03 xtreak joined #perl6
12:06 teatime oh, I just realized... there could totally be a module to generate bash/zsh completions, for users who use the getopt-like MAIN stuff
12:09 Aaronepower joined #perl6
12:12 bdmatatu joined #perl6
12:13 rindolf joined #perl6
12:15 Aaronepower joined #perl6
12:15 ChoHag joined #perl6
12:20 void1 joined #perl6
12:24 * [Coke] finds a weird issue where he is using proc::async to ssh -t to a box to test something, then using Test to say ok/not ok.... the output starts getting indented so that each line is indented to where the last one ended.
12:24 timotimo you're getting \n without \r but your terminal is set to not go back to beginning of line without \r?
12:27 [Coke] taking test out of it, if I dd the test names, I see the same behavior. each line indented 4 more. weird.
12:28 [Coke] (and I have to run stty sane)
12:30 [Coke] guessing it's an interaction between proc async and ssh -t
12:30 traxex joined #perl6
12:31 Aaronepower joined #perl6
12:34 [Coke] Yup. (I need the -t for the interaction with the remote server, but that's what triggers the terminal weirdness.)
12:35 timotimo mhm
12:38 [Coke] oh, sweet, I can rewrite the test a smidge to not need the -t. :)
12:39 pilne joined #perl6
12:44 zakharyas joined #perl6
12:49 traxex joined #perl6
12:49 Aaronepower joined #perl6
12:52 wamba joined #perl6
12:54 pilne ok, so rakudobrew is out the window, which version is currently reccomended for "people playing with the language"? 2017.7?
12:54 mcmillhj joined #perl6
12:55 [Coke] compiler only, then whatever the latest monthly release is
12:55 [Coke] which is every month, so 2017.09
12:56 [Coke] I believe the common wisdom regarding rakudobrew is that if you do choose to use it, don't do "rakudo build nom" unless you wipe it out first
12:56 [Coke] but if you do individual releases, that's fine. I've been bit by the "build nom" thing more than once.
13:00 cdg joined #perl6
13:01 traxex_ joined #perl6
13:01 raschipi joined #perl6
13:06 Geth joined #perl6
13:07 pilne ty, and i take it the general way to run zef is installed to userland and not as root?
13:10 wamba joined #perl6
13:12 piojo pilne: yes, zef installs itself. so zef is installed the same way it installs all the other modules
13:12 piojo but be ready to "rm -r ~/.zef" several times per hour if you're using it a lot. It's not that reliable.
13:13 piojo (Or maybe that's just on windows)
13:13 traxex joined #perl6
13:18 pilne tyvm
13:18 xtreak joined #perl6
13:22 pilne while this is hardly a "painful" install, hopefully something like rakudobrew can be made to work sometime down the line, tools like that are nice for managing environments (:
13:25 HoboWithAShotgun m: say √4
13:25 camelia rakudo-moar 714c18: OUTPUT: «5===SORRY!5===␤Argument to "say" seems to be malformed␤at <tmp>:1␤------> 3say7⏏5 √4␤Bogus postfix␤at <tmp>:1␤------> 3say 7⏏5√4␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        s…»
13:25 HoboWithAShotgun hey i am disappointed
13:26 stmuk_ joined #perl6
13:28 ryn1x_ joined #perl6
13:38 Aaronepower joined #perl6
13:44 rba joined #perl6
13:44 piojo pilne: oops, I misread what you wrote--zef is usually *not* run as root
13:44 piojo never mind, I just misread twice. I guess it's time to log off!
13:45 piojo left #perl6
13:59 raschipi .
14:01 mempko joined #perl6
14:07 [Coke] :
14:13 ruoso____ joined #perl6
14:14 timotimo huh, what's wrong with the perl6 syntax checker atom package?
14:14 timotimo /bin/sh: scl: line 1: syntax error: unexpected end of file /bin/sh: error importing function definition for `BASH_FUNC_scl' /bin/sh: module: line 1: syntax error: unexpected end of file /bin/sh: error importing function definition for `BASH_FUNC_module'
14:17 dogbert2 joined #perl6
14:26 buggable New CPAN upload: TimeUnit-0.1.0.tar.gz by ATROXAPER https://cpan.metacpan.org/authors/id/A/AT/ATROXAPER/Perl6/TimeUnit-0.1.0.tar.gz
14:27 atroxaper My first...
14:27 pilne ty (:
14:27 raschipi atroxaper: gimme repo link...
14:28 atroxaper Oh... Forget link it in readme... https://github.com/atroxaper/p6-TimeUnit/blob/master/README.md
14:29 raschipi atroxaper: make it accept named arguments, so we can do (:42seconds)
14:30 atroxaper Like NANOSECONDS.from(:42minutes) ?
14:32 raschipi The upper case letters also look like a code smaell.
14:32 raschipi They are usually used in Perl6 to mean something unusual is going on, so it looks like very out of place in your interface
14:32 raschipi smell*
14:33 raschipi Are you copying this interface from somewhere?
14:33 atroxaper I'm a Java developer :) It is like Java TimeUnit. I'm used to it.
14:34 kerframil timotimo: possibly related: https://github.com/atom/atom/issues/13733. as a side-note, launching sh where bash-specific features are used (BASH_FUNC_* indicates the use of a function exported by way of the environment) could backfire badly where /bin/sh is something other than bash.
14:34 atroxaper raschipi: It's like Java constants. Hm... Do you think 'all-lower-letters' are better?
14:35 skids joined #perl6
14:35 raschipi In debian /bin/sh is very likely to be /bin/dash, and on FreeBSD it's /bin/tcsh
14:37 raschipi atroxaper: We call 'all-lower-letters' kebab-case and it's the usual way of doing it in Perl6. If you do something differenty than that people will spend time trying to figure out why and then get angry because there's no reason. So you should use it.
14:38 timotimo kerframil: oh yeah, i've had KDE plasma unable to start up because my login shell is fish
14:39 atroxaper raschipi: I just see that https://docs.perl6.org/language/5to6-nutshell#constant (DEBUG). Of course I fully agreed about community code style. I will fix it. Thanks.
14:40 kerframil timotimo: that's sad
14:40 timotimo it is!
14:40 timotimo i've followed the advice of #fedora-kde and changed shells to bash and just set konsole to launch fish for me
14:40 kerframil probably blind sourcing of shell code, rather than executing it in the actually-targetted shell. or something like that.
14:41 timotimo and/or missing hashbang
14:42 raschipi It should be possible to set login shell to Powershell or Rc, yet these bugs where scripts don't specify the shell they need are common.
14:42 timotimo i remember a big period where things were broken on ubuntu preview versions because they turned /bin/sh into dash
14:44 mcmillhj joined #perl6
14:44 kerframil indeed. I'm glad they did it. sh means sh, the Shell Command Language. no one should have any expectations beyond that.
14:45 kerframil a shakedown was overdue, in my opinion
14:46 raschipi In Debian and it's alternatives the link is configurable, so it might be dash or bash, varying by system. So the testing is ongoing.
14:48 timotimo i'm also glad
14:48 Geth ¦ doc/master: 7 commits pushed by (Luca Ferrari)++, (Rafael Schipiura)++
14:48 Geth ¦ doc/master: 643f6a421b | Add a short introduction to subroutines and precedence dropping.
14:48 Geth ¦ doc/master: d8165a797d | Remove extra blank lines and git conflict headers.
14:48 Geth ¦ doc/master: 2194934a16 | Correct missing plural on "subroutine".
14:48 Geth ¦ doc/master: 3d15e5e74f | Correct mispelled "invoking".
14:48 Geth ¦ doc/master: 8edfab10f0 | Fix mispelled "yield".
14:48 Geth ¦ doc/master: 69d7951fc5 | Align '#' comments in block of code example.
14:48 HoboWithAShotgun joined #perl6
14:48 Geth ¦ doc/master: 135102b394 | Merge pull request #1594 from fluca1978/method-precedence-drop
14:48 Geth ¦ doc/master: review: https://github.com/perl6/doc/compare/dc6564869d...135102b394
14:48 ryn1x__ joined #perl6
14:51 raschipi Of course the fix everywhere bashisms were used was just to change the shebang, so in the end it didn't make much difference.
14:54 raschipi I mean it didn't make much difference regarding the original objective of the change, which was to use a faster shell.
14:55 darkmorph joined #perl6
14:55 kerframil too bad, as there are some great linting tools these days. shellcheck, for instance.
14:58 raschipi shellsheck is a pain fo me to use because it doesn't know about assossiative arrays and complains about every use saying  I shouldn't do math, so any useful output gets complety buried in the shaff, because I use assossiative arrays extensivley
15:01 kerframil it should know all about associative arrays, as long as a bash-targetting shebang is present. that makes sense, as associative arrays are obviously not a feature of sh.
15:03 ryn1x__ joined #perl6
15:03 raschipi Executed it again, every time I use the assossiatives I get "SC2102: Ranges can only match single chars (mentioned due to duplicates)." You know how to fix that?
15:03 kerframil hmm. can you pastebin a test case?
15:04 * AlexDaniel- is also interested
15:06 kyan joined #perl6
15:08 raschipi I will, just a sec.
15:12 traxex_ joined #perl6
15:17 darkmorph joined #perl6
15:17 raschipi Oh, the errors I was getting went away after an update, it's fixed. That error I pointed above is unrelated and I should actually fix that.
15:18 kyan m: sub foo( --> Nil) { say "blah" }
15:18 camelia rakudo-moar a0f29e: ( no output )
15:18 raschipi I didn't test the new version because I was on vacation, only saw the update in my computer at home.
15:18 kyan m: sub foo(--> Nil Str $var) { say "$var" }
15:18 camelia rakudo-moar a0f29e: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Malformed return value (return constraints only allowed at the end of the signature)␤at <tmp>:1␤------> 3sub foo(--> Nil 7⏏5Str $var) { say "$var" }␤»
15:19 cognominal joined #perl6
15:19 kyan (aha, this has been fixed since the version I have installed! It was saying "Type 'Nil' is not declared", which I had a feeling was a mistake.)
15:20 leont joined #perl6
15:24 AlexDaniel- kyan: \o/
15:24 AlexDaniel- didn't really expect anyone to notice that fix so fast :)
15:28 mson joined #perl6
15:29 telex joined #perl6
15:33 geekosaur joined #perl6
15:33 atroxaper raschipi: do you like so https://github.com/atroxaper/p6-TimeUnit ? :)
15:34 kerframil raschipi: cool
15:35 raschipi 'beep-after(5, hours)' should be 'beep-after(:5hours)', I think.
15:35 kerframil raschipi: if you do find any bugs, though, let the maintainer know. he's a decent fella.
15:36 atroxaper raschipi: beep-after(5, hours) is not my code. it is a sample how you can write your code with time-unit
15:36 raschipi kerframil: I will, thanks for the help.
15:38 traxex joined #perl6
15:39 wamba joined #perl6
15:43 raschipi atroxaper: The way I would do  Perl6 interface like that would be
15:44 mcmillhj joined #perl6
15:44 raschipi m: multi beep-after(:$minutes) { say "$minutes minutes" }; multi beep-after(:$seconds) { say "$seconds seconds" }; beep-after(:5minutes); beep-after(:3seconds);
15:44 camelia rakudo-moar a0f29e: OUTPUT: «5 minutes␤3 seconds␤»
15:44 timotimo but then you can't just combine it! :)
15:47 atroxaper sub beep-after($time, TimeUnit $unit) { sleep(seconds.from($time, $unit); beep(); }; beep-after(5, minutes);
15:47 atroxaper I think is good enough, no?
15:48 atroxaper beep-after($minutes, minutes), yes ^^
15:54 bwisti joined #perl6
15:56 kyan m: my $a = 'b'; $_ := $a; sub foo() { say $a =:= $_; }; foo;
15:56 camelia rakudo-moar a0f29e: OUTPUT: «False␤»
15:57 kyan How can I make a sub inherit $_ from the enclosing block?
15:59 kyan (Replacing $_ with $b in that snippet, and putting "my " in front of the first instance, is inherited by the sub.)
16:00 moritz kyan: it inherits the value in $_, but not the container
16:00 moritz you can access $OUTER::_ I guess, but please don't write to it
16:00 moritz that's generally bad API design in Perl 6
16:01 moritz m: my $a = 'b'; $_ := $a; sub foo() { say $a =:= $OUTER::_; }; foo;
16:01 camelia rakudo-moar a0f29e: OUTPUT: «True␤»
16:01 kyan Ok, thanks!
16:04 zakharyas joined #perl6
16:05 kyan It would be nice to be able to use the "given" keyword with sub declarations, something like sub foo() given $? { ...
16:05 moritz what would that do?
16:06 buggable New CPAN upload: TimeUnit-0.1.1.tar.gz by ATROXAPER https://cpan.metacpan.org/authors/id/A/AT/ATROXAPER/Perl6/TimeUnit-0.1.1.tar.gz
16:08 kyan Erm, s/$?/$_ in my example. I'm thinking, since "given" sets $_ for a batch of "when" statements, it could set $_ for the sub to whatever it was set to in the caller...
16:08 kyan Could also write sub foo() given "a" { ... to have $_ set to "a" in the sub
16:09 moritz kyan: or you can just write  sub foo($_) { ... }
16:10 moritz and have $_ set to the parameter that was passed to the sub
16:10 kyan That requires it to be specified on each call to foo, though. It's nice to be able to write "foo;" without any parens or arguments to call it
16:11 ggoebel joined #perl6
16:12 moritz that's not how Perl 6 does things
16:12 moritz we are a bit more explicit about when we pass $_ to subs or methods
16:12 moritz so that people don't have to keep a list of things in their head of which function works on $_ and which doesn't
16:13 moritz which works pretty well in the core language
16:13 kyan Heh, fair enough. I guess I'm just too used to Bash, where functions mostly inherit the current state :P
16:13 kyan Thanks!
16:15 kyan (Is there a document somewhere that describes the differences between $_ and a "normal" variable, btw? I feel like that might help me out...)
16:16 troys joined #perl6
16:16 raschipi $_ is a normal variable...
16:16 ShalokShalom_ joined #perl6
16:16 kyan Normal variables seem to get inherited by subs, though, whereas $_ doesn't — I feel like there might be a conceptual distinction I'm missing?
16:17 moritz kyan: both normal variables and $_ are inherited from the outer scope, though not from the caller
16:17 timotimo many blocks get their own $_
16:17 timotimo m: say (-> { say "hi" }).perl
16:17 camelia rakudo-moar a0f29e: OUTPUT: «->  { #`(Block|50214056) ... }␤»
16:17 timotimo m: say ({ say "hi" }).perl
16:17 camelia rakudo-moar a0f29e: OUTPUT: «-> ;; $_? is raw { #`(Block|55969136) ... }␤»
16:18 moritz m: my $a = 42; $_ = 23; sub f() { say (:$a, :$_).perl }; f(); { my $a = 1; my $_ = 2; f() }
16:18 camelia rakudo-moar a0f29e: OUTPUT: «Potential difficulties:␤    Redeclaration of symbol '$_'␤    at <tmp>:1␤    ------> 3$a, :$_).perl }; f(); { my $a = 1; my $_7⏏5 = 2; f() }␤(:a(42), :_(Any))␤(:a(42), :_(Any))␤»
16:18 timotimo there, it has an optional $_ argument
16:19 kyan Oh, I think I get what you mean, it's like it's a normal variable but entering a sub creates a new $_ in the sub's scope?
16:19 moritz be careful in the sub vs. block distinction
16:20 moritz m: sub f($a) { }; say &f.signature.perl
16:20 camelia rakudo-moar a0f29e: OUTPUT: «:($a)␤»
16:20 moritz no magic with $_ afaict
16:21 Wiertek joined #perl6
16:21 kyan Hmm. I guess I'll just keep working on the code and see if it becomes clear. (Sorry I'm kinda slow on the draw.) Thanks for your help! :)
16:26 kent\n joined #perl6
16:28 zakharyas joined #perl6
16:29 raschipi kyan: What happens is that blocks that don't have any other signature will have just one parameter, called $_
16:30 kyan Ohhhhh! I see. Thanks :D
16:30 HoboWithAShotgun how di create a sequence using an arbitrary code block to build the next item
16:30 ugexe m: my $block = { $^a + $^b }; say $block(1, 2)
16:30 camelia rakudo-moar a0f29e: OUTPUT: «3␤»
16:31 HoboWithAShotgun again, i saw that in a video
16:31 wander joined #perl6
16:31 ugexe map or gather/take would both work
16:32 wamba joined #perl6
16:32 wander m: $_ = 42; { .say }
16:32 camelia rakudo-moar a0f29e: OUTPUT: «42␤»
16:32 HoboWithAShotgun i am trying to get this
16:32 HoboWithAShotgun gather { take $seed;  until f($seed) < 1e-5 { take $seed = g($seed); }
16:32 jnthn m: say (1, 1, -> $a, $b { $a + $b } ... *)[^10]
16:32 camelia rakudo-moar a0f29e: OUTPUT: «(1 1 2 3 5 8 13 21 34 55)␤»
16:32 wander m: { .say }("hi")
16:32 camelia rakudo-moar a0f29e: OUTPUT: «hi␤»
16:32 HoboWithAShotgun into a sequence, but i am stuck at $seed ... ^0
16:33 HoboWithAShotgun i dont know how to put the function in there
16:33 HoboWithAShotgun basically the +1
16:34 jnthn Maybe something like: $seed, &g ... { f($_) < 1e-5 }
16:36 rba_ joined #perl6
16:36 * jnthn wanders home...bbl
16:36 wander m: my $seed = 0; sub g($seed) { $seed + 1 }; sub f($seed) { e**(-$seed) }; say  $seed, &g ... { f($_) < 1e-5 };
16:36 camelia rakudo-moar a0f29e: OUTPUT: «(0 1 2 3 4 5 6 7 8 9 10 11 12)␤»
16:38 HoboWithAShotgun ah, nah.
16:38 raschipi m: my $seed = 127; say my @a = $seed, {$_ %% 2 ?? $_/2 !! $_*3+1} ... 4
16:38 camelia rakudo-moar a0f29e: OUTPUT: «[127 382 191 574 287 862 431 1294 647 1942 971 2914 1457 4372 2186 1093 3280 1640 820 410 205 616 308 154 77 232 116 58 29 88 44 22 11 34 17 52 26 13 40 20 10 5 16 8 4]␤»
16:38 HoboWithAShotgun i think the original syntax is clearer
16:38 ugexe m: my $seed = 0; my $a := gather { take $seed; until $seed > 10 { take $seed = ($seed + 1) } }; say $a.perl
16:38 camelia rakudo-moar a0f29e: OUTPUT: «(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11).Seq␤»
16:38 HoboWithAShotgun that's what i have ugexe
16:39 robertle joined #perl6
16:39 ugexe but mine works, and you have f($seed) and g($seed)
16:39 ugexe e.g. maybe thats where your problem is
16:41 HoboWithAShotgun yes, i want the series of f1(x) until f(2(x) reaches a treshold
16:42 raschipi syntax error
16:42 kent\n joined #perl6
16:46 rba joined #perl6
16:48 ugexe m: say 1e-5.Int
16:48 camelia rakudo-moar a0f29e: OUTPUT: «0␤»
16:51 kyan What's the right way to write a variable declaration of a List of Pairs? (e.g. my List $foo; versus my List of Pairs $foo)
16:51 ugexe list cant be typed
16:52 kyan Oh, interesting.
16:52 ugexe well, parameterized according to the error message.
16:53 kyan What's the right way to write something that acts kinda like that, but only lets pairs in? ;P
16:54 kyan (making a subset of List I'd think might work (?) but seems like the wrong way to do it...)
16:54 ugexe my Pair @a;
16:54 kyan Oh! Ok. That's... surprisingly simple. Thanks!
16:55 ugexe note its an array, not a list though
16:56 kyan Cool, I'm not totally clear on the difference but I suspect that problem can be resolved by reading the docs :) Thanks!
16:58 mienaikage !p6mod bang on DuckDuckGo is now live
17:03 zakharyas joined #perl6
17:05 atroxaper left #perl6
17:17 domidumont joined #perl6
17:25 Geth ¦ doc: fluca1978++ created pull request #1601: Fix "head2" POD title section.
17:25 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1601
17:26 imcsk8 joined #perl6
17:27 Geth ¦ doc: 2a56726229 | (Luca Ferrari)++ | doc/Language/syntax.pod6
17:27 Geth ¦ doc: Fix "head2" POD title section.
17:27 Geth ¦ doc:
17:27 Geth ¦ doc: That was my fault on PR merged by commit 135102b39481aa.
17:27 Geth ¦ doc: There was an extra space between "head" and "2" leading to
17:27 synopsebot Link: https://doc.perl6.org/language/syntax
17:27 Geth ¦ doc: the wrong rendering of the section title.
17:27 Geth ¦ doc: review: https://github.com/perl6/doc/commit/2a56726229
17:27 Geth ¦ doc: 263c847f17 | Altai-man++ (committed using GitHub Web editor) | doc/Language/syntax.pod6
17:27 Geth ¦ doc: Merge pull request #1601 from fluca1978/method-precedence-drop
17:27 Geth ¦ doc:
17:27 Geth ¦ doc: Fix "head2" POD title section.
17:27 Geth ¦ doc: review: https://github.com/perl6/doc/commit/263c847f17
17:33 ryn1x__ joined #perl6
17:51 Cabanossi joined #perl6
17:56 W4RL0RD joined #perl6
18:04 Geth ¦ doc: W4anD0eR96++ created pull request #1602: [WIP] Try to fix intro of non-string keys of Hash
18:04 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1602
18:15 kurahaupo joined #perl6
18:18 rindolf mienaikage: nice
18:18 timotimo cool!
18:26 HoboWithAShotgun joined #perl6
18:34 mcmillhj joined #perl6
18:35 evalable6 joined #perl6
18:37 Ven joined #perl6
18:39 Aaronepower joined #perl6
18:46 mcmillhj joined #perl6
18:55 setty1 joined #perl6
18:57 pmurias m: ("foo" => 10000000000000000000).BagHash.grab(1)
18:57 camelia rakudo-moar a0f29e: OUTPUT: «Cannot unbox 64 bit wide bigint into native integer␤  in block <unit> at <tmp> line 1␤␤»
18:57 pmurias ^^ seems like a bug?
19:12 Geth ¦ doc: fb1c89b28e | (David Warring)++ | doc/Language/nativecall.pod6
19:12 Geth ¦ doc: document newly introduced pointer increment and array referencing
19:12 Geth ¦ doc: review: https://github.com/perl6/doc/commit/fb1c89b28e
19:12 synopsebot Link: https://doc.perl6.org/language/nativecall
19:13 geekosaur I think that's in a class of known bugs?
19:15 evalable6 joined #perl6
19:15 Geth ¦ doc: 927ddba17a | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Failure.pod6
19:15 Geth ¦ doc: Fix typo
19:15 Geth ¦ doc: review: https://github.com/perl6/doc/commit/927ddba17a
19:15 synopsebot Link: https://doc.perl6.org/type/Failure
19:15 audiatorix AlexDaniel-: any idea where the logic for destructuring lies?
19:17 AlexDaniel- pmurias: yes, seems like a bug
19:17 AlexDaniel- pmurias: please rakudobug if there's no ticket already
19:23 AlexDaniel- audiatorix: I think it depends on what you're looking for exactly. There are some bits and pieces in different places. Here for example: https://github.com/rakudo/rakudo/blob/25c87d0d1c343d60644f84d04dae865357731bc5/src/Perl6/Actions.nqp#L5024-L5031
19:24 AlexDaniel- audiatorix: if you grep for sub-signature and maybe even subsignature you'll find some relevant pieces
19:24 audiatorix Thanks
19:31 raschipi joined #perl6
19:32 johnjohn101 joined #perl6
19:33 raschipi mienaikage++ ddg++
19:36 smls joined #perl6
19:37 smls m: role R { multi method a (:$r!) { "R" } };  class A does R { multi method a { "A" } };  say A.new.a(:r)
19:37 camelia rakudo-moar 25c87d: OUTPUT: «R␤»
19:37 smls m: role R { multi method a (:$r!) { "R" } };  class A does R { multi method a (:$a) { "A" } };  say A.new.a(:r)
19:37 camelia rakudo-moar 25c87d: OUTPUT: «A␤»
19:37 smls ^^ bug?
19:39 Rawriful joined #perl6
19:41 AlexDaniel- smls: maybe not. I think both multies fit your arguments, and it makes sense that A is called first
19:41 mr-foobar joined #perl6
19:42 smls AlexDaniel-: In the first version, both multies also fit the arguments.
19:43 AlexDaniel- smls: oh…
19:43 smls AlexDaniel-: And isn't  :$r!  a more specific fit for argument :r, than an implicit  *%_  ?
19:45 AlexDaniel- smls: maybe you're right
20:00 aindilis joined #perl6
20:05 epony joined #perl6
20:17 cdg joined #perl6
20:21 stmuk joined #perl6
20:31 cdg_ joined #perl6
20:54 HoboWithAShotgun i just learned about the WHY keyword. but that's a special case right? i mean i can't somehow access arbitrary comments via introspection
20:57 timotimo no, only pod comments that are attached to things
20:57 timotimo i.e. #| or #= comments
20:57 stmuk_ joined #perl6
20:58 tyil is pod in perl 6 the same as in perl 5? I should start learning it and use it in my code
20:59 timotimo a bit different
20:59 Wiertek joined #perl6
20:59 tyil alright, I'll make sure to attach "perl 6" to any pod-related query as well :p
21:00 raschipi You can search for 'pod6'
21:03 tyil is there a utility to compile pod6 into a manpage?
21:03 raschipi Yes, perl6
21:04 tyil how would I invoke it to compile the pod6 from a perl script?
21:05 TEttinger joined #perl6
21:05 raschipi Use the --doc option.
21:05 tyil nvm, it was lower on the page
21:06 tyil I should read before asking simple stuff ;~;
21:07 raschipi There's no problem with that, it's fine.
21:07 ChoHag joined #perl6
21:09 HoboWithAShotgun m: my @a = <1 2 3>; say @a.grep( * ~~ "2" );
21:09 camelia rakudo-moar 5d3ebc: OUTPUT: «(2)␤»
21:10 HoboWithAShotgun m: my @a = <1 2 3>; say @a.grep( *.Int ~~ 2 );
21:10 camelia rakudo-moar 5d3ebc: OUTPUT: «Cannot use Bool as Matcher with '.grep'.  Did you mean to use $_ inside a block?␤  in block <unit> at <tmp> line 1␤␤»
21:10 HoboWithAShotgun why is this? why doesn't this dwim?
21:11 HoboWithAShotgun m: my @a = <1 2 3>; say @a.grep( *.Int == 2 );
21:11 camelia rakudo-moar 5d3ebc: OUTPUT: «(2)␤»
21:11 HoboWithAShotgun argh
21:11 HoboWithAShotgun m: say "2" ~~ 2
21:11 camelia rakudo-moar 5d3ebc: OUTPUT: «True␤»
21:12 raschipi m: my @a = <1 2 3>; say @a.grep( {.Int ~~ 2} );
21:12 camelia rakudo-moar 5d3ebc: OUTPUT: «(2)␤»
21:12 geekosaur I thought this was a listed/known trap
21:12 HoboWithAShotgun yeah i know
21:12 raschipi HoboWithAShotgun: It does exactly what you mean, you just meant the wrong thing.
21:13 HoboWithAShotgun bo it's still odd. if *.Int ~~ 2, and 2 ~~ "2", then *.Int must ~~ "2" too
21:14 geekosaur 'every dwim comes with a wat'
21:14 gfldex HoboWithAShotgun: that may be your opinion but the 2 .ACCEPT methods you are calling seam not to agree
21:15 geekosaur iirc here the 'wat' ends up being even more confusing; this case 'works' but others become incomprehensible
21:15 AlexDaniel- soooo… if you want it to DWIM, then…
21:15 AlexDaniel- m: my @a = <1 2 3>; say @a.grep( 2 ~~ *.Int );
21:15 camelia rakudo-moar 5d3ebc: OUTPUT: «(2)␤»
21:15 raschipi m: ( *.Int ~~ 2  ).WHAT;  ( *.Int == 2  ).WHAT;
21:15 camelia rakudo-moar 5d3ebc: ( no output )
21:15 AlexDaniel- this seems to work?
21:15 raschipi m: say ( *.Int ~~ 2  ).WHAT,  ( *.Int == 2  ).WHAT;
21:15 camelia rakudo-moar 5d3ebc: OUTPUT: «(Bool)(WhateverCode)␤»
21:15 AlexDaniel- geekosaur: so what's the DWIM here then?
21:16 HoboWithAShotgun gdflex: there is no flaw in my argument. if x = y and y = z then z = x
21:16 HoboWithAShotgun and if perl thinks otherwise then perl is wrong
21:16 geekosaur raschipi just showed it, I think. the ~~ 'consumes' the WhateverCode
21:16 geekosaur in effect it's using thw WhateverCode smartmatcher instead of the Int smartmatcher
21:17 geekosaur but if you make it not do that then there are other cases you expect WhateverCode to smartmatch that won't
21:17 cognominal joined #perl6
21:17 AlexDaniel- for example?
21:17 HoboWithAShotgun yeah, *. onward :) thx for the explanation
21:18 geekosaur I am struggling to remember this whole thing, I do recall I think TimToady explaining it at some point
21:19 gfldex ~~ on a Callable matches on the boolean result of invocation
21:19 geekosaur possibly something like using 'given' to match types?
21:19 raschipi HoboWithAShotgun: Smartmatch is explicitly NOT commutative
21:19 HoboWithAShotgun best to stay away from *, unless for when you are sure what you do
21:19 geekosaur ^
21:19 AlexDaniel- is it this? https://docs.perl6.org/language/traps#Topicalizing_Operators
21:19 geekosaur er. I meat for raschipi's remark
21:20 AlexDaniel- nah, not really
21:20 AlexDaniel- but the same “flip to LHS” remark applies
21:20 raschipi G'night people.
21:20 gfldex m: my @a = <1 2 3>; my $result = { "2" }.().Bool; say @a.grep( $result ~~ 2 );
21:20 geekosaur a ~~ b can't mean the same thing as b ~~ a, because it has to pick one side to invoke .ACCEPTS on
21:20 camelia rakudo-moar 5d3ebc: OUTPUT: «Cannot use Bool as Matcher with '.grep'.  Did you mean to use $_ inside a block?␤  in block <unit> at <tmp> line 1␤␤»
21:22 geekosaur if nothing else, that error message tries hard but is still LTA
21:23 geekosaur and, aaargh. yes, I think gfldex has the right of it; it's not WhateverCode per se, it's that the closure produced by WhateverCode is a Callable
21:24 HoboWithAShotgun m: ( * * * * *)(1 2 3)
21:24 camelia rakudo-moar 5d3ebc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)␤at <tmp>:1␤------> 3( * * * * *)(17⏏5 2 3)␤    expecting any of:␤        infix␤   …»
21:24 HoboWithAShotgun m: say ( * * * * *)(1 2 3)
21:24 camelia rakudo-moar 5d3ebc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)␤at <tmp>:1␤------> 3say ( * * * * *)(17⏏5 2 3)␤    expecting any of:␤        infix…»
21:25 geekosaur and you can't automatically 'promote' the closure to include the smartmatch without breaking something else? so it applies immediately matching the Callable, and you have therefore applied the immediate result of that as the grep expression
21:25 HoboWithAShotgun m: say sub { * * * * * }(1 2 3)
21:25 camelia rakudo-moar 5d3ebc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)␤at <tmp>:1␤------> 3say sub { * * * * * }(17⏏5 2 3)␤    expecting any of:␤        in…»
21:27 gfldex m: say { * * * * * }.(|(1 2 3))
21:27 camelia rakudo-moar 5d3ebc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Malformed double closure; WhateverCode is already a closure without curlies, so either remove the curlies or use valid parameter syntax instead of *␤at <tmp>:1␤------> 3say { * * * * * }7⏏5.(|(1 2…»
21:27 HoboWithAShotgun say ( * * * * * )(1, 2, 3)
21:27 evalable6 HoboWithAShotgun, rakudo-moar 5d3ebc09b: OUTPUT: «6»
21:27 HoboWithAShotgun say ( * * * * *)(1, 2, 3)
21:27 evalable6 HoboWithAShotgun, rakudo-moar 5d3ebc09b: OUTPUT: «6»
21:28 HoboWithAShotgun oh i forgot the commas abbove
21:39 HoboWithAShotgun m: sub f($x) { $x+1 }; my $x = 1; say ($x, f($x), f(*) ... 10)
21:39 camelia rakudo-moar 5d3ebc: OUTPUT: «Cannot resolve caller Numeric(Whatever: ); none of these signatures match:␤    (Mu:U \v: *%_)␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
21:40 HoboWithAShotgun sub f($x) { $x+1 }; my $x = 1; say (1, 2, 3 ... 10)
21:41 HoboWithAShotgun m: say "ustillthere?";
21:41 camelia rakudo-moar 5d3ebc: OUTPUT: «ustillthere?␤»
21:43 HoboWithAShotgun m: say (1, 2, 3 ... 10)
21:43 camelia rakudo-moar 5d3ebc: OUTPUT: «(1 2 3 4 5 6 7 8 9 10)␤»
21:48 AlexDaniel- HoboWithAShotgun: I created this: https://github.com/perl6/doc/issues/1603
21:48 AlexDaniel- HoboWithAShotgun: re “ustillthere”, you forgot “m:”
21:54 HoboWithAShotgun yeah i know :)
21:54 HoboWithAShotgun how do you do aspect orientation in perl6?
21:57 Xliff m: say '}' ~~ / '}'
21:57 camelia rakudo-moar de564a: OUTPUT: «5===SORRY!5===␤Regex not terminated.␤at <tmp>:1␤------> 3say '}' ~~ / '}'7⏏5<EOL>␤Unable to parse regex; couldn't find final '/'␤at <tmp>:1␤------> 3say '}' ~~ / '}'7⏏5<EOL>␤    expecting any of:␤        infix stopper␤  …»
21:57 Xliff m: say '}' ~~ / '}' /
21:57 camelia rakudo-moar de564a: OUTPUT: «「}」␤»
21:57 Xliff m: say '{' ~~ / '{' /
21:57 camelia rakudo-moar de564a: OUTPUT: «「{」␤»
21:57 Xliff m: say '{' !~~ / '{' /
21:57 camelia rakudo-moar de564a: OUTPUT: «False␤»
22:03 pilne joined #perl6
22:04 epony joined #perl6
22:05 epony joined #perl6
22:11 domidumont joined #perl6
22:16 HoboWithAShotgun can you have custom traits?
22:17 timotimo yup!
22:19 cdg joined #perl6
22:19 HoboWithAShotgun and what can you do with it? can i have it so that I say "my $var is debug" and have it do something wheneber something happens to that variable, like getting assigned to
22:22 timotimo i think you'll need to use a proxy for that purpose
22:22 timotimo rather than a trait
22:22 HoboWithAShotgun same for subs :)
22:22 timotimo that's easier
22:24 geekosaur hm. can a trait wrap a variable in a Proxy?
22:25 geekosaur or, I guess, replace it with
22:25 HoboWithAShotgun yes, reading what a proxy is, that is what's needed apparently
22:26 HoboWithAShotgun cause if you have calls to that in your code you're better off explicity printing the variable
22:26 timotimo m: multi sub trait_mod:<is>(Variable:D $self is raw: :replaced!) { $self = my Str $ }; my Int $test is replaced; $test = "hi";
22:26 camelia rakudo-moar de564a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Can only use the : invocant marker in the signature for a method␤at <tmp>:1␤------> 3rait_mod:<is>(Variable:D $self is raw: :7⏏5replaced!) { $self = my Str $ }; my Int ␤»
22:26 timotimo m: multi sub trait_mod:<is>(Variable:D $self is raw, :replaced!) { $self = my Str $ }; my Int $test is replaced; $test = "hi";
22:26 camelia rakudo-moar de564a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3rait_mod:<is>(Variable:D $self is raw, :7⏏5replaced!) { $self = my Str $ }; my Int ␤»
22:27 timotimo m: multi sub trait_mod:<is>(Variable:D $self is raw, :$replaced!) { $self = my Str $ }; my Int $test is replaced; $test = "hi";
22:27 camelia rakudo-moar de564a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Cannot assign to an immutable value␤at <tmp>:1␤»
22:27 timotimo m: multi sub trait_mod:<is>(Variable:D $self is rw, :$replaced!) { $self = my Str $ }; my Int $test is replaced; $test = "hi";
22:27 camelia rakudo-moar de564a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Can't use unknown trait 'is replaced' in a variable declaration.␤at <tmp>:1␤------> 3f = my Str $ }; my Int $test is replaced7⏏5; $test = "hi";␤    expecting any of:␤        TypeObject␤    …»
22:27 timotimo not like that clearly
22:28 johnjohn101 left #perl6
22:29 HoboWithAShotgun i'm not a debugger person. what i'd love to have would be some nice way to make the program print debugging information without cluttering the code with print statements
22:30 HoboWithAShotgun could you maybe make it so these pod comments be printed as they occur?
22:30 HoboWithAShotgun possibly interpolated in the right scope?
22:30 timotimo you mean like "use trace"? :)
22:31 timotimo someone started work on active comments or something like that
22:31 timotimo where you'd put more # in a row and when the "comment output level" is higher than the number of # then the code gets run
22:31 HoboWithAShotgun thats neat!
22:32 timotimo i'm not sure how far they got or what it's called
22:32 HoboWithAShotgun TBD ...
22:33 timotimo i can't find it on the modules page
22:36 leont joined #perl6
22:38 HoboWithAShotgun multi sub trait_mod:<is>(Variable:D $self is raw: :smaller!) { $self = --$self }; my Int $test is smaller=10; $test.say;
22:38 HoboWithAShotgun m: multi sub trait_mod:<is>(Variable:D $self is raw: :smaller!) { $self = --$self }; my Int $test is smaller=10; $test.say;
22:38 camelia rakudo-moar 4b8a0e: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Can only use the : invocant marker in the signature for a method␤at <tmp>:1␤------> 3rait_mod:<is>(Variable:D $self is raw: :7⏏5smaller!) { $self = --$self }; my Int $t␤»
22:39 HoboWithAShotgun i have no idea what i'm doing :)
22:39 timotimo yeah, has to be a , instead of the : after raw
22:39 timotimo and the "is raw" is the part that doesn't work
22:39 timotimo but be aware that traits are applied at compile time, as soon as the name is parsed
22:39 timotimo so the "= 10" will not be known at the point your trait is run
22:39 HoboWithAShotgun m: multi sub trait_mod:<is>(Variable:D $self is raw, :smaller!) { $self = --$self }; my Int $test is smaller=10; $test.say;
22:39 camelia rakudo-moar 4b8a0e: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3rait_mod:<is>(Variable:D $self is raw, :7⏏5smaller!) { $self = --$self }; my Int $t␤»
22:40 HoboWithAShotgun ah allright
22:40 timotimo yes, needs to have a $ there
22:41 HoboWithAShotgun m: multi sub trait_mod:<is>(Variable:D $self is raw, :smaller!) { say $self }; my Int $test is smaller=10;
22:41 camelia rakudo-moar 4b8a0e: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3rait_mod:<is>(Variable:D $self is raw, :7⏏5smaller!) { say $self }; my Int $test is␤»
22:41 timotimo m: multi sub trait_mod:<is>(Variable:D $self is raw, :$smaller!) { say $self }; my Int $test is smaller=10;
22:41 camelia rakudo-moar 4b8a0e: OUTPUT: «Variable.new(name => "\$test", scope => "my", var => Int, block => -> gnatur { #`(Block|59330296) ... }, slash => Perl6::Grammar.new() #`[140477191271040])␤»
22:41 HoboWithAShotgun better rtfm :)
22:42 HoboWithAShotgun where do i find this?
22:44 timotimo uhhh, hmm
22:46 mattp_ joined #perl6
22:48 timotimo i mean, you can look at the classes like Variable and the other traits that exist
22:48 timotimo it's all in rakudo/src/core/
22:48 mson joined #perl6
22:48 mattp_ joined #perl6
22:49 Aaronepower joined #perl6
22:54 leont joined #perl6
22:59 Herby_ joined #perl6
22:59 Herby_ \o
23:04 HoboWithAShotgun lol. "In general this requires solving the halting problem, which even Perl 6 compiler writers have trouble with."
23:05 HoboWithAShotgun from the docs about wantarray
23:07 HoboWithAShotgun .tell zoffix i saw your video ( https://www.youtube.com/watch?v=paa3niF72Nw ), that was very enjoyable. why not make a few more?
23:07 yoleaux HoboWithAShotgun: I'll pass your message to zoffix.
23:08 timotimo zoffix has been encouraging people to give a talk at the torronto perl mongers via hangouts or similar
23:09 timotimo inviting i guess?
23:15 BenGoldberg joined #perl6
23:20 cdg_ joined #perl6
23:20 pilne when using nativecall, does the c code execute at (near?)c-speeds? or is it a glue functionality (and not a hotspot eliminator?)
23:22 epony joined #perl6
23:25 leont joined #perl6
23:28 geekosaur it's glue
23:29 pilne ty
23:34 timotimo the glue recently got improved to make it thinner
23:35 timotimo you can compare speeds between the last monthly release and current development version of rakudo
23:35 timotimo if you have some nativecall-heavy benchmark
23:35 * timotimo signs off
23:37 pilne naahhhh i was just curious, all this dev stuff really is over my head, i'm just a huge fanboy/cheerleader (:
23:43 b2gills .tell kyan `.split("", :skip-empty)` is better written as `.comb()`
23:43 yoleaux b2gills: I'll pass your message to kyan.
23:56 evalable6 joined #perl6

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

Perl 6 | Reference Documentation | Rakudo