Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-11-13

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:16 cdg joined #perl6
00:33 ugexe Something about t/02-rakudo/04-diag.t does not like to work with some combination of testing a) pre-make-install, b) testing with prove, and c) using prove with `--archive`, but i'm not immediately seeing anything suspect https://jenkins.p6.nu/job/rakudo/7/os=linux/tapResults/
00:52 ugexe `- diag at the start of file shows up in non-verbose prove run` - this doesn't seem like something that should be tested
00:55 ugexe eh its not actually testing prove
01:02 ugexe ah its because it essentially does `$*EXECUTABLE -e 'use Test; ...` which is not valid unless its already installed or it passes the current $*REPO to the $*EXECUTABLE
01:03 leont I remember seeing similar issues in the spectests for Test.pm, they fail when you don't have any rakudo installed -_-
01:03 ugexe almost seems like a $*EXECUTABLE-BUT-WITH-MAH-LIBS would be useful
01:04 leont (no idea if that got fixed in the mean time)
01:06 ugexe i havent gotten to prove-invoked-spectest yet, but hopefully that was fixed
01:16 cdg joined #perl6
01:25 aborazmeh joined #perl6
01:25 aborazmeh joined #perl6
01:26 perigrin joined #perl6
01:29 ryn1x joined #perl6
01:35 Cabanossi joined #perl6
01:42 kalkin-- joined #perl6
01:51 piojo joined #perl6
02:00 mson joined #perl6
02:05 Cabanossi joined #perl6
02:08 comborico1611 joined #perl6
02:09 comborico1611 m: sub t ( say "hello" ); t;
02:09 camelia rakudo-moar dbce04e6a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Invalid typename 'say' in parameter declaration.␤at <tmp>:1␤------> 3sub t ( say7⏏5 "hello" ); t;␤»
02:09 comborico1611 m: sub t ( say "hello"; ); t;
02:09 camelia rakudo-moar dbce04e6a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Invalid typename 'say' in parameter declaration.␤at <tmp>:1␤------> 3sub t ( say7⏏5 "hello"; ); t;␤»
02:11 geekosaur does your font show the difference between { and ( ?
02:11 comborico1611 m: sub t ( ) { say "hello" }; t;
02:11 camelia rakudo-moar dbce04e6a: OUTPUT: «hello␤»
02:11 comborico1611 I'm ashamed to answer that question. Lol
02:12 comborico1611 m: sub t { say "hello" }; t;
02:12 camelia rakudo-moar dbce04e6a: OUTPUT: «hello␤»
02:12 comborico1611 m: sub t( ) { say "hello" }; t;
02:12 camelia rakudo-moar dbce04e6a: OUTPUT: «hello␤»
02:18 comborico1611 Goodnight!
02:21 geekosaur ...it's common enough that I asked it...
02:21 BenGoldberg joined #perl6
02:31 ryn1x joined #perl6
02:34 ch3ck3r joined #perl6
02:37 cdg joined #perl6
02:41 cdg joined #perl6
02:54 ilbot3 joined #perl6
02: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!
03:03 MasterDuke joined #perl6
03:04 blakers joined #perl6
03:08 releasable6 joined #perl6
03:09 blakers p6: say is anyone using perl6 in production?
03:09 camelia rakudo-moar 53130587f: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Bogus postfix␤at <tmp>:1␤------> 3say is anyone using perl6 in production7⏏5?␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤      …»
03:09 blakers p6: say "is anyone using perl6 in production?"
03:09 camelia rakudo-moar 53130587f: OUTPUT: «is anyone using perl6 in production?␤»
03:12 mingdao joined #perl6
03:15 noganex_ joined #perl6
03:29 astj joined #perl6
03:30 astj joined #perl6
03:34 astj joined #perl6
03:39 ryn1x joined #perl6
04:02 char_var[buffer] joined #perl6
04:28 R0b0t1_ joined #perl6
04:44 ryn1x joined #perl6
04:50 Cabanossi joined #perl6
04:58 lookatme joined #perl6
05:07 mempko joined #perl6
05:27 ZzZombo Can I can easily get a list of items in hash, OTHER than those with provided keys?
05:28 ZzZombo Kinda like reverse slice.
05:30 lookatme m: my %h = 1 => 2, 3 => 5; say %h.[0];
05:30 camelia rakudo-moar b2725c122: OUTPUT: «{1 => 2, 3 => 5}␤»
05:30 ZzZombo Uh, what is that?
05:31 lookatme Just trying to do
05:31 ZzZombo ah, okay.
05:32 lookatme Why you need another way ?
05:32 ZzZombo I have a list of keys I'm NOT interested in, I need the other items in the hash.
05:33 lookatme oh
05:34 lookatme m: my %h = 1 => 2, 3 => 5, 4 => 6; say %hR<1 2>;
05:34 camelia rakudo-moar b2725c122: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '%hR' is not declared␤at <tmp>:1␤------> 3my %h = 1 => 2, 3 => 5, 4 => 6; say 7⏏5%hR<1 2>;␤»
05:34 ugexe m: my %foo = :a<1>, :b<2>, :c<3>; my @choices = <a d>; say %foo.grep({.key !~~ any @choices}).perl
05:34 camelia rakudo-moar b2725c122: OUTPUT: «(:c(IntStr.new(3, "3")), :b(IntStr.new(2, "2"))).Seq␤»
05:34 lookatme m: my %h = 1 => 2, 3 => 5; say %h{%h.keys (-) [1, 2]};
05:34 camelia rakudo-moar b2725c122: OUTPUT: «(Any)␤»
05:38 evalable6 joined #perl6
05:38 lookatme m: my %h = 1 => 2, 3 => 5, 4 => 6; say %h{(%h.keys (-) [1, 2]).keys};
05:38 camelia rakudo-moar b2725c122: OUTPUT: «(2 5 6)␤»
05:38 lookatme :(
05:43 lookatme m: my %h = 1 => 2, 3 => 5, 4 => 6; say %h{(%h.keys (-) <1, 2>).keys};
05:43 camelia rakudo-moar b2725c122: OUTPUT: «(2 5 6)␤»
05:44 ryn1x joined #perl6
05:44 parv joined #perl6
05:47 lookatme m: my %h = bar => 2, foo => 5, fbar => 6; say %h{%h.keys() (-) <foo bar>};
05:47 camelia rakudo-moar b2725c122: OUTPUT: «6␤»
05:48 parv that's interesting (set operation).
05:48 lookatme m: my %h = 1 => 2, 2 => 5, fbar => 6; say %h{%h.keys() (-) ("1", "2")};
05:48 camelia rakudo-moar b2725c122: OUTPUT: «6␤»
05:49 lookatme m: my %h = 1 => 2, 2 => 5, fbar => 6; say %h{%h.keys() (-) <1 2 >}; # that's not work
05:49 camelia rakudo-moar b2725c122: OUTPUT: «(Any)␤»
05:50 lookatme m: my %h = 1 => 2, 2 => 5, fbar => 6; say %h{%h.keys() (-) Q :w < 1 2 >}; # that's what I like Q
05:50 camelia rakudo-moar b2725c122: OUTPUT: «6␤»
05:51 parv oh man, too much work that.
05:51 parv (relatively speaking)
05:51 lookatme hmm
05:54 ufobat_ joined #perl6
05:55 Cabanossi joined #perl6
05:57 parv lookatme, could that be due to IntStr thing?
05:57 parv say <4 5 >.perl
05:57 evalable6 parv, rakudo-moar b2725c122: OUTPUT: «(IntStr.new(4, "4"), IntStr.new(5, "5"))»
05:57 parv p6: say <4 5 >.perl
05:57 camelia rakudo-moar b2725c122: OUTPUT: «(IntStr.new(4, "4"), IntStr.new(5, "5"))␤»
05:58 lookatme oh
05:58 parv p6: say <a b >.perl
05:58 camelia rakudo-moar b2725c122: OUTPUT: «("a", "b")␤»
05:58 lookatme That's why it not work :(
05:58 lookatme m: say Q :w <1 2 >
05:58 camelia rakudo-moar b2725c122: OUTPUT: «(1 2)␤»
05:58 lookatme m: say Q :w <1 2 > .WHAT
05:58 camelia rakudo-moar b2725c122: OUTPUT: «===SORRY!===␤Method call must either supply a name or have a child node that evaluates to the name␤»
05:59 lookatme m: say (Q :w <1 2 > ).WHAT
05:59 camelia rakudo-moar b2725c122: OUTPUT: «(List)␤»
05:59 lookatme m: say (Q :w <1 2 > ).[0]WHAT
05:59 camelia rakudo-moar b2725c122: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say (Q :w <1 2 > ).[0]7⏏5WHAT␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        stateme…»
05:59 lookatme m: say (Q :w <1 2 > ).[0].WHAT
05:59 camelia rakudo-moar b2725c122: OUTPUT: «(Str)␤»
05:59 lookatme m: dd (Q :w <1 2 > )
05:59 camelia rakudo-moar b2725c122: OUTPUT: «("1", "2")␤»
06:00 parv "try harder to convert Int to Str" is the way to go (for now) :-|
06:00 ryn1x joined #perl6
06:00 lookatme oh
06:01 Actualeyes joined #perl6
06:03 parv lookatme, have you written modules in perl6 yet? or, have you written anything of significance (to you)? just curious.
06:03 lookatme Hmm, and another thing my script is fast enough when I use nqp and racer : https://ideone.com/Cm7Cox
06:03 lookatme yeah, I write some module
06:04 lookatme my nickname is araraloren
06:05 lookatme Hmm, How to find module use the robot ? I forgot it
06:08 parv lookatme, thanks. i am reading your program.
06:08 lookatme Oh, that's use for find source file of c / c++
06:09 piojo joined #perl6
06:09 lookatme grep: Getopt
06:09 greppable6 lookatme, https://gist.github.com/44190923ec32ed4f2d55a6498c245f63
06:10 parv still, that is much more than what I had used perl6 (only just on the command line/REPL).
06:13 lookatme we can use it in our work
06:15 lookatme I'm a c/c++ developer, So I make a perl6 app : https://github.com/araraloren/perl6-app-snippet
06:15 lookatme run some c/c++ snippet
06:17 parv lookatme, got that.
06:17 domidumont joined #perl6
06:17 domidumont1 joined #perl6
06:18 lookatme parv, And some other script for personal using, such like a simple spdier: https://github.com/araraloren/Getopt-Kinoko/blob/master/sample/fetch-picture.p6 , using for fetch picture in Baidu tieba(in china)
06:18 moritz good morning
06:18 lookatme moritz, morning o/
06:25 domidumont joined #perl6
06:43 geospeck joined #perl6
06:49 nadim joined #perl6
07:01 darutoko joined #perl6
07:04 abraxxa joined #perl6
07:05 ryn1x joined #perl6
07:05 wamba joined #perl6
07:10 Cabanossi joined #perl6
07:12 geospeck joined #perl6
07:16 lookatme joined #perl6
07:23 abraxxa joined #perl6
07:41 wamba joined #perl6
08:01 Alikzus joined #perl6
08:04 geospeck joined #perl6
08:04 domidumont joined #perl6
08:10 rindolf joined #perl6
08:13 dct joined #perl6
08:16 ufobat_ heya :)
08:17 lookatme :) ho
08:17 ryn1x joined #perl6
08:24 zulu46 joined #perl6
08:26 zakharyas joined #perl6
08:32 Arimaafan9 joined #perl6
08:33 zakharyas joined #perl6
08:33 HaraldJoerg joined #perl6
08:36 dugword joined #perl6
08:39 Arimaafan9 Hello. I have a question: I want to make an instance of a class (myclass1 in file1.pm6) in side another class (myclass2 in file2.pm6). I can instantiate a class in a pl6 file by writing "use lib '.'; use file1;", but when I try doint that in a module file I get an error.
08:40 Cabanossi joined #perl6
08:41 Arimaafan9 anyone know how to do this? I tried asking on stackoverflow, but couldnt get an answer.
08:42 lookatme Arimaafan9, are you trying make a module ?
08:51 xinming joined #perl6
08:55 giraffe joined #perl6
08:56 cdg joined #perl6
09:01 * moritz doesn't find the question on SO
09:10 Cabanossi joined #perl6
09:10 lowbro joined #perl6
09:10 lowbro joined #perl6
09:20 dakkar joined #perl6
09:22 abraxxa joined #perl6
09:28 ryn1x joined #perl6
09:55 margeas joined #perl6
09:55 Cabanossi joined #perl6
10:03 ryn1x joined #perl6
10:11 geospeck joined #perl6
10:15 napo1eon joined #perl6
10:15 sena_kun joined #perl6
10:19 ChoHag joined #perl6
10:23 ShalokShalom joined #perl6
10:36 geospeck joined #perl6
10:40 HoboWithAShotgun joined #perl6
10:48 stmuk is there anything like "hackerrank" which is more OSS friendly, obscure language friendly and less recruiter focussed?
10:55 Cabanossi joined #perl6
10:56 araraloren joined #perl6
11:02 tbrowder Arimaafan9: can you show a min version of what you’re trying to do?
11:19 ryn1x joined #perl6
11:33 dugword joined #perl6
11:41 Zoffix joined #perl6
11:41 Zoffix huggable: advent
11:41 huggable Zoffix, Sign up to write an Advent blog post: https://github.com/perl6/mu/blob/master/misc/perl6advent-2017/schedule
11:42 Zoffix Sign up to write an Advent Post. Anyone can write. It doesn't have to be about code; just about Perl 6. Even if you're new you can write about something cool you've learned about Perl 6.
11:42 Zoffix https://rakudo.party/post/Rakudo-Perl-6-Advent-Calendar-2017--Call-for-Authors
11:45 geospeck joined #perl6
11:49 Geth ¦ mu: d998b267f9 | (Zoffix Znet)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
11:49 Geth ¦ mu: Make schedule emptier
11:49 Geth ¦ mu: review: https://github.com/perl6/mu/commit/d998b267f9
11:49 Zoffix (might still write those, but keep them as emergency advent hole filler)
11:54 Geth ¦ mu: a94cc1f361 | (Elizabeth Mattijsen)++ | misc/perl6advent-2017/schedule
11:54 Geth ¦ mu: Tentative shotgun on the final Advent post
11:54 Geth ¦ mu:
11:54 Geth ¦ mu: This is a blog post that's been brewing inside of me for a long time already.
11:54 Geth ¦ mu: It should give people food for thought.  But I'm also open to taking such a
11:54 Geth ¦ mu: post elsewhere or elsetime.
11:54 Geth ¦ mu: review: https://github.com/perl6/mu/commit/a94cc1f361
11:55 Cabanossi joined #perl6
11:55 Zoffix \o/
12:00 Zoffix left #perl6
12:02 jonas1 joined #perl6
12:03 araraloren_ joined #perl6
12:25 ryn1x joined #perl6
12:27 ChoHag joined #perl6
12:28 raschipi joined #perl6
12:29 AlexDaniel joined #perl6
12:33 El_Che releasable6: status
12:33 releasable6 El_Che, Next release in 5 days and ≈6 hours. No blockers. 0 out of 176 commits logged
12:33 releasable6 El_Che, Details: https://gist.github.com/6d31a40b2aa569dc6cd7c1cee8e627b7
12:37 ChoHag joined #perl6
12:40 Cabanossi joined #perl6
12:49 araraloren_ I他
12:49 araraloren_ It's harder find a good http client module :(
12:50 ChoHag joined #perl6
12:53 timotimo araraloren_: how do you like Cro::HTTP?
12:53 araraloren_ I have tried LWP::Simple HTTP::Client HTTP::UserAgent, every has its problem
12:53 araraloren_ I haven't try it yet
12:55 araraloren_ I'll try it tomorrow, I was trying to login into my router :)
12:55 timotimo do you want a few tips for your directory crawler script? for making it faster?
12:55 araraloren_ timotimo, thanks
12:55 araraloren_ yeah, please
12:56 timotimo the 'if $f ne "." | ".."' might go through actual junctions if my junction optimization doesn't catch it, so that might be significantly more expensive than $f ne "." && $f ne ".."
12:57 timotimo if you turn %ext into a Set up front your (elem) will be much cheaper because it won't have to recreate the set over and over again
12:57 domidumont joined #perl6
12:58 timotimo same for $os<w> as well
12:58 araraloren_ yeah, ok
12:59 araraloren_ I'll test it :)
13:00 araraloren_ Thanks, I playing game now :)
13:00 timotimo have fun!
13:01 araraloren_ Hmm :)
13:01 timotimo oh, and if/elsif/else is noticably faster than given/when in tight loops
13:01 [Coke] left #perl6
13:01 [Coke] joined #perl6
13:19 ryn1x joined #perl6
13:25 araraloren_ OK
13:27 timotimo it won't be that way forever, but for now it is
13:33 ryn1x joined #perl6
13:36 araraloren_ yeah, I think they haven't optimize it
13:39 mson joined #perl6
13:40 Cabanossi joined #perl6
13:41 greppable6 joined #perl6
13:41 domidumont joined #perl6
13:49 Geth ¦ perl6-most-wanted: 8fa0def9af | (Tom Browder)++ (committed using GitHub Web editor) | most-wanted/modules.md
13:49 Geth ¦ perl6-most-wanted: giving up creating this module
13:49 Geth ¦ perl6-most-wanted: review: https://github.com/perl6/perl6-most-wanted/commit/8fa0def9af
13:53 mcmillhj joined #perl6
13:56 zakharyas joined #perl6
13:58 cdg joined #perl6
14:04 cdg joined #perl6
14:09 ryn1x joined #perl6
14:09 khw joined #perl6
14:12 dct joined #perl6
14:12 araraloren_ https://ideone.com/KbiAdO I fixed some bug, and it quite fast now :) thanks
14:15 raschipi why do you have two shebangs?
14:16 araraloren_ Hmm, I paste one and the website has one :P
14:20 moritz @ret.push("$path/$f") if $f ne ".." && $f ne ".";
14:20 moritz @ret.push("$path/$f") if $f eq none <. ..>;
14:23 greppable6 joined #perl6
14:23 dct joined #perl6
14:24 timotimo moritz: it was a junction before, it's no longer that because of performance
14:24 timotimo araraloren_: what was the bug? and how much faster did it get?
14:25 timotimo araraloren_: also, if you run it with perl6 --stagestats you can see if parsing it takes noticably long and turn it into a module that gets precompiled
14:25 El_Che moritz: your book arrived today :)
14:25 timotimo so your script will just be "use FindTheFiles" and the module would be the contents of what is now the script file
14:26 araraloren_ ok, I'll test later
14:29 census joined #perl6
14:31 Ven joined #perl6
14:34 moritz El_Che: \o/
14:44 cdg joined #perl6
14:45 comborico1611 joined #perl6
14:54 comborico1611 Good morning.
14:55 raschipi morning
14:56 comborico1611 Been on here long?
14:56 comborico1611 (today)
14:57 raschipi 2h28min
14:58 comborico1611 Having a productive day?
14:59 raschipi i think now it will work
15:00 araraloren_ timotimo, it speed up the script about 20%.
15:03 araraloren_ yeah, and the parser take long than old one
15:05 araraloren_ And I have not found the module FindTheFile :)
15:06 araraloren_ oh, I misunderstand you. yeah I'll make it as a App module.
15:10 timotimo how long does it take for "stage parse" and all that?
15:12 mempko joined #perl6
15:14 llfourn joined #perl6
15:16 cdg joined #perl6
15:18 araraloren_ The "stage parse" is about 0.497, what do you mean all ? timotimo
15:19 timotimo it also spends a bit of time in stage optimize and stage mast usually
15:19 timotimo that time also goes down if your code is just "use App::FindStuffInFolders;"
15:19 araraloren_ oh, awesome
15:20 araraloren_ it's about 0.027 and 0.037
15:20 araraloren_ and the mbc stage is about 0.001
15:20 ryn1x joined #perl6
15:21 timotimo OK, just a tiny win
15:21 araraloren_ Great, I gotta got to bed now, many thanks tonight timotimo
15:21 araraloren_ good night
15:22 timotimo good night!
15:39 HoboWithAShotgun m: my @foo = (1,2,3); say @foo.map( $++ => *).join(';');
15:39 camelia rakudo-moar 06cbe9c29: OUTPUT: «0       1;1     2;2     3␤»
15:39 HoboWithAShotgun where does that zro come from?
15:40 Cabanossi joined #perl6
15:40 [Coke] from the $
15:41 [Coke] m: say $; say $++;
15:41 camelia rakudo-moar 06cbe9c29: OUTPUT: «(Any)␤0␤»
15:41 [Coke] m: say +$;
15:41 camelia rakudo-moar 06cbe9c29: OUTPUT: «Use of uninitialized value of type Any in numeric context␤0␤  in block <unit> at <tmp> line 1␤»
15:42 jnthn I think from the definition of ++ on a type object
15:44 HoboWithAShotgun is there an automatic loop counter?
15:45 timotimo there is not
15:45 HoboWithAShotgun bummer
15:45 timotimo but $++ or ++$ can work as one
15:45 HoboWithAShotgun i got bitten by that already
15:46 timotimo m: say (1, 2, 3).pairs.join(";")
15:46 camelia rakudo-moar 06cbe9c29: OUTPUT: «0       1;1     2;2     3␤»
15:46 timotimo btw
15:46 timotimo and yes, $++ on an undefined value (what $ starts out containing) will return 0 rather than whatever undefined value was in $ before
15:46 timotimo because you're using it as a number, so having 0 as the starting point makes sense
15:48 HoboWithAShotgun no i got bitten by it not getting reset to zero after the loop. so when i tried to ran that loop again it didn't work because $++ still had the value of the previous use
15:49 kerframil joined #perl6
15:49 AlexDaniel HoboWithAShotgun: do you have any specific example? I think we want to add something to https://docs.perl6.org/language/traps#Using_a_once_block
15:51 HoboWithAShotgun not anymore no.
15:52 jnthn m: my @foo = (1,2,3); say @foo.kv.map(* => *).join(';');
15:52 camelia rakudo-moar 06cbe9c29: OUTPUT: «0       1;1     2;2     3␤»
15:52 jnthn Why not this? :)
15:56 comborico1611 m: my $greet = sub { say "hi"; }; $greet( );
15:56 camelia rakudo-moar 06cbe9c29: OUTPUT: «hi␤»
15:56 comborico1611 m: my $greet = sub { say "hi"; }; $greet;
15:56 camelia rakudo-moar 06cbe9c29: OUTPUT: «WARNINGS for <tmp>:␤Useless use of $greet in sink context (line 1)␤»
15:57 comborico1611 m: my $greet = sub { say "hi"; }; $greet ( );
15:57 camelia rakudo-moar 06cbe9c29: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3my $greet = sub { say "hi"; }; $greet7⏏5 ( );␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement…»
15:57 yqt joined #perl6
16:03 ufobat m: my $greet = sub { say "hi"; }; $greet.();
16:03 camelia rakudo-moar 06cbe9c29: OUTPUT: «hi␤»
16:03 ufobat m: my &greet = sub { say "hi"; }; greet();
16:03 camelia rakudo-moar 06cbe9c29: OUTPUT: «hi␤»
16:04 ufobat m: my sub greet() { say "hi"; }; greet();
16:04 camelia rakudo-moar 06cbe9c29: OUTPUT: «hi␤»
16:05 comborico1611 .() Interesting! Thank you.
16:06 comborico1611 m: my $greet = sub { say "hi"; }; $greet.( );
16:06 camelia rakudo-moar 06cbe9c29: OUTPUT: «hi␤»
16:09 ufobat you have lexical subs as well
16:10 comborico1611 In fact, i think the method call is the most accurate way!
16:10 ufobat m: sub foo { my sub greet { say "hi" };    greet()  }; a()
16:10 camelia rakudo-moar 06cbe9c29: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    a used at line 1␤␤»
16:10 ufobat m: sub foo { my sub greet { say "hi" };    greet()  }; foo()
16:10 camelia rakudo-moar 06cbe9c29: OUTPUT: «hi␤»
16:10 comborico1611 Are you talking about .What etc?
16:10 ufobat m: sub foo { my sub greet { say "hi" };    greet()  }; greet(); foo() # greet() outside of foo() doesn't work
16:10 camelia rakudo-moar 06cbe9c29: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    greet used at line 1. Did you mean 'grep'?␤␤»
16:11 comborico1611 I think that's a little too advanced for me to understand right now.
16:11 ufobat i dont know if this is true, but if you ask me i'd find it strange to have a $scalar for a sub
16:12 ufobat basically you can delcare subs inside subs
16:12 comborico1611 For sure.
16:12 ufobat as you declare my $variables;
16:12 ufobat and they have a lexical scope, which means you can only use them within your (current) sub
16:13 ufobat and with that you could maybe avoid storing a anon sub in a $scalar
16:13 ufobat just as an idea
16:13 comborico1611 I agree (from what i can understand). Using confusing code is not good.
16:14 ufobat sub foo { my sub greet { say "hi" }; ...;   greet()  }; <-- you see sub greet is delcared inside foo
16:14 ufobat so you can use greet() only inside foo
16:14 comborico1611 Yes. Local scope.
16:14 ufobat that's what i mean :)
16:15 comborico1611 Gotcha. Thanks for the tips!
16:20 cdg joined #perl6
16:22 cdg_ joined #perl6
16:27 geospeck joined #perl6
16:31 philomath joined #perl6
16:32 ryn1x joined #perl6
16:32 dugword joined #perl6
16:34 mingdao joined #perl6
16:45 margeas joined #perl6
16:50 Geth ¦ marketing: 4d940542f6 | (Zoffix Znet)++ | 34 files
16:50 Geth ¦ marketing: Reorganize structure
16:50 Geth ¦ marketing:
16:50 Geth ¦ marketing: - Add `pub` dir that will have usable, relocation-safe links to materials
16:50 Geth ¦ marketing: - Add `archive` dir to keep outdated stuff at
16:50 Geth ¦ marketing: review: https://github.com/perl6/marketing/commit/4d940542f6
16:53 HaraldJoerg left #perl6
16:54 Geth ¦ marketing: d9cda79be7 | (Zoffix Znet)++ | 23 files
16:54 Geth ¦ marketing: Add "Introducing Perl 6" brochure
16:54 Geth ¦ marketing:
16:54 Geth ¦ marketing: First draft
16:54 Geth ¦ marketing: review: https://github.com/perl6/marketing/commit/d9cda79be7
16:55 Geth ¦ marketing: 803884ef64 | (Zoffix Znet)++ | pub/Introducing-Perl6-Brochure.pdf
16:55 Geth ¦ marketing: Add pub symlink to Introducing Perl 6 brochure
16:55 Geth ¦ marketing: review: https://github.com/perl6/marketing/commit/803884ef64
16:55 Cabanossi joined #perl6
16:56 Geth ¦ marketing: 1323e739ad | (Zoffix Znet)++ (committed using GitHub Web editor) | pub/README.md
16:56 Geth ¦ marketing: Add clickable link to raw PDF
16:56 Geth ¦ marketing: review: https://github.com/perl6/marketing/commit/1323e739ad
16:56 HoloIRCUser2 joined #perl6
17:06 zakharyas joined #perl6
17:07 domidumont joined #perl6
17:08 ryn1x joined #perl6
17:08 nadim joined #perl6
17:10 mcmillhj joined #perl6
17:13 st_elmo joined #perl6
17:14 abraxxa joined #perl6
17:19 Voldenet m: await (^3).map({ start { sleep(.100); }}); say now - BEGIN now
17:19 camelia rakudo-moar 06cbe9c29: OUTPUT: «0.17777005␤»
17:20 Voldenet I wonder if there's any good way to get the critical {} working
17:22 Voldenet using Lock.protect sounds good enough, I'm just wondering if I can use some global namespace for magic "critical" keyword
17:23 epony joined #perl6
17:24 Voldenet m: sub critical(&c) { state $lck = Lock.new(); $lck.protect: &c; }; await (^3).map({ start { critical { sleep(.100); }}}); say now - BEGIN now
17:24 camelia rakudo-moar 06cbe9c29: OUTPUT: «0.343150␤»
17:25 ugexe shouldnt use state var for locks
17:26 Voldenet Okay. But why?
17:27 ugexe its not thread safe to do since its at least two non-atomic operations, //=, (is this defined) -> (if not then define it)
17:27 ugexe so you could get two threads hitting it before its defined
17:27 Voldenet Oh, so...
17:27 Voldenet m: sub critical(&c) { with BEGIN Lock.new() { .protect: &c } }; await (^3).map({ start { critical { sleep(.100); }}}); say now - BEGIN now
17:27 camelia rakudo-moar 06cbe9c29: OUTPUT: «0.3735283␤»
17:27 ugexe or something like that. so generally you just put it as a lexical or a attribute
17:28 Voldenet that'd be better, right?
17:28 ugexe yeah i think that is ok
17:28 Voldenet thanks
17:29 geekosaur there's an atomicvar also
17:29 mcmillhj joined #perl6
17:31 timotimo zoffix, "and with that how to get started" sounds strange
17:32 abraxxa joined #perl6
17:32 timotimo i wonder if i should open github issues for this?
17:40 mson joined #perl6
17:43 ryn1x joined #perl6
17:44 timotimo i like the brochure. only very minor issues
17:44 ChoHag joined #perl6
17:55 rgrau joined #perl6
18:07 timotimo i expect the pages from our books would just be added from wendy's original brochure pdf?
18:17 zakharyas joined #perl6
18:23 geospeck joined #perl6
18:28 tailgate joined #perl6
18:30 Geth ¦ marketing: a9c65b4824 | (Zoffix Znet)++ (committed using GitHub Web editor) | README.md
18:30 Geth ¦ marketing: Add license section
18:30 Geth ¦ marketing: review: https://github.com/perl6/marketing/commit/a9c65b4824
18:32 tailgate Hi, I'm trying to set up zef on OSX. I installed it with rakudobrew, and packages install sucessfully. However, if I atempt to use a package i installed, I get Could not find Text::CSV at line 1 in: (list of folders)
18:32 tailgate what do I need to change to get this working?
18:34 [Coke] tailgate: works fine here; do you have multiple versions of rakudo installed with rakudobrew?
18:34 tailgate I installed previous versions. Is there a way to check that?
18:34 tailgate I used homebrew
18:34 [Coke] ... homebrew, or rakudobrew?
18:35 [Coke] I'm testing Text::CSV right now in case there's something weird about that module in particular. (works for me in general though, using a single installed rakudo version in rakudobrew and using zef as my module installer)
18:36 [Coke] when you install a module, it's for that named version you installed with rakudobrew; so moar-2017.10 might have it, but moar-2017.09 could not.
18:36 [Coke] (yup, that module works fine)
18:37 tailgate yeah, I think I have something screwed up on my side
18:37 [Coke] so could be version skew in rakudobrew; could be a typo in your use: $ perl6 -MText::CSV -eNil; will test that one module.
18:38 tailgate I get the same error
18:38 HoboWithAShotgun m: my $proc  = run 'sed', 's/e/x/', :in($input); say $proc.in.put("test", );
18:38 camelia rakudo-moar 06cbe9c29: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$input' is not declared␤at <tmp>:1␤------> 3my $proc  = run 'sed', 's/e/x/', :in(7⏏5$input); say $proc.in.put("test", );␤»
18:39 HoboWithAShotgun m: my $proc  = run 'sed', 's/e/x/', :in("tee"); say $proc.in.put("test", );
18:39 camelia rakudo-moar 06cbe9c29: OUTPUT: «run is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub run at src/RESTRICTED.setting line 14␤  in block <unit> at <tmp> line 1␤␤»
18:39 HoboWithAShotgun meh
18:39 troys joined #perl6
18:39 tailgate [Coke]: I figured it out. I need to run rakudobrew init and put rakudo in my PATH
18:40 tailgate so I just need to set up my shell's init
18:40 HoboWithAShotgun anyway, the put line above complains about the signature not matching.
18:40 ugexe because :in does not take a command to run
18:40 Cabanossi joined #perl6
18:40 ugexe you give it a handle
18:41 [Coke] tailgate: ah, so maybe were testing with a different perl6 than the RB one.
18:42 tailgate Im using homebrew's rakudo-star
18:42 ugexe my $tee = shell "tee", :out, :in; and :in($tee.out) + $tee.in.put(...) or some such
18:42 [Coke] so no rakudobrew at all?
18:42 tailgate no, I have it installed.
18:42 tailgate rakudo init fixed it
18:43 [Coke] ... rakudo-star and rakudobrew are two completely different things. you have both?
18:43 tailgate yeah
18:44 wander joined #perl6
18:46 setty1 joined #perl6
18:47 tailgate The zef instructions said to use rakudobrew
18:48 [Coke] if you're using zef via rakudobrew, then you're not using rakudo-star anymore.
18:48 TimToady joined #perl6
18:49 tailgate hmm. If i uninstall rakudo-star, my perl6 command is gone too
18:49 [Coke] rakudo star comes with zef, a bunch of modules pre-installed...
18:49 ugexe well, if you have a rakudostar installed and also rakudobrew its possible for the rakudobrew perl6's zef bin to use the rakudo star lib of zef (old)
18:50 [Coke] tailgate: ah, trust ugexe over me, they wrote zef.
18:51 tailgate Is it better to install zef manually or rakudobrew?
18:51 ugexe if you do `zef --help` it will show you the path of its configuration file
18:51 ugexe that should show you if the correct zef is being used
18:51 [Coke] tailgate: again, you should have already had zef installed from star.
18:53 Rawriful joined #perl6
18:58 wander or `zef --help  |& grep CONFIGURATION` for `zef --help` prints a lot of infos
18:59 ryn1x joined #perl6
19:00 comborico1611 joined #perl6
19:01 geospeck joined #perl6
19:05 Aaronepower joined #perl6
19:09 ilogger2_ joined #perl6
19:10 Cabanossi joined #perl6
19:10 ilogger2 joined #perl6
19:30 HoboWithAShotgun how do i create a rx// with a :g modifier?
19:31 ryn1x joined #perl6
19:32 HoboWithAShotgun i tried $something ~~ m:g/$rx/; but that only matches once
19:33 moritz huh
19:34 moritz m: my $re = rx/./; say 'abc' ~~ m:g/$re/
19:34 camelia rakudo-moar 06cbe9c29: OUTPUT: «(「a」 「b」 「c」)␤»
19:34 moritz seems to match three times, as expected
19:34 huf *can* g be part of the regex (and not the application of the regex)?
19:34 moritz no
19:34 moritz it's a run-time only adverb
19:34 HoboWithAShotgun allright, mus be something else then
19:34 mcmillhj joined #perl6
19:34 huf oh but the original also, silly me
19:36 st_elmo joined #perl6
19:40 shlomif joined #perl6
19:40 shlomif joined #perl6
19:43 shlomif joined #perl6
19:44 mempko joined #perl6
19:45 ilogger2 joined #perl6
19:47 espadrine joined #perl6
19:48 rindolf joined #perl6
19:50 HoboWithAShotgun m: my $reg = 'foo|bar'; say "1"; say "foo" ~~ / $reg /; say "2";  say "foo" ~~ / foo|bar /;
19:50 camelia rakudo-moar 06cbe9c29: OUTPUT: «1␤Nil␤2␤「foo」␤»
19:51 HoboWithAShotgun what am i missing here, why is the first one not matching?
19:52 moritz strings are interpolated as literals
19:52 moritz you need <$reg> if you want it to be interpreted as a regex
19:55 Cabanossi joined #perl6
19:57 wander otherwise it is literal
19:57 wander m: my $reg = 'foo|bar'; say "1"; say "foo|bar" ~~ / $reg /;
19:58 camelia rakudo-moar 06cbe9c29: OUTPUT: «1␤「foo|bar」␤»
19:58 wander https://docs.perl6.org/language/regexes#Regex_Interpolation
20:01 epony joined #perl6
20:04 ChoHag joined #perl6
20:06 vike joined #perl6
20:12 comborico1611 joined #perl6
20:14 HoboWithAShotgun i got bitten by something, not sure if it's a bug. This works: https://hastebin.com/bufudurowu.pl, this doesn't: https://hastebin.com/abotumajuq.pl
20:16 HoboWithAShotgun it's probably that eval trap?
20:16 HoboWithAShotgun but i don't see what's wrong with that even if it gets eval'ed
20:17 timotimo check what $i has in it afterwards
20:17 timotimo probably something much larger than 4
20:18 timotimo the <{ ... }> code is getting re-run every time the match reaches that point
20:18 timotimo m: my $i = 0; say "foo foo foo foo" ~~ / <{ say $i++; "foo" }> /;
20:19 camelia rakudo-moar 06cbe9c29: OUTPUT: «0␤「foo」␤»
20:19 HoboWithAShotgun 32
20:19 timotimo m: my $i = 0; say "foo foo foo foo" ~~ m:g/ <{ say $i++; "foo" }> /;
20:19 camelia rakudo-moar 06cbe9c29: OUTPUT: «0␤1␤2␤3␤4␤5␤6␤7␤(「foo」 「foo」 「foo」 「foo」)␤»
20:19 timotimo you'll be matching 0foo | 1bar | 2baz | 3pun the first time
20:19 timotimo the second time you'll be matching against 4foo | 5bar | 6baz | 7pun
20:20 timotimo thanks to backtracking and searching for the next possible match it probably won't match 0foo_5barz either. perhaps 0foo_9barz or even later
20:23 timotimo HoboWithAShotgun: does the explanation make any sense?
20:23 HoboWithAShotgun makes sense. the code block could return something else at each run
20:28 releasable6 joined #perl6
20:29 HoboWithAShotgun on a scale of 1 to 10, how terrible is this: https://hastebin.com/akagikufeg.pl
20:30 HoboWithAShotgun (line 12)
20:32 lizmat HoboWithAShotgun: how about "map( { .perl.substr(1, *-2) } )" ?
20:32 HoboWithAShotgun yeah
20:32 lizmat haven't tried, but this may also work "map( *.perl.substr: 1, *-2 )" ?
20:33 HoboWithAShotgun no, i mean how terrible is it to stringify a regex, strip the // and return it into a combined regex
20:33 HoboWithAShotgun it feels there should be a better way to combine regexes
20:33 lizmat ah, ok, like that
20:34 * lizmat doesn't know of a way, but again, that's not saying much :-)
20:34 moritz HoboWithAShotgun: well, you can build an array of regexes in the form rx/ $i $previous_regex /
20:34 philomath joined #perl6
20:34 moritz and then interpolate the resulting array
20:35 HoboWithAShotgun huh?
20:35 patrickz joined #perl6
20:35 robertle joined #perl6
20:37 moritz let me try to make an example
20:38 cdg joined #perl6
20:38 cdg joined #perl6
20:38 moritz HoboWithAShotgun: http://perlpunks.de/paste/show/5a0a02db.1736.259
20:39 moritz in Perl 6, regexes are much more like code than they are strings
20:39 ugexe m: my $a = /a/; my $b = /b/; my $ab = /<$a> <$b>/; say "a" ~~ $ab; say "b" ~~ $ab; say "ab" ~~ $ab; # i already typed this so damnit im pasting it
20:39 camelia rakudo-moar 06cbe9c29: OUTPUT: «Nil␤Nil␤「ab」␤»
20:40 moritz so you should the approach transforming regexes much like you would transforming code
20:40 moritz by embedding it in closures
20:40 moritz m: my $a = /a/; my $b = /b/; my $ab = /$a $b/; say "a" ~~ $ab; say "b" ~~ $ab; say "ab" ~~ $ab;
20:40 camelia rakudo-moar 06cbe9c29: OUTPUT: «Nil␤Nil␤「ab」␤»
20:40 moritz no need for <$foo> if $foo already contains a Regex object
20:41 HoboWithAShotgun nice.
20:41 HoboWithAShotgun now go and claim your price for solving something in 2 minutes I needed an  hour for
20:41 HoboWithAShotgun https://stackoverflow.com/questions/47267671/combining-regexes-using-a-loop-in-perl-6/47268308#47268308
20:43 * HoboWithAShotgun puts the @.kv trick into his book
20:43 HoboWithAShotgun i had no idea that works with arrays too
20:44 ryn1x joined #perl6
20:44 HoboWithAShotgun and i see no why there is no magic line counter, you don't need it
20:44 lizmat s/no/know ?
20:44 lizmat or s/no/now ?
20:44 HoboWithAShotgun dyslexia.
20:45 HoboWithAShotgun sometimes it slips through :)
20:45 lizmat .oO( dyslexis untie! )
20:45 moritz HoboWithAShotgun: see https://smile.amazon.com/Parsing-Perl-Regexes-Grammars-Recursive/dp/1484232275 for more tricks :-)
20:48 AlexDaniel joined #perl6
20:49 moritz m: say Regex.^mro
20:49 camelia rakudo-moar 06cbe9c29: OUTPUT: «((Regex) (Method) (Routine) (Block) (Code) (Any) (Mu))␤»
20:55 HoboWithAShotgun shameless self plugger
20:55 HoboWithAShotgun i like it :)
20:59 comborico1611 Moritz, where are you from? My last name is Dolenz.
20:59 moritz comborico1611: Germany
20:59 comborico1611 Do you have Slavic ancestry?
21:00 mspo not Geneva living with the frankenstein family?
21:00 moritz comborico1611: not that I know of. "Lenz" is an old-ish German word for "spring" (the season)
21:00 mspo (Justine Moritz)
21:01 moritz and Moritz can also be a last name, yes
21:01 comborico1611 Hmm.  Dolenc is Slovenian the low-lands.  The C was changed to Z during immigration to America.
21:02 comborico1611 For low-lands*
21:08 comborico1611 Or hills (i can't remember)
21:09 comborico1611 Is "where" used mostly inside of signatures?
21:09 timotimo you can also use it for a subset declaration
21:10 timotimo m: subset Greeting of Str where /:i hi /; say "oh hi mark" ~~ Greeting
21:10 camelia rakudo-moar b2fbf893d: OUTPUT: «True␤»
21:10 timotimo m: subset Greeting of Str where /:i hi /; say "you're my favourite customer" ~~ Greeting
21:10 camelia rakudo-moar b2fbf893d: OUTPUT: «False␤»
21:10 Cabanossi joined #perl6
21:10 comborico1611 Oh yes, i see.  (That is the next paragraph in the book.). Mainly those two, alright.
21:12 andrzejku joined #perl6
21:19 mempko joined #perl6
21:33 kaare__ joined #perl6
21:37 nadim joined #perl6
21:45 ryn1x joined #perl6
21:46 zostay_ joined #perl6
21:47 jcallen_ joined #perl6
21:48 Shozan joined #perl6
21:49 freeze_ joined #perl6
21:49 cdg joined #perl6
21:49 BinGOs_ joined #perl6
21:52 erdic_ joined #perl6
21:52 erdic_ joined #perl6
21:52 7GHAA6UVM joined #perl6
21:52 tabv joined #perl6
21:53 leedo joined #perl6
21:54 unicodable6 joined #perl6
21:55 Cabanossi joined #perl6
21:56 squashable6 joined #perl6
21:56 daxim joined #perl6
21:57 charsbar joined #perl6
21:59 yqt joined #perl6
22:08 wamba joined #perl6
22:08 mienaikage joined #perl6
22:11 lizmat and another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2017/11/13/2017-46-spesh-explained/
22:17 comborico1611 A weekly update is very impressive for volunteer work.
22:17 MasterDuke joined #perl6
22:18 lizmat comborico1611: thank you :-)
22:21 benchable6 joined #perl6
22:21 coverable6 joined #perl6
22:21 quotable6 joined #perl6
22:22 bisectable6 joined #perl6
22:22 releasable6 joined #perl6
22:22 committable6 joined #perl6
22:22 nativecallable6 joined #perl6
22:22 comborico1611 I've been impressed with the community, for sure.
22:25 pilne joined #perl6
22:26 ilmari[m] joined #perl6
22:26 wamba[m] joined #perl6
22:26 mack[m] joined #perl6
22:26 M-Illandan joined #perl6
22:26 wictory[m] joined #perl6
22:26 Matthew[m] joined #perl6
22:26 tyil[m] joined #perl6
22:26 tadzik joined #perl6
22:26 unclechu joined #perl6
22:26 AlexDaniel` joined #perl6
22:26 xui_nya[m] joined #perl6
22:27 CIAvash[m] joined #perl6
22:27 Garland_g[m] joined #perl6
22:27 ryn1x joined #perl6
22:29 squashable6 joined #perl6
22:30 Ven joined #perl6
22:32 TEttinger joined #perl6
22:36 AlexDaniel and yet again I forgot to generate the report… uhh
22:37 AlexDaniel time to make a bot I guess
22:37 lizmat AlexDaniel: that's ok, we'll do a two week one next week :-)
22:38 ryn1x joined #perl6
22:40 SmokeMachine how can I get a ISO-8859-1 string from a socket async?
22:42 timotimo that's latin1, isn't it?
22:42 wamba joined #perl6
22:42 timotimo hm, i thought the Supply method allowed setting an encoding
22:43 timotimo well, i'd suggest doing something like whenever $mysocket.Supply(:bin).map(*.decode('latin-1')) { say $_ }
22:44 SmokeMachine yes, latin1...
22:44 SmokeMachine thanks!
22:45 kitsunenokenja joined #perl6
22:55 Cabanossi joined #perl6
23:02 niceperl joined #perl6
23:11 timotimo :o the talk about spitsh has been uploaded for like two weeks and i totally missed it :|
23:16 statisfiable6 joined #perl6
23:25 Cabanossi joined #perl6
23:27 statisfiable6 joined #perl6
23:28 cdg joined #perl6
23:43 comborico1611 joined #perl6
23:44 ggherdov joined #perl6
23:45 ryn1x joined #perl6
23:50 mcmillhj joined #perl6
23:51 timotimo llfourn: i'm really enjoying that talk
23:53 cdg joined #perl6
23:53 pecastro joined #perl6
23:55 Cabanossi joined #perl6
23:56 cdg joined #perl6
23:57 raschipi joined #perl6

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

Perl 6 | Reference Documentation | Rakudo