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

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

Perl 6 | Reference Documentation | Rakudo