»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
wildtrees star, though it doesnt seem to have zef 00:00
AlexDaniel wildtrees: I'd say it's a bit too old
wildtrees perl6 pines for zef install linenoise or readline though 00:01
I tried zef and it didnt work
searched around for zef perl6 on nixos and didnt get much 00:02
00:02 Manifest0 joined
wildtrees there is something called rakudobrew, does anyone use that? 00:02
AlexDaniel wildtrees: you can install zef manually: github.com/ugexe/zef#manual
wildtrees not sure how that will work with nix, I am kinda new to nixos 00:03
00:04 aborazmeh joined, aborazmeh left, aborazmeh joined
wildtrees is rakudo-star really old? 00:08
AlexDaniel wildtrees: the latest rakudo star version is 2019.03 00:10
wildtrees yea I noticed that 00:11
AlexDaniel, thank you for your help, I gotta run 00:12
00:12 wildtrees left 00:20 aborazmeh left 00:21 aborazmeh joined, aborazmeh left, aborazmeh joined 00:25 Manifest0 left 00:31 Manifest0 joined 00:33 MilkmanDan left 00:34 MilkmanDan joined 00:35 Cabanossi left, Cabanossi joined
Xliff m: say 5 »**« (^5) 00:41
camelia Lists on either side of non-dwimmy hyperop of infix:<**> are not of the same length while recursing
left: 1 elements, right: 5 elements
in block <unit> at <tmp> line 1
Xliff m: say 5 «**» (^5)
camelia (1 5 25 125 625)
00:41 Manifest0 left
Xliff m: say 4 «**» (^5) 00:41
camelia (1 4 16 64 256)
Xliff m: say 4 «**» (^6) 00:42
camelia (1 4 16 64 256 1024)
00:44 MilkmanDan left, MilkmanDan joined 00:47 Manifest0 joined 00:48 kaare_ left 00:56 Manifest0 left 01:03 Manifest0 joined 01:04 ChoHag_ left 01:12 Manifest0 left 01:13 noisegul_ joined 01:16 noisegul left 01:17 Manifest0 joined 01:21 ChoHag joined 01:28 Manifest0 left 01:33 Manifest0 joined 01:36 mowcat joined 01:37 Manifest0 left 01:43 Manifest0 joined 01:48 Manifest0 left 01:50 aborazmeh left 01:52 Manifest0 joined 01:57 Manifest0 left, mowcat left 02:04 Manifest0 joined 02:08 Manifest0 left 02:13 Manifest0 joined 02:14 sauvin_ is now known as Sauvin 02:21 Manifest0 left 02:27 aborazmeh joined, aborazmeh left, aborazmeh joined, Manifest0 joined 02:34 xiaoyafeng joined 02:37 Manifest0 left 02:42 Manifest0 joined 03:03 Manifest0 left 03:08 Manifest0 joined 03:35 Manifest0 left 03:41 Manifest0 joined 03:47 Manifest0 left 03:52 Manifest0 joined 03:57 Manifest0 left 04:00 Actualeyes joined 04:01 Actualeyes left, Actualeyes joined 04:02 Actualeyes left, Actualeyes joined 04:04 Actualeyes left, Manifest0 joined, Actualeyes joined 04:06 Actualeyes left, Actualeyes joined 04:08 Actualeyes left 04:09 Actualeyes joined 04:10 Manifest0 left 04:11 molaf joined 04:17 Manifest0 joined 04:22 Manifest0 left 04:27 Manifest0 joined 04:30 [Sno] left 04:38 Manifest0 left 04:42 cooper left 04:44 Manifest0 joined 04:50 Manifest0 left 04:51 aborazmeh left 04:53 nebuchadnezzar joined 04:55 Manifest0 joined 05:06 Manifest0 left 05:12 Manifest0 joined 05:16 Manifest0 left 05:22 Manifest0 joined 05:23 molaf left 05:28 Manifest0 left 05:31 robertle left 05:33 Manifest0 joined 05:35 Cabanossi left, kensanata joined 05:38 Cabanossi joined 05:45 ChoHag left 05:47 Manifest0 left 05:49 _jrjsmrtn left 05:54 Manifest0 joined 06:01 Manifest0 left 06:06 ChoHag joined 06:07 Manifest0 joined 06:13 Manifest0 left 06:19 brrt joined, domidumont joined 06:20 Manifest0 joined 06:25 Manifest0 left 06:30 Manifest0 joined 06:38 Manifest0 left 06:43 Manifest0 joined 06:48 Manifest0 left 06:50 S007 joined 06:53 Manifest0 joined 06:54 ambs left 06:59 Manifest0 left 07:04 kensanata left, Manifest0 joined 07:06 patrickb joined 07:07 rindolf joined, ambs joined 07:14 Manifest0 left 07:19 Manifest0 joined 07:22 domidumont1 joined 07:25 domidumont left 07:36 Manifest0 left 07:40 Manifest0 joined 07:47 Manifest0 left, antoniogamiz joined 07:51 antoniogamiz left 07:53 Manifest0 joined 07:55 antoniogamiz joined 07:58 Manifest0 left 08:02 zakharyas joined, Manifest0 joined, noisegul_ is now known as noisegul 08:06 __jrjsmrtn__ joined 08:12 kst` joined 08:13 kst left 08:14 dakkar joined 08:21 Manifest0 left
kawaii morning o/ 08:22
noisegul Good morning :) 08:23
antoniogamiz o/
08:26 Manifest0 joined 08:35 Manifest0 left 08:42 Manifest0 joined 08:46 domidumont1 left 08:49 dakkar left, dakkar joined 08:51 domidumont joined 09:01 Manifest0 left 09:02 aborazmeh joined, aborazmeh left, aborazmeh joined 09:10 antoniogamiz left 09:11 antoniogamiz joined, Manifest0 joined 09:14 kensanata joined 09:18 Manifest0 left
Geth ¦ doc: antoniogamiz self-assigned No space after category comma in indices (and in general generated pages with leading whitespace) github.com/perl6/doc/issues/2884 09:19
09:23 Manifest0 joined 09:27 Manifest0 left 09:30 domidumont left 09:34 Manifest0 joined 09:35 ChoHag left 09:41 kaare_ joined
El_Che when was #= addes to sub MAIN? 09:45
it does nothing on 2019.3.1
09:47 Sgeo_ joined 09:50 Sgeo__ left 09:51 MasterDuke left 09:54 huf joined, Black_Ribbon left 10:02 Manifest0 left 10:05 huf left 10:06 zakharyas left 10:07 Manifest0 joined 10:18 Manifest0 left 10:20 sena_kun joined
moritz a loong time ago 10:23
commit fbfccfa2ff30f6093176fa34da038442d8d427d5 10:24
Author: Elizabeth Mattijsen [email@hidden.address]
Date: Thu Oct 11 15:55:35 2018 +0200
Make handling of MAIN completely pluggable and documentable
might have been even before then
10:24 Manifest0 joined
El_Che mmm 10:26
El_Che checks his code again
10:39 aborazmeh left 10:44 user9 left
antoniogamiz each element in the meta part of every reference in the documentation should apper only once? 10:45
10:45 Manifest0 left
antoniogamiz s/apper/appear 10:45
or what should be unique is the entire meta part? 10:46
(I ask for this issue => github.com/perl6/doc/issues/1912)
lizmat isn't sure 10:51
lizmat will follow jmerelo's thoughts on this
10:52 Manifest0 joined
antoniogamiz lizmat: ok, I will talk with him :) 10:53
is there a function to classify the duplicates in a list?
I mean, for instance if we have this list [1,2,1,2,2] 10:54
lizmat you want to know which ones occur more than once? repeated
docs.perl6.org/routine/repeated
antoniogamiz the output would be something like 1 => 2, 2 => 3
oh, I will check it out
lizmat .repeated.Bag
then the frequency in the Bag is 1 less from the actual frequency 10:55
antoniogamiz perl6 is amazing, ty lizmat :)
lizmat if you just want all the frequencies, then just .Bag :-) 10:56
10:57 Sgeo__ joined 11:01 Sgeo_ left 11:03 Manifest0 left 11:09 antoniogamiz left, Manifest0 joined 11:16 Manifest0 left 11:19 brrt left 11:20 Manifest0 joined 11:25 Manifest0 left, breinbaas left 11:26 kensanata left 11:27 brrt joined 11:30 Manifest0 joined 11:33 brrt left 11:37 Sgeo__ left, Sgeo__ joined 11:47 Manifest0 left 11:52 Manifest0 joined 11:57 Manifest0 left 12:01 Manifest0 joined 12:02 kensanata joined 12:12 Manifest0 left 12:14 domidumont joined 12:17 Manifest0 joined 12:22 Manifest0 left 12:23 kaare_ left, kaare_ joined 12:27 candr joined 12:28 Manifest0 joined, domidumont1 joined 12:31 domidumont left 12:34 domidumont joined 12:35 domidumont1 left, molaf joined 12:37 kaare_ left 12:38 zakharyas joined 12:43 Manifest0 left 12:45 mowcat joined 12:49 Manifest0 joined 12:54 Manifest0 left 12:58 Manifest0 joined 13:08 kensanata left 13:10 brrt joined
candr anyone use perl6-mode and flycheck? I'm not getting any linting... 13:12
13:14 brrt` joined 13:15 brrt left 13:20 domidumont1 joined 13:21 Manifest0 left 13:23 domidumont left 13:26 Manifest0 joined 13:29 molaf left 13:31 Manifest0 left
timotimo can you get it to output the exact commandline it's calling perl6 with? 13:35
github.com/hinrik/flycheck-perl6/b...rl6.el#L54 - this? 13:36
13:36 Manifest0 joined 13:38 abraxxa left 13:42 Manifest0 left 13:44 molaf joined 13:48 Manifest0 joined
candr hmm... I don't have any of those "flycheck-per6-..." command available with M-x... 13:51
or "flycheck-define-checker" 13:52
I don't have a deep emacs understanding though so I might not be understanding what you are asking me to do... 13:53
I have flycheck-perl6 installed... and in a .pm6 file i can see Perl6 ant FlyC modes are enabled 13:55
14:05 brrt` is now known as brrt, Manifest0 left 14:09 abraxxa joined 14:10 Manifest0 joined 14:13 Sgeo_ joined
El_Che releasable6: status 14:14
releasable6 El_Che, Next release will happen when it's ready. R6 is down. At least 1 blocker. 666 out of 680 commits logged
El_Che, Details: gist.github.com/7300f7414c7b30c232...0498253f44
El_Che while waiting on the new release, added packages for recently released alpine 3.9 en 3.10, Fedora 30, Debian 10, Ubuntu 19.04. Travis is building them. This way people that are waiting for packages don't have to wait for a new version. 14:15
14:16 Sgeo__ left
candr can I define a dynamically scoped subroutine? i.e. I want it to use the variables in-scope where it is called. 14:21
timotimo only works for variables that are "is dynamic", but then you can use CALLER:: for that purpose
if you're on 6.c, $_ is always dynamic 14:22
(which was a major hindrance to optimizations)
ugexe my &*FOO = ... ? 14:23
timotimo i think they mean it a little differently
ugexe my &*foo 14:24
candr so I have a multiple subroutines and they all share a lot of code so I want to factor out the code that is different and then pass that in as a &sub.... I want it to be dynamically scoped though so I dont need to pass it a ton of variables it depends on... 14:25
timotimo m: my $a = 1; my $b = 2; my $c = 3; sub testsub(*%a) { .say for %a }; testsub(|@(::.kv)) 14:27
camelia Too many positionals passed; expected 0 arguments but got 30
in sub testsub at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo m: my $a = 1; my $b = 2; my $c = 3; sub testsub(*%a) { .say for %a }; testsub(|%(::.kv))
camelia GLOBALish => (GLOBAL)
$/ => (Any)
$=pod => []
$! => (Any)
EXPORT => (EXPORT)
::?PACKAGE => (GLOBAL)
$c => 3
$_ => (Any)
$¢ => (Any)
$a => 1
&testsub => &testsub
!UNIT_MARKER => (!UNIT_MARKER)
$b => 2
$=finish => (Mu)
$?PAC…
timotimo m: my $a = 1; my $b = 2; my $c = 3; sub testsub(*%a) { .say for %a }; testsub(|%(MY::.kv))
camelia $b => 2
$/ => (Any)
$=finish => (Mu)
$a => 1
$=pod => []
GLOBALish => (GLOBAL)
$! => (Any)
::?PACKAGE => (GLOBAL)
$_ => (Any)
$?PACKAGE => (GLOBAL)
!UNIT_MARKER => (!UNIT_MARKER)
$¢ => (Any)
$c => 3
&testsub => &testsub
EX…
timotimo probably not the best idea to have that in mainline
m: sub contains-stuff { my $a = 1; my $b = 2; my $c = 3; sub testsub(*%a) { .say for %a }; testsub(|%(MY::.kv)) }; contains-stuff
camelia $c => 3
&testsub => &testsub
$¢ => (Any)
$b => 2
$_ => (Any)
$! => (Any)
$a => 1
$*DISPATCHER => (Mu)
$/ => (Any)
timotimo well, it has $a, $b, and $c
candr m: sub dynamic() {say $a}; my $a='a'; dynamic() 14:33
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared
at <tmp>:1
------> 3sub dynamic() {say 7⏏5$a}; my $a='a'; dynamic()
candr ^ i want a way to do that...
14:33 domidumont joined 14:34 brrt left
timotimo m: macro dynamic { quasi { call-dynamic($a) } }; my $a = "a"; sub call-dynamic($a) { say "a is $a" }; dynamic 14:35
camelia 5===SORRY!5=== Error while compiling <tmp>
Use of macros is experimental; please 'use experimental :macros'
at <tmp>:1
------> 3macro7⏏5 dynamic { quasi { call-dynamic($a) } };
timotimo m: use experimental :macros; macro dynamic { quasi { call-dynamic($a) } }; my $a = "a"; sub call-dynamic($a) { say "a is $a" }; dynamic
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared
at <tmp>:1
------> 3s; macro dynamic { quasi { call-dynamic(7⏏5$a) } }; my $a = "a"; sub call-dynamic($
timotimo ah 14:36
14:36 domidumont1 left, redhands joined
jnthn m: sub dynamic() {say $*a}; my $*a='a'; dynamic() 14:37
camelia a
jnthn Just use dynamic variables if you want it to be dynamic :)
candr ah perfect! thx! 14:38
14:43 lucasb joined 14:44 pamplemousse joined 14:52 TimToady joined 15:00 pierrot joined 15:01 dogbert11 left 15:14 molaf left 15:16 niceperl joined 15:19 antoniogamiz joined 15:21 xiaoyafeng left 15:23 Sgeo__ joined, patrickb left 15:24 MasterDuke joined 15:26 Sgeo_ left 15:36 niceperl left 15:41 Kaypie left, Sgeo_ joined 15:42 Kaypie joined 15:44 Sgeo__ left 15:52 epony left 16:01 epony joined 16:02 Manifest0 left 16:05 domidumont left 16:08 Manifest0 joined 16:16 abraxxa left 16:22 ChoHag joined 16:23 [Sno] joined 16:24 wildtrees joined 16:30 Manifest0 left
antoniogamiz is there a prefedefined regex to match everything? 16:30
s/prefedefined/predefined
16:31 dakkar left
sena_kun <?> 16:31
also .*
antoniogamiz oh
so <?+> will match every word? including weird unicode characters?
sena_kun .* is even a better option, because `<?>` just makes your regex matching everything without capturing 16:32
antoniogamiz good, thanks sena_kun :)
sena_kun antoniogamiz, what do you mean by "everything"? any possible input? I believe `.*` does that.
m: say ' asdf ' ~~ /<?>/ 16:33
camelia 「」
sena_kun m: say ' asdf#$@$ ' ~~ /<?>/
camelia 「」
sena_kun m: say ' asdf#$@$ ' ~~ /.*/
camelia 「 asdf#$@$ 」
timotimo <?> is for causing match success without matching anything
sena_kun m: say 'はは攻撃好きですか' ~~ /.*/
camelia 「はは攻撃好きですか」
timotimo show off newlines, too
sena_kun m: say "はは攻撃好きですか\n" ~~ /.*/ 16:34
camelia 「はは攻撃好きですか
antoniogamiz gooooooooood :D 16:35
16:36 Manifest0 joined
Kaypie not so fun thing about perl 6 is getting used to how good its regex is then going to languages like js and realizing how crippled their implementation of it is 16:38
16:38 Kaypie is now known as Kaiepi
timotimo omg yes 16:38
it can really hurt
Kaiepi js only *just* got lookbehind
and i still don't think you can use it on multiline strings, not sure about that though 16:39
timotimo that sounds too terrible to be true
Kaiepi > /a\nb/.test("a\nb") 16:40
true
guess not
i remember there being something weird about newlines and regex in js though
timotimo potentially related to ^ and $ 16:41
Kaiepi ahhhhh i remember now
bastille% node -e 'console.log(/.../.test("a\nb"))'
false
. doesn't match newlines
moritz might need (?s:.) 16:42
Kaiepi only thing other languages have over perl 6 when it comes to regex is they will throw if you try to use quantifiers on zero-width stuff 16:44
i opened an issue about it but apparently it's really hard to fix or something
timotimo i think maybe it'd be a natural fit to put that in the optimizer
that goes through the regex qast
a few cases may be very easy to spot, but others might be much harder 16:45
16:46 rfold joined
ugexe "only thing" is pretty strong. consider the speed difference of `for (1..1000000) { my $foo = "abc" ~~ /bc/ }`. Perl5 is 0.105s, Perl6 4.592 16:51
16:51 Manifest0 left
timotimo perl5 would surely turn that into the equivalent of *.contains("bc") 16:51
ugexe the implementation details are irrelevant though 16:52
timotimo point is, we can do that particular optimization, too
ugexe cracks whip
timotimo 0.94user 0.03system 0:01.00elapsed 97%CPU (0avgtext+0avgdata 90336maxresident)k 16:55
0.71user 0.00system 0:00.72elapsed 99%CPU (0avgtext+0avgdata 5084maxresident)k
perl6 only slightly slower than perl5 in this
when the regex gets optimized to the .contains thing
ugexe the same speed difference can be found with /\wbc/ though 16:58
timotimo OK 16:59
i sure hope the regex engine already turns scan followed by cclass to findcclass 17:00
if not, there's a cheap win to be found there
truthfully, though, just /./ already takes 4.8s to run that many times
17:01 Manifest0 joined
timotimo oh, who would have thought that rm-rf'ing my site's precomp folder would make startup of moarperf slower, lol 17:03
lizmat weird
timotimo d'oh, i also rm'd all the js 17:04
lizmat BTW, `for ^100000 { my $foo = "abc" ~~ /bc/ }` creates 200000 Match object, I would expect it to only create 100000
timotimo Match is equivalent to Cursor now
surely it'll !start_cursor somewhere or something
one to scan, then to go forward
lizmat ok, 100000 in !cursor_start and 100000 in !cursor_init 17:05
BTW, the profile for "for ^100000 { my $foo = "abc" ~~ /bc/ }" is borked for me in the Routines tab 17:06
top entry: 100% (18446744073709.51ms)
which skews all of the other ones 17:07
timotimo brrr
hrmpf, did i accidentally delete an important file from moarperf when i needed to free up disk space? i thought i only deleted the node_modules folder 17:08
lizmat: you have moarperf, right? does yours have a static/js/main.js? 17:10
rfold If NFG code point synthesis a DoS hazard?
17:10 redhands left
timotimo rfold: yes, if your attacker is able to spam terabytes of strings at you without you noticing 17:11
i didn't check what the exact numbers would be
17:11 redhands joined
lizmat timotimo: what would be the name it got git-cloned with ? 17:12
timotimo lizmat: how do you mean?
lizmat I can't find a dir called "moarperf" in my Github dir
:-(
timotimo ooh never mind
i just wasn't patient enough for the js to compile 17:13
lizmat *phew* yeah, that can take a while
17:14 redhands left 17:15 redhands joined
timotimo Regex's ACCEPTS already takes 2 seconds on its own without the actual regex matching it seems like 17:16
lizmat yeah, it doesn't JIT
timotimo potentially the callerskipthunks op? 17:17
anyway, i gotta go AFK for a little 17:18
lizmat wouldn't be surprised... haven't looked at a spesh log since the PTS
timotimo is it right that the Regex gets cloned every time around the loop?
it's only 400ms in total compared to the ACCEPTS which is at 5.4s 17:19
github.com/rakudo/rakudo/blob/mast...ch.pm6#L43 - where does this method allocate an Int, is it the || op? does anybody want to try turning that into an nqp:: logic op that returns native int directly perhaps? 17:20
lizmat looks 17:21
timotimo oh wow that's a hilarious side-effect 17:22
m: for 1..100000 -> int $_ { my $foo = "abc" ~~ /bc/ }
camelia This type cannot unbox to a native integer: P6opaque, Str
in block <unit> at <tmp> line 1
timotimo it's trying to set the LHS of the ~~ as the $_ on the RHS 17:23
but it's defined to be native int
ok BBL
17:26 klapperl joined 17:29 Sgeo_ left, Sgeo_ joined 17:38 redhands left
rfold Does IO::Socket provide any sort of input buffering for binary data? Or does .read always do a read system call? Looking at Rakudo, NQP and MoarVM the latter appears to be the case but I may be missing something. 17:38
17:42 antoniogamiz left
timotimo lizmat: cool, is it a noticeable change with your latest commit? 17:45
lizmat for that one method from 88ms to 84ms .... so not a lot 17:46
for 100000 iterations
timotimo GC time went down a little?
lizmat no, but there was one GC less 17:47
timotimo so that ought to save one or two miliseconds, too
lizmat average was about 1.55 ms 17:48
so yes
actually, no that was nursery collection time
it's all pretty much in noise 17:49
timotimo that code never runs the full gc since nothing ever lands in the old generation :)
i wonder what allocates both Hash and BOOTHash in <anon> from the -e
17:50 antoniogamiz joined
timotimo ah, the BOOTHash could well be inside the Hash 17:51
antoniogamiz m: "dd dd" ~~ /[.<-[ ]>]*/
camelia ( no output )
antoniogamiz mm why that regex does not return "dd" 17:52
I want every character possible except for a space
timotimo spaces inside char classes aren't significant 17:54
sena_kun m: 'dd dd' ~~ /\w/
camelia ( no output )
sena_kun m: say 'dd dd' ~~ /\S/
camelia 「d」
timotimo you can backslash it
sena_kun m: say 'dd dd' ~~ /<-[\ ]>/
camelia 「d」
antoniogamiz but \S works with all unicode characters? 17:55
timotimo yeah
lizmat everything that does not have the whitespace property
antoniogamiz oh good :DDDDDDDDDDD
timotimo the thing that bails ACCEPTS from Regex is actually getlexrelcaller 17:58
not ctxcallerskipthunks
17:58 MasterDuke left
timotimo that is only missing from the exprjit 17:58
18:01 Black_Ribbon joined 18:06 Sgeo__ joined 18:09 Sgeo_ left 18:19 candr left 18:26 pamplemousse left 18:27 Manifest0 left
wildtrees how can I use $ in a string context? 18:30
18:30 pounce joined
wildtrees like with ~ 18:30
18:30 zakharyas left 18:32 Manifest0 joined
antoniogamiz scaping it? \$ 18:33
18:34 MasterDuke joined, abraxxa joined
moritz or if you mean a variable in string contest, $var.Str or ~$var 18:37
wildtrees no I mean $ by itself as a variable 18:39
like: say "number of lines" ~ $ ; 18:42
18:43 lucasb left
El_Che new pkgs for recently released distributions: github.com/nxadm/rakudo-pkg/releas...19.03.1-02 18:47
weekly: new pkgs for recently released distributions: github.com/nxadm/rakudo-pkg/releas...19.03.1-02 18:48
notable6 El_Che, Noted!
El_Che once rakudo 2019.07 is out, pks will be released inmediately
(I see disco needs to be added) 18:50
masak m: sub foo($a, :$b, $c = "default") {} 18:51
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot put optional positional parameter $c after variadic parameters
at <tmp>:1
------> 3sub foo($a, :$b, $c = "default"7⏏5) {}
expecting any of:
constraint
masak ^^ isn't this error message wrong? $c is after :$b, which is not a variadic parameter, but a named one.
wildtrees m: say $ 18:53
camelia (Any)
wildtrees m: say $++ 18:54
camelia 0
18:54 molaf joined
wildtrees m: say $++ ; say "number of lines: " ~ $ ; 18:54
camelia 0
Use of uninitialized value element of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
number of lines:
in block <unit> at <tmp> line 1
wildtrees how would I use '$' in that ~ context? 18:55
18:55 molaf left
antoniogamiz why do you want to use $? 18:59
ugexe m: say "Number of lines: " ~ (my $ = "") 19:01
camelia Number of lines:
19:01 huf joined
ugexe if you want to reuse the earlier $++... well no 19:01
that would simply be 2 anonymous vars 19:02
if you want to reuse, then dont make it anonymous
$ isn't some global, its simply anonymous
m: say $++; say $++
camelia 0
0
19:03
lizmat weekly: thenewstack.io/getting-started-at-...on-perl-6/
notable6 lizmat, Noted!
19:03 antoniogamiz left
ugexe m: say "Number of lines: " ~ ++$ 19:03
camelia Number of lines: 1
19:06 thundergnat left 19:12 Manifest0 left
wildtrees ugexe, how do I just get the value of '$' by itself then? 19:15
moritz wildtrees: if you need to get the value in another place, don't use just $
use a proper, named variable
ugexe how would you access an anonymous class in two places? you cannot 19:16
m: class :: { method bar { say 42 } }; # This has no name... how do you call it in 2 different expressions?
camelia ( no output )
ugexe m: class :: { method bar { say 42 } }.new.bar # we can do it once
camelia 42
ugexe but clearly there is no way to get at the *anonymous* class again 19:17
19:17 Manifest0 joined
ugexe I wondered if `my $x := $` would work, but no 19:21
19:24 brrt joined
ugexe you could use an explicit state var instead of the anonymous state var though 19:25
m: say "Number of lines: " ~ (state $x += 1); say $x
camelia Number of lines: 1
1
ugexe m: say (state $x += 1) for 1..3; say $x 19:28
camelia 1
2
3
3
19:30 abraxxa1 joined 19:33 abraxxa left
Altreus ${} is a hash, right 19:33
Hash %constructor = { ... :roles(:${ }) } 19:34
19:34 MasterDuke left 19:35 MasterDuke joined
Altreus Have confusion, will paste 19:36
19:40 Manifest0 left 19:45 Manifest0 joined
Altreus gist.github.com/Altreus/0bb08d6045...ad6d5ef61a 19:49
19:49 mowcat left, Manifest0 left
Altreus from-json should probably define :U on the invocant but I can do that later 19:50
I don't understand why what looks like a hash in %constructor<roles> doesn't populate the roles property
OK I think I have to link to my actual file 19:52
19:54 pamplemousse2 joined, Manifest0 joined
Altreus in this method it seems I successfully construct the roles property github.com/shuppet/p6-api-discord/...d.pm6#L167 19:55
Then I call this method on the returned object github.com/shuppet/p6-api-discord/...d.pm6#L129
that ends up here github.com/shuppet/p6-api-discord/...d.pm6#L214 19:56
Then I call this method on the Member object and $.guild.roles is empty github.com/shuppet/p6-api-discord/...d.pm6#L196
20:01 zakharyas joined 20:02 Manifest0 left 20:04 pamplemousse2 left 20:06 molaf joined, Manifest0 joined
El_Che weekly: new pkgs for recently released distributions: github.com/nxadm/rakudo-pkg/releas...19.03.1-03 (correct release, fixed Mint repo's) 20:10
notable6 El_Che, Noted!
20:11 leont joined
leont Does Alexander Kiryuhin use this channel? If so what's his username? 20:13
20:17 Manifest0 left
Altreus I've determined that the hash shown in my gist does not produce a Guild with any roles in it 20:17
It fails to populate roles whether it is $.roles or %.roles 20:21
20:22 Manifest0 joined
El_Che leont: I think he goes by sena_kun 20:23
leont: looking at his talk subject op yapce 20:24
s/looking at/deduced from/
sena_kun leont, that's me
El_Che \o/
Sherlock Homes skillz
leont Cool
Basically, I was planning to write ASN.1 and LDAP stuff at some point, because I felt perl6 would be a good match, but apparently you already did it so I don't have to :-p 20:25
sena_kun leont, patches are welcome, there are a looot of work(for ASN.1, at least, because I implemented only parts needed for ldap).
leont, ASN.1 support is pretty incomplete(no values, only types, not all types, no restrictions etc), LDAP support is, well, I am working on it, a lot of stuff just works, I am in the middle of writing StartTLS(LDAPS is supported), but if you are fancy to write tons of extensions(they are easy to implement), you are welcome. 20:27
:)
I think you can 1)ask me about various things; 2)write patches for things that you need and are NYI, I'll gladly accept them. 20:28
and feature requests along with bug reports are insanely welcome, of course. 20:30
Altreus Is there a property of an object that lets me identify it? So I can see whether an object in one place is the same as in another? 20:31
Demos[m] lol does there exist ANY not imcomplete implementation of ASN.1
sena_kun dunno 20:32
leont Well, I'm kind of short on time lately, but I'll try to take a look at it later 20:33
sena_kun I didn't intend to implement it at all. for my master's paper I wanted to write ldap in cro, but I didn't know much about it. and then I digged deeper, saw ASN.1 and was like oh noooo, I guess we'll do it.
leont My "favorite" sentence from the spec: «The resulting type and value of an instance of use of the new value notation is determined by the value (and the type of the value) finally assigned to the distinguished local reference identified by the keyword VALUE, according to the processing of the macrodefinition for the new type notation followed by that for the new value notation.» 20:34
sena_kun leont, no problem, just tickets are ok. I have talks planned for Perlcon for both ASN.1 and Cro::LDAP and trying to make it polished(docs wise, real testing against openldap wise etc) until then.
leont I saw, that's how I discovered you were working on it. 20:35
sena_kun \o/
leont LDAP is uniquely suitable for async operation, because unlike most protocols requests and responses don't have to be in the same order
Since you're using cro I'm guessing/hoping the same is true in your implementation 20:36
sena_kun you do get promise for a normal request and a supply of entries+refs for search request
leont Makes sense 20:38
sena_kun I will appreciate a lot opinions about it, since I literaly didn't know a thing about it until I started implementing, so I am not so aware about common patterns and things like that. Was inspired by a couple of other implementations including Net::LDAP, while keeping things Cro-based.
(not something I should be proud about or write openly, of course) 20:39
20:42 zakharyas left 20:45 Manifest0 left
sena_kun Altreus, I think there is an operator for identity. 20:48
likely =:=
m: my $a = 5; say $a =:= 5; say $a =:= $a; #`( beware! it checks for container identity, so if you don't have one... ) my \foo = 10; say foo =:= foo; say foo =:= 10; 20:49
camelia False
True
True
True
20:50 Manifest0 joined 20:55 Manifest0 left 20:56 kaare_ joined 21:01 Manifest0 joined, rindolf left, irced joined 21:04 thundergnat joined 21:12 Manifest0 left
ugexe I've been doing exploratory LemonLDAP stuff at work 21:14
21:16 mowcat joined, mowcat left, mowcat joined 21:17 abraxxa1 left 21:18 Manifest0 joined 21:24 Manifest0 left 21:30 ctilmes1 left, Manifest0 joined, natrys joined 21:37 squashable6 left 21:38 squashable6 joined 21:50 Manifest0 left
irced hey all, how can I stringify a map so that a Str stores a listing of each keys contents as key => contents, or key => [contents, contents]. basically, how can I stringify the output of say %map (except get all the values , no ellipses ... and print a newline after each key value pair). one solution seems to me to be to iterate %map.kv -> $key, $val {} and somehow stringify the result of say $key and say 21:55
$val. any thoughts?
21:55 Manifest0 joined
sena_kun m: my %a = :1a, :2b; my $str; for %a.kv -> $k, $v { $str ~= "$k => $v\n" }; say $str; 21:57
camelia b => 2
a => 1
sena_kun m: my %a = :1a, :2b; my $str; for %a.kv -> $k, $v { $str ~= "$k => [$v]\n" }; say $str;
camelia b => [2]
a => [1]
sena_kun m: my %a = :1a, :2b, c => <1 2 3>; my $str; for %a.kv -> $k, $v { $str ~= "$k => [$v]\n" }; say $str;
camelia c => [1 2 3]
a => [1]
b => [2]
irced sena_kun, that can work, thanks, I can just output a single value as an array. (you can imagine my goal is to be able to export/import using regular expressions). 21:58
ugexe .classify
MasterDuke irced: maybe also try .put
sena_kun irced, .perl/EVAL is not your case? 21:59
irced MasterDuke: that works too.
MasterDuke: i think , lemme see
sena_kun m: my %a = :4a; my $store = %a.perl; say $store; my %b = EVAL $store; say %b;
camelia 5===SORRY!5=== Error while compiling <tmp>
EVAL is a very dangerous function!!! (use the MONKEY-SEE-NO-EVAL pragma to override this error,
but only if you're VERY sure your data contains no injection attacks)
at <tmp>:1
------> 3%a.perl; …
sena_kun m: use MONKEY; my %a = :4a; my $store = %a.perl; say $store; my %b = EVAL $store; say %b; 22:00
camelia {:a(4)}
{a => 4}
sena_kun I think you don't need to play with regexps to export/import, if it is Perl 6-only thing.
irced with objective being to make a parseable map output, sena_kun's would be more on track to parse arrays where values have spaces 22:01
sena_kun: yes, import/export regex is my game plan.
sena_kun: is there a perl6 way?
sena_kun: besides my roundabout way
sena_kun m: my %a = :1a, :2b, c => <1 2 3>; my $str; for %a.kv -> $k, $v { $str ~= "$k => [{$v.elems == 1 ?? $v !! $v.join(" DELIMITER ") }]\n" }; say $str;
camelia a => [1]
c => [1 DELIMITER 2 DELIMITER 3]
b => [2]
sena_kun irced, ^
irced sena_kun: that is a more complete solution to my specific problem, thanks. still, it does require playing with regexps to export/import, wouldn't you agree? 22:03
err, import anyway
sena_kun irced, agreed. You can do it with .perl/EVAL too, I posted an example above.
irced sena_kun: oh thanks for bringing my attention to that
sena_kun but, of course, bear in mind that EVAL will execute any arbitrary code, so it is a nice way to shoot in one's foot. and probably in feet of all people who can use your software. 22:04
22:04 rfold left
sena_kun I wonder if there is something like pickle(or how is it named?) from python. 22:04
irced sena_kun: i wonder if there is some way I can profit from increased podiatrist business. 22:05
sena_kun: like some investment instrument.
oops so off topic
irced is trying the .perl/EVAL suggestion. 22:06
sena_kun irced, anyway, we can go a level above if you want: you need to store/load, but for what? some super-generic solution?
lizmat sena_kun: not to my knowledge.... in the Perl world usually called "Storable" or "Sereal"
sena_kun lizmat, would be really nice to port something like this to Perl 6. Unfortunately, I suspect there are a lot of things to take care about, memory layouts and so on, scary stuff, and requires knowlege of guts too. 22:07
irced I want to serialize a %map to a file and load the map in a another script to manipulate it. basically, serialization but serialization modules seem too heavy a manual on what there is clearly a short solution for as you have demonstrated.
sena_kun:
lizmat I've looked at Sereal some years ago now... but that is too tightly bound to Perl 5 guts
irced sena_kun: so i will put %map contents in a Str write it to a file read it into or slurp it in whatever script. 22:08
sena_kun irced, I wonder if a really nice solution is json or yaml. :)
lizmat I think FROGGS looked at storing it as MoarVM bytecode
irced sena_kun: and build a map from it
lizmat sleep&
sena_kun irced, just store it as json and you have both 1)short and simple code; 2)no security issues with EVAL
lizmat, good night. o/ 22:09
and 3)interoperability with various other tools, languages and so on that understand json
22:09 john_parr left, Cabanossi left
irced sena_kun: well, JSON could work as well, and would be a solid choice if the values become complex, but this is a simple case 22:10
sena_kun: flattened case if you will
sena_kun irced, if it is really a simple case, then a couple of lines as shown above will do. otherwise you can scale with json. seems enough to me.
irced sena_kun: however, JSON libraries usually require a lot of code
sena_kun: i mean, i've done JSON in C with libjansson and the modules in perl6 i think are just as cumbersome. 22:11
sena_kun: i think.
sena_kun irced, `use JSON::Fast; spurt 'my-file' to-json %map;`, on receiving side: `use JSON::Fast; my %map = from-json slurp 'my-file'`
irced sena_kun: now that's nice
sena_kun it doesn't require a lot of code, does it?
irced sena_kun: thanks for highlighting the module for me! 22:12
sena_kun m: say to-json 1234;
camelia 1234
Saw 1 occurrence of deprecated code.
================================================================================
Sub to-json (from GLOBAL) seen at:
<tmp>, line 1
Please use JSON::Fast, JSON::Tiny or JSON::Pretty from modu…»
sena_kun m: say to-json {:5a, :42b};
camelia {
"a": 5,
"b": 42
}
Saw 1 occurrence of deprecated code.
================================================================================
Sub to-json (from GLOBAL) seen at:
<tmp>, line 1
Please use JSON::Fast, JSON::Tiny or JSON:…
sena_kun m: my $a = to-json {:5a, :42b}; say $a; my $b = from-json $a; say $b; 22:13
camelia {
"a": 5,
"b": 42
}
Saw 2 occurrences of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
<tmp>, line 1
Please use JSON::Fast, JSON::Tiny or JS…
sena_kun m: my $a = to-json {:5a, :42b}; my $b = from-json $a; say $b;
camelia {a => 5, b => 42}
Saw 2 occurrences of deprecated code.
================================================================================
Sub from-json (from GLOBAL) seen at:
<tmp>, line 1
Please use JSON::Fast, JSON::Tiny or JSON::Pretty f…
sena_kun irced, ^ it uses deprecated internal rakudo parser(hence the warnings), but with `use JSON::Fast` you will be safe.
irced sena_kun: ok, i will look at the module and try your suggestions a little later. thanks so much! 22:14
sena_kun irced, you are welcome!
22:17 john_parr joined, brrt left 22:18 Cabanossi joined
irced thanks MasterDuke for the input as well. 22:18
MasterDuke np 22:22
22:26 Manifest0 left 22:31 Manifest0 joined 22:38 Manifest0 left 22:40 natrys left 22:42 Altai-man_ joined, Altai-man_ left 22:43 Manifest0 joined 22:45 sena_kun left 22:53 Manifest0 left 22:59 leont left 23:01 Manifest0 joined 23:09 Manifest0 left 23:14 Manifest0 joined 23:19 Manifest0 left 23:24 Manifest0 joined 23:27 [particle] joined 23:29 vrurg left, vrurg joined 23:30 [particle]1 left 23:31 [particle]1 joined, [particle] left 23:36 pounce left 23:38 mowcat left
wildtrees what are these "string".IO being returned from dir() ? how do I get rid of the IO on them 23:41
23:43 Manifest0 left
jnthn IO::Path objects. I figure by "get rid of" you want to turn it into a string, which you could maybe do with the ~ prefix operator or calling .Str, though there's other ways depending on exactly what string you want: doc.perl6.org/type/IO::Path 23:45
(Most useful methods in there or it: basename, relative, absolute) 23:46
23:50 Manifest0 joined 23:53 MasterDuke left