»ö« 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.
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 jenkins.p6.nu/job/rakudo/7/os=linux/tapResults/ 00:33
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:52
eh its not actually testing prove 00:55
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 -_-
ugexe almost seems like a $*EXECUTABLE-BUT-WITH-MAH-LIBS would be useful
leont (no idea if that got fixed in the mean time) 01:04
ugexe i havent gotten to prove-invoked-spectest yet, but hopefully that was fixed 01:06
comborico1611 m: sub t ( say "hello" ); t; 02:09
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid typename 'say' in parameter declaration.
at <tmp>:1
------> 3sub t ( say7⏏5 "hello" ); t;
comborico1611 m: sub t ( say "hello"; ); t;
camelia 5===SORRY!5=== Error while compiling <tmp>
Invalid typename 'say' in parameter declaration.
at <tmp>:1
------> 3sub t ( say7⏏5 "hello"; ); t;
geekosaur does your font show the difference between { and ( ? 02:11
comborico1611 m: sub t ( ) { say "hello" }; t;
camelia hello
comborico1611 I'm ashamed to answer that question. Lol
m: sub t { say "hello" }; t; 02:12
camelia hello
comborico1611 m: sub t( ) { say "hello" }; t;
camelia hello
comborico1611 Goodnight! 02:18
geekosaur ...it's common enough that I asked it... 02:21
blakers p6: say is anyone using perl6 in production? 03:09
camelia 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
blakers p6: say "is anyone using perl6 in production?"
camelia is anyone using perl6 in production?
ZzZombo Can I can easily get a list of items in hash, OTHER than those with provided keys? 05:27
Kinda like reverse slice. 05:28
lookatme m: my %h = 1 => 2, 3 => 5; say %h.[0]; 05:30
camelia {1 => 2, 3 => 5}
ZzZombo Uh, what is that?
lookatme Just trying to do 05:31
ZzZombo ah, okay.
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.
lookatme oh 05:33
m: my %h = 1 => 2, 3 => 5, 4 => 6; say %hR<1 2>; 05:34
camelia 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>;
ugexe m: my %foo = :a<1>, :b<2>, :c<3>; my @choices = <a d>; say %foo.grep({.key !~~ any @choices}).perl
camelia (:c(IntStr.new(3, "3")), :b(IntStr.new(2, "2"))).Seq
lookatme m: my %h = 1 => 2, 3 => 5; say %h{%h.keys (-) [1, 2]};
camelia (Any)
lookatme m: my %h = 1 => 2, 3 => 5, 4 => 6; say %h{(%h.keys (-) [1, 2]).keys}; 05:38
camelia (2 5 6)
lookatme :(
m: my %h = 1 => 2, 3 => 5, 4 => 6; say %h{(%h.keys (-) <1, 2>).keys}; 05:43
camelia (2 5 6)
lookatme m: my %h = bar => 2, foo => 5, fbar => 6; say %h{%h.keys() (-) <foo bar>}; 05:47
camelia 6
parv that's interesting (set operation). 05:48
lookatme m: my %h = 1 => 2, 2 => 5, fbar => 6; say %h{%h.keys() (-) ("1", "2")};
camelia 6
lookatme m: my %h = 1 => 2, 2 => 5, fbar => 6; say %h{%h.keys() (-) <1 2 >}; # that's not work 05:49
camelia (Any)
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 6
parv oh man, too much work that. 05:51
(relatively speaking)
lookatme hmm
parv lookatme, could that be due to IntStr thing? 05:57
say <4 5 >.perl
evalable6 (IntStr.new(4, "4"), IntStr.new(5, "5"))
parv p6: say <4 5 >.perl
camelia (IntStr.new(4, "4"), IntStr.new(5, "5"))
lookatme oh 05:58
parv p6: say <a b >.perl
camelia ("a", "b")
lookatme That's why it not work :(
m: say Q :w <1 2 >
camelia (1 2)
lookatme m: say Q :w <1 2 > .WHAT
camelia ===SORRY!===
Method call must either supply a name or have a child node that evaluates to the name
lookatme m: say (Q :w <1 2 > ).WHAT 05:59
camelia (List)
lookatme m: say (Q :w <1 2 > ).[0]WHAT
camelia 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…
lookatme m: say (Q :w <1 2 > ).[0].WHAT
camelia (Str)
lookatme m: dd (Q :w <1 2 > )
camelia ("1", "2")
parv "try harder to convert Int to Str" is the way to go (for now) :-| 06:00
lookatme oh 06:00
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 : ideone.com/Cm7Cox
yeah, I write some module
my nickname is araraloren 06:04
Hmm, How to find module use the robot ? I forgot it 06:05
parv lookatme, thanks. i am reading your program. 06:08
lookatme Oh, that's use for find source file of c / c++
lookatme grep: Getopt 06:09
greppable6 lookatme, gist.github.com/44190923ec32ed4f2d...498c245f63
parv still, that is much more than what I had used perl6 (only just on the command line/REPL). 06:10
lookatme we can use it in our work 06:13
I'm a c/c++ developer, So I make a perl6 app : github.com/araraloren/perl6-app-snippet 06:15
run some c/c++ snippet
parv lookatme, got that. 06:17
lookatme parv, And some other script for personal using, such like a simple spdier: github.com/araraloren/Getopt-Kinok...picture.p6 , using for fetch picture in Baidu tieba(in china) 06:18
moritz good morning 06:18
lookatme moritz, morning o/
ufobat_ heya :) 08:16
lookatme :) ho 08:17
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:39
Arimaafan9 anyone know how to do this? I tried asking on stackoverflow, but couldnt get an answer. 08:41
lookatme Arimaafan9, are you trying make a module ? 08:42
moritz doesn't find the question on SO 09:01
stmuk is there anything like "hackerrank" which is more OSS friendly, obscure language friendly and less recruiter focussed? 10:48
tbrowder Arimaafan9: can you show a min version of what you’re trying to do? 11:02
Zoffix huggable: advent 11:41
huggable Zoffix, Sign up to write an Advent blog post: github.com/perl6/mu/blob/master/mi...7/schedule
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
rakudo.party/post/Rakudo-Perl-6-Ad...or-Authors
Geth mu: d998b267f9 | (Zoffix Znet)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
Make schedule emptier
11:49
Zoffix (might still write those, but keep them as emergency advent hole filler)
Geth mu: a94cc1f361 | (Elizabeth Mattijsen)++ | misc/perl6advent-2017/schedule
Tentative shotgun on the final Advent post

This is a blog post that's been brewing inside of me for a long time already. It should give people food for thought. But I'm also open to taking such a post elsewhere or elsetime.
11:54
Zoffix \o/ 11:55
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
El_Che, Details: gist.github.com/6d31a40b2aa569dc6c...cee8e627b7
araraloren_ I他 12:49
It's harder find a good http client module :(
timotimo araraloren_: how do you like Cro::HTTP? 12:53
araraloren_ I have tried LWP::Simple HTTP::Client HTTP::UserAgent, every has its problem
I haven't try it yet
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?
araraloren_ timotimo, thanks
yeah, please
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:56
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
timotimo same for $os<w> as well 12:58
araraloren_ yeah, ok
I'll test it :) 12:59
Thanks, I playing game now :) 13:00
timotimo have fun!
araraloren_ Hmm :) 13:01
timotimo oh, and if/elsif/else is noticably faster than given/when in tight loops
araraloren_ OK 13:25
timotimo it won't be that way forever, but for now it is 13:27
araraloren_ yeah, I think they haven't optimize it 13:36
Geth perl6-most-wanted: 8fa0def9af | (Tom Browder)++ (committed using GitHub Web editor) | most-wanted/modules.md
giving up creating this module
13:49
araraloren_ ideone.com/KbiAdO I fixed some bug, and it quite fast now :) thanks 14:12
raschipi why do you have two shebangs? 14:15
araraloren_ Hmm, I paste one and the website has one :P 14:16
moritz @ret.push("$path/$f") if $f ne ".." && $f ne "."; 14:20
@ret.push("$path/$f") if $f eq none <. ..>;
timotimo moritz: it was a junction before, it's no longer that because of performance 14:24
araraloren_: what was the bug? and how much faster did it get?
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 :)
timotimo so your script will just be "use FindTheFiles" and the module would be the contents of what is now the script file
araraloren_ ok, I'll test later 14:26
moritz El_Che: \o/ 14:34
comborico1611 Good morning. 14:54
raschipi morning 14:55
comborico1611 Been on here long? 14:56
(today)
raschipi 2h28min 14:57
comborico1611 Having a productive day? 14:58
raschipi i think now it will work 14:59
araraloren_ timotimo, it speed up the script about 20%. 15:00
yeah, and the parser take long than old one 15:03
araraloren_ And I have not found the module FindTheFile :) 15:05
oh, I misunderstand you. yeah I'll make it as a App module. 15:06
timotimo how long does it take for "stage parse" and all that? 15:10
araraloren_ The "stage parse" is about 0.497, what do you mean all ? timotimo 15:18
timotimo it also spends a bit of time in stage optimize and stage mast usually 15:19
that time also goes down if your code is just "use App::FindStuffInFolders;"
araraloren_ oh, awesome
it's about 0.027 and 0.037 15:20
and the mbc stage is about 0.001
timotimo OK, just a tiny win 15:21
araraloren_ Great, I gotta got to bed now, many thanks tonight timotimo
good night
timotimo good night! 15:22
HoboWithAShotgun m: my @foo = (1,2,3); say @foo.map( $++ => *).join(';'); 15:39
camelia 0 1;1 2;2 3
HoboWithAShotgun where does that zro come from?
[Coke] from the $ 15:40
m: say $; say $++; 15:41
camelia (Any)
0
[Coke] m: say +$;
camelia Use of uninitialized value of type Any in numeric context
0
in block <unit> at <tmp> line 1
jnthn I think from the definition of ++ on a type object 15:42
HoboWithAShotgun is there an automatic loop counter? 15:44
timotimo there is not 15:45
HoboWithAShotgun bummer
timotimo but $++ or ++$ can work as one
HoboWithAShotgun i got bitten by that already
timotimo m: say (1, 2, 3).pairs.join(";") 15:46
camelia 0 1;1 2;2 3
timotimo btw
and yes, $++ on an undefined value (what $ starts out containing) will return 0 rather than whatever undefined value was in $ before
because you're using it as a number, so having 0 as the starting point makes sense
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:48
AlexDaniel HoboWithAShotgun: do you have any specific example? I think we want to add something to docs.perl6.org/language/traps#Usin...once_block 15:49
HoboWithAShotgun not anymore no. 15:51
jnthn m: my @foo = (1,2,3); say @foo.kv.map(* => *).join(';'); 15:52
camelia 0 1;1 2;2 3
jnthn Why not this? :)
comborico1611 m: my $greet = sub { say "hi"; }; $greet( ); 15:56
camelia hi
comborico1611 m: my $greet = sub { say "hi"; }; $greet;
camelia WARNINGS for <tmp>:
Useless use of $greet in sink context (line 1)
comborico1611 m: my $greet = sub { say "hi"; }; $greet ( ); 15:57
camelia 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…
ufobat m: my $greet = sub { say "hi"; }; $greet.(); 16:03
camelia hi
ufobat m: my &greet = sub { say "hi"; }; greet();
camelia hi
ufobat m: my sub greet() { say "hi"; }; greet(); 16:04
camelia hi
comborico1611 .() Interesting! Thank you. 16:05
m: my $greet = sub { say "hi"; }; $greet.( ); 16:06
camelia hi
ufobat you have lexical subs as well 16:09
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()
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
a used at line 1
ufobat m: sub foo { my sub greet { say "hi" }; greet() }; foo()
camelia hi
comborico1611 Are you talking about .What etc?
ufobat m: sub foo { my sub greet { say "hi" }; greet() }; greet(); foo() # greet() outside of foo() doesn't work
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
greet used at line 1. Did you mean 'grep'?
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
basically you can delcare subs inside subs 16:12
comborico1611 For sure.
ufobat as you declare my $variables;
and they have a lexical scope, which means you can only use them within your (current) sub
and with that you could maybe avoid storing a anon sub in a $scalar 16:13
just as an idea
comborico1611 I agree (from what i can understand). Using confusing code is not good.
ufobat sub foo { my sub greet { say "hi" }; ...; greet() }; <-- you see sub greet is delcared inside foo 16:14
so you can use greet() only inside foo
comborico1611 Yes. Local scope.
ufobat that's what i mean :)
comborico1611 Gotcha. Thanks for the tips! 16:15
Geth marketing: 4d940542f6 | (Zoffix Znet)++ | 34 files
Reorganize structure

  - Add `pub` dir that will have usable, relocation-safe links to materials
  - Add `archive` dir to keep outdated stuff at
