Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-07-26

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 dugword joined #perl6
00:04 cdg joined #perl6
00:12 zoll joined #perl6
00:13 Celelibi joined #perl6
00:14 sufrostico joined #perl6
00:23 Cabanossi joined #perl6
00:24 Ptolemarch joined #perl6
00:36 jeromelanteri joined #perl6
00:39 lookatme joined #perl6
00:39 lookatme morning
00:39 yoleaux 25 Jul 2017 15:08Z <zengargoyle> lookatme: that video has been make public now, so it's all good.
00:42 mcmillhj joined #perl6
00:53 Cabanossi joined #perl6
00:59 mcmillhj joined #perl6
01:22 cdg joined #perl6
01:25 Actualeyes joined #perl6
01:29 mcmillhj joined #perl6
01:50 mcmillhj joined #perl6
01:51 ilbot3 joined #perl6
01:51 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!
01:52 Cabanossi joined #perl6
02:02 noganex joined #perl6
02:12 mcmillhj joined #perl6
02:15 geekosaur joined #perl6
02:19 moritz_ joined #perl6
02:19 zengargo1le joined #perl6
02:19 xinming_ joined #perl6
02:19 notbenh joined #perl6
02:19 freeze joined #perl6
02:20 MilkmanDan joined #perl6
02:20 charsbar joined #perl6
02:21 giraffe joined #perl6
02:21 konsolebox joined #perl6
02:22 Cabanossi joined #perl6
02:24 mcmillhj joined #perl6
02:28 benjikun joined #perl6
02:28 benjikun Could someone help
02:28 benjikun I keep trying to do zef install Text::CSV
02:28 benjikun but I keep getting: ===> Fetching [FAIL]: Text::CSV:ver('0.008'):auth('github:Tux') from git://github.com/Tux/CSV.git
02:30 lookatme It should be git@github.com:author/Tux/CSV.git
02:31 benjikun why is zef getting it from the wrong source
02:33 MasterDuke benjikun: i can `git clone git://github.com/Tux/CSV.git`. do you have ssh keys set up with github?
02:33 benjikun no i dont
02:34 lookatme I depend on the META file provide by author
02:34 lookatme https://raw.githubusercontent.com/Tux/CSV/master/META6.json
02:34 lookatme The url in the meta file is wrong
02:35 benjikun so how do I fix it
02:35 MasterDuke benjikun: you can always clone the module manually, and then do something like `zeg install .` from its directory
02:36 lookatme maybe this also working: zef install https://github.com/Tux/CSV.git
02:36 MasterDuke so you'd clone from the https url (which i think it just the git:://<...> url with https:// instead of git://)
02:36 lookatme yeah, it works, benjikun you can manual provide the repo url
02:36 lookatme zef install https://github.com/Tux/CSV.git
02:36 MasterDuke lookatme++ that's even easier
02:37 lookatme Yeah
02:37 benjikun https://gist.github.com/anonymous/466b8dec8dffeaec619a7ffaf8af077d
02:38 pharv joined #perl6
02:39 benjikun even zef install <github link> won't work
02:39 lookatme maybe u should install `zip` package
02:39 benjikun I get what I posted at the gist
02:39 benjikun already have it
02:40 lookatme Is unzip command available ?
02:40 benjikun yep
02:40 mcmillhj joined #perl6
02:40 lookatme OH, IDK..
02:41 MasterDuke what if you try `zef install https://github.com/Tux/CSV/archive/master.zip`?
02:41 lookatme The last way is `git clone https://github.com/Tux/CSV.git` and `cd **directory**` and `zef install .`
02:41 benjikun https://gist.github.com/anonymous/522dcb79c30e7fb4ecd56499c558d635
02:41 dj_goku joined #perl6
02:41 dj_goku joined #perl6
02:42 MasterDuke benjikun: what version is your zef and perl6?
02:42 lookatme zef --version
02:42 lookatme perl6 --version
02:43 rjk joined #perl6
02:43 benjikun https://gist.github.com/anonymous/80933cd5de00b40719dca32b2a63c053
02:43 benjikun ugh
02:45 lookatme maybe you can update your zef command
02:45 lookatme zef --force install zef
02:46 lookatme or upgrade ?
02:46 ugexe clone zef and `perl6 -Ilib bin/zef uninstall zef && perl6 -Ilib bin/zef install .`
02:47 ugexe your perl6 is likely too new to run the old version of zef you are using
02:47 ugexe oh rakudobrew
02:47 ugexe rakudobrew nuke moar-nom
02:47 ugexe rakudobrew build moar 2017.07
02:48 ugexe rakudobrew switch moar-2017.07
02:48 ugexe rakudobrew build zef
02:52 Cabanossi joined #perl6
02:52 Guest65208 Yeah I guess you failed to keep that from me and why would you keep it from me
02:57 mcmillhj joined #perl6
03:00 noganex_ joined #perl6
03:05 AlexDani` joined #perl6
03:13 mcmillhj joined #perl6
03:16 benjikun ugexe: I did all of that
03:16 benjikun still doing the same thing
03:18 benjikun "No fetching backend available"
03:18 benjikun "No extracting backend available"
03:19 benjikun any more recommendations anyone?
03:20 ugexe impossible, the instructions i gave you do not require a fetching or extracting backend
03:20 lookatme IDK, all works well on my fedora
03:20 benjikun I rebuilt rakudo and zef
03:20 benjikun still did the same thing
03:21 lookatme benjikun, show us `zef info zef`
03:21 benjikun https://gist.github.com/anonymous/84b90c9e5db81718080a962f5966baca
03:22 lookatme I dont' think it's last zef release
03:22 lookatme my version is 0.1.13
03:22 lookatme zef
03:22 benjikun it's the one rakudobrew built hm
03:22 Cabanossi joined #perl6
03:23 ugexe zef if version 0.1.25
03:23 ugexe is
03:23 benjikun how can i remove zef with rakudobrew
03:24 lookatme I'm not using rakudobrew, I install rakudo from source
03:25 lookatme Yeah, the last version is 0.1.25, I see it
03:26 benjikun https://gist.github.com/anonymous/a86c589fef7cb155644fd48165a3c417
03:26 pompomcrab joined #perl6
03:26 benjikun how does that not update it
03:26 lookatme benjikun, I recommend you uninstall all thing about rakudo, and do a clean install
03:26 benjikun how do I uninstall it all if I compiled it with rakudobrew
03:27 ugexe rakudobrew nuke moar-nom, which i thought you said you did
03:27 AlexDani` joined #perl6
03:27 ugexe if you have to ask how to use rakudobrew you should probably not use it
03:27 mcmillhj joined #perl6
03:28 benjikun I did
03:28 ugexe try `rm -rf ~/.perl6`
03:30 benjikun alright now I'm compiling it without rakudobrew
03:36 Cabanossi joined #perl6
03:37 benjikun https://gist.github.com/anonymous/04c49ec74505bbb0924d4d7f053d1988
03:37 benjikun That arose from be running 'perl6 -Ilib bin/zef install .'
03:40 lookatme ugexe ^^
03:43 ufobat joined #perl6
03:44 mcmillhj joined #perl6
03:45 ugexe did you check your perl6 -v to make sure you are running the version you think you are?
03:46 cpage_ joined #perl6
03:53 Guest65208 left #perl6
04:05 Actualeyes joined #perl6
04:09 raiph joined #perl6
04:13 mcmillhj joined #perl6
04:14 dead1 joined #perl6
04:19 dead1 left #perl6
04:20 deep-book-gk_ joined #perl6
04:22 deep-book-gk_ left #perl6
04:28 mcmillhj joined #perl6
04:35 GhostKenical joined #perl6
04:47 pompomcrab joined #perl6
04:47 pompomcrab left #perl6
04:48 mcmillhj joined #perl6
05:21 Cabanossi joined #perl6
05:28 baest joined #perl6
05:30 astj joined #perl6
05:38 xtreak joined #perl6
05:44 AlexDani` joined #perl6
05:52 Cabanossi joined #perl6
05:58 wamba joined #perl6
06:00 dugword joined #perl6
06:03 astj joined #perl6
06:04 abraxxa joined #perl6
06:12 andrzejku joined #perl6
06:13 mr-foobar joined #perl6
06:17 baest joined #perl6
06:20 unop joined #perl6
06:25 lookatme :)
06:28 Ven joined #perl6
06:39 AlexDani` joined #perl6
06:40 domidumont joined #perl6
06:41 lowbro joined #perl6
06:41 lowbro joined #perl6
06:45 lizmat http://www.evanmiller.org/why-im-learning-perl-6.html   # nice!
06:45 lizmat https://news.ycombinator.com/item?id=14848255  # HN comments
06:47 lookatme lizmat++
06:47 domidumont joined #perl6
06:49 lowbro joined #perl6
06:49 lowbro joined #perl6
06:51 Cabanossi joined #perl6
06:53 Ven_ joined #perl6
07:01 xtreak joined #perl6
07:04 xtreak_ joined #perl6
07:09 nadim joined #perl6
07:25 parv joined #perl6
07:34 rindolf joined #perl6
07:35 darutoko joined #perl6
07:36 wamba joined #perl6
07:48 samcv what's a better error for this:
07:48 samcv m: my @a; @a[Int]
07:48 camelia rakudo-moar 9c0d40: OUTPUT: «Indexing requires an instance, tried to do: @a[ (Int) ]?  in block <unit> at <tmp> line 1??»
07:49 samcv maybe Indexing requires a defined variable? # though still this doesn't really match how our other errors are
07:53 k-man joined #perl6
07:53 samcv Unable to call postcircumfix @a[ ] with an undefined Int. Indexing requires a defined object
07:53 samcv maybe that?
07:53 mcmillhj joined #perl6
07:58 lookatme samcv, with an type object ?
08:00 samcv Unable to call postcircumfix @a[ (Int) ] with a type object.
08:00 samcv Indexing requires a defined objec
08:00 samcv lookatme, how's that?
08:01 lookatme samcv, seems like ok
08:01 samcv cool. yeah that sounds more like other error messages-
08:01 zakharyas joined #perl6
08:01 jonas1 joined #perl6
08:11 jeromelanteri joined #perl6
08:15 dakkar joined #perl6
08:25 amalia__ joined #perl6
08:29 andreoss joined #perl6
08:40 xtreak joined #perl6
08:40 brrt joined #perl6
08:46 dakkar_ joined #perl6
08:47 brrt left #perl6
08:59 robertle joined #perl6
09:06 exprosic joined #perl6
09:06 exprosic left #perl6
09:06 pmurias joined #perl6
09:09 wamba joined #perl6
09:21 evalable6 joined #perl6
09:21 hahainte1net joined #perl6
09:21 lumimies joined #perl6
09:21 Spot__ joined #perl6
09:21 Spot__ joined #perl6
09:21 lumimies joined #perl6
09:22 obra_ joined #perl6
09:22 Cabanossi joined #perl6
09:22 plicease_ joined #perl6
09:24 bisectable6 joined #perl6
09:24 unicodable6 joined #perl6
09:28 camelia joined #perl6
09:45 brabo joined #perl6
09:48 nadim joined #perl6
09:54 bjz joined #perl6
10:01 eliasr joined #perl6
10:11 AlexDani` joined #perl6
10:14 parv joined #perl6
10:20 Actualeyes left #perl6
10:21 Cabanossi joined #perl6
10:28 emeric joined #perl6
10:39 espadrine joined #perl6
10:46 diegok joined #perl6
10:51 Cabanossi joined #perl6
10:54 Woodi joined #perl6
10:54 Woodi hallo :)
10:55 Woodi Perl6 was hacknewsed :)
10:57 ZofBot joined #perl6
11:01 pmurias if I want to write a slang what should I look at?
11:02 timotimo maybe Tuxic, maybe the SQL one, maybe Piersing
11:02 pmurias I found some old slang docs: https://mouq.github.io/slangs.html, but it seems to be removed from the current ones
11:04 timotimo perhaps all you need to do is use refine_slang
11:04 timotimo instead of fiddling with %*LANG (which is going away)
11:04 timotimo the whole section about export and the language braid could be replaced with like two lines of text and a short code example
11:06 someuser joined #perl6
11:10 gdonald joined #perl6
11:22 parv joined #perl6
11:26 adu joined #perl6
11:29 jeromelanteri timotimo, how to pass a string where content is kind of %type<my_key> ? (like "%type{my_key}" ... "%type<my_key>" doesn't woks to)
11:30 jeromelanteri :m %try = { first => "waw", second => "re-waw"}; say "waw => %try<first>";
11:30 timotimo i don't understand the question
11:30 timotimo m: my %try = { first => "waw", second => "re-waw"}; say "waw => %try<first>";
11:30 camelia rakudo-moar ccaa06: OUTPUT: «Potential difficulties:?    Useless use of hash composer on right side of hash assignment; did you mean := instead??    at <tmp>:1?    ------> 3 = { first => "waw", second => "re-waw"}7?5; say "waw => %try<first>";?waw => waw?»
11:30 jeromelanteri if i want to put a value (who is Str) from inside a string ?
11:30 timotimo m: my %try = { first => "waw", second => "re-waw"}; say "waw" => %try<first>";
11:30 camelia rakudo-moar ccaa06: OUTPUT: «5===SORRY!5===?Two terms in a row?at <tmp>:1?------> 3d => "re-waw"}; say "waw" => %try<first>7?5";?    expecting any of:?        infix?        infix stopper?        postfix?        statement end?        statement modifier? …»
11:30 timotimo m: my %try = { first => "waw", second => "re-waw"}; say "waw" => %try<first>;
11:30 camelia rakudo-moar ccaa06: OUTPUT: «Potential difficulties:?    Useless use of hash composer on right side of hash assignment; did you mean := instead??    at <tmp>:1?    ------> 3 = { first => "waw", second => "re-waw"}7?5; say "waw" => %try<first>;?waw => waw?»
11:31 timotimo oh, of course
11:31 timotimo m: my %try = first => "waw", second => "re-waw"; say "waw" => %try<first>;
11:31 camelia rakudo-moar ccaa06: OUTPUT: «waw => waw?»
11:31 timotimo you mean how to interpolate a value from inside a hash into a string?
11:31 timotimo m: my %try = first => "waw", second => "re-waw"; say "here's waw: %try<first>"
11:31 camelia rakudo-moar ccaa06: OUTPUT: «here's waw: waw?»
11:36 Cabanossi joined #perl6
11:47 rindolf joined #perl6
12:07 MilkmanDan joined #perl6
12:11 raschipi joined #perl6
12:33 wamba joined #perl6
12:33 sherwool joined #perl6
12:33 nadim hi, what's the use of the 'provides' section in META6?
12:36 timotimo it tells "use"rs what things can be "use"d from this distribution
12:37 timotimo i.e. if it isn't in provides, you can't "use" it without a "use lib" (which should be considered a hack if you're making a distribution)
12:37 Geth joined #perl6
12:41 Woodi installing R* 2017.07 tries to scan filesystem from / to find git repos, probably some strange defaults...
12:42 timotimo i think it does that to make sure you're not accidentally running the installation procedure from inside the rakudo star repository
12:42 Woodi also DBish probably didn't install becouse tests failed, eg. trying to connect to mysql with specific user and pass :)
12:42 timotimo no, when the tests can't connect to the db in question, the whole test suite for that driver is skipped
12:43 Woodi but modules will bi installed ?
12:44 jeromelanteri timotimo, yes, i have to go with prompt-for("my string..."); but i can not use prompt-for(%hash<key>); then i try to do something like prompt-for("%hash<key>");
12:44 jeromelanteri but failed
12:44 timotimo you can either .Str at the end or ~ in the front
12:45 jeromelanteri like prompt-for("~%hesh<key>"); ?
12:46 jeromelanteri or prompt-for(%hash<key>.Str)
12:46 jeromelanteri i try...
12:46 faraco joined #perl6
12:47 timotimo without " " around it when you put ~ in front
12:47 timotimo but just "%hash<key>" should also work (as long as you don't typo the variable name)
12:48 jeromelanteri timotimo, works together, but warning said "Useless use of hash composer on right side of hash assignment; did you mean:= instead? at ....
12:49 zakharyas joined #perl6
12:49 jeromelanteri so it is a CLI use script... may it be better ?
12:52 timotimo you have to remove the { } around your hash literal
12:52 timotimo it must be either my %foo = a => 1, b => 2;
12:52 Aaronepower Hello, how do you turn a dictionary into named arguments?
12:52 timotimo or, if you have a specific reason to do exactly that, and you know why you're doing it: my %foo := { a => 1, b => 2 }
12:52 lucasb joined #perl6
12:52 timotimo Aaronepower: just put a | in front when you do the call
12:53 mcmillhj joined #perl6
12:53 jeromelanteri timotimo, that's it ! why this happened ? does it mean it was a reference of hash ?
12:54 timotimo assignment to a hash wants a list of contents. either pairs or an even number of things that will become key, value, key, value, ...
12:54 timotimo assignment into lists and hashes is "copying", which means that my %foo = { a => 1, b => 2
12:55 timotimo oops
12:55 faraco sounds like list and scalar context plays a big role.
12:55 timotimo assignment into lists and hashes is "copying", which means that my %foo = { a => 1, b => 2 } ends up unpacking the hash on the right hand side and putting the individual thigns into the hash on the left hand side
12:57 jeromelanteri oh ok. thenk you for explications. fine.
12:58 faraco How can I start contributing to Rakudo? I want to try to fix bugs as a learning experience (never did in for any programming language community)
12:58 timotimo faraco: that's probably easiest to explain when you've got a particular bug you'd like to fix
12:59 timotimo there are many parts to rakudo that all need slightly different expertise
12:59 timotimo the core setting, i.e. all classes, their methods, and subroutines, as well as operators, are implemented in perl6. that's the core setting and you find all that code in src/core and src/core.d for anything only in v6.d
13:00 faraco sounds like an advanced thing to even begin with :O
13:00 timotimo if something doesn't parse or parses wrong, that'd be in src/Perl6/Grammar.nqp and if the parse results in something wrong, that'd be src/Perl6/World.nqp or src/Perl6/Optimizer.nqp
13:00 timotimo those three are written in nqp, which has slightly different rules from perl6
13:01 timotimo but the grammar is mostly just perl6 grammars & rules, which are the same in perl6 and nqp
13:01 timotimo the core setting has many parts that have been written using nqp::blah ops, even though the code is perl6 code
13:01 timotimo if you get stuff like segfaults, you'll most probably have to look into MoarVM, which is written in C. that requires completely different expertise, IMO
13:02 faraco timotimo++ thanks. I'll gonna learn nqp if it is the key to get into the rakudo development.
13:03 timotimo we have something very good for that :)
13:03 timotimo https://github.com/edumentab/rakudo-and-nqp-internals-course
13:03 timotimo hard to believe this is already 4 years old
13:04 Woodi R* installed ! just 2h. but panda was installed succesfully ;)  P4 32bit here. and it runs a bit faster then before :)
13:04 faraco again thanks
13:05 Woodi thanks and later
13:05 shlomif joined #perl6
13:05 LeCamarade joined #perl6
13:07 timotimo but woodi
13:07 timotimo please use zef instead of panda
13:11 jeromelanteri :m %a = a => '_a', b => [ c=>'b', d => 'b']; $b = "c"; say %a<$b>;
13:12 jeromelanteri m: %a = a => '_a', b => [ c=>'b', d => 'b']; $b = "c"; say %a<$b>;
13:12 camelia rakudo-moar 8f73d7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Variable '%a' is not declared?at <tmp>:1?------> 3<BOL>7?5%a = a => '_a', b => [ c=>'b', d => 'b']?»
13:12 jeromelanteri m: %a = (a => '_a', b => [ c=>'b', d => 'b']); $b = "c"; say %a<$b>;
13:12 camelia rakudo-moar 8f73d7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Variable '%a' is not declared?at <tmp>:1?------> 3<BOL>7?5%a = (a => '_a', b => [ c=>'b', d => 'b'?»
13:13 faraco Also, I see that Perl 6 has something called Parser and token. Are they used to create programming language or DSLs?
13:13 jeromelanteri m: %a = a => '_a', b => [ c=>'b', d => 'b']; $b = "c"; say %a{$b};
13:13 camelia rakudo-moar 8f73d7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Variable '%a' is not declared?at <tmp>:1?------> 3<BOL>7?5%a = a => '_a', b => [ c=>'b', d => 'b']?»
13:14 jeromelanteri m: my %a = a => '_a', b => [ c=>'b', d => 'b']; $b = "c"; say %a{$b};
13:14 camelia rakudo-moar 8f73d7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Variable '$b' is not declared?at <tmp>:1?------> 3 = a => '_a', b => [ c=>'b', d => 'b']; 7?5$b = "c"; say %a{$b};?»
13:14 jeromelanteri m: my %a = a => '_a', b => [ c=>'b', d => 'b']; my $b = "c"; say %a{$b};
13:14 camelia rakudo-moar 8f73d7: OUTPUT: «(Any)?»
13:14 jeromelanteri m: my %a = a => '_a', b => [ c=>'b', d => 'b']; my $b = "c"; say %a<$b>;
13:14 camelia rakudo-moar 8f73d7: OUTPUT: «(Any)?»
13:15 jeromelanteri m: my %a = a => '_a', b => [ c=>'b', d => 'b']; my $b = "c"; say %a<b><$b>;
13:15 camelia rakudo-moar 8f73d7: OUTPUT: «Type Array does not support associative indexing.?  in block <unit> at <tmp> line 1??»
13:15 perlpilot faraco: where did you see that Perl 6 has something called "Parser"?
13:15 timotimo you have to use <<$b>> if you want $b to mean "what's inside $b"
13:16 faraco perlpilot: whoops my mistake. it is called 'grammar'.
13:16 andrzejku joined #perl6
13:17 perlpilot faraco: yeah, grammars are composed of regex, rules, and tokens, and they can be used to make other languages or DSLs.
13:18 timotimo or for parsing whatever data you come across
13:18 faraco perlpilot: that is cool! I did a few rackets and interested in building DSL. I hope I knew this earlier.
13:18 faraco few programs in racket*
13:18 timotimo there was a presentation about perl6 and DSLs
13:19 timotimo https://fosdem.org/2017/schedule/event/informal_dsl/
13:19 faraco thanks!
13:19 timotimo it may not look like it but the little play button gives you a video recording
13:19 jeromelanteri i have this: [ {g => 'def', repos => []}, {g=>'try', repos => [{title => 'a title', url => 'https://my_url'}] } ]
13:19 jeromelanteri inside this: %datas
13:20 jeromelanteri and, my %group = %datas<group>.first: {$_<group> eq 'try'};
13:21 jeromelanteri but at: %repo = %group<repos>.first: {$_<<$object>> eq $object_name };
13:21 jeromelanteri perl6 no happy... it said that
13:22 timotimo you've put a hash object on the RHS of that assignment?
13:22 jeromelanteri odd number of elements found where hash initializer expected: Only saw 1 element.
13:22 jeromelanteri RHS ?
13:22 timotimo right. here's where you either unpack the hash by putting an @(...) around it (gives you the individual pair objects that then go into %repo)
13:22 timotimo Right Hand Side
13:23 timotimo or you use := which makes %repo the exact same object that's inside your %datas
13:23 timotimo i.e. any change to %repo will also change the hash that's somewhere inside %datas
13:23 araraloren joined #perl6
13:24 skids joined #perl6
13:25 jeromelanteri use of := for %repo show erre Type check failed in binding: expected associativ,e but got Nil (Nil)
13:26 perlpilot jeromelanteri: can you show us the real code?  Or a small, complete example that exhibits the behavior you see?
13:26 jeromelanteri yes
13:28 timotimo m: my %datas = foo => { a => 1, b => 2 }; my %foo-data = %datas<foo> # doesn't work
13:28 camelia rakudo-moar 8f73d7: ( no output )
13:28 timotimo er, it does, huh?
13:28 araujo joined #perl6
13:28 araujo joined #perl6
13:29 timotimo i wonder how you get your error, then
13:33 Zoffix m: my %datas is default(Nil) = foo => Nil; my %foo-data := %datas<foo>
13:33 camelia rakudo-moar 8f73d7: OUTPUT: «Type check failed in binding; expected Associative but got Nil (Nil)?  in block <unit> at <tmp> line 1??»
13:34 jeromelanteri https://gist.github.com/jerome-diver/0930e64025f280edd572578540eb8ffe
13:34 Zoffix jeromelanteri: .first returns Nil when it doesn't find anything
13:35 Zoffix jeromelanteri: doesn't look like you're using %repo anywhere; if that's all of the code, you can rewrite that return to  `return so Nil !=== %group<repos>.first: { $_<<$object>> eq $object_name };`
13:36 timotimo Zoffix: you think if we only have one value on the RHS of hash assignment we should output the type that's been found?
13:36 Zoffix jeromelanteri: or `return defined .... first ...`
13:36 Zoffix jeromelanteri: depending on whether you want to find if .first found anything or whether the found thing is defined also
13:37 Zoffix timotimo: I don't understand the question...
13:37 jeromelanteri Zoffix, i check first that %group<repos> has sone or more element(s).
13:37 jeromelanteri i ckechED
13:37 jeromelanteri at ligne 7
13:37 timotimo m: my %foo = 1
13:37 camelia rakudo-moar 8f73d7: OUTPUT: «Odd number of elements found where hash initializer expected:?Only saw: 1?  in block <unit> at <tmp> line 1??»
13:37 timotimo "only saw one Int"
13:37 Zoffix jeromelanteri: this is wrong: $_<<$object>>
13:38 jeromelanteri Zoffix, what it should be ? (IDK)
13:38 Zoffix jeromelanteri: should be $_.{ $object } or just .{ $object }; «» interpret whispace
13:38 jeromelanteri ok, let's try...
13:38 Zoffix m: my $o = "one two three"; dd «$o».elems
13:38 camelia rakudo-moar 8f73d7: OUTPUT: «3?»
13:38 Zoffix jeromelanteri: won't fix your problem. I'm just saying that code is wrong.
13:39 jeromelanteri ok
13:39 timotimo oh damn, i hadn't thought of whitespace in << >>
13:40 jeromelanteri m: %g = a=>'_a', b=>[]; say %g<b>.elems;
13:40 camelia rakudo-moar 8f73d7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Variable '%g' is not declared?at <tmp>:1?------> 3<BOL>7?5%g = a=>'_a', b=>[]; say %g<b>.elems;?»
13:40 Zoffix jeromelanteri: %group<repos>.elems is also wrong, unless you can guarantee <repos> will always have a list in it
13:40 jeromelanteri m: my %g = a=>'_a', b=>[]; say %g<b>.elems;
13:40 camelia rakudo-moar 8f73d7: OUTPUT: «0?»
13:40 Zoffix jeromelanteri: should be %group<repos>:v.elems
13:40 Zoffix m: my %group; dd [%group<repos>.elems, %group<repos>:v.elems ]
13:40 camelia rakudo-moar 8f73d7: OUTPUT: «[1, 0]?»
13:41 Zoffix jeromelanteri: without `:v` you get an `Any` which .elems'es to a 1-element list containing an Any
13:41 jeromelanteri Zoffix, ok
13:42 jeromelanteri Zoffix, but same error
13:42 jeromelanteri m: my %g = a=>'_a', b=>[]; say %g<b>.elems;
13:42 camelia rakudo-moar 8f73d7: OUTPUT: «0?»
13:42 jeromelanteri not Any.
13:43 Zoffix jeromelanteri: what's the error?
13:43 perlpilot m: my %g = a=>'_a', b=>[]; say %g<q>.elems;   # jeromelanteri
13:43 camelia rakudo-moar 8f73d7: OUTPUT: «1?»
13:43 jeromelanteri Type check failed in binding; expected Associative but got Nil (Nil)
13:44 Zoffix jeromelanteri: did you fix your issue with attempting to assign the Nil from .first to %hash?
13:45 jeromelanteri Zoffix, did you see my code ? and the content of the datas ?
13:45 jeromelanteri nothing is empty when error happen.
13:45 jeromelanteri when something empty, the condition check with elems jump this line
13:46 jeromelanteri so the error occur when it is NOT empty.
13:46 Zoffix jeromelanteri: there's no jumping here: https://gist.github.com/jerome-diver/0930e64025f280edd572578540eb8ffe#file-check-pm6-L9
13:47 Zoffix jeromelanteri: and it's comparing URL to TITLE because I guess you've used $title instead of $url here: https://gist.github.com/jerome-diver/0930e64025f280edd572578540eb8ffe#file-check-pm6-L18
13:47 jeromelanteri ligne 8
13:47 jeromelanteri unless (%group<repos>.elems ==0) {
13:47 jeromelanteri so litteraly, do that if the content is NOT empty.
13:48 jeromelanteri so ligne 9 code occur when it is not empty.
13:48 jeromelanteri correct ?
13:48 jeromelanteri (sorry, but it is the iddentation who is wrong... )
13:48 Zoffix jeromelanteri: yes, but if the line 9's .first doesn't find any it'll return a Nil, which they will be bound to %repos which causes the error you're seeing;
13:48 jeromelanteri i do update and iddent well the ligne 9
13:49 Zoffix jeromelanteri: untested, but I think your first sub can be cleaned up and written like this: https://gist.github.com/zoffixznet/3d74bdcd403c0f4dcce7c1b1c12f4987
13:49 jeromelanteri Zoffix, that's strange... i'm going to do a say %group<repos> before for see
13:50 Zoffix jeromelanteri: fix line 18. You're using $title instead of $url
13:51 jeromelanteri Zoffix, yes, exact.
13:51 jeromelanteri but actualy, the error occur from line 17
13:51 jeromelanteri and say %group<repos> show that it is NOT empty
13:52 Zoffix jeromelanteri: also, in Rakudo you don't need parenstheses on if {}/unless {} conditions. You can just write them as `unless git_repo_exist $url { return "remote repo failed"; }` or even `return "remote repo failed" unless git_repo_exist $url`
13:52 Zoffix jeromelanteri: sure, but does it have the matching data?
13:52 jeromelanteri there is: [{title => air-line, url => https://.....}]
13:52 jeromelanteri Zoffix, ok
13:53 Zoffix jeromelanteri: and what's in $title and $url?
13:53 jeromelanteri title => air-line
13:53 Aaronepower Hello, in HTTP::UserAgent how do you send json? It seems it only supports form data?
13:53 jeromelanteri url (see in my code the yaml file... it is exactly the same content...
13:54 Zoffix jeromelanteri: OK, so line 18 will fail, because it's checking whether `url` field has value `air-line`
13:54 jeromelanteri Zoffix, oh well... waiting
13:54 Zoffix jeromelanteri: and your code is broken so instead of returning False, it'll fail when binding a Nil to %repos
13:55 Zoffix m: my %group = repos => [{title => "air-line", url => "https://.....}]
13:55 camelia rakudo-moar 8f73d7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?Unable to parse expression in double quotes; couldn't find final '"' ?at <tmp>:1?------> 3e => "air-line", url => "https://.....}]7?5<EOL>?    expecting any of:?        double quotes?      …»
13:55 Zoffix m: my %group = repos => [{title => "air-line", url => "https://....."}]; my %repos := %group<repos>.first: *<url> eq 'https'
13:55 camelia rakudo-moar 8f73d7: OUTPUT: «Use of Nil in string context?  in whatevercode  at <tmp> line 1?Type check failed in binding; expected Associative but got Nil (Nil)?  in block <unit> at <tmp> line 1??»
13:57 jeromelanteri Zoffix, $title (so the title i want to check if exist or not) is a string, and it exist same i write it at prompt question time
13:57 jeromelanteri same for $url.
13:57 jeromelanteri the principe is to check inside datas that it exist already or not.
13:57 jeromelanteri oh waiting, i'm try to understanding what i'm reading from your code test
13:58 jeromelanteri i'm trying to understand
13:58 Zoffix Well, fix your .first so it returns False instead of trying to bind a Nil to %respos. I explained a problem, showed it, and gave you alternate code without the problem. I don't know what else to do.
13:59 Zoffix Aaronepower: briefly looking at source, don't see that option for .post but you can make your own HTTP::Request and use .add-content on it
13:59 jeromelanteri Zoffix, oh i think i understand... there is no occurence ofon test, then it can not store the data inside %repo... correct ?
14:00 jeromelanteri it return Nil
14:00 Zoffix Right.
14:00 jeromelanteri OMG!
14:01 jeromelanteri Zoffix, thank you. and thank you timotimo  to... 2 errors in one line !
14:03 faraco I believe I did try distribute a module to perl 6 modules. I used something like Perl Dist::Zilla, but I forgot the name. Is there any similar tool that does the similar thing?
14:03 AlexDaniel joined #perl6
14:04 Zoffix buggable: eco mi6
14:04 buggable Zoffix, App::Mi6 'minimal authoring tool for Perl6': https://github.com/skaji/mi6
14:04 jeromelanteri Zoffix, timotimo like this, it works: https://gist.github.com/jerome-diver/0930e64025f280edd572578540eb8ffe
14:04 faraco AlexDaniel: Hi, the formatting works great. However, how can I test the code examples with running make xtest. It takes too much memory for me (32 bit pc)
14:04 faraco Zoffix: that's it. Thanks.
14:04 Zoffix faraco: that? ^ it's a far cry from Dist::Zilla but IIRC it works
14:05 faraco AlexDaniel: without running make xtest*
14:05 AlexDaniel faraco: perhaps you can run the test file directly (the one you are interested in)
14:05 Zoffix Aaronepower: perl6 -MHTTP::UserAgent -e 'my $req = HTTP::Request.new: POST => "http://httpbin.org/post", Authorization => "Zofmeister"; $req.add-content: "[42]"; with HTTP::UserAgent.new.request($req) { .content.say }'
14:05 jeromelanteri may i write (if need) something like that:
14:06 Zoffix Aaronepower: there should definitely be an easier way to do that. Maybe you could hack up a PR? :)
14:06 jeromelanteri %x := $_ if %y<z>.first *$_.{$z} eq $aa;
14:06 Aaronepower Zoffix: I'm only just learning perl6
14:07 Zoffix jeromelanteri: change `if` to `with`
14:07 pmurias how should a module that implements a JSX-like slang in Perl 6 be called?
14:07 AlexDaniel faraco: … but I wonder why would it need any huge amounts of memory
14:08 pmurias it would allow stuff like my $foo = <span>Here is a span</span>
14:08 jeromelanteri Zoffix, ok
14:08 Zoffix pmurias: JSX.pm6 :)
14:08 AlexDaniel faraco: do you know at what point exactly it runs out of memory?
14:08 Zoffix pmurias: Though I guess Slang:: prefix could be useful as a warning to people that the module is using unsupported, unspecced, can-=break-at-any-time features.
14:09 * Zoffix &
14:10 faraco AlexDaniel: Oh I'm sorry for my vague statement. By a lot of memory, I meant it takes around 2 hours to complete test. Not including how my other running programs became unresponsive quickly. Installing App::mi6 and I just got 7 seconds delay on the app testing.
14:11 faraco I don't blame the tools, I blame my hardware.
14:11 AlexDaniel faraco: what about doing just: perl6 xt/examples-compilation.t
14:12 AlexDaniel faraco: in other words, just test examples and don't run any other xtests
14:12 faraco AlexDaniel: thanks. I didn't know what to test before. Now I know, and that saves a lot of time from now on.
14:12 faraco AlexDaniel++
14:12 linuksz joined #perl6
14:12 AlexDaniel faraco: ah, also, it seems to accept a list of files as arguments
14:13 AlexDaniel faraco: https://github.com/perl6/doc/blob/master/xt/examples-compilation.t#L22-L23
14:13 AlexDaniel faraco: so you can tell it to test some specific file only
14:14 [Coke] faraco: if you can't run make xtest, don't worry about it; thank you for trying, though.
14:14 [Coke] ... and also what alexd said.
14:14 linuksz this code is in the signature of MAIN, and it don't work if $rotate is not given in the command line:
14:14 linuksz Str :$rotate
14:14 linuksz where { $rotate ~~ /right|left/ || note "Direction only can be 'left' or 'right'." },
14:15 [Coke] (I need to make a utility that runs all the tests but only on a given file)
14:15 perlpilot Aaronepower: submitting a PR is a great way to learn things  :)
14:15 faraco awesome!
14:16 timotimo linuksz: you need a case for rotate not being set; the where clause will always be called
14:16 timotimo i.e. !$rotate.defined || $rorate ~~ ... || note blah
14:17 linuksz in the where clause?
14:17 timotimo yup
14:19 linuksz it works! thanks!
14:19 timotimo YW
14:21 Aaronepower perlpilot: Sure, but I'm having enough trouble making a basic script.
14:24 Zoffix linuksz: you have a bug in your code "foobarlefter" will also be accepted. Use `$rotate eq <left right>.any or note "blah blah"`. There's also Subset::Helper module:  sub MAIN ($foo where subset-is <right left>.any, "Direction only can be 'left' or 'right'.") {…}
14:24 Zoffix buggable: eco Subset::Helper
14:24 buggable Zoffix, Subset::Helper 'create awesome subsets': https://github.com/zoffixznet/perl6-Subset-Helper
14:24 Zoffix Oh, it wants a Callable *sigh*
14:25 Zoffix sub MAIN ($foo where subset-is * eq <right left>.any, "Direction only can be 'left' or 'right'.") {…}
14:25 Zoffix That module could use more love to make it better
14:25 jeromelanteri Zoffix, and can i write:
14:25 faraco Aaronepower: are you a Rust programmer?
14:25 Actualeyes joined #perl6
14:25 sufrostico joined #perl6
14:26 faraco if yes, damn. You are really good at what you are doing.
14:26 jeromelanteri defined $_ with %a.first: *<x> eq $y ?? return True !! return False;
14:26 Aaronepower faraco: Yes I am. How would I be good?
14:26 Zoffix You could improve NativeCall module to work with Rust libs :}
14:26 faraco I found this https://github.com/Aaronepower/tokei
14:26 Aaronepower Oh yea
14:27 linuksz Zoffix, thanks
14:27 Aaronepower That is me.
14:28 Aaronepower Zoffix: Rust -> language amounts to "Compile lib with C FFI functions and have the language call those".
14:28 Zoffix jeromelanteri: no, you're passing the result of the ternary as the arg to .first() and `with` already checks for definedness, so that defined() is useless.    `return defined %a.first: *<x> eq $y`
14:28 Zoffix Aaronepower: yeah, that don't work tho. One of the hypotheses for the issues we had was that the borrow checker thinks something was borrowed when we use the stuff from Rakudo
14:29 jeromelanteri Zoffix, oh yes... better !
14:29 Aaronepower Zoffix: That wouldn't make sense since the borrow checker is at compile time.
14:29 Zoffix Ah
14:29 Zoffix Then it was something else :) I recall lots of segfaults
14:30 Aaronepower faraco: tokei is inspired by a perl script. https://github.com/AlDanial/cloc
14:31 faraco that's cool. Thanks for introducing me to cloc also.
14:32 faraco it looks like unix wc, but more descriptive?
14:33 timotimo cloc also knows about comments and empty lines
14:33 timotimo at least sloccount does
14:33 timotimo i'm just assuming cloc also does that
14:34 timotimo huh, cloc contains stuff from sloccount, so maybe it's an enhanced version? who knows
14:34 faraco installing that right now. that is actually gonna be helpful for me.
14:35 Aaronepower faraco: I would recommend tokei over cloc if you're counting large repos brings minutes -> milliseconds.
14:38 faraco Aaronepower: will do.
14:39 sufrostico joined #perl6
14:49 sufrostico joined #perl6
14:49 sufrostico joined #perl6
14:49 Zoffix $ perl6 -MJSON::Fast -MWWW -e 'dd jpost("http://httpbin.org/post", to-json({:42a, :foo<meows>}), :Authorization<Zofmeister>).<json><foo>'
14:49 Zoffix Str %result = "meows"
14:49 Zoffix Aaronepower: ^ just added post that can post a body to WWW
14:50 Zoffix and jpost automatically decodes response as JSON
14:50 andreoss joined #perl6
14:50 Zoffix zef --force install https://github.com/zoffixznet/perl6-WWW/archive/master.zip
14:50 Zoffix How come GitHub removed .tar.gz option? Kinda annoying 'cause zip isn't available on debian by default :/
14:51 Cabanossi joined #perl6
14:52 sufrostico joined #perl6
14:52 Zoffix but they do provide a .tar.gz option for releases :/ https://github.com/zoffixznet/perl6-WWW/archive/1.003001.tar.gz
14:57 astj joined #perl6
14:59 sufrostico joined #perl6
15:00 faraco question, if someone use 'use v6.c', will the user able to use the next version (eg. v6.d)?
15:00 khw joined #perl6
15:01 pmurias faraco: yes, but it will try to preserve compatability
15:01 faraco pmurias: alright I see. Thanks. I thought it will incompatible with each version (that gonna be sucks)
15:01 mspo is there a changelog for .c -> .d ?
15:01 faraco be incompatible*
15:02 wamba joined #perl6
15:03 Zoffix mspo: there's no .d yet, so no.
15:03 faraco https://github.com/perl6/6.d-prep - maybe that? not sure
15:03 faraco oh
15:03 Zoffix faraco: use v6.c; will use 6.c version of the language. That script won't see any improvements/additions of 6.d
15:04 faraco that sounds familiar
15:04 faraco thanks for the advice tho
15:05 Zoffix m: use v6.d.PREVIEW; await ^1000 .map: {start await Promise.in(2)}; say now - INIT now
15:05 camelia rakudo-moar 5d89ce: OUTPUT: «2.3192678?»
15:05 Zoffix m:  await ^1000 .map: {start await Promise.in(2)}; say now - INIT now
15:05 camelia rakudo-moar 5d89ce: OUTPUT: «(timeout)»
15:05 Zoffix ^ when 6.d gets released, the default will be the 2.3s and any script that has use v6.c; will get the timeout version
15:06 faraco ain't it will be better if we just use v6; ?
15:07 Zoffix faraco: I'd imagine `use v6;` would give you latest stable, same as no version specified
15:09 mspo so it's like use perl5.000020 or whatever?
15:09 Zoffix m: use nqp; say v6.c ~~ v6
15:09 camelia rakudo-moar 5d89ce: OUTPUT: «True?»
15:09 mspo Zoffix: https://github.com/perl6/6.d-prep/blob/master/TODO/FEATURES.md ?
15:09 Aaronepower Why are there so many numbers for a version?
15:11 Zoffix mspo: not exactly, in Perl you get "old" version by default; in Rakudo you get latest stable by default; I think use v5.020 just gets you new features up to that version; it doesn't use the v5.020 compiler
15:11 mspo Aaronepower: in which case?
15:11 Zoffix mspo: URL ? <--- what are you asking?
15:11 Zoffix Aaronepower: there's just one :) 6 and one letter :)
15:11 mspo Zoffix: those are the differences proposed for .d ?
15:11 Zoffix mspo: not even close. Those are just the features still to implement.
15:11 Aaronepower Zoffix: I mean in your version numbers. 1.003001 as an example
15:12 Zoffix Aaronepower: semver without the second dot 1.003001 == 1.003.001 == 1.3.1
15:12 Zoffix http://semver.org/
15:13 Aaronepower Zoffix: Why all the extra zeroes>
15:13 ugexe in perl5 you cannot do 1.2.3
15:13 Aaronepower ?*
15:13 Zoffix mspo: a lot of 6.d features are already implemeneted in 6.c compiler. They're just not "officially" part of the language. Though now that we'll have proper infrastructure, they'll be more strict process. We'll also be releasing point language releases quarter,ly
15:14 Zoffix Aaronepower: because otherwise I can only do 10 releases of each subversion and patch levels
15:14 Aaronepower Zoffix: ???
15:15 Aaronepower Zoffix: 1.9 -> 1.10 -> 1.11 ?
15:15 Zoffix Aaronepower: that doesn't have patch in it
15:15 Zoffix semver is 3 numbers
15:16 Aaronepower Zoffix: I just omitted it, you can imagine a .0 on the end and it's still the same question.
15:16 Zoffix Aaronepower: you can't imagine a .0 on the end, since as I've said, I don't use the second dot. I use a proper good looking number, with a single dot
15:17 Zoffix So lacking the second dot, I use two triplets of digits after the dot to indicate subversion and patch
15:17 mspo so you max out at 999 in the second and third positions
15:17 Zoffix Yeah. That's a long way to go tho :)
15:17 mspo can you use hex?
15:18 Zoffix I don't
15:18 mspo modified hex with roman numerals?
15:18 ugexe you can use whatever if the tooling knows what format it is
15:19 mspo I'm just making jokes.  I don't even know where these numbers are listed
15:19 Zoffix in https://github.com/zoffixznet/perl6-WWW/archive/1.003001.tar.gz
15:19 wamba joined #perl6
15:21 ugexe https://metacpan.org/source/URI/File-Slurp-9999.18
15:22 cdg joined #perl6
15:22 mspo so cpan doesn't support two dots?
15:22 Zoffix https://metacpan.org/pod/release/ZOFFIX/Acme-Net-FullAuto-0.9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999/lib/Acme/Net/FullAuto.pm
15:22 Zoffix I win :)
15:25 nadim joined #perl6
15:29 ilmari Zoffix: version is only varchar(16), so that won't index properly
15:29 ilmari (in the PAUSE DB)
15:29 Zoffix ilmari: yeah, I heard :)
15:30 timotimo we need version to be BLOB
15:30 ilmari LONGTEXT
15:31 timotimo how i long for some good text
15:31 Zoffix yeah, it was tossed from PAUSE already. That's just Metacpan's page picking it up; probably from backpan
15:32 timotimo backpan, so, like, nap?
15:32 nebuchadnezzar joined #perl6
15:32 * Zoffix doesn't know what nap is
15:32 Zoffix Everything you ever uploaded to CPAN lives on on BackPAN, even after you delete it from PAUSE: http://backpan.perl.org/authors/id/Z/ZO/ZOFFIX/
15:32 ilmari y nap?
15:33 Zoffix hehe, Acme::BabyEater... good times :)
15:34 Skarsnik joined #perl6
15:40 st_elmo joined #perl6
15:52 Skarsnik hm, I think there is a regression in memory usable since 2017.05 when calling a command https://gist.github.com/Skarsnik/6adfba55ff9b0d179a8ffee923112393
15:54 timotimo Skarsnik: could very well be different positions in the GC cycle
15:54 bronious joined #perl6
15:54 timotimo try a force gc before the sleep 5 and measure again between that and the sleep
15:55 Skarsnik well what it bother me the most is the sleep 5 make it take ~1Mb more
15:55 Skarsnik How I can force the gc?
15:56 Zoffix Skarsnik: use nqp; nqp::force_gc()
15:58 Skarsnik similar result
15:58 Skarsnik skarsnik@vps300582:~/perl6/benchmark$ ./rakudo-2017.07/install/bin/perl6 -I p6-linux-proc-statm/lib/ ../testshell.p6 qqx
15:58 Skarsnik Before shell call : 78.728 kb
15:58 Skarsnik html is 258974 chars
15:58 Skarsnik After shell call : 113.488 kb
15:58 Skarsnik After sleep 5 : 113.488 kb
15:58 sena_kun joined #perl6
15:58 Skarsnik I put it before the 'after shell call'
15:59 Skarsnik (I switch to qqx since it works for old version of rakudo)
16:01 timotimo i wonder what heaptrack would show here.
16:01 Skarsnik still no nice tool in moar to query memory usage? x)
16:02 sena_kun Is JSON::Marshal maintainer here?
16:03 Zoffix sena_kun: nope. They seem to have quit using IRC. I see them post in our Facebook group once in a while
16:04 sena_kun :c
16:07 sena_kun https://gist.github.com/Altai-man/fe3df2e36c9c2b7dfe2821f96235d2d9 - I wonder where I should sent a bug-report about this. It's either zef || JSON::Marshal || JSON::Fast.
16:07 faraco joined #perl6
16:07 faraco joined #perl6
16:08 Zoffix holy hell the "Why I'm learning P6" thread got 175 HN comments :o https://news.ycombinator.com/item?id=14854418
16:09 Skarsnik tl;dr x)
16:09 Skarsnik Seriously, anything interesting in that?
16:11 faraco m: say WHAT .first;
16:11 camelia rakudo-moar 5d89ce: OUTPUT: «(Any)?»
16:12 faraco m: say WHAT sum;
16:12 camelia rakudo-moar 5d89ce: OUTPUT: «(Int)?»
16:13 Zoffix Skarsnik: based on past experience, doubt it. I bet it's a bunch of "Why have language X when I have {«Ruby Python "Any other 25 year old language that replaced an earlier language"».pick}"
16:13 Zoffix And the other bunch is people arguing about $CS-concept and why it <sucks rocks>.pick
16:13 faraco I found sum is in TODO list. I want to define the method definition like, method sum(Int:D --> Int:D)
16:13 Zoffix .oO( HN/CommentsGenerator.pm6 )
16:14 faraco but not sure if it only receives Int.
16:15 Zoffix faraco: method on what?
16:15 Zoffix m: &sum.candidates».signature.say
16:15 camelia rakudo-moar 5d89ce: OUTPUT: «(() (\SELF) (+ is raw))?»
16:15 Zoffix m: ().^lookup('sum').candidates».signature.say
16:15 camelia rakudo-moar 5d89ce: OUTPUT: «((List $: *%_))?»
16:15 Zoffix heh
16:16 Zoffix faraco: it don't take no Int:D
16:16 andreoss can i have anonymous hashes with default?
16:16 faraco how do you document these 'undocumented' methods :((
16:18 Zoffix s: &trait_mod:<is>, \(%, :42default)
16:18 SourceBaby Zoffix, Something's wrong: ?ERR: Could not find candidate that can do \({}, :default(42))?  in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 37?  in block <unit> at -e line 6??
16:18 Zoffix s: &trait_mod:<is>
16:18 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/5d89cef/src/core/traits.pm#L13
16:19 Zoffix don't even see one for Variable
16:20 Zoffix faraco: find implementation. Find tests that spec that implementation. Document your findings.
16:21 faraco seems myself doing say WHAT on these methods looks primitive as hell.
16:22 lucs joined #perl6
16:23 Zoffix faraco: it seems wrong. WHAT returns the type object of the return value
16:23 Skarsnik https://map.perl6.party/ hm sig for sum are weird
16:24 Zoffix Oh, right, I forgot about that website.
16:24 Zoffix faraco: you could use that ^. But note that it's rakudo implementation, not the language definitions
16:24 Skarsnik You have too much perl6 related stuff x)
16:24 Zoffix andreoss: I'm gonna tentatively say "no". What are you trying tod o?
16:25 faraco Skarsnik, Zoffix: Hey thanks guys, I'll PR on these things since I don't know the accuracy.
16:25 Zoffix andreoss: well, without nqp that is
16:26 robertle joined #perl6
16:27 Zoffix m: use nqp; my %foo is default(42); nqp::p6bindattrinvres({:70a}, Hash, q|$!descriptor|, nqp::getattr(%foo, Hash, q|$!descriptor|))<foo>.say
16:27 camelia rakudo-moar 5d89ce: OUTPUT: «42?»
16:28 Zoffix hehe
16:32 El_Che "I hate perl
16:32 El_Che 6"
16:32 El_Che but he doesn't
16:33 El_Che https://news.ycombinator.com/item?id=14855781
16:33 El_Che heh hates haskell ;)
16:33 andreoss m: use MONKEY-TYPING; augment class Hash { method with-default(\a) { my %s is default(a) = self.clone }}; say({}.with-default(0){1})
16:33 camelia rakudo-moar : OUTPUT: «(Mu)?»
16:34 andreoss not Any for some reason
16:35 Zoffix andreoss: because traits are compile-time
16:35 Zoffix m: use MONKEY-TYPING; augment class Hash { method with-default(\a) { "my %s is default({a}) = self.clone".EVAL }}; say({}.with-default(0){1})
16:35 camelia rakudo-moar 5d89ce: OUTPUT: «0?»
16:36 Zoffix (not a recommended way of solving that)
16:36 Cabanossi joined #perl6
16:37 colomon joined #perl6
16:39 andreoss .with-default or mutable .default would be nice for parsed hashes
16:40 * Zoffix doesn't see the point...
16:40 Zoffix Just stick em into a container
16:41 faraco ok, now I'm annoying. I looked for the tests in Rakudo t/ , but I didn't find any tests for the methods implementations. Can anybody point me out where to look for the methods test. Or I'm looking at the wrong place?
16:41 colomon back in Feb, Zoffix asked: “I don't get how .grep-not(/foo/) is better than .grep({!/foo/}).”  My answer is every six months or so I want to do this operation, and I have never once remembered how to code it. The ONLY reason I figured out this time is I googled “grep not” on the IRclog — and that after about ten minutes of searching everything I could think of.
16:41 Aaronepower Hello, is there any way to condense to multiple .trans calls?
16:41 colomon faraco: by default most spectests don’t come with a standard Rakudo build
16:42 colomon faraco: if you do “make spectest” it will download them from github before running them.
16:42 faraco oh thanks.
16:42 Zoffix Aaronepower: .trans: [<a b c>] => [<A B C>]
16:43 Zoffix faraco: the spec is in https://github.com/perl6/roast
16:43 faraco tyvm
16:43 geekosaur Aaronepower, note that the general case may not be possible, if there is overlap that must happen in a specific order
16:44 Aaronepower geekosaur: There is.
16:44 Aaronepower geekosaur: My current line looks like this `q:to/END/.trans(/\x20/ => '').trans(/\n/ => ' ').trans(/"/ => '\"')`
16:45 raschipi joined #perl6
16:45 andreoss Zoffix: what kind of container?
16:45 geekosaur right, so you could combine the last two but the first needs to stay separate.
16:47 Zoffix colomon: that statement assumes everyone reaches for "grep-not" when they want one. We don't have .first-not or .^can-not or .so-not, so ".grep-not" would be an oddity compared to the rest of the language. You can equally write .grep({not /foo/}). An elitist in me says just learn your tools: .grep checks by True/False. If you have a True, you'd reverse it with a not or ! op. No googling required :/
16:47 andreoss if i get a hash from YAML file, i should either clone it with `is default` on each level or guard every hash lookup with ||$DEFAULT
16:48 andreoss *`is default`.EVAL
16:49 geekosaur Zoffix, I think the confusion here is grep(!/foo/) vs. grep( {!/foo} )
16:49 Zoffix m: say (my % is default(0) = {:42a},){1}
16:49 camelia rakudo-moar 5d89ce: OUTPUT: «0?»
16:49 geekosaur the former is "natural" but wrong
16:49 colomon Zoffix: the problem with that (from my perspective, anyway) is that it’s totally not obvious why that works.
16:49 faraco from the sum test, it says it always return Int even if endpoints are Num or Rat integers.
16:50 setty1 joined #perl6
16:50 faraco so, my current hypothesis is: method sum(--> Int)
16:50 geekosaur Aaronepower, the combined part is something like .trans(["\n", '"'] => [' ', '\"'])
16:50 colomon Zoffix: and you can say what you want, but I spent five years actively working on Rakudo, and I might have been the stupidest developer present, but if I cannot reliably figure out it / remember it, I don’t know why we would expect newcomers to do so.
16:51 Zoffix m: (1.5, 2e-1).sum.say
16:51 camelia rakudo-moar 5d89ce: OUTPUT: «1.7?»
16:51 Zoffix faraco: ^ not true
16:51 faraco hmm, about this? https://github.com/perl6/roast/blob/d1baf2e7a3e56cd6619c46040d04ed6daebc1d02/S03-operators/range-int.t#L486
16:52 andreoss m: sub with-default(%h, \default) { -> $k { %h{$k} || default } }; say with-default({1=>2}, 0)(2)
16:52 camelia rakudo-moar 5d89ce: OUTPUT: «0?»
16:52 shadoxx joined #perl6
16:52 faraco just want to see how the verify the arguments and the return value. After I know the process, maybe I can do it on my own.
16:52 andreoss will settle with this
16:52 shadoxx Ok. I want to get into Perl 6. I come from a Python/PHP/C background
16:53 AlexDaniel \o/
16:53 Zoffix shadoxx: there's a python-to-perl6 guide. Don't know how good it is: https://docs.perl6.org/language/py-nutshell
16:53 colomon Zoffix: honestly, it isn’t at all obvious to me why grep({! /foo/}) should work.  I know why grep(/foo/) works (no brackets) — it’s a smartmatch.  but it isn’t obvious to me that grep({/foo/}) should work.  and adding a negation to it just seems like magic.
16:53 raschipi grep(!/foo/) obviously won't work, casting a regex to bool won't give something grep can use
16:54 Zoffix colomon: and you spent 5 years actively working on Rakudo?
16:54 faraco maybe I should try something more obvious..
16:54 colomon Zoffix: yes.
16:55 Zoffix colomon: I spent 1.5 years with Perl 6 and just a year working on Rakudo... That shit's basic
16:55 cdg joined #perl6
16:56 Zoffix If you don't know how .grep works, I don't see how adding a whole nuther method solves anything.
16:56 Zoffix faraco: that's just poor test description.
16:56 faraco even grep is not documented
16:57 Zoffix Yeah it is: https://docs.perl6.org/routine/grep#(List)_routine_grep
16:57 shadoxx Zoffix: this guide is pretty ok, exactly what i was looking for. Perl syntax seems familiar enough. :]
16:57 shadoxx thanks!
16:57 colomon Zoffix: I know how .grep works.  I don’t know how smartmatching a code block with a negated regular expression translates to things that don’t match the regular expression.
16:57 faraco urm, so method and routine is not same? - https://docs.perl6.org/routine/grep#class_Any
16:58 jnthn colomon: A regex in boolean context applies itself to $_
16:58 shadoxx /buffer jan
16:58 Zoffix shadoxx: see also "For Newcomers" resources section ( https://perl6.org/resources/ ) and https://perl6book.com/ for a list of books ("Tink Perl 6" one is free to download)
16:58 jnthn colomon: The !/foo/ thing thus boolifies it forcing it to run against $_ and then negates the result :)
16:58 shadoxx whoops.
16:59 colomon jnthn++ # an exlanation
16:59 colomon *explanation
16:59 jnthn It's an odd construct if you don't know the /foo/ automatic matching on $_ in Bool/sink context
16:59 Ven joined #perl6
17:00 Zoffix m: say <foo bar ber foods>.grep: *.match(/foo/).not
17:00 camelia rakudo-moar 5d89ce: OUTPUT: «(bar ber)?»
17:00 colomon and it’s a uniquish construct: You cannot negate .grep(Int) by saying .grep({!Int}), correct?
17:00 jnthn Correct
17:00 jnthn You'd need .grep(* !
17:00 raschipi m: given "foo" { !/foo/ }; given "bar" { !/foo/ }
17:00 jnthn oops
17:00 camelia rakudo-moar 5d89ce: OUTPUT: «WARNINGS for <tmp>:?Useless use of "!" in expression "!/foo/" in sink context (lines 1, 1)?»
17:00 jnthn You'd need .grep(* !
17:00 jnthn argh
17:00 jnthn You'd need .grep(* !~~ Int)
17:01 faraco https://docs.perl6.org/routine/grep#class_Any is that supposed to be there. 2 place of grep documentaton?
17:01 Zoffix faraco: more than one type provides the method
17:01 faraco aww....I should take a break...
17:01 AlexDaniel m: my @a = ‘foo’, 25, ‘z’, 3; say @a.grep(none(Int))
17:01 camelia rakudo-moar 5d89ce: OUTPUT: «(foo z)?»
17:02 raschipi m: given "foo" { say !/foo/ }; given "bar" {say !/foo/ }
17:02 camelia rakudo-moar 5d89ce: OUTPUT: «False?True?»
17:03 Zoffix AlexDaniel++ right, you can use Junctions too
17:03 Zoffix m: say <foo bar ber foods>.grep: none /foo/
17:03 camelia rakudo-moar 5d89ce: OUTPUT: «(bar ber)?»
17:03 AlexDaniel m: my @a = ‘foo’, 25, ‘z’, 3; say @a.grep(none(/foo/)) # it feels like a stupid way to do it, but it works
17:03 camelia rakudo-moar 5d89ce: OUTPUT: «(25 z 3)?»
17:03 AlexDaniel yea
17:04 Zoffix not far away from .grep-not :)
17:05 Dunearhp joined #perl6
17:05 Skarsnik_ joined #perl6
17:05 faraco left #perl6
17:06 Zoffix m: dd WHAT (1.0 .. 10.0).sum
17:06 camelia rakudo-moar 5d89ce: OUTPUT: «Int?»
17:06 Zoffix m: dd WHAT (1.1 .. 10.0).sum
17:06 camelia rakudo-moar 5d89ce: OUTPUT: «Rat?»
17:06 Zoffix .oO( lame )
17:07 AlexDaniel Zoffix: why does this happen, by the way?
17:07 Zoffix .tell faraco so the .sum test description is not too wrong. Indeed Range.sum produces an Int for non-Int endpoint, but only if it can; (1.1 .. 10.0).sum gives a Rat :/
17:07 yoleaux Zoffix: I'll pass your message to faraco.
17:07 Zoffix AlexDaniel: it was made that way, I'd guess :) There's roast test covering it
17:07 Zoffix s: ^4, 'sum', \()
17:08 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/5d89cef/src/core/Range.pm#L642
17:08 AlexDaniel is it a call to .narrow somewhere or something?
17:08 [Coke] colomon: this seems like something that could be listed under .grep with a "BTW, if you're trying to ..."
17:08 AlexDaniel mm
17:08 Zoffix s: (), 'sum', \()
17:08 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/5d89cef/src/core/List.pm#L375
17:08 AlexDaniel [Coke]++
17:08 [Coke] (like a trap, but closer to the "source")
17:08 [Coke] colomon: if you open a doc ticket, I'll even promise to write it. :)
17:09 AlexDaniel colomon: please do, it's a good idea
17:11 Zoffix m: class Foo { method x { say "Foo" } }; class Bar { method x { say "Bar"; nextsame } }; Bar.new.x
17:11 camelia rakudo-moar 5d89ce: OUTPUT: «Bar?»
17:11 Zoffix What is it `nextsame`ing to here? It's not a multi method :/ https://github.com/rakudo/rakudo/blob/5d89cef/src/core/Range.pm#L643
17:12 AlexDaniel m: class Foo { method x { say "Foo" } }; class Bar is Foo { method x { say "Bar"; nextsame } }; Bar.new.x
17:12 camelia rakudo-moar 5d89ce: OUTPUT: «Bar?Foo?»
17:12 AlexDaniel Zoffix: doesn't have to be
17:12 colomon [Coke]++
17:12 Zoffix Oh, I forgot `is` duh :)
17:13 AlexDaniel on a relevant note, can I ask a noob question :)
17:13 AlexDaniel do I get it right that TWEAK in a role is a bad idea?
17:13 mr-foobar joined #perl6
17:14 AlexDaniel because, basically, it will never be called if the class does-ing this role has its own TWEAK
17:14 AlexDaniel and nextsame/nextwhatever will not reach role's TWEAK ever
17:14 AlexDaniel well, that's unless I'm a complete monkey
17:16 Zoffix m: dd (1.0 .. 10.0).int-bounds
17:16 camelia rakudo-moar 5d89ce: OUTPUT: «(1, 10)?»
17:16 Zoffix "AlexDaniel ? Zoffix: why does this happen, by the way?" ... ^ that's why
17:17 Zoffix .int-bounds gives Ints even on ranges made outta Rats (when possible)
17:18 sufrostico joined #perl6
17:22 Ven joined #perl6
17:25 Hotkeys joined #perl6
17:25 Hotkeys joined #perl6
17:25 Hotkeys joined #perl6
17:26 Hotkeys howdy
17:26 raschipi heya
17:27 Hotkeys haven't been here in a while or used p6 in a while
17:27 Hotkeys but I heard about 6.d coming so I thought I might come back
17:29 Zoffix heh
17:29 Zoffix Hotkeys: nothing special will happen when it comes out, though :)
17:29 Hotkeys still :P
17:29 Zoffix Most of the new features are already implemented in the compiler (without needing 6.d pragma)
17:30 Hotkeys I had sort of forgotten about p6 but then a post popped up on /r/programming about it and here I am again
17:30 Zoffix I didn't even notice you left :)
17:31 Hotkeys 3
17:31 Hotkeys <3 I think
17:31 Hotkeys unless you didn't notice me in the first place :P
17:33 Zoffix I do remember your nick.
17:35 Hotkeys I did make a very small contribution to p6 and I think my name is forever immortalized on the contributors list for 6.c so that's something
17:35 mspo Hotkeys: I'm in a similar boat
17:36 geekosaur I remember you being here but asking me to notice going away is a bit of a reach. (both of you actually...)
17:36 Hotkeys :P
17:36 Hotkeys fair enough
17:36 Hotkeys I do remember y'all too
17:36 mspo <bender> REMEMBER ME!
17:36 Hotkeys I used to do a lot of codegolfing in p6
17:36 perlpilot Hotkeys: but, but, ... why did you leave?!?  ;)
17:37 mspo I made a doc thing for grammers but I think it's been lost
17:37 geekosaur (mind, that's also true in person. fsvo "mind"...)
17:37 mspo Hotkeys: oh yeah I *do* remember you linking to those a lot
17:37 mspo I left because I started trying to write a udp network thing and there was practically no support for it
17:38 geekosaur there still isn't much in the way of udp support
17:38 Hotkeys https://codegolf.stackexchange.com/users/46687/lockopeners?tab=answers practically all of my posts are p6 golf :P
17:38 mspo I'm out of here!
17:38 geekosaur not much demand I guess
17:38 Hotkeys mspo: time for you to write a udp library I suppose :D
17:38 mspo Hotkeys: apparently
17:39 geekosaur except that can't really be done in perl 6, there needs to be moarvm bindings to the appropriate libuv apis
17:39 mspo IIRC networking isn't spec-ed at a langauge level and you just get whatever libuv offers
17:39 mspo oterhwise you're told to use NativeCall
17:40 mspo erlang has the best networking stuff
17:41 geekosaur otoh perl 6 isn't the only language in this boat, if you want to do udp in haskell you don;t get much help beyond a very raw socket-level binding that iirc is missing some useful pieces
17:41 mspo although even it had a lot of pain points
17:41 mspo it stopped supporting unix sockets for something like 6 years :)
17:41 mspo but recently got them back
17:45 iviv joined #perl6
17:46 perlpilot geekosaur: It would still be a shame to lose that vibe that Perl has generally good IO support (especially including sockets)
17:47 raschipi How was it supposed to interact with a modern Unix without unix sockets?
17:48 geekosaur erlang's "thing" is network services, not local
17:48 raschipi Well, P6 doesn't have a D-Bus library too, so it can't do it too.
17:49 raschipi too manys toos
17:49 AlexDaniel Hotkeys: welcome back o/
17:49 AlexDaniel Hotkeys: I did notice :)
17:50 jnthn IO::Socket::Async certainly has some basic UDP support, but I don't recall seeing any RTs asking for it to be improved, so yes, low demand I guess :)
17:51 jnthn mspo: There are spectests covering networking stuff, which means it is decidedly part of the language.
17:51 timotimo uses i know for udp: 1) gamedev (though you'd nativecall to enet most likely), 2) multimedia streaming, 3) DNS
17:52 perlpilot NFS
17:52 perlpilot (if everyone hasn't switch to TCP yet)
17:53 domidumont joined #perl6
17:53 unop joined #perl6
17:53 AlexDaniel by the way, if somebody wants to work on a networking LHF, then here is one: RT #131766 ;)
17:53 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=131766
17:53 AlexDaniel although quite possibly it's not as easy as it looks…
17:54 colomon [Coke]: perl6/doc issue on github is appropriate way to do it?
17:54 AlexDaniel I might get to it myself some day maybe, after all I can't connect any new bots now :)
17:54 AlexDaniel colomon: yes
17:54 * colomon hits “New issue"
17:56 mspo jnthn: I think my complaining wsa what mainly got udp into io::socket::async
17:56 perlpilot mspo: were you writing a game in P6?  ;)
17:56 mspo perlpilot: I was trying to write a dns client
17:57 mspo but now I'm too busy at $work to do much of that
17:58 Hotkeys AlexDaniel: o/
17:58 wamba joined #perl6
17:59 shlomif joined #perl6
17:59 geekosaur timotimo, tftp/bootp/dhcp :p
17:59 perlpilot I wish I could wrap my head around all this async stuff.   I mean I can do stuff, but I haven't internalized it enough such that I don't feel like a monkey banging on a keyboard when I try to create something.
18:06 colomon [Coke]: https://github.com/perl6/doc/issues/1425
18:06 mspo also udp for memcached
18:06 mspo and a million other things
18:06 mspo QUIC
18:07 perlpilot colomon: What if there was an adverb to negate the test?
18:07 sftp joined #perl6
18:08 mspo I didn't even check p6's support for unix sockets
18:08 domidumont joined #perl6
18:08 AlexDaniel perlpilot: an adverb for .grep you mean?
18:08 colomon perlpilot: I briefly hoped :v would do exactly that, but no such luck.
18:09 mspo jnthn: there won't be "demand" without initial support
18:09 perlpilot AlexDaniel: yes
18:09 Zoffix Stop wanting to add stuff the second you think of something :/
18:09 perlpilot colomon: :v is already meaningful, it would have to be something else
18:09 colomon perlpilot: yes, I figured that out
18:10 mcgyver joined #perl6
18:10 geekosaur :v would be a bad choice if we're not planning to duplicate perl 5's "of course you're an ancient unixer" vibe
18:10 AlexDaniel it's already taken anyway
18:10 Skarsnik Zoffix, I wanted extra sprinkles on my donuts :(
18:10 raschipi If the "grep" didnt do that already
18:11 Zoffix Skarsnik: well, hang around, maybe someone will come up with an option to add.
18:11 Zoffix Maybe a couple more methods + new syntax
18:11 perlpilot Zoffix: Adding things is fine.   We can do it the traditional way:  prototype in a module, get people to try it out, if there's enough support migrate it into the language
18:12 raschipi It should be called "Where-Object" to avoid the Unix stink
18:12 Zoffix perlpilot: the common objection to that strategy I hear is "I don't wanna use a module; I want it in core"
18:12 geekosaur "tough"
18:12 perlpilot Zoffix: sure ... just garner enough support and your wish comes true.
18:12 perlpilot :-)
18:13 geekosaur yes, we're going to put the kitchen sink in core for all the "I don wanna use a module" crowd
18:14 AlexDaniel m: ‘?’.sink
18:14 camelia rakudo-moar 5d89ce: ( no output )
18:14 AlexDaniel it's already there
18:14 perlpilot I suppose there's always "convince TimToady and it goes in by fiat" but hopefully that's *extremely* rare
18:15 Zoffix perlpilot: the approach I observe is propose an idea that's considered singularly and not in the context of the entire language, then get mad with Zoffix for rejecting the ticket :)
18:15 Zoffix Like, it's not just .grep-not, there's at least .first-not that comes together with it.
18:16 Skarsnik .dont-match(/foo/)
18:16 Zoffix .don't-match :)
18:16 AlexDaniel Zoffix: well, according to that logic you can also reject RT #131766
18:16 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=131766
18:16 perlpilot Well, I'd propose a :n(egate) adverb (or something like that)
18:16 Rawriful joined #perl6
18:17 Zoffix AlexDaniel: why according to that logic?
18:17 ugexe but this only really makes sense in the case of implicit smart match negating yes?
18:17 Zoffix I've seen that ticket already; I have nothing to say about it.
18:18 ugexe if you do * !~~ ..., which is only 2 extra characters via adding *-not
18:18 AlexDaniel Zoffix: adding stuff is bad, very few will benefit from it anyway, yada-yada
18:18 Zoffix Ah.
18:18 AlexDaniel so far I'm probably the only person needing it anyway, so
18:18 Skarsnik I think lot of peple does not use unless instead of if !
18:19 FROGGS joined #perl6
18:19 Zoffix Yes, adding stuff is bad. It leads to more things to learn. How many of you ever read a `grep` man page in entirety?
18:19 Skarsnik (I love unless)
18:19 geekosaur which grep, a sensible one or the gnu monstrosity?
18:19 Zoffix Either :)
18:19 Hotkeys I also like unless
18:19 Hotkeys it's more readable imo, if only slightly
18:19 * AlexDaniel doesn't like unless, but loves “without”
18:20 perlpilot I've read enough of the grep man page to find the handful of options I use regularly  :)
18:20 Skarsnik printf manpage is already long enough for me x)
18:20 Hotkeys I feel like adding a grep-not, etc. is unnecessary when you can just negate your predicate
18:20 Zoffix .grep({!/foo/}) can be understood just from the bits you already probably know and use elsewhere .grep(/foo/, :n) has extra knowledge of specific `:n` adverb to grep
18:21 geekosaur Hotkeys, except you don't "just" negate it
18:21 ugexe right, and that becomes more apparently when you don't write implicit smart match version of (/.../)
18:21 geekosaur you have to convert it to a closure and negate *that*
18:21 Zoffix m: [].^lookup('splice').candidates.elems.say
18:21 camelia rakudo-moar 5d89ce: OUTPUT: «31?»
18:21 Zoffix AlexDaniel: ^ mindlessly adding stuff is why we have 31 candidates to .splice.
18:21 AlexDaniel Zoffix: not saying that this is good
18:22 Zoffix I challenge someone to name all possible ways to call it without looking at docs.
18:22 * Zoffix goes away to yell at the cloud
18:22 * Zoffix &
18:23 Skarsnik I don't even know wat splice do x)
18:23 perlpilot heh
18:25 Hotkeys I didn't realize there was more splice than just like @foo.splice($start, $n?, @bar)
18:25 jimlenz joined #perl6
18:26 perlpilot I wonder how much of those splice variations are documented even.
18:26 Hotkeys Skarsnik: given the above, it removes $n elements starting at $start in @foo and replaces them with @bar
18:26 ugexe splice(*) and splice(0) and various edge cases
18:26 Hotkeys but apparently there is more too
18:27 Skarsnik can you rewrite perl6 with splice?
18:27 sfc joined #perl6
18:27 masak in 007, I realized we'll want .splice, but that it should be two methods: https://github.com/masak/007/issues/238
18:27 masak but maybe I've missed some edge cases too ;)
18:27 Zoffix perlpilot: it's fully documented
18:28 * masak reads https://docs.perl6.org/routine/splice
18:29 Hotkeys ah, $start and $elems can both take Whatever and Callable
18:30 Hotkeys that sounds fun
18:30 masak the Callable is mostly for the WhateverCode case, I'll bet
18:30 perlpilot 31 is suspiciously 2**5-1  ;-)
18:30 masak m: my @xs = [1, 2, 3, 4, 5, 6]; @xs.splice(*/2); say @xs.perl
18:30 camelia rakudo-moar 5d89ce: OUTPUT: «Cannot resolve caller splice(Array: Rat); none of these signatures match:?    (Array:D \SELF: *%_)?    (Array:D $: Whatever, *%_)?    (Array:D $: Callable:D $offset, *%_)?    (Array:D $: Int:D $offset, *%_)?    (Array:D $: Whatever, Whatever, *…»
18:30 Hotkeys is that suspicious
18:30 Zoffix $offset, $size?, **@replacement is basically the nutshell, but $offset and $size can be either Int, or Whatever, or Callable, which permutes all the candidates (since not doing that leads to large perf loss in cases of needless slurpie)
18:31 masak m: my @xs = [1, 2, 3, 4, 5, 6, 7]; @xs.splice(*/2); say @xs.perl
18:31 camelia rakudo-moar 5d89ce: OUTPUT: «Cannot resolve caller splice(Array: Rat); none of these signatures match:?    (Array:D \SELF: *%_)?    (Array:D $: Whatever, *%_)?    (Array:D $: Callable:D $offset, *%_)?    (Array:D $: Int:D $offset, *%_)?    (Array:D $: Whatever, Whatever, *…»
18:31 masak hmm
18:31 masak m: my @xs = [1, 2, 3, 4, 5, 6, 7]; @xs.splice(floor */2); say @xs.perl
18:31 camelia rakudo-moar 5d89ce: OUTPUT: «Cannot resolve caller Numeric(WhateverCode: ); none of these signatures match:?    (Mu:U \v: *%_)?  in block <unit> at <tmp> line 1??»
18:31 Hotkeys lol
18:31 masak m: my @xs = [1, 2, 3, 4, 5, 6, 7]; @xs.splice((*/2).Int); say @xs.perl
18:31 camelia rakudo-moar 5d89ce: OUTPUT: «[1, 2, 3]?»
18:31 masak surprisingly unwilling to coerce other numbers to Int
18:32 perlpilot masak: thus we circle back to Zoffix's original point  ;)
18:32 Zoffix But wait! There's more!
18:32 masak perlpilot: heh; I didn't backlog that far ;)
18:32 Zoffix The performance enhancements lost the coersion we do in many other routines. The actual number of candidates is supposed to be 52
18:32 Zoffix Ticket: https://rt.perl.org/Ticket/Display.html?id=130439#ticket-history
18:32 Zoffix Oh, it's fixed already
18:32 Zoffix lizmat++
18:33 Hotkeys m: my @xs = [1, 2, 3, 4, 5, 6, 7]; @xs.splice(* - 3); say @xs.perl
18:33 camelia rakudo-moar 5d89ce: OUTPUT: «[1, 2, 3, 4]?»
18:33 Hotkeys handy
18:33 Zoffix Oh wait, that's not the full  fix
18:33 jnthn mspo: Yes, so I implemented the initial support, and nobody yet told me it's missing anything, so afaik it's sufficient.
18:33 AlexDaniel “If so, please treat this ticket as [LTA] (the amount of candidates printed is insane).” XD
18:33 lizmat wotdidifix?
18:33 Zoffix lizmat: https://rt.perl.org/Ticket/Display.html?id=130439#txn-1444716
18:33 Zoffix lizmat: but I read later comments in the ticket saying it was reverted
18:33 AlexDaniel m: my @a = <a b c d e f g>; say @a.splice: ^3
18:33 camelia rakudo-moar 5d89ce: OUTPUT: «Cannot resolve caller splice(Array: Range); none of these signatures match:?    (Array:D \SELF: *%_)?    (Array:D $: Whatever, *%_)?    (Array:D $: Callable:D $offset, *%_)?    (Array:D $: Int:D $offset, *%_)?    (Array:D $: Whatever, Whatever,…»
18:33 AlexDaniel e: my @a = <a b c d e f g>; say @a.splice: ^3
18:34 evalable6 AlexDaniel, rakudo-moar 5d89cef9f: OUTPUT: «(exit code 1) Cannot resolve caller splice(Array: Range); none of these signatures match:?…»
18:34 evalable6 AlexDaniel, Full output: https://gist.github.com/f6dd4bfb7eecf41cd2107e10b7d159b0
18:34 masak lizmat++ # fixing stuff and then acting all innocent about it :P
18:34 lizmat .oO( you don't want to know how innocent I act when I have broken things :-)
18:35 lizmat .oO( who, moi? )
18:35 perlpilot lizmat: yeah, but you put them back together like they did to the bionic man: stronger, faster, better.  :)
18:36 lizmat *blush*  :-)
18:40 * masak .oO( qui, me? )
18:44 cdg joined #perl6
18:45 zengargo1le only HN thread thing that caught my eye was Q about creating static executables.  almosy said 'yes someday' when things settle down and somebody actually tries to do it.
18:46 jdv79 the quip about concurrency by rurban caught my eye
18:46 Exodist joined #perl6
18:46 zengargo1le heh
18:46 kybr joined #perl6
18:47 jdv79 is a static executable very useful these days when we have containers?
18:47 jdv79 or is it about obfuscation of source
18:48 mack[m] i think yes it would still be useful with containers because the containers could be smaller
18:48 zengargo1le it can be very nice.  i made a 'emergency backup of documents' thing that included a static Go http(s) server.  no worries it won't work whenever the need arises.
18:49 jdv79 as long as the OS abi doesn't change too much
18:49 zengargo1le libc and libm.
18:49 mack[m] for example, a container we used to build latex documents was like 2GB - would be nice to have one that can handle the perl6 runtime without having to download all the bits to just run the binary
18:49 jdv79 yeah
18:50 zengargo1le yeah, generic backcompat support, but no libraries, scripts, modules, etc.
18:50 mack[m] +1
18:51 zengargo1le include the Windows/OSX versions of the server and the whole subdir is a thing that can copy and work.
18:51 zengargo1le data and a couple Go static executables.
18:53 lizmat afk for some Valerian&
18:54 zengargoyle or a cross-platfome password manager on a USB stick.
18:54 mack[m] it's one of the magic things i like about rust-lang too
18:54 mspo static linking?
18:54 mack[m] copying the binary around w/o the dependencies
18:54 mspo yeah static linking
18:55 unop joined #perl6
18:55 mspo jar files are nice too
18:55 zengargoyle i had the thought that p6 way could even include the libfoo.so.x.y.z in the CUR like other .so that can be in CUR.
18:56 zengargoyle one of my modules builds a .so that's entirely not-perl-related-at-all and it's stored and loaded from the CUR as part of the module....
18:58 b2gills Hotkeys: I noticed your lack of presence. Mostly because I noticed that you stopped posting code golfs, so that meant more that I had to write.
18:58 geekosaur zengargoyle, that was tried and breaks things that do dynamic loading
18:58 noganex joined #perl6
18:58 zengargoyle does preloading not work?
18:58 geekosaur for example gtk loads a bunch of stuff dynamically at runtime (dlopen()) and handles renamed stuff poorly
18:59 Zoffix zengargoyle: there's already something like that for Windows, innit?
18:59 geekosaur how portable is that?
18:59 Zoffix buggable: eco wix
18:59 buggable Zoffix, App::InstallerMaker::WiX 'Tool to make basic WiX installers for Perl 6 apps, bundling MoarVM/Rakudo.': https://github.com/jnthn/p6-app-installermaker-wix
18:59 Hotkeys b2gills: oh hey it's you the other code golf person :D
19:00 raschipi Static linking should just die already.
19:00 zengargoyle geekosaur: that's one of the reasons i asked about the appveyor Windows CI thingy... :)
19:00 b2gills There have been a few other people posting Perl 6 code golfs in the mean time
19:01 zengargoyle not sure if LibraryMake helper magically makes simple C library work.   (works on OSX and Linux....)
19:01 zengargoyle b2gills: where is this code golf thing?
19:01 nicq20 joined #perl6
19:02 b2gills https://codegolf.stackexchange.com/
19:02 nicq20 Hey-o
19:02 b2gills I'm user 1147 https://codegolf.stackexchange.com/users/1147/brad-gilbert-b2gills
19:03 b2gills It is a spin-off from Stack Overflow (where I'm user 1337)
19:04 * zengargoyle did /r/dailyprobrammer for a while until just didn't have the time....
19:04 Hotkeys meanwhile I'm user 46687 https://codegolf.stackexchange.com/users/46687/lockopeners
19:05 Hotkeys wow I've gotten rep in the past 30 days
19:05 Hotkeys thanks codegolf users
19:06 zengargoyle always thing the APL derivative peeps won. :P
19:07 b2gills Most of the time it is languages devoted to code golfing that win. Though Perl 6 sometimes even beats them
19:07 nhywyll joined #perl6
19:07 Hotkeys I mostly ignore the golfing languages
19:07 Hotkeys they're almost entirely uninteresting to me
19:08 Hotkeys congratulations you wrote the shortest code in a language specifically designed to have the shortest code
19:08 b2gills I look at the explanations to see if there is another way to write it that might be smaller
19:08 Hotkeys I think I might have a couple that get close to or beat golflangs
19:09 Hotkeys I'd have to go through my answers though
19:09 b2gills Most of the time I would say that Perl 6 is at least within spitting distance of the shortest of the non-golfing languages
19:09 zengargoyle i think 2 of my modules came directly from p6 no having that thing yet.
19:11 zengargoyle 2 more if you count things i p6-ified but don't understand enough to thrust out to the worl.
19:11 andrzejku joined #perl6
19:13 nicq20 Anyone know where I can find out how the :sym<> thing works?
19:15 zengargoyle nicq20: as in the magic colon pair thing or the grammar thing?
19:15 nicq20 The grammar thing.
19:16 nicq20 Well, I guess it would be more of a proto thing?
19:16 zengargoyle yeah, you've read the docs.perl6.org Grammar sections...
19:20 b2gills https://stackoverflow.com/questions/41769177/why-would-you-use-a-proto-rule-in-a-perl-6-grammar/41770672#41770672
19:21 b2gills for the :sym<> thing ^
19:21 Cabanossi joined #perl6
19:23 zengargoyle i fulmbled through the docs then the synopses then just look at modules in the ecosystem that use grammar.
19:24 Zoffix There's a blurb in docs too https://docs.perl6.org/language/grammars#Protoregexes
19:27 nicq20 Ok, so it's actually a lot simpler than I had thought. Thanks!
19:30 zengargoyle b2gills++ nice link.
19:31 nicq20 As a side note, is the `augment slang MAIN {}` thing still in use, or should `$?LANG.refine_slang` be used instead?
19:31 Zoffix nicq20: neither should be used, in a sense that neither is an official or supported way to use slangs
19:32 Zoffix nicq20: but $?LANG.refine_slang is it, if you got 2017.07 rakudo or newer
19:33 Zoffix BEGIN $?LANG.refine_slang('MAIN', role YourGrammar {…}, role YourActions {…})
19:33 Zoffix with actions being an optional arg
19:35 nicq20 Zoffix: Thanks!
19:37 nicq20 m: BEGIN {$?LANG.refine_slang('MAIN', token comment:sym<###> { <sym> {} \N* {say $/.Str} }, $?LANG.actions) }; say "Hi
19:37 camelia rakudo-moar 5d89ce: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?An exception occurred while evaluating a BEGIN?at <tmp>:1?Exception details:?  5===SORRY!5=== Error while compiling ?  Cannot find method 'specialize' on object of type Perl6::Metamodel::ClassH…»
19:37 nicq20 m: BEGIN {$?LANG.refine_slang('MAIN', token comment:sym<###> { <sym> {} \N* {say $/.Str} }, $?LANG.actions) }; say "Hi"; ### test
19:37 camelia rakudo-moar 5d89ce: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?An exception occurred while evaluating a BEGIN?at <tmp>:1?Exception details:?  5===SORRY!5=== Error while compiling ?  Cannot find method 'specialize' on object of type Perl6::Metamodel::ClassH…»
19:38 nicq20 m: BEGIN {$?LANG.refine_slang('MAIN', token comment:sym<###> { <sym> {} \N* {say $/.Str} }) }; say "Hi"; ### test
19:38 camelia rakudo-moar 5d89ce: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>?An exception occurred while evaluating a BEGIN?at <tmp>:1?Exception details:?  5===SORRY!5=== Error while compiling ?  Cannot find method 'specialize' on object of type Perl6::Metamodel::ClassH…»
19:41 Zoffix nicq20: note that my example uses a role, not a token
19:41 nicq20 Oh, gee whiz. Mis-type.
19:42 nicq20 m: BEGIN {$?LANG.refine_slang('MAIN', role {token comment:sym<###> { <sym> {} \N* {say $/.Str} }}) }; say "Hi"; ### test
19:42 camelia rakudo-moar 5d89ce: OUTPUT: «Hi?»
19:42 Zoffix m: BEGIN $?LANG.refine_slang('MAIN', role { token apostrophe { <[ - ' \\ ]> } }, role { method apostrophe($) { say "That's one good-lookin' apostrophe you got there, bruh!" } }); my $foo\bar = 42; say $foo\bar;
19:42 camelia rakudo-moar 5d89ce: OUTPUT: «===SORRY!===?Type check failed in binding to parameter '<anon>'; expected Any but got Perl6::Grammar+{<anon|55680560>} (Perl6::Grammar+{<anon...)?»
19:43 Zoffix m: BEGIN $?LANG.refine_slang('MAIN', role { token apostrophe { <[ - ' \\ ]> } }, role { method apostrophe(Mu $) { say "That's one good-lookin' apostrophe you got there, bruh!" } }); my $foo\bar = 42; say $foo\bar;
19:43 camelia rakudo-moar 5d89ce: OUTPUT: «That's one good-lookin' apostrophe you got there, bruh!?That's one good-lookin' apostrophe you got there, bruh!?42?»
19:44 Zoffix bummer all the action methods need a Mu type constraint :|
19:45 nicq20 m: BEGIN {$?LANG.refine_slang('MAIN', role {token comment:sym<###> { <sym> {} \N* {say $/.Str} }}) }; say "Hi"; $*LANG.^methods>>.name.grep(/'comment'/).say
19:45 camelia rakudo-moar 5d89ce: OUTPUT: «Hi?()?»
19:46 nicq20 m: BEGIN {$?LANG.refine_slang('MAIN', role {token comment:sym<###> { <sym> {} \N* {say $/.Str} }}) }; say "Hi"; BEGIN {$*LANG.^methods>>.name.grep(/'comment'/).say}
19:46 camelia rakudo-moar 5d89ce: OUTPUT: «(comment comment:sym<#> comment:sym<#`(...)> comment:sym<#|(...)> comment:sym<#|> comment:sym<#=(...)> comment:sym<#=> pod_block:sym<delimited_comment> pod_block:sym<paragraph_comment> pod_block:sym<abbreviated_comment> comment:sym<line_directive>)?Hi?»
19:47 Zoffix nicq20: somewhat easier way of seeing all the available methods: https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Grammar.nqp
19:48 nicq20 Huh. The comment:sym<###> method is not listed.
19:48 dwarring joined #perl6
19:49 itaipu joined #perl6
19:50 Zoffix m: BEGIN {$?LANG.refine_slang('MAIN', role {token comment:sym<###> { <sym> {} \N* {say $/.Str} }}) }; say "Hi"; BEGIN $?LANG.^name.say
19:50 camelia rakudo-moar 5d89ce: OUTPUT: «Perl6::Grammar?Hi?»
19:51 Zoffix Don't look like it got anything mixed into it yet at that point
19:52 Zoffix And they seem to be kept separate: https://github.com/perl6/nqp/blob/master/src/QRegex/Cursor.nqp#L221-L233
19:52 * Zoffix &
19:55 nicq20 Zoffix: What part indicates it would be separate?
19:56 nicq20-mobile joined #perl6
19:56 Geth ¦ ecosystem: 7c3024d686 | (Tony O'Dell)++ (committed using GitHub Web editor) | META.list
19:56 Geth ¦ ecosystem: an auto yaml router for HTTP::Server::Router
19:56 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/7c3024d686
20:00 nicq20_mobile joined #perl6
20:02 nicq20Mobile joined #perl6
20:04 mkaufman2 joined #perl6
20:06 kaare_ joined #perl6
20:09 aindilis joined #perl6
20:13 nicq20-mobile joined #perl6
20:18 Zoffix nicq20-mobile: that it pops it into $!slangs and that .^name has an unmixed name
20:18 Zoffix I've no idea how the lanfuage switch in the braid happens tho
20:19 nicq20-mobile Oh, sorry. I thought that's what you were referring to.
20:26 cpage_ joined #perl6
20:27 colomon_ joined #perl6
20:28 Hotkeys left #perl6
20:30 TEttinger joined #perl6
20:44 cpage joined #perl6
20:49 colomon joined #perl6
20:50 mbailey_j joined #perl6
20:56 colomon joined #perl6
20:58 Geth ¦ doc: 69b25a390f | (David Warring)++ | doc/Type/Buf.pod6
20:58 Geth ¦ doc: document Buf subbuf-rw routine and method
20:58 Geth ¦ doc:
20:58 Geth ¦ doc: closes #1148
20:58 Geth ¦ doc: review: https://github.com/perl6/doc/commit/69b25a390f
21:10 nadim Is the debugger up and running again?
21:11 profken joined #perl6
21:12 profken When will I be able to compile perl6 to a binary/executable?
21:12 El_Che profken: not soon
21:13 cono joined #perl6
21:13 profken Dang
21:13 profken Is it hard to get a language to that stage?
21:14 El_Che It's not the language, it's the dynamic VM
21:14 El_Che (like you don't create java or ruby binaries)
21:15 El_Che maybe somehting like perl5's fatpack should be possible
21:15 El_Che so you need a rakudo installation (a pkg) + a program file
21:15 profken I see
21:16 profken I really enjoy using perl6 on the go
21:16 profken Being able to make stand-alone executables would be great though
21:16 El_Che I agree
21:19 cpage__ joined #perl6
21:21 Cabanossi joined #perl6
21:26 cpage__ joined #perl6
21:28 wamba joined #perl6
21:29 cpage_ joined #perl6
21:29 shmibs joined #perl6
21:38 colomon joined #perl6
21:41 mcmillhj joined #perl6
21:46 Hotkeys joined #perl6
21:50 pharv_ joined #perl6
21:58 mcmillhj joined #perl6
22:02 cpage joined #perl6
22:04 chuck3 joined #perl6
22:06 chuck3 is perl 6 suitable for general puprose programming, ie applications?
22:09 chuck3 join #linux
22:22 pecastro joined #perl6
22:32 mbailey_j joined #perl6
22:41 cpage_ joined #perl6
22:41 Zoffix chuck3, yup
22:42 Zoffix profken: it's already possible on windows
22:42 Zoffix buggable: eco wix
22:42 buggable Zoffix, App::InstallerMaker::WiX 'Tool to make basic WiX installers for Perl 6 apps, bundling MoarVM/Rakudo.': https://github.com/jnthn/p6-app-installermaker-wix
22:42 mcmillhj joined #perl6
22:42 Zoffix the "fatpack" approach
22:46 AlexDani` joined #perl6
22:55 profken Zoffix: How big do the installers come out to be?
22:57 Zoffix No idea
22:58 mcmillhj joined #perl6
23:14 mcmillhj joined #perl6
23:25 mbailey_j left #perl6
23:28 imcsk8 joined #perl6
23:32 cdg joined #perl6
23:41 pilne joined #perl6
23:41 zollX joined #perl6
23:43 pompomcrab joined #perl6
23:44 steven_ joined #perl6
23:46 steven_ does anyone have a link to a good example of creating your own module then using it from another source file?
23:55 mcmillhj joined #perl6
23:55 llfourn I don't have a link but I usually just make a file like 'MyProject/lib/MyModule.pm6'
23:56 llfourn and then cd MyProject
23:56 llfourn create a src file like MyProject/main.p6
23:56 llfourn and then perl6 -Ilib main.p6
23:58 steven_ ok i am trying it now
23:59 steven_ thank you
23:59 sivoais joined #perl6

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

Perl 6 | Reference Documentation | Rakudo