»ö« 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:00 mempko joined 00:01 mcmillhj left 00:05 traxex left, bwisti joined, tardisx joined 00:07 kjk joined, mcmillhj joined 00:08 pilne joined, cdg joined 00:09 traxex joined 00:11 benchable6 left, benchable6 joined, ChanServ sets mode: +v benchable6 00:12 cdg_ left, mcmillhj left 00:13 cdg left
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
p6: my $p = 'ab(.+)ef'; 'abcdef' ~~ rx/<{$p}>/; $/[0]
camelia ( no output )
kjk p6: my $p = 'ab(.+)ef'; 'abcdef' ~~ rx/<{$p}>/; say $/[0]
camelia Nil
kjk p6: 'abcdef' ~~ rx/ab(.+)ef/; say $/[0] 00:16
camelia 「cd」
kjk is that expected behavior?
00:18 rba joined 00:20 rba_ left 00:21 traxex left, Cabanossi left 00:22 kyan joined 00:23 Cabanossi joined
Xliff m: my @a = <a b c de>; say @a.map( .tc ); 00:23
camelia No such method 'tc' for invocant of type 'Any'
in block <unit> at <tmp> line 1
Xliff m: my @a = <a b c de>; say @a.map( *.tc );
camelia (A B C De)
MasterDuke p6: my $p = 'ab(.+)ef'; 'abcdef' ~~ rx/<$p>/; say $/[0]
camelia Nil
00:23 mcmillhj joined 00:25 rgrau left 00:26 BenGoldberg joined
kjk btw, what's the difference between rx/<$p>/ vs rx/<{$p}>/ ? 00:26
00:26 traxex joined, mempko left 00:28 itaipu joined
MasterDuke <$p> should interpolate $p and interpret it as a regex 00:28
<{$p}> should run $p as code and match (i.e., proceed to the rest of the regex) based on what it evaluates to 00:29
00:29 mcmillhj left
kjk gotcha, thanks MasterDuke 00:30
MasterDuke if i remember correctly
kjk though I'm still puzzled why the captured group is lost
00:31 epony joined
MasterDuke hm, i might have that slightly wrong. <{ }> runs the code inside and then interpolates the result of that into the regex 00:31
00:31 rba_ joined
MasterDuke m: say "foo" ~~ /<{' o ** 2 '}>/ 00:33
camelia 「oo」
pilne i must again confess my lovehate of perl6 for ruining every other language out there for me...
00:33 rba left
pilne everything else feels like i'm fighting my brain to get code out in a way that appeases the runtime 00:34
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
tushar p6: my $p = rx/ab(.+)ef/; 'abcdef' ~~ $p; say $/[0]; 00:35
yoleaux 2 Oct 2016 12:31Z <perlawhirl> tushar: like this? gist.github.com/0racle/abbc0d2f7c7...7aacc7a5f8
camelia 「cd」
00:36 cdg joined 00:37 margeas left
kjk p6: 'abcdef' ~~ rx/<{'ab(.+' ~ ')ef' }>/; say $/[0] 00:37
camelia Nil
00:37 traxex left 00:39 mcmillhj joined 00:40 cdg left
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:42
00:42 troys is now known as troys_
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
'abcdef' ~~ rx/ab(.+)ef/; say $/[0]
p6: 'abcdef' ~~ rx/ab(.+)ef/; say $/[0]
camelia 「cd」
00:44 mcmillhj left 00:49 traxex joined, llfourn joined
ugexe m: "abcdef" ~~ rx/$<foo>=<{"ab(.+" ~ ")ef"}>/; say $/; # a named capture will get its 0 match set though...? 00:50
camelia 「abcdef」
foo => 「abcdef」
0 => 「cd」
00:55 mcmillhj joined
MasterDuke committable6: releases "abcdef" ~~ rx/$<foo>=<{"ab(.+" ~ ")ef"}>/; say $/; 00:57
committable6 MasterDuke, ¦releases (23 commits): «「abcdef」␤ foo => 「abcdef」␤ 0 => 「cd」»
00:59 tushar left 01:04 mcmillhj left 01:05 Cabanossi left 01:07 Cabanossi joined 01:08 kjk left 01:10 tushar joined, traxex left 01:11 eroux left 01:13 troys_ is now known as troys 01:14 mcmillhj joined 01:16 traxex joined, bdmatatu joined 01:19 mcmillhj left 01:24 kjk joined 01:26 ryn1x joined 01:30 mcmillhj joined
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:32
01:37 mcmillhj left
MasterDuke kyan: i don't think that's possible 01:40
kyan MasterDuke: Ok, thanks! Figured I'd ask, since it might be hiding somewhere in all the cool features :) 01:41
01:41 audiatorix joined
audiatorix Hey folks 01:42
how difficult would it be to change array/list deconstruction
01:42 bitrauser joined
audiatorix as it stands now, `my (@a, $b) = (1, 2), 3;` doesn't have the expected result 01:43
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:44
01:44 darkmorph joined 01:46 ilbot3 left, bitrauser_ left 01:48 leont left 01:49 mcmillhj joined 01:54 ilbot3 joined, ChanServ sets mode: +v ilbot3 01:55 mcmillhj left 01:59 kerframil left 02:03 mcmillhj joined 02:04 kjk left 02:05 eliasr left 02:07 mcmillhj left 02:12 ngaywood left 02:15 haxmeister left, tushar left 02:16 aindilis` joined 02:17 aindilis left 02:18 bdmatatu left, mcmillhj joined 02:20 dj_goku left, agwind_ joined, Cabanossi left 02:21 karthyk left 02:22 Cabanossi joined 02:24 karthyk joined, agwind left 02:28 mcmillhj left 02:36 mcmillhj joined, noganex_ joined 02:39 noganex left 02:40 ufobat___ joined 02:41 mcmillhj left 02:43 simcop2387 left
Xliff m: my %h = ( a >= 1, b => 2, c => 3); my @a; @a.push: %h; @a.push: %h; dd @a; 02:43
camelia 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;
Xliff m: my %h = ( a => 1, b => 2, c => 3); my @a; @a.push: %h; @a.push: %h; dd @a;
camelia Array @a = [{:a(1), :b(2), :c(3)}, {:a(1), :b(2), :c(3)}]
02:43 ufobat_ left
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 Cannot resolve caller push(Int: Hash); none of these signatures match:
(Any:U \SELF: |values is raw)
in block <unit> at <tmp> line 1
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;
camelia Hash %a = {:a($[{:a(1), :b(2), :c(3)}, {:a(1), :b(2), :c(3)}]), :b($[{:a(1), :b(2), :c(3)},])}
02:45 troys is now known as troys_ 02:47 simcop2387 joined, mcmillhj joined 02:52 mcmillhj left 02:54 jeek joined 02:59 mcmillhj joined
AlexDaniel- audiatorix: somehow I don't think there's a good well-thought-out reason why 03:01
audiatorix: in fact, I'd love to see a ticket for this, if there's no ticket already
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
and maybe with some clues on how to make that work 03:02
in fact, what the hell is this?
m: my ((@a), $b) = [1, 2], 3; dd @a; dd $b
camelia Mu
Int $b = 3
AlexDaniel- ok we got $b right, but where did [1, 2] go? 03:03
03:03 mcmillhj left 03:04 mson left, Herby_ left
AlexDaniel- I'd expect normal destructuring to work there 03:06
pilne m: my (@a, $b) = (1, 2), 3; 03:09
camelia ( no output )
pilne m: my (@a, $b) = (1, 2), 3; say @a 03:10
camelia [(1 2) 3]
pilne i see it too, but it is definitely a "gotcha" unless i too am missing something
03:12 mcmillhj joined
BenGoldberg m: ((my @a), my $b) = (1, 2), 3; dd @a; 03:13
camelia Array @a = [(1, 2), 3]
BenGoldberg m: ((my @a), my $b) = [1, 2], 3; dd @a; 03:14
camelia Array @a = [[1, 2], 3]
pilne :m ((my @a), my $b = ((1, 2), 3; dd @a; dd $b;
AlexDaniel- I don't think there's anything missing
pilne did i blow it up?
AlexDaniel- one way or another, but it's a bug
pilne no i typod
m: ((my @a), my $b = ((1, 2), 3; dd @a; dd $b;
camelia 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
pilne m: my ((@a), $b) = ((1, 2), 3); dd @a; dd $b; 03:16
camelia Mu
Int $b = 3
03:16 wamba joined 03:17 mcmillhj left 03:21 lucs joined 03:24 mcmillhj joined 03:28 mcmillhj left
Geth doc: W4anD0eR96++ created pull request #1600:
Fix broken link to ACCEPTS
03:35
03:36 someuser joined 03:39 mcmillhj joined 03:43 someuser left
Geth doc: 708d7ae73f | (Alex Wander)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
Fix broken link to ACCEPTS

mentioned in #1599
03:44
synopsebot Link: doc.perl6.org/language/operators
Geth doc: dc6564869d | (Aleks-Daniel Jakimenko-Aleksejev)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
Merge pull request #1600 from W4anD0eR96/patch-3

Fix broken link to ACCEPTS
03:46 darkmorph left 03:48 mcmillhj left 03:51 Cabanossi left, Cabanoss- joined, Cabanoss- is now known as Cabanossi, evalable6 left 03:52 evalable6 joined, ChanServ sets mode: +v evalable6 03:59 mcmillhj joined 04:00 wamba left 04:03 mcmillhj left 04:07 duff joined
duff anyone here!? 04:07
I'm looking to learn Perl, and not sure if I should start learning Perl 5 or Perl6 04:08
Anyone have any advice?
I have programmed in python, java, C languages, pretty much everything else 04:09
TEttinger hi duff 04:10
duff Hi
AlexDaniel- duff: any project you have in mind? It really depends on what you are going to use it for
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
duff Hobbyist
Ok
I'm pretty much tired of coding in python and looking for another language. Ruby didn't do it for me.
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.
TEttinger the grammars are one way that sub-languages can be built inside perl6, if that's an interest of yours
duff that sounds pretty cool actually
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
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
duff Ok
AlexDaniel- although similar in some ways
s/use/you/ :)
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
duff I don't know Perl 5, so I don't know if Perl 6 is correcting mistakes or fixing bad design
AlexDaniel- duff: that's an interesting question to ask on #perl6 :)
pilne neither, it's fixing the growing pains of a scripting language becomming a general purpose language
04:14 someuser_ joined
duff Ok I see 04:15
pilne considering it's origins and what it has adapted to, perl5 is fucking incredible
duff I heard it's incredibly fast, and blows languages like python out of the water. Is this true?
TEttinger no
pilne but perl6 took those experiences from developing perl5 (and looking at other languages), to make perl6
duff But has a steeper learning curve, so all those start-up babies choose an easier language like python
Ok
pilne perl5 can be quite fast, but just like to make fast python, yer getting into black magic
perl6 is currently working on improving it's performance 04:16
TEttinger perl6 is getting faster as more people work on it
it's a main goal
duff Is Perl6 complete enough to make serious projects with? Is it stable enough?
Or still a long way out
?
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)
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
duff Ok, thanks guys. I'm going to do some research and see which one really fits me. 04:18
Take care
04:18 mcmillhj left, duff left
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
i think they are working on a JIT based on eclipse ORM for ruby
04:19 piojo joined, someuser_ left
pilne err eclipse OMR 04:19
developer.ibm.com/open/2017/03/01/...hats-next/
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
and go come up with an unbiased answer… 04:20
pilne i *love* working in perl6 for things i'm doing locally
like, idgaf if it has spinup time personally
AlexDaniel- yoleaux: time 04:21
.time
argh
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.
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
AlexDaniel- yeah… 04:22
that's true
04:23 itaipu left
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
i'm a hobbysit/dabbler by trade in programming
AlexDaniel- pilne: I feel you
04:24 wamba joined
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:24
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")
AlexDaniel- pilne: have you tried Prolog? 04:27
04:29 mcmillhj joined 04:30 BenGoldberg left
pilne i have read some things about it 04:30
never written code
04:33 itaipu_ left
AlexDaniel- pilne: it's a very enjoyable mind-bending thingie. Try it maybe :) 04:33
(not very practical though, but very fun)
04:34 troys_ is now known as troys
AlexDaniel- m: my ((@a), $b) = [1, 2], 3; say @a.^name; dd $b 04:34
camelia VMNull
Int $b = 3
AlexDaniel- right…
pilne: RT #126857
synopsebot RT#126857 [open]: rt.perl.org/Ticket/Display.html?id=126857 [BUG] Bogus array subsignature in declaration `my ([$a]);` binds variable to VMNull
04:35 wamba left
piojo Does anyone here work on the MongoDB driver? 04:36
04:37 mcmillhj left 04:48 mcmillhj joined, troys left 04:49 kid51 joined 04:53 kyan left 04:56 mcmillhj left 05:03 Cabanossi left 05:04 thou joined 05:06 Cabanossi joined 05:09 mcmillhj joined 05:11 pilne left 05:14 Xal left 05:15 mcmillhj left, Xal joined 05:23 wamba joined 05:24 mcmillhj joined 05:27 araujo left 05:28 araujo joined 05:29 mcmillhj left 05:30 xtreak joined 05:33 Cabanossi left 05:34 thou left 05:36 mcmillhj joined, Cabanossi joined 05:40 mcmillhj left 05:48 kid51 left 05:50 bwisti left 05:51 andrzejku joined, mcmillhj joined 05:53 HoboWithAShotgun left 05:55 HoboWithAShotgun joined, domidumont joined 05:57 bdmatatu joined 05:59 domidumont left, mcmillhj left 06:00 domidumont joined, Wiertek joined, Piotr_ joined 06:02 someuser_ joined, bdmatatu left 06:04 domidumont left, domidumont joined 06:07 mcmillhj joined 06:12 mcmillhj left 06:21 mcmillhj joined 06:23 patrickz joined 06:25 xtreak left 06:26 mcmillhj left 06:27 xtreak joined 06:35 someuser_ left 06:37 mcmillhj joined 06:42 mcmillhj left 06:45 darutoko joined 06:51 wamba left, mcmillhj joined 06:53 nadim_ joined 06:54 wamba joined 06:56 mcmillhj left 07:00 lowbro joined, lowbro left, lowbro joined 07:01 jonas1 joined, pecastro joined 07:02 samebchase joined 07:04 HoboWithAShotgun left, xtreak left 07:06 samebchase left, aborazmeh joined, aborazmeh left, aborazmeh joined, xtreak joined 07:07 mcmillhj joined 07:08 samebchase joined, rurban joined 07:09 cdg joined 07:13 rurban left 07:14 cdg left 07:15 mcmillhj left 07:16 ntinos left 07:18 robertle left 07:26 mcmillhj joined 07:30 abraxxa joined, cdg joined 07:34 mcmillhj left 07:35 cdg left 07:39 mcmillhj joined 07:43 jsimonet left, jsimonet joined 07:44 mcmillhj left 07:49 llfourn left 07:55 mcmillhj joined 07:59 wamba left 08:02 curan joined 08:04 mcmillhj left 08:08 xtreak left 08:10 zakharyas joined 08:11 mcmillhj joined 08:16 dakkar joined, mcmillhj left 08:20 Cabanossi left 08:21 Cabanossi joined 08:23 piojo left, piojo joined 08:27 mcmillhj joined 08:33 mcmillhj left 08:34 Aaronepower left 08:36 xtreak joined 08:37 kerframil joined 08:44 mcmillhj joined 08:50 TEttinger left, mcmillhj left 08:57 mcmillhj joined 09:00 araujo left, robertle joined 09:01 mcmillhj left 09:02 parv joined 09:04 wamba joined, xtreak left 09:05 xtreak joined 09:06 rgrau joined 09:14 Aaronepower joined 09:17 epony left 09:18 epony joined 09:24 xtreak left, xtreak_ joined 09:27 traxex_ joined 09:28 xtreak_ left, xtreak joined 09:29 traxex left 09:32 traxex_ left 09:33 aborazmeh left 09:39 traxex joined 09:42 sacomo left, melezhik left 09:45 someuser joined 09:46 cdg joined 09:48 traxex left 09:51 cdg left 09:52 traxex joined, varada joined 09:56 varada left
tyil I dont work on it, but I have a project using it 09:58
10:03 rba joined 10:05 eliasr joined, rba_ left, steeznson joined
buggable New CPAN upload: Config-1.2.2.tar.gz by TYIL cpan.metacpan.org/authors/id/T/TY/...2.2.tar.gz 10:06
10:08 Aaronepower left 10:12 Aaronepower joined 10:19 margeas joined 10:29 dustinm` left, leont joined 10:31 steeznson left 10:33 dustinm` joined, ChoHag left
piojo tyil: what's your experience? Does it work well? 10:38
tyil it gets the job done, it lets me put stuff in a database :p 10:39
github.com/scriptkitties/perl6-Shi...ers/V1.pm6 this file does some inserting into MongoDB
my only remaining issue with it was that I cant find any clear doc on how to insert a proper timestamp 10:40
10:43 curan left 10:44 parv left 10:54 araujo joined, araujo left, araujo joined
piojo tyil: you mean an arbitrary time, or a "last modified" timestamp for data modifications? 10:55
tyil either, I can store a timestamp as a string just fine, but MongoDB supports storing them as ISODate objects too 10:58
10:58 bdmatatu joined
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:00
my BSON::Document $req .= new: ( update => 'users', updates => [ ( q => (guid => $user,), u => ('$set' => (:meaning(42),), '$currentDate' => (lastModified => True),),), ],); 11:01
tyil interesting
11:02 Spot__ left, bdmatatu left, skaji left 11:03 lumimies left 11:04 Spot__ joined, lumimies joined 11:06 skaji joined 11:16 melezhik joined 11:20 W4RL0RD joined 11:25 Grrrr left 11:29 traxex_ joined 11:30 HoboWithAShotgun joined 11:31 Grrrr joined 11:32 traxex left 11:35 salva0 joined 11:43 atroxaper joined 11:45 jameslen_ left, Aaronepower left 11:46 pmurias joined 11:47 zakharyas left, Piotr_ left, Aaronepower joined 11:48 salva0 left 11:49 Aaronepower left
Geth ecosystem: Tyil++ created pull request #374:
Remove App::MPD::AutoQueue, now available on CPAN
11:53
ecosystem: 1f6dd69e98 | (Patrick Spek)++ | META.list
Remove App::MPD::AutoQueue, now available on CPAN
ecosystem: c5fca77d50 | (Patrick Spek)++ (committed using GitHub Web editor) | META.list
Merge pull request #374 from Tyil/master

Remove App::MPD::AutoQueue, now available on CPAN
11:58 xtreak left 11:59 jameslenz joined 12:03 xtreak joined
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:06
12:09 Aaronepower joined 12:12 Aaronepower left, bdmatatu joined 12:13 rindolf joined 12:15 Aaronepower joined, ChoHag joined 12:20 void1 joined
[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
12:24 void1 left
timotimo you're getting \n without \r but your terminal is set to not go back to beginning of line without \r? 12:24
[Coke] taking test out of it, if I dd the test names, I see the same behavior. each line indented 4 more. weird. 12:27
(and I have to run stty sane) 12:28
guessing it's an interaction between proc async and ssh -t 12:30
12:30 Aaronepower left, traxex joined 12:31 traxex_ left, Aaronepower joined
[Coke] Yup. (I need the -t for the interaction with the remote server, but that's what triggers the terminal weirdness.) 12:34
timotimo mhm 12:35
12:36 W4RL0RD left
[Coke] oh, sweet, I can rewrite the test a smidge to not need the -t. :) 12:38
12:39 pilne joined 12:40 wamba left 12:44 zakharyas joined 12:47 Aaronepower left 12:49 traxex left, traxex joined, Aaronepower joined 12:52 wamba joined 12:53 bdmatatu left
pilne ok, so rakudobrew is out the window, which version is currently reccomended for "people playing with the language"? 2017.7? 12:54
12:54 mcmillhj joined
[Coke] compiler only, then whatever the latest monthly release is 12:55
which is every month, so 2017.09
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
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 13:01 traxex_ joined, raschipi joined, traxex left 13:03 wamba left 13:05 traxex_ left 13:06 Geth left, Geth joined
pilne ty, and i take it the general way to run zef is installed to userland and not as root? 13:07
13:10 wamba joined
piojo pilne: yes, zef installs itself. so zef is installed the same way it installs all the other modules 13:12
but be ready to "rm -r ~/.zef" several times per hour if you're using it a lot. It's not that reliable.
(Or maybe that's just on windows) 13:13
13:13 perlpilot left, traxex joined 13:16 xtreak left
pilne tyvm 13:18
13:18 xtreak joined
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:22
HoboWithAShotgun m: say √4 13:25
camelia 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…
HoboWithAShotgun hey i am disappointed
13:26 stmuk_ joined, stmuk left, Aaronepower left 13:28 ryn1x_ joined 13:29 ryn1x left 13:31 rba left 13:33 a3r0 left 13:38 Aaronepower joined 13:44 rba joined
piojo pilne: oops, I misread what you wrote--zef is usually *not* run as root 13:44
never mind, I just misread twice. I guess it's time to log off!
13:45 xtreak left, piojo left 13:48 Wiertek left 13:58 wamba left
raschipi . 13:59
14:00 jeromelanteri left 14:01 mempko joined
[Coke] : 14:07
14:13 ruoso____ joined
timotimo huh, what's wrong with the perl6 syntax checker atom package? 14:14
/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:16 mempko left 14:17 dogbert2 joined
buggable New CPAN upload: TimeUnit-0.1.0.tar.gz by ATROXAPER cpan.metacpan.org/authors/id/A/AT/...1.0.tar.gz 14:26
atroxaper My first... 14:27
pilne ty (:
raschipi atroxaper: gimme repo link...
atroxaper Oh... Forget link it in readme... github.com/atroxaper/p6-TimeUnit/b.../README.md 14:28
raschipi atroxaper: make it accept named arguments, so we can do (:42seconds) 14:29
14:30 pilne left
atroxaper Like NANOSECONDS.from(:42minutes) ? 14:30
raschipi The upper case letters also look like a code smaell. 14:32
They are usually used in Perl6 to mean something unusual is going on, so it looks like very out of place in your interface
smell*
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.
kerframil timotimo: possibly related: 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
raschipi In debian /bin/sh is very likely to be /bin/dash, and on FreeBSD it's /bin/tcsh 14:35
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:37
timotimo kerframil: oh yeah, i've had KDE plasma unable to start up because my login shell is fish 14:38
atroxaper raschipi: I just see that docs.perl6.org/language/5to6-nutshell#constant (DEBUG). Of course I fully agreed about community code style. I will fix it. Thanks. 14:39
14:39 mcmillhj left
kerframil timotimo: that's sad 14:40
timotimo it is!
i've followed the advice of #fedora-kde and changed shells to bash and just set konsole to launch fish for me
kerframil probably blind sourcing of shell code, rather than executing it in the actually-targetted shell. or something like that.
timotimo and/or missing hashbang 14:41
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
kerframil indeed. I'm glad they did it. sh means sh, the Shell Command Language. no one should have any expectations beyond that. 14:44
a shakedown was overdue, in my opinion 14:45
14:46 leont left
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:46
14:47 HoboWithAShotgun left
timotimo i'm also glad 14:48
Geth doc/master: 7 commits pushed by (Luca Ferrari)++, (Rafael Schipiura)++
14:48 HoboWithAShotgun joined
14:48 lowbro left, ryn1x__ joined 14:50 ryn1x__ left
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:51
14:51 someuser left
raschipi I mean it didn't make much difference regarding the original objective of the change, which was to use a faster shell. 14:54
14:55 darkmorph joined
kerframil too bad, as there are some great linting tools these days. shellcheck, for instance. 14:55
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 14:58
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:01
15:03 ryn1x__ joined
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?
AlexDaniel- is also interested 15:04
15:06 kyan joined, ryn1x__ left
raschipi I will, just a sec. 15:08
15:12 traxex_ joined 15:15 darkmorph left, traxex left 15:16 cognominal left 15:17 epony left, darkmorph joined
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:17
kyan m: sub foo( --> Nil) { say "blah" } 15:18
camelia ( no output )
raschipi I didn't test the new version because I was on vacation, only saw the update in my computer at home.
kyan m: sub foo(--> Nil Str $var) { say "$var" }
camelia 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
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:19
15:20 leont joined 15:21 rgrau left, geekosaur left
AlexDaniel- kyan: \o/ 15:24
didn't really expect anyone to notice that fix so fast :)
15:26 patrickz left 15:27 telex left 15:28 mson joined 15:29 telex joined 15:31 leont left 15:33 geekosaur joined
atroxaper raschipi: do you like so github.com/atroxaper/p6-TimeUnit ? :) 15:33
kerframil raschipi: cool 15:34
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.
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:36 mcmillhj left 15:37 traxex_ left 15:38 traxex joined 15:39 wamba joined
raschipi atroxaper: The way I would do  Perl6 interface like that would be 15:43
15:44 mcmillhj joined
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 5 minutes
3 seconds
timotimo but then you can't just combine it! :)
atroxaper sub beep-after($time, TimeUnit $unit) { sleep(seconds.from($time, $unit); beep(); }; beep-after(5, minutes); 15:47
15:47 ChoHag left
atroxaper I think is good enough, no? 15:47
beep-after($minutes, minutes), yes ^^ 15:48
15:49 domidumont left 15:50 wamba left 15:54 bwisti joined, kent\n left
kyan m: my $a = 'b'; $_ := $a; sub foo() { say $a =:= $_; }; foo; 15:56
camelia False
kyan How can I make a sub inherit $_ from the enclosing block? 15:57
15:57 ggoebel left 15:58 abraxxa left
kyan (Replacing $_ with $b in that snippet, and putting "my " in front of the first instance, is inherited by the sub.) 15:59
moritz kyan: it inherits the value in $_, but not the container 16:00
you can access $OUTER::_ I guess, but please don't write to it
that's generally bad API design in Perl 6
m: my $a = 'b'; $_ := $a; sub foo() { say $a =:= $OUTER::_; }; foo; 16:01
camelia True
kyan Ok, thanks!
16:02 zakharyas left 16:04 zakharyas joined
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?
buggable New CPAN upload: TimeUnit-0.1.1.tar.gz by ATROXAPER cpan.metacpan.org/authors/id/A/AT/...1.1.tar.gz 16:06
16:07 robertle left
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
Could also write sub foo() given "a" { ... to have $_ set to "a" in the sub
moritz kyan: or you can just write sub foo($_) { ... } 16:09
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
moritz that's not how Perl 6 does things 16:12
we are a bit more explicit about when we pass $_ to subs or methods
so that people don't have to keep a list of things in their head of which function works on $_ and which doesn't
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
Thanks!
(Is there a document somewhere that describes the differences between $_ and a "normal" variable, btw? I feel like that might help me out...) 16:15
16:16 troys joined
raschipi $_ is a normal variable... 16:16
16:16 zakharyas left, ShalokShalom_ joined
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:16
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 $_
m: say (-> { say "hi" }).perl
camelia -> { #`(Block|50214056) ... }
timotimo m: say ({ say "hi" }).perl
camelia -> ;; $_? is raw { #`(Block|55969136) ... }
moritz m: my $a = 42; $_ = 23; sub f() { say (:$a, :$_).perl }; f(); { my $a = 1; my $_ = 2; f() } 16:18
camelia 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))
timotimo there, it has an optional $_ argument
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
16:19 ShalokShalom left
moritz be careful in the sub vs. block distinction 16:19
m: sub f($a) { }; say &f.signature.perl 16:20
camelia :($a)
moritz no magic with $_ afaict
16:21 Wiertek joined
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:21
16:26 kent\n joined 16:28 zakharyas joined
raschipi kyan: What happens is that blocks that don't have any other signature will have just one parameter, called $_ 16:29
kyan Ohhhhh! I see. Thanks :D 16:30
HoboWithAShotgun how di create a sequence using an arbitrary code block to build the next item
ugexe m: my $block = { $^a + $^b }; say $block(1, 2)
camelia 3
HoboWithAShotgun again, i saw that in a video 16:31
16:31 wander joined
ugexe map or gather/take would both work 16:31
16:32 wamba joined
wander m: $_ = 42; { .say } 16:32
camelia 42
HoboWithAShotgun i am trying to get this
gather { take $seed; until f($seed) < 1e-5 { take $seed = g($seed); }
jnthn m: say (1, 1, -> $a, $b { $a + $b } ... *)[^10]
camelia (1 1 2 3 5 8 13 21 34 55)
wander m: { .say }("hi")
camelia hi
HoboWithAShotgun into a sequence, but i am stuck at $seed ... ^0
i dont know how to put the function in there 16:33
basically the +1
16:33 dakkar left
jnthn Maybe something like: $seed, &g ... { f($_) < 1e-5 } 16:34
16:36 rba_ joined
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 };
camelia (0 1 2 3 4 5 6 7 8 9 10 11 12)
HoboWithAShotgun ah, nah. 16:38
raschipi m: my $seed = 127; say my @a = $seed, {$_ %% 2 ?? $_/2 !! $_*3+1} ... 4
camelia [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]
HoboWithAShotgun i think the original syntax is clearer
ugexe m: my $seed = 0; my $a := gather { take $seed; until $seed > 10 { take $seed = ($seed + 1) } }; say $a.perl
camelia (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11).Seq
16:38 rba left
HoboWithAShotgun that's what i have ugexe 16:38
16:39 kent\n left, robertle joined
ugexe but mine works, and you have f($seed) and g($seed) 16:39
e.g. maybe thats where your problem is
HoboWithAShotgun yes, i want the series of f1(x) until f(2(x) reaches a treshold 16:41
raschipi syntax error 16:42
16:42 kent\n joined 16:46 rba joined
ugexe m: say 1e-5.Int 16:48
camelia 0
16:48 raschipi left, rba_ left
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
kyan Oh, interesting. 16:52
ugexe well, parameterized according to the error message.
kyan What's the right way to write something that acts kinda like that, but only lets pairs in? ;P 16:53
(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;
kyan Oh! Ok. That's... surprisingly simple. Thanks!
ugexe note its an array, not a list though 16:55
kyan Cool, I'm not totally clear on the difference but I suspect that problem can be resolved by reading the docs :) Thanks! 16:56
mienaikage !p6mod bang on DuckDuckGo is now live 16:58
16:59 zakharyas left 17:02 HoboWithAShotgun left 17:03 zakharyas joined 17:05 atroxaper left 17:08 aindilis` left 17:17 domidumont joined
Geth doc: fluca1978++ created pull request #1601:
Fix "head2" POD title section.
17:25
17:26 imcsk8 left, imcsk8 joined
Geth doc: 2a56726229 | (Luca Ferrari)++ | doc/Language/syntax.pod6
Fix "head2" POD title section.

That was my fault on PR merged by commit 135102b39481aa. There was an extra space between "head" and "2" leading to the wrong rendering of the section title.
17:27
synopsebot Link: doc.perl6.org/language/syntax
doc: 263c847f17 | Altai-man++ (committed using GitHub Web editor) | doc/Language/syntax.pod6
Merge pull request #1601 from fluca1978/method-precedence-drop

Fix "head2" POD title section.
17:30 zakharyas left 17:33 ryn1x__ joined 17:48 ryn1x__ left 17:50 Cabanossi left 17:51 Cabanossi joined 17:52 troys is now known as troys_ 17:56 W4RL0RD joined
Geth doc: W4anD0eR96++ created pull request #1602:
[WIP] Try to fix intro of non-string keys of Hash
18:04
18:15 kurahaupo joined
rindolf mienaikage: nice 18:18
timotimo cool!
18:19 cdg left 18:21 W4RL0RD left 18:26 HoboWithAShotgun joined 18:27 Aaronepower left 18:32 mcmillhj left 18:34 mcmillhj joined 18:35 evalable6 left, evalable6 joined 18:37 Ven joined, Ven is now known as Guest75286 18:39 Aaronepower joined, darutoko left, mcmillhj left 18:41 Guest75286 left 18:46 mcmillhj joined 18:50 troys_ is now known as troys 18:55 setty1 joined
pmurias m: ("foo" => 10000000000000000000).BagHash.grab(1) 18:57
camelia Cannot unbox 64 bit wide bigint into native integer
in block <unit> at <tmp> line 1
pmurias ^^ seems like a bug?
Geth doc: fb1c89b28e | (David Warring)++ | doc/Language/nativecall.pod6
document newly introduced pointer increment and array referencing
19:12
synopsebot Link: doc.perl6.org/language/nativecall
geekosaur I think that's in a class of known bugs? 19:13
19:15 evalable6 left, evalable6 joined
Geth doc: 927ddba17a | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Failure.pod6
Fix typo
19:15
synopsebot Link: doc.perl6.org/type/Failure
audiatorix AlexDaniel-: any idea where the logic for destructuring lies?
19:17 jonas1 left
AlexDaniel- pmurias: yes, seems like a bug 19:17
pmurias: please rakudobug if there's no ticket already
audiatorix: I think it depends on what you're looking for exactly. There are some bits and pieces in different places. Here for example: github.com/rakudo/rakudo/blob/25c8...5024-L5031 19:23
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 19:32 johnjohn101 joined
raschipi mienaikage++ ddg++ 19:33
19:36 smls joined
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 R
smls m: role R { multi method a (:$r!) { "R" } }; class A does R { multi method a (:$a) { "A" } }; say A.new.a(:r)
camelia A
smls ^^ bug?
19:39 Rawriful joined
AlexDaniel- smls: maybe not. I think both multies fit your arguments, and it makes sense that A is called first 19:41
19:41 mr-foobar joined
smls AlexDaniel-: In the first version, both multies also fit the arguments. 19:42
AlexDaniel- smls: oh… 19:43
smls AlexDaniel-: And isn't :$r! a more specific fit for argument :r, than an implicit *%_ ?
19:43 mr-fooba_ left
AlexDaniel- smls: maybe you're right 19:45
20:00 aindilis joined 20:05 andrzejku left, epony joined 20:17 cdg joined 20:18 mson left 20:21 stmuk joined 20:24 stmuk_ left 20:31 cdg_ joined 20:34 cdg left 20:50 Wiertek left 20:52 kyan left
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:54
20:54 smls left
timotimo no, only pod comments that are attached to things 20:57
i.e. #| or #= comments
20:57 troys is now known as troys_, stmuk_ joined
tyil is pod in perl 6 the same as in perl 5? I should start learning it and use it in my code 20:58
20:59 skids left
timotimo a bit different 20:59
20:59 Wiertek joined
tyil alright, I'll make sure to attach "perl 6" to any pod-related query as well :p 20:59
21:00 stmuk left
raschipi You can search for 'pod6' 21:00
tyil is there a utility to compile pod6 into a manpage? 21:03
raschipi Yes, perl6
tyil how would I invoke it to compile the pod6 from a perl script? 21:04
21:05 TEttinger joined
raschipi Use the --doc option. 21:05
tyil nvm, it was lower on the page
I should read before asking simple stuff ;~; 21:06
raschipi There's no problem with that, it's fine. 21:07
21:07 ChoHag joined
HoboWithAShotgun m: my @a = <1 2 3>; say @a.grep( * ~~ "2" ); 21:09
camelia (2)
HoboWithAShotgun m: my @a = <1 2 3>; say @a.grep( *.Int ~~ 2 ); 21:10
camelia Cannot use Bool as Matcher with '.grep'. Did you mean to use $_ inside a block?
in block <unit> at <tmp> line 1
HoboWithAShotgun why is this? why doesn't this dwim?
m: my @a = <1 2 3>; say @a.grep( *.Int == 2 ); 21:11
camelia (2)
HoboWithAShotgun argh
m: say "2" ~~ 2
camelia True
raschipi m: my @a = <1 2 3>; say @a.grep( {.Int ~~ 2} ); 21:12
camelia (2)
geekosaur I thought this was a listed/known trap
HoboWithAShotgun yeah i know
raschipi HoboWithAShotgun: It does exactly what you mean, you just meant the wrong thing.
HoboWithAShotgun bo it's still odd. if *.Int ~~ 2, and 2 ~~ "2", then *.Int must ~~ "2" too 21:13
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
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…
m: my @a = <1 2 3>; say @a.grep( 2 ~~ *.Int );
camelia (2)
raschipi m: ( *.Int ~~ 2 ).WHAT; ( *.Int == 2 ).WHAT;
camelia ( no output )
AlexDaniel- this seems to work?
raschipi m: say ( *.Int ~~ 2 ).WHAT, ( *.Int == 2 ).WHAT;
camelia (Bool)(WhateverCode)
AlexDaniel- geekosaur: so what's the DWIM here then?
HoboWithAShotgun gdflex: there is no flaw in my argument. if x = y and y = z then z = x 21:16
21:16 cognominal left
HoboWithAShotgun and if perl thinks otherwise then perl is wrong 21:16
geekosaur raschipi just showed it, I think. the ~~ 'consumes' the WhateverCode
in effect it's using thw WhateverCode smartmatcher instead of the Int smartmatcher
but if you make it not do that then there are other cases you expect WhateverCode to smartmatch that won't 21:17
21:17 cognominal joined, Wiertek left
AlexDaniel- for example? 21:17
HoboWithAShotgun yeah, *. onward :) thx for the explanation
geekosaur I am struggling to remember this whole thing, I do recall I think TimToady explaining it at some point 21:18
gfldex ~~ on a Callable matches on the boolean result of invocation 21:19
geekosaur possibly something like using 'given' to match types?
raschipi HoboWithAShotgun: Smartmatch is explicitly NOT commutative
HoboWithAShotgun best to stay away from *, unless for when you are sure what you do
geekosaur ^
21:19 mcmillhj left
AlexDaniel- is it this? docs.perl6.org/language/traps#Topi..._Operators 21:19
geekosaur er. I meat for raschipi's remark
AlexDaniel- nah, not really 21:20
but the same “flip to LHS” remark applies
raschipi G'night people.
geekosaur a ~~ b can't mean the same thing as b ~~ a, because it has to pick one side to invoke .ACCEPTS on
gfldex m: my @a = <1 2 3>; my $result = { "2" }.().Bool; say @a.grep( $result ~~ 2 );
camelia Cannot use Bool as Matcher with '.grep'. Did you mean to use $_ inside a block?
in block <unit> at <tmp> line 1
geekosaur if nothing else, that error message tries hard but is still LTA 21:22
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:23
HoboWithAShotgun m: ( * * * * *)(1 2 3) 21:24
camelia 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
HoboWithAShotgun m: say ( * * * * *)(1 2 3)
camelia 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…
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)
camelia 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:25 wamba left, raschipi left
gfldex m: say { * * * * * }.(|(1 2 3)) 21:27
camelia 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…
HoboWithAShotgun say ( * * * * * )(1, 2, 3)
evalable6 6
HoboWithAShotgun say ( * * * * *)(1, 2, 3)
evalable6 6
HoboWithAShotgun oh i forgot the commas abbove 21:28
21:28 troys_ is now known as troys
HoboWithAShotgun m: sub f($x) { $x+1 }; my $x = 1; say ($x, f($x), f(*) ... 10) 21:39
camelia 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
HoboWithAShotgun sub f($x) { $x+1 }; my $x = 1; say (1, 2, 3 ... 10) 21:40
m: say "ustillthere?"; 21:41
camelia ustillthere?
HoboWithAShotgun m: say (1, 2, 3 ... 10) 21:43
camelia (1 2 3 4 5 6 7 8 9 10)
21:45 setty1 left
AlexDaniel- HoboWithAShotgun: I created this: github.com/perl6/doc/issues/1603 21:48
HoboWithAShotgun: re “ustillthere”, you forgot “m:”
HoboWithAShotgun yeah i know :) 21:54
how do you do aspect orientation in perl6?
Xliff m: say '}' ~~ / '}' 21:57
camelia 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
Xliff m: say '}' ~~ / '}' /
camelia 「}」
Xliff m: say '{' ~~ / '{' /
camelia 「{」
Xliff m: say '{' !~~ / '{' /
camelia False
21:59 ShalokShalom_ left 22:00 pmurias left 22:03 pilne joined, epony left 22:04 epony joined 22:05 epony left, epony joined 22:06 cdg_ left 22:10 domidumont left 22:11 domidumont joined
HoboWithAShotgun can you have custom traits? 22:16
timotimo yup! 22:17
22:19 cdg joined
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:19
22:20 audiatorix left
timotimo i think you'll need to use a proxy for that purpose 22:22
rather than a trait
HoboWithAShotgun same for subs :)
timotimo that's easier
geekosaur hm. can a trait wrap a variable in a Proxy? 22:24
or, I guess, replace it with 22:25
HoboWithAShotgun yes, reading what a proxy is, that is what's needed apparently
cause if you have calls to that in your code you're better off explicity printing the variable 22:26
22:26 rindolf left
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 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
timotimo m: multi sub trait_mod:<is>(Variable:D $self is raw, :replaced!) { $self = my Str $ }; my Int $test is replaced; $test = "hi";
camelia 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
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 5===SORRY!5=== Error while compiling <tmp>
Cannot assign to an immutable value
at <tmp>:1
timotimo m: multi sub trait_mod:<is>(Variable:D $self is rw, :$replaced!) { $self = my Str $ }; my Int $test is replaced; $test = "hi";
camelia 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
timotimo not like that clearly
22:28 johnjohn101 left
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:29
could you maybe make it so these pod comments be printed as they occur? 22:30
possibly interpolated in the right scope?
timotimo you mean like "use trace"? :)
someone started work on active comments or something like that 22:31
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
HoboWithAShotgun thats neat!
timotimo i'm not sure how far they got or what it's called 22:32
HoboWithAShotgun TBD ...
timotimo i can't find it on the modules page 22:33
22:36 leont joined
HoboWithAShotgun multi sub trait_mod:<is>(Variable:D $self is raw: :smaller!) { $self = --$self }; my Int $test is smaller=10; $test.say; 22:38
m: multi sub trait_mod:<is>(Variable:D $self is raw: :smaller!) { $self = --$self }; my Int $test is smaller=10; $test.say;
camelia 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
HoboWithAShotgun i have no idea what i'm doing :) 22:39
timotimo yeah, has to be a , instead of the : after raw
and the "is raw" is the part that doesn't work
but be aware that traits are applied at compile time, as soon as the name is parsed
so the "= 10" will not be known at the point your trait is run
HoboWithAShotgun m: multi sub trait_mod:<is>(Variable:D $self is raw, :smaller!) { $self = --$self }; my Int $test is smaller=10; $test.say;
camelia 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
HoboWithAShotgun ah allright 22:40
timotimo yes, needs to have a $ there
HoboWithAShotgun m: multi sub trait_mod:<is>(Variable:D $self is raw, :smaller!) { say $self }; my Int $test is smaller=10; 22:41
camelia 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 leont left
timotimo m: multi sub trait_mod:<is>(Variable:D $self is raw, :$smaller!) { say $self }; my Int $test is smaller=10; 22:41
camelia Variable.new(name => "\$test", scope => "my", var => Int, block => -> gnatur { #`(Block|59330296) ... }, slash => Perl6::Grammar.new() #`[140477191271040])
HoboWithAShotgun better rtfm :)
where do i find this? 22:42
timotimo uhhh, hmm 22:44
22:45 mattp_ left, Aaronepower left 22:46 mattp_ joined, mattp_ left
timotimo i mean, you can look at the classes like Variable and the other traits that exist 22:48
it's all in rakudo/src/core/
22:48 mson joined, mattp_ joined 22:49 Aaronepower joined 22:54 leont joined 22:56 troys is now known as troys_ 22:59 Herby_ joined
Herby_ \o 22:59
23:01 epony left 23:02 robertle left
HoboWithAShotgun lol. "In general this requires solving the halting problem, which even Perl 6 compiler writers have trouble with." 23:04
from the docs about wantarray 23:05
.tell zoffix i saw your video ( 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.
timotimo zoffix has been encouraging people to give a talk at the torronto perl mongers via hangouts or similar 23:08
inviting i guess? 23:09
23:15 BenGoldberg joined 23:20 cdg_ joined
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:20
23:22 epony joined 23:23 cdg left 23:24 cdg_ left 23:25 leont left, leont joined
geekosaur it's glue 23:28
pilne ty 23:29
timotimo the glue recently got improved to make it thinner 23:34
you can compare speeds between the last monthly release and current development version of rakudo 23:35
if you have some nativecall-heavy benchmark
timotimo signs off
23:36 leont left
pilne naahhhh i was just curious, all this dev stuff really is over my head, i'm just a huge fanboy/cheerleader (: 23:37
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 left, evalable6 joined