16:50
Geth marketing: d9cda79be7 | (Zoffix Znet)++ | 23 files
Add "Introducing Perl 6" brochure

First draft
16:54
marketing: 803884ef64 | (Zoffix Znet)++ | pub/Introducing-Perl6-Brochure.pdf
Add pub symlink to Introducing Perl 6 brochure
16:55
Geth marketing: 1323e739ad | (Zoffix Znet)++ (committed using GitHub Web editor) | pub/README.md
Add clickable link to raw PDF
16:56
Voldenet m: await (^3).map({ start { sleep(.100); }}); say now - BEGIN now 17:19
camelia 0.17777005
Voldenet I wonder if there's any good way to get the critical {} working 17:20
using Lock.protect sounds good enough, I'm just wondering if I can use some global namespace for magic "critical" keyword 17:22
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 0.343150
ugexe shouldnt use state var for locks 17:25
Voldenet Okay. But why? 17:26
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
so you could get two threads hitting it before its defined
Voldenet Oh, so... 17:27
m: sub critical(&c) { with BEGIN Lock.new() { .protect: &c } }; await (^3).map({ start { critical { sleep(.100); }}}); say now - BEGIN now
camelia 0.3735283
ugexe or something like that. so generally you just put it as a lexical or a attribute
Voldenet that'd be better, right? 17:28
ugexe yeah i think that is ok
Voldenet thanks
geekosaur there's an atomicvar also 17:29
timotimo zoffix, "and with that how to get started" sounds strange 17:31
timotimo i wonder if i should open github issues for this? 17:32
timotimo i like the brochure. only very minor issues 17:44
timotimo i expect the pages from our books would just be added from wendy's original brochure pdf? 18:07
Geth marketing: a9c65b4824 | (Zoffix Znet)++ (committed using GitHub Web editor) | README.md
Add license section
18:30
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
what do I need to change to get this working?
[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?
I used homebrew
[Coke] ... homebrew, or rakudobrew?
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:35
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
(yup, that module works fine)
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.
tailgate I get the same error 18:38
HoboWithAShotgun m: my $proc = run 'sed', 's/e/x/', :in($input); say $proc.in.put("test", );
camelia 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", );
HoboWithAShotgun m: my $proc = run 'sed', 's/e/x/', :in("tee"); say $proc.in.put("test", ); 18:39
camelia 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
HoboWithAShotgun meh
tailgate [Coke]: I figured it out. I need to run rakudobrew init and put rakudo in my PATH 18:39
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.
ugexe because :in does not take a command to run
ugexe you give it a handle 18:40
[Coke] tailgate: ah, so maybe were testing with a different perl6 than the RB one. 18:41
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
[Coke] so no rakudobrew at all?
tailgate no, I have it installed.
rakudo init fixed it
[Coke] ... rakudo-star and rakudobrew are two completely different things. you have both? 18:43
tailgate yeah
tailgate The zef instructions said to use rakudobrew 18:47
[Coke] if you're using zef via rakudobrew, then you're not using rakudo-star anymore. 18:48
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...
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)
[Coke] tailgate: ah, trust ugexe over me, they wrote zef. 18:50
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
that should show you if the correct zef is being used
[Coke] tailgate: again, you should have already had zef installed from star.
wander or `zef --help |& grep CONFIGURATION` for `zef --help` prints a lot of infos 18:58
HoboWithAShotgun how do i create a rx// with a :g modifier? 19:30
HoboWithAShotgun i tried $something ~~ m:g/$rx/; but that only matches once 19:32
moritz huh 19:33
m: my $re = rx/./; say 'abc' ~~ m:g/$re/ 19:34
camelia (「a」 「b」 「c」)
moritz seems to match three times, as expected
huf *can* g be part of the regex (and not the application of the regex)?
moritz no
HoboWithAShotgun allright, mus be something else then
moritz it's a run-time only adverb
huf oh but the original also, silly me
HoboWithAShotgun m: my $reg = 'foo|bar'; say "1"; say "foo" ~~ / $reg /; say "2"; say "foo" ~~ / foo|bar /; 19:50
camelia 1
Nil
2
「foo」
HoboWithAShotgun what am i missing here, why is the first one not matching? 19:51
moritz strings are interpolated as literals 19:52
you need <$reg> if you want it to be interpreted as a regex
wander otherwise it is literal 19:57
m: my $reg = 'foo|bar'; say "1"; say "foo|bar" ~~ / $reg /;
camelia 1
「foo|bar」
19:58
wander docs.perl6.org/language/regexes#Re...erpolation
HoboWithAShotgun i got bitten by something, not sure if it's a bug. This works: hastebin.com/bufudurowu.pl, this doesn't: hastebin.com/abotumajuq.pl 20:14
it's probably that eval trap? 20:16
but i don't see what's wrong with that even if it gets eval'ed
timotimo check what $i has in it afterwards 20:17
probably something much larger than 4
the <{ ... }> code is getting re-run every time the match reaches that point 20:18
m: my $i = 0; say "foo foo foo foo" ~~ / <{ say $i++; "foo" }> /;
camelia 0
「foo」
20:19
HoboWithAShotgun 32
timotimo m: my $i = 0; say "foo foo foo foo" ~~ m:g/ <{ say $i++; "foo" }> /;
camelia 0
1
2
3
4
5
6
7
(「foo」 「foo」 「foo」 「foo」)
timotimo you'll be matching 0foo | 1bar | 2baz | 3pun the first time
the second time you'll be matching against 4foo | 5bar | 6baz | 7pun
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:20
HoboWithAShotgun: does the explanation make any sense? 20:23
HoboWithAShotgun makes sense. the code block could return something else at each run
HoboWithAShotgun on a scale of 1 to 10, how terrible is this: hastebin.com/akagikufeg.pl 20:29
(line 12) 20:30
lizmat HoboWithAShotgun: how about "map( { .perl.substr(1, *-2) } )" ? 20:32
HoboWithAShotgun yeah
lizmat haven't tried, but this may also work "map( *.perl.substr: 1, *-2 )" ?
HoboWithAShotgun no, i mean how terrible is it to stringify a regex, strip the // and return it into a combined regex 20:33
it feels there should be a better way to combine regexes
lizmat ah, ok, like that
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 /
moritz and then interpolate the resulting array 20:34
HoboWithAShotgun huh? 20:35
moritz let me try to make an example 20:37
moritz HoboWithAShotgun: perlpunks.de/paste/show/5a0a02db.1736.259 20:38
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
camelia Nil
Nil
「ab」
moritz so you should the approach transforming regexes much like you would transforming code 20:40
by embedding it in closures
m: my $a = /a/; my $b = /b/; my $ab = /$a $b/; say "a" ~~ $ab; say "b" ~~ $ab; say "ab" ~~ $ab;
camelia Nil
Nil
「ab」
moritz no need for <$foo> if $foo already contains a Regex object
HoboWithAShotgun nice. 20:41
now go and claim your price for solving something in 2 minutes I needed an hour for
stackoverflow.com/questions/472676...8#47268308
HoboWithAShotgun puts the @.kv trick into his book 20:43
i had no idea that works with arrays too
HoboWithAShotgun and i see no why there is no magic line counter, you don't need it 20:44
lizmat s/no/know ?
or s/no/now ?
HoboWithAShotgun dyslexia.
sometimes it slips through :) 20:45
lizmat
.oO( dyslexis untie! )
moritz HoboWithAShotgun: see smile.amazon.com/Parsing-Perl-Rege...1484232275 for more tricks :-)
moritz m: say Regex.^mro 20:49
camelia ((Regex) (Method) (Routine) (Block) (Code) (Any) (Mu))
HoboWithAShotgun shameless self plugger 20:55
i like it :)
comborico1611 Moritz, where are you from? My last name is Dolenz. 20:59
moritz comborico1611: Germany
comborico1611 Do you have Slavic ancestry?
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)
mspo (Justine Moritz)
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.
For low-lands* 21:02
Or hills (i can't remember) 21:08
comborico1611 Is "where" used mostly inside of signatures? 21:09
timotimo you can also use it for a subset declaration
m: subset Greeting of Str where /:i hi /; say "oh hi mark" ~~ Greeting 21:10
camelia True
timotimo m: subset Greeting of Str where /:i hi /; say "you're my favourite customer" ~~ Greeting
camelia False
comborico1611 Oh yes, i see. (That is the next paragraph in the book.). Mainly those two, alright. 21:10
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2017/11/13/...explained/ 22:11
comborico1611 A weekly update is very impressive for volunteer work. 22:17
lizmat comborico1611: thank you :-) 22:18
comborico1611 I've been impressed with the community, for sure. 22:22
AlexDaniel and yet again I forgot to generate the report… uhh 22:36
time to make a bot I guess 22:37
lizmat AlexDaniel: that's ok, we'll do a two week one next week :-)
SmokeMachine how can I get a ISO-8859-1 string from a socket async? 22:40
timotimo that's latin1, isn't it? 22:42
timotimo hm, i thought the Supply method allowed setting an encoding 22:42
timotimo well, i'd suggest doing something like whenever $mysocket.Supply(:bin).map(*.decode('latin-1')) { say $_ } 22:43
SmokeMachine yes, latin1... 22:44
thanks!
timotimo :o the talk about spitsh has been uploaded for like two weeks and i totally missed it :| 23:11
timotimo llfourn: i'm really enjoying that talk 23:51