Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-07-05

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 Cabanossi joined #perl6
00:04 travis-ci joined #perl6
00:04 travis-ci Doc build errored. Greg Donald 'Fix grammer around IO::Handle.getc.'
00:04 travis-ci https://travis-ci.org/perl6/doc/builds/250158390 https://github.com/perl6/doc/compare/c7c1b8cbde2c...25d00a202626
00:04 travis-ci left #perl6
00:05 Actualeyes left #perl6
00:07 mr-foobar joined #perl6
00:09 lizmat joined #perl6
00:17 Lambd0x_ would it be possible that in Linux a module compiles and in Windows not?
00:17 Lambd0x_ If yes, it would explain why GTK::Simple fails to get installed. :(
00:18 geekosaur is gtk installed?
00:19 geekosaur (no, it is unlikely that GTK::Simple downloads Gtk DLLs for you)
00:22 ugexe heh, but it does
00:22 ugexe https://github.com/perl6/gtk-simple/blob/master/Build.pm
00:24 ugexe i just tried to install on windows and it failed to download the dlls during Build.pm because IO::Socket::SSL is not installed
00:28 Lambd0x_ ugexe, I got IO::Socket::SSL installed just to check and still it fails. But debug doesn't say anything meaningful to me regarding what caused it.
00:28 Lambd0x_ ugexe, I suppose the gtk3 dlls got installed.
00:32 lookatme joined #perl6
00:38 travis-ci joined #perl6
00:38 travis-ci Doc build errored. Will "Coke" Coleda 'Sort exact matches first in category
00:38 travis-ci https://travis-ci.org/perl6/doc/builds/250164474 https://github.com/perl6/doc/compare/25d00a202626...6582ed00036b
00:38 travis-ci left #perl6
00:38 lookatme morning
00:45 Cabanossi joined #perl6
00:45 Geth ¦ doc: b7d08b58cd | (Will "Coke" Coleda)++ | template/search_template.js
00:45 Geth ¦ doc: Highlight the matched porton of the search
00:45 Geth ¦ doc:
00:45 Geth ¦ doc: Fixed #1409
00:45 Geth ¦ doc: review: https://github.com/perl6/doc/commit/b7d08b58cd
00:54 mr-foobar joined #perl6
01:03 ggoebel joined #perl6
01:03 Actualeyes joined #perl6
01:05 Lambd0x_ ugexe, what does it mean when zeg debug line says # SKIP: No build.pm for ....
01:05 Lambd0x_ ugexe, *zef
01:19 lookatme Lambd0x_, when you need additional c code or something else, you need a build.pm build your helper library
01:19 lookatme looks like this: https://github.com/araraloren/Net-FTPlib/blob/master/Build.pm
01:29 ggoebel joined #perl6
01:31 parv joined #perl6
01:36 travis-ci joined #perl6
01:36 travis-ci Doc build errored. Will "Coke" Coleda 'Highlight the matched porton of the search
01:36 travis-ci https://travis-ci.org/perl6/doc/builds/250173336 https://github.com/perl6/doc/compare/6582ed00036b...b7d08b58cde7
01:36 travis-ci left #perl6
01:48 ilbot3 joined #perl6
01:48 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 Khisanth joined #perl6
01:53 uberbaud joined #perl6
02:03 astj joined #perl6
02:14 Sgeo_ joined #perl6
02:17 noganex joined #perl6
02:18 BenGoldberg joined #perl6
02:18 Sgeo__ joined #perl6
02:23 uberbaud^ joined #perl6
02:25 Sgeo_ joined #perl6
02:31 Cabanossi joined #perl6
02:53 uberbaud joined #perl6
03:01 Cabanossi joined #perl6
03:46 Cabanossi joined #perl6
04:00 Cabanossi joined #perl6
04:14 Matthew[m] joined #perl6
04:22 mr-fooba_ joined #perl6
04:23 konsolebox joined #perl6
04:26 TeamBlast joined #perl6
04:30 Cabanossi joined #perl6
04:42 uberbaud joined #perl6
04:47 samcv what's zoffix's current username?
04:49 Actualeyes joined #perl6
04:52 brrt joined #perl6
04:57 wamba joined #perl6
04:57 TEttinger I think it's samcv
04:58 llfourn ZofBot: what's zoffix's current username?
04:59 TEttinger ZofBot: ?
04:59 TEttinger it doesn't know does it
04:59 llfourn doesn't look like it :\
05:00 |oLa| joined #perl6
05:04 mr-foobar joined #perl6
05:11 raiph joined #perl6
05:19 samcv ZofBot, help!
05:23 samcv well i made an RT for an IO regression introduced to command line arguments https://rt.perl.org/Public/Bug/Display.html?id=131703
05:24 samcv MAIN has a command line argument, and at the end of execution it tries to open that as a file
05:24 samcv which it should not do
05:27 TeamBlast joined #perl6
05:31 mr-foobar joined #perl6
05:33 wiz joined #perl6
05:34 xtreak joined #perl6
05:44 ugexe `perl6 -e 'sub MAIN($mode = "easy") { get; }' easy` exits immediately, while `perl6 -e 'sub MAIN($mode = "easy") { get; }'` waits for enter to be pressed
05:45 Cabanossi joined #perl6
05:48 cyphase joined #perl6
05:49 cyphase joined #perl6
05:50 cyphase joined #perl6
05:52 cyphase joined #perl6
05:54 cyphase joined #perl6
05:54 ugexe samcv: it can be fixed in the script by s/get;/prompt;/ at least
05:55 samcv yeah i know
05:55 ugexe which is what it probably should be anyway even if this is a bug
05:55 samcv but regardless shouldn't be using the arg as a file since it should be taken by MAIN
05:55 samcv my friend discovered it when they updated
05:56 cyphase joined #perl6
06:03 mr-foobar joined #perl6
06:07 lowbro joined #perl6
06:07 lowbro joined #perl6
06:08 lookatme joined #perl6
06:15 ufobat joined #perl6
06:17 Grauwolf joined #perl6
06:20 TimToady joined #perl6
06:34 timotimo i wonder how it used to know before that the last arg isn't a file
06:34 timotimo i don't think there's a signalling mechanism for "these args have been used up"
06:40 andrzejku joined #perl6
06:50 abraxxa joined #perl6
07:04 leont joined #perl6
07:23 domidumont joined #perl6
07:25 zakharyas joined #perl6
07:25 darutoko joined #perl6
07:31 nattefrost joined #perl6
07:32 uberbaud joined #perl6
07:32 espadrine joined #perl6
07:45 Cabanossi joined #perl6
07:49 timotimo maybe ArgFiles has always opened every argument on the commandline but it just wasn't fatal if one (or all) of them were missing
07:50 timotimo and stdin was always the last entry in argfiles?
07:58 rindolf joined #perl6
08:02 dakkar joined #perl6
08:03 dakkar_ joined #perl6
08:14 cschwenz joined #perl6
08:19 lookatme joined #perl6
08:24 zacts joined #perl6
08:30 wamba joined #perl6
08:39 llfourn is there anyway to get the Proc::Async finish promise without saving the result of .start?
08:44 llfourn hmm it looks like not
08:44 Cabanossi joined #perl6
08:55 nadim_ joined #perl6
08:58 zakharyas joined #perl6
09:03 ab6tract joined #perl6
09:03 cfa joined #perl6
09:03 ab6tract o/
09:03 samcv grant status update 2 up https://cry.nu/perl6/grant-status-update-2/
09:03 cfa not sure if this was picked up when i mentioned it a few days back:
09:03 cfa ~; perl6 --profile
09:04 cfa Segmentation fault: 11
09:04 ab6tract lizmat: can you run me through the reasoning for reverting the Baggy semantics of (<) and (<=) ?
09:04 ab6tract the perl 6 weekly note just says that it was done because of documentation?
09:07 ab6tract considering that we no longer keep baggy versions of any of the other set operators around, it seems like a strange choice to me
09:09 jnthn llfourn: No
09:10 nadim_ Hi, I have: class A {method get_B{ B.new(:a(self)) } } class B{ has A $a} # that is a A object returns itself wrapped in as a B object. Class B has to be declared for A to use it, how do I get this working?
09:10 nadim_ m: class A {method get_B{ B.new(:a(self)) } } class B{ has A $a} A.new.get_B() ;
09:10 camelia rakudo-moar d5d3bd: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3ass A {method get_B{ B.new(:a(self)) } }7⏏5 class B{ has A $a} A.new.get_B() ;␤    expecting any of:␤        infix…»
09:12 jnthn nadim_: Need to stub B before. class B { ... }
09:12 jnthn (Literally with the ... )
09:13 pecastro joined #perl6
09:17 nadim_ thank you , I google "predeclare class" but was unsuccessful
09:18 nadim_ I could also pass an A to B, and it may even be better, but I wanted to know how to wrap objects
09:22 nadim_ jnthn: when passing self to the B constructor above, does self get copied in B.a? shallow copied? referenced?
09:23 jnthn Referenced
09:24 nadim_ good!
09:28 xtreak joined #perl6
09:28 Foss joined #perl6
09:28 Foss what's zoffix's current username?
09:29 Guest94316 left #perl6
09:29 Cabanossi joined #perl6
09:47 cosimo joined #perl6
09:51 bjz joined #perl6
09:59 Geth ¦ specs: 658d1e5c35 | (Zoffix Znet)++ (committed using GitHub Web editor) | v6d.pod
09:59 Geth ¦ specs: Propose change to $*ARGFILES inside MAIN
09:59 Geth ¦ specs:
09:59 Geth ¦ specs: Make $*ARGFILES := $*IN or IO::ArgFiles.new($*IN) inside sub MAIN
09:59 Geth ¦ specs: review: https://github.com/perl6/specs/commit/658d1e5c35
10:00 Cabanossi joined #perl6
10:00 Geth ¦ specs: 030df46f12 | (Zoffix Znet)++ (committed using GitHub Web editor) | v6d.pod
10:00 Geth ¦ specs: Fix POD error
10:00 Geth ¦ specs: review: https://github.com/perl6/specs/commit/030df46f12
10:02 cyphase joined #perl6
10:06 cyphase joined #perl6
10:08 cyphase joined #perl6
10:09 skids joined #perl6
10:10 astj joined #perl6
10:11 ab6tract .ask lizmat can you run me through the reasoning for reverting the Baggy semantics of (<) and (<=) ? the perl 6 weekly note just says that it was done because of documentation. considering that we no longer keep baggy versions of any of the other set operators around, it seems like a strange choice to me.
10:11 yoleaux ab6tract: I'll pass your message to lizmat.
10:11 Geth ¦ specs: 0aa72aa1d9 | (Zoffix Znet)++ (committed using GitHub Web editor) | v6d.pod
10:11 Geth ¦ specs: Clarify a bit the $*ARGFILES in MAIN
10:11 Geth ¦ specs: review: https://github.com/perl6/specs/commit/0aa72aa1d9
10:12 cyphase joined #perl6
10:14 cyphase joined #perl6
10:16 cyphase joined #perl6
10:17 lizmat ab6tract
10:17 yoleaux 10:11Z <ab6tract> lizmat: can you run me through the reasoning for reverting the Baggy semantics of (<) and (<=) ? the perl 6 weekly note just says that it was done because of documentation. considering that we no longer keep baggy versions of any of the other set operators around, it seems like a strange choice to me.
10:17 lizmat ab6tract: I'm still in 2 minds about it myself, and wonder what masak and labster would want to say about it
10:18 lizmat currently I'm leaning towards deprecating (<+) in favour of baggy semantics of (<) and (<=)
10:19 ab6tract i like the way you are leaning :)
10:19 ab6tract it also fits the way TimToady describes "sets as a degraded case of bags"
10:20 ab6tract lizmat: regarding the documentation, it's been on my TODO list for quite some time. hopefully i can take some time this weekend to finally get it updated.
10:21 lizmat ab6tract: meanwhile, there are currently 4 mix tests in roast that fail, of which I think the first 3 are faulty
10:21 lizmat could you have a look?
10:21 lizmat git blame sorta points your way
10:24 ChoHag joined #perl6
10:28 nadim_ m: class A { has $!p ; method new { my $o = self.bless ; $o.p = 1 } } ; A.new ;
10:28 camelia rakudo-moar d5d3bd: OUTPUT: «No such method 'p' for invocant of type 'A'␤  in method new at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
10:29 nadim_ how do I set a private member in the new method?
10:29 jnthn You don't, you do it in a BUILD or TWEAK method
10:30 jnthn *submethod, even
10:30 * nadim_ looks at the doc
10:38 nadim_ it would have been nice if it was possible to pass the private member initial values to bless.
10:39 nadim_ it there an example somewhere of a new method that calls BUILD or TWEAK? if that is the way to initialize from a new method.
10:39 jnthn You don't need to write new at all
10:40 jnthn m: class A { has $!p; submethod TWEAK(:$!p) { }; method pp() { say $!p } }; A.new(p => 42).pp
10:40 camelia rakudo-moar d5d3bd: OUTPUT: «42␤»
10:41 nadim_ I need to do some computations in new to set other members
10:41 nadim_ $!p itself is the result of such a computation
10:42 nadim_ do I do that in BULD instead?
10:42 jnthn m: class A { has $!p; submethod TWEAK(:$a, :$b) { $!p = $a + $b }; method pp() { say $!p } }; A.new(a => 4, b => 38).pp
10:42 camelia rakudo-moar d5d3bd: OUTPUT: «42␤»
10:43 jnthn Or BUILD
10:43 jnthn BUIL
10:43 jnthn oops
10:43 jnthn BUILD = I want complete control over construction, don't set any attributes automatically for me
10:43 jnthn TWEAK = do the normal thing for public attributes and then let me do some extra work
10:44 jnthn And they both just get passed the named parameters passed to bless
10:44 jnthn And the default new just calls bless with whatever it gets
10:45 Cabanossi joined #perl6
10:45 robertle joined #perl6
10:47 nadim_ I kinda get it. I think a few examples in the doc would be good. I think the example in the docs: class Area ... has a typo, it says "has $.size" but BUILD has "$!size = ...."
10:47 jnthn Where's the typo?
10:48 jnthn If you mean . vs ! then no, it's correct
10:48 jnthn has $.size; is short for has $!size; method size() { $!size }
10:49 nadim_ yeah right is readonly, is ro traits are used
10:49 timotimo "is ro" is the default unless you make your class "is rw"
10:54 nadim_ the problem, for me, is that BUILD only takes named args when I need something like: submethod BUILD($s, *%attributes)
10:56 nadim_ I had new($s, *%attributes) but I want to set a $!p inside the new method, can I can BUILD/TWEAK?
10:56 nadim_ or do I need to add a method to set $!p?
10:56 timotimo in that case you need a custom new method
10:57 timotimo the regular new will never accept positional arguments
10:57 nadim_ I had a custom new
10:57 bjz joined #perl6
10:57 timotimo in that case it can just pass the $s to be put into $!p via a named parameter that is otherwise not used
10:57 nadim_ I want it positional
10:58 timotimo yes, the "new" method will get it positional
10:58 timotimo TWEAK and BUILD both get all named args passed to bless
10:58 jnthn Just have new turn the positional into a named that is passed to bless, and receive that named in BUILD/TWEAK
10:59 nadim_ ok
11:01 nadim_ gh hoops).
11:01 nadim_ I wonder why bless does not set private members. I understand that new does not do it but if bless is  lower lever it seems that it would have been a good idea (raher than jump through hoops)
11:01 nadim_ there must be a reason of course, I am just curious which one.
11:01 timotimo yeah, it's because bless is API, and private attributes are not
11:01 timotimo you can't refactor private attributes freely if someone could be relying on their names
11:02 dubi0us joined #perl6
11:02 jnthn Perl 6 tries very hard to make sure you can confidently refactor $!thingy inside of your class without having to ever care about code outside of your class.
11:02 jnthn So long as you preseve behavior, that is
11:02 nadim_ silly question, is there a run time system to make attributes private, or readonly?
11:03 jonas1 joined #perl6
11:03 jnthn I'm not sure I even understand the question :)
11:03 nadim_ Not saying it's a good idea, just wondering
11:03 nadim_ then it must be a bad idea ;)
11:03 jnthn I mean, if you are using the MOP to define a new class at runtime then you can choose then whether the attribute is public or private
11:03 jnthn But the accessor generation for . happens at compose time
11:04 nadim_ that answers the question
11:04 jnthn For a normal class decl in a program that menas the method is added when the closing } of the class is reached
11:04 jnthn Alright
11:04 jnthn Lunch time here :)
11:05 nadim_ Bon appetit
11:20 ab6tract lizmat: yup, i will check it out after work
11:29 nadim_ m: [^10]
11:29 camelia rakudo-moar d5d3bd: ( no output )
11:29 nadim_ m: dd [^10]
11:29 camelia rakudo-moar d5d3bd: OUTPUT: «[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]␤»
11:29 nadim_ how do I get a list with ten elements? I want the list object not its elements
11:30 timotimo huh?
11:30 bjz joined #perl6
11:30 timotimo m: [^10].^name.say
11:30 camelia rakudo-moar d5d3bd: OUTPUT: «Array␤»
11:30 timotimo m: [^10].List.^name.say
11:30 camelia rakudo-moar d5d3bd: OUTPUT: «List␤»
11:31 ab6tract m: (^10).^name.say
11:31 camelia rakudo-moar d5d3bd: OUTPUT: «Range␤»
11:31 nadim_ .List meh I have tried a lot of combinations for nothing. I though $(^10) would make the trick
11:31 ab6tract m: (| ^10).^name.say
11:31 camelia rakudo-moar d5d3bd: OUTPUT: «Slip␤»
11:32 nadim_ is there a way to get a list without passing by an array?
11:33 tbrowder hi, #perl6
11:35 nadim_ ji
11:35 nadim_ hi
11:35 ab6tract m: (^10).List.^name.say
11:35 camelia rakudo-moar d5d3bd: OUTPUT: «List␤»
11:36 tbrowder i continue to have a small problem with installing rakudo from the rakudo star download: the instruction don't work for installing with the --prefix option
11:36 ab6tract m: sub f(List() $l) { dd $l }; f(^10)
11:36 camelia rakudo-moar d5d3bd: OUTPUT: «List $l = $(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)␤»
11:36 tbrowder hi, nadim!
11:36 timotimo tbrowder: can you elaborate?
11:36 timotimo nadim_: why don't you just (^10).List?
11:37 timotimo m: say (^10).List.^name
11:37 camelia rakudo-moar d5d3bd: OUTPUT: «List␤»
11:38 tbrowder yes, i use: perl Configure.pl --backend=moar --gen-moar --prefix=/opt/rakudo
11:38 timotimo you can only use --gen-moar if you have write access to the prefix
11:38 timotimo because in that case the configure step calls "make install" on moar, and then on nqp
11:38 timotimo before it can build rakudo
11:39 tbrowder make then proceeds until it quits when it can't find moar in /opt/rakudo...let me check the error msg again...
11:40 nadim_ timotimo: lol! yes why not.
11:41 timotimo [ ] is syntax for "gimme an Array"
11:41 ab6tract nadim_: did you see my coercive subroutine example?
11:41 timotimo tbrowder: it might have failed to "make install" in moar but for some reason continued on
11:41 ab6tract m: sub l( List() $l ) { dd $l; return $l }; l(^10).^name.say
11:41 camelia rakudo-moar d5d3bd: OUTPUT: «List $l = $(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)␤List␤»
11:42 tbrowder no, the per Conf* step stops when it can't find a necessary executable in /opt/rakudo: a chicken and egg situation
11:43 timotimo it should try to build a moar in that case
11:44 nadim_ joined #perl6
11:44 timotimo only if --gen-moar is passed, of course
11:44 tbrowder but it doesn't for me: debian 8, 64-bit
11:45 Cabanossi joined #perl6
11:45 nadim_ ab6tract: yes but I wanted to send something as a list not receive it as a list.
11:45 tbrowder well --gen-moar was passed
11:46 timotimo can has a full log?
11:53 ab6tract nadim_: but if you are "sending it", then it is being received by something, correct?
11:54 ab6tract :)
12:00 W4RL0RD joined #perl6
12:00 nadim_ the receiving end is generic (a dumper) can't coerce there ;)
12:00 tbrowder i can provide it, ref to gist ok?
12:01 nadim_ of course I could call the corercing sub as an argument to the dumper but is just too much :)
12:02 timotimo yeah
12:03 bjz_ joined #perl6
12:04 wamba joined #perl6
12:13 mr-fooba_ joined #perl6
12:15 tbrowder timotimo: here's the problem: the prefix dir has to either already exist or be able to be created in the config step by the user--not a clean separation between make and make install.
12:17 tbrowder i think the config, make, and make test step should be completely done ss an ordinary user. then sudo make install.  even if that can't be done right away, the instructions need to say that.
12:19 xtreak joined #perl6
12:19 tbrowder i remember now the problem and looked into a PR on the process but found it all too complex for me to understand. ther are really two build steps, but the first one almost requires root, and that pollutes the rest of the build directory with root ownership.
12:22 timotimo tbrowder: well volunteered!
12:22 timotimo oh
12:22 timotimo the solution if you want to put stuff into a privileged place is to run configure and make in all three projects manually, and make install in each as root
12:23 DrForr_ If anyone is interested in the compilation speed difference between '|' and '||' separated terms, look at https://github.com/drforr/perl6-Format-Lisp - tag 828e0b766ba8ba579584c08da4857dd177e05d24
12:24 DrForr_ 5 seconds or so as it is, but change '|' to '||' in tilde-Atom and it jumps to 51 seconds.
12:24 tbrowder well i can definitely PR instructions, but the clean separation is beyond me.
12:24 tbrowder although i can look at it again (yuk!)
12:25 DrForr_ It still needs more refactoring, and cleaning up would probaby solve the speed difference but it serves to demonstrate the delta.
12:25 zakharyas joined #perl6
12:25 tbrowder .tell DrForr_ my Perl6::Parser PR is passing travis testing
12:25 yoleaux tbrowder: I'll pass your message to DrForr_.
12:26 DrForr_ Thanks, will look at it in a few minutes.
12:26 yoleaux 12:25Z <tbrowder> DrForr_: my Perl6::Parser PR is passing travis testing
12:27 nadim_ Can we return named values?  without using a hash.
12:28 moritz no
12:28 moritz well, using a capture maybe
12:28 timotimo yeah, a capture, or a pair or list of pairs
12:28 moritz m: sub f() { return a => 42 }; say f().perl
12:28 camelia rakudo-moar d5d3bd: OUTPUT: «:a(42)␤»
12:28 nadim_ the interesting part would be the receiving end
12:29 nadim_ can we put a capture there to match the pairs?
12:30 nadim_ timotimo: how would a capture look like?
12:32 timotimo m: say \(1, 2, :foo(bar)).perl
12:32 camelia rakudo-moar d5d3bd: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    bar used at line 1. Did you mean 'VAR', 'bag'?␤␤»
12:32 timotimo m: say \(1, 2, :foo("bar")).perl
12:32 camelia rakudo-moar d5d3bd: OUTPUT: «\(1, 2, :foo("bar"))␤»
12:32 timotimo m: say \(1, 2, :foo("bar")).^name
12:32 camelia rakudo-moar d5d3bd: OUTPUT: «Capture␤»
12:33 nadim_ and on the receiving end?
12:36 timotimo m: my $cap = \(1, 2, :foo("bar")); say $cap.list.perl; say $cap.hash.perl;
12:36 camelia rakudo-moar d5d3bd: OUTPUT: «(1, 2)␤Map.new((:foo("bar")))␤»
12:37 paulmr_ joined #perl6
12:38 lucasb joined #perl6
12:38 paulmr_ left #perl6
12:54 aborazmeh joined #perl6
12:54 aborazmeh joined #perl6
12:58 astj_ joined #perl6
13:02 wamba joined #perl6
13:24 MilkmanDan joined #perl6
13:28 lowbro joined #perl6
13:28 lowbro joined #perl6
13:30 Cabanossi joined #perl6
13:30 ChoHag joined #perl6
13:34 nadim_ Do untyped arguments default to Any? I just got surprised when  I got message "Type check failed in binding to parameter '$s'; expected Any but got Mu (Mu)" but the parameters had no type.
13:34 jnthn On routines, yes.
13:34 buggable joined #perl6
13:36 buggable joined #perl6
13:41 linuksz joined #perl6
13:41 nadim_ OK, what's the thought behind that?
13:42 nadim_ and it was on a routine not a method.
13:42 jnthn Methods are routines
13:42 jnthn Reasoning is so junctions auto-thread there
13:42 jnthn On blocks the default is Mu
13:43 nadim_ ok then it was on sub but I have to expect that with methods too then
13:43 jnthn Yes
13:43 jnthn You can expicitly type it as Mu if need be
13:43 nadim_ I did and it worked fine
13:49 nicq20 joined #perl6
13:52 mr-foobar joined #perl6
13:57 alimon joined #perl6
13:59 Cabanossi joined #perl6
14:06 buggable joined #perl6
14:08 cog_ joined #perl6
14:08 buggable joined #perl6
14:10 buggable_ joined #perl6
14:20 cyphase joined #perl6
14:25 cyphase joined #perl6
14:26 cyphase joined #perl6
14:28 cyphase joined #perl6
14:29 cyphase joined #perl6
14:30 cyphase joined #perl6
14:41 * ufobat is still hoping for some help at the perl6 ml: http://www.nntp.perl.org/group/perl.perl6.users/2017/07/msg3967.html maybe someone has something to add there :-)
14:47 khw joined #perl6
14:57 buggable_ joined #perl6
14:58 buggable joined #perl6
15:00 Cabanossi joined #perl6
15:04 nadim_ So I got a pull request or two, from someone you are going to guess the name of, for some syntax: the patch is for changing "$object.method $arg" to "$object.method: $arg". where are we abou the usage of a semicolumn? should we try to use that, and why, or it just confuses everyone?
15:13 moritz $object.method $arg is a syntax error
15:14 moritz I personally like $obj.method: $args, but I know for example that masak++ is not a big fan
15:22 linuksz is there any limit to the number of promises?
15:23 linuksz i am writing a script, and i want to run a lot of external commands in parallel
15:23 linuksz my @result = await @array.map({start run_test $_})
15:24 linuksz i wrote it, but it don't work if @array has more elements than 16
15:24 linuksz i want to start about 350-400 processes
15:24 mr-fooba_ joined #perl6
15:24 Ven`` joined #perl6
15:25 Ven`` o/
15:25 nadim_ do they all have to run in parallel or are you just trying to parallelize as much as you can? in later, this sounds like a bad idea; even if the language supports it you're going to have a lot of scheduling for nothing
15:26 linuksz how should i do it?
15:26 nadim_ start a pool and as soon as a process ends add a process to your pool
15:27 jnthn linuksz: The reason you hit problems at 16 is that a start { ...await ... } will block a thread from the pool
15:27 nadim_ it probably will end faster and you will also get intermediate results faster, rather than having to wait for most to finish. that is of course dependent on how you system schedules
15:27 jnthn You can probably write it without a start block though.
15:28 linuksz i didn't learned programming in school ( only doing for hobby )
15:28 nadim_ masak: why you no like ':' on calls?
15:28 nadim_ linuksz: doesn't matter, we all have learned more practicing than at school
15:29 jnthn Though as nadim_ said, 350 procs spawned at once is still likely going to cause some pain :)
15:29 jnthn I think there's a module for this use case though
15:29 nadim_ specially if they are not io bound
15:29 timotimo yeah, Proc::Q
15:30 jnthn https://github.com/zoffixznet/perl6-Proc-Q
15:30 Element80 joined #perl6
15:30 Element80 oh, beat me to it :)
15:30 linuksz i searched for 'pool' in wikipedia, but what article should i choose?
15:30 Cabanossi joined #perl6
15:30 linuksz i don't know what is a pool
15:31 timotimo it's just the concept of something that has a number of other things in it that are ready to be used and put back
15:31 nadim_ Hehe! what is this? "Invocant of method 'Bridge' must be an object instance of type 'Int', not a type object of type 'Int'.  Did you forget a '.new'?" I probably wrote crappy code but I am curious about what Bridge is.
15:32 Ven`` nadim_: you passed a type object (like Int) instead an Int (like 5)
15:32 Element80 nadim_: the idea behind it is it returns a "bridge" type so you can, say, add two different numerics together, but it's really just a .Num call
15:33 zakharyas1 joined #perl6
15:34 linuksz how can i start a pool?
15:34 Element80 linuksz: basically there are 16 (by default) threads to do things at once. And in 6.d await needs a thread too. So you're using up all 16 and not leaving enough for the await.
15:35 Element80 linuksz: don't worry about the pool. You could `use v6.d.PREVIEW` to make `await` non-blocking
15:35 Element80 linuksz: That'll probably fix your initial problem but for 350 procs... you'll need about 80GB of RAM. Hence why Proc::Q module was suggested. It was designed precicely to run a ton of procs.
15:36 nadim_ 80 GB! no problems. ;)
15:36 Actualeyes joined #perl6
15:36 linuksz ok, not 350 procs, but at least 60-80 would be good at one time
15:37 Element80 linuksz: what perl6 version are you on?   perl6 -v
15:37 linuksz This is Rakudo version 2017.06-116-g385092270 built on MoarVM version 2017.06-35-g3d3d0d05
15:37 linuksz implementing Perl 6.c.
15:37 Element80 good
15:37 Element80 linuksz: so zef install Proc::Q
15:38 Element80 linuksz: do you want to just run them or do you need their STDOUT/STDERR? Do you need them any STDIN?
15:38 linuksz capturing STDOUT
15:39 timotimo mhhh, stout
15:40 linuksz here's my script: http://sprunge.us/CCXU
15:40 alimon joined #perl6
15:41 linuksz it's an ugly code, i know, but it should be work firstly
15:42 timotimo interesting, you have your own getopt
15:42 Element80 linuksz: ok, so you can do:   react whenever proc-q(^2000 .map({«cal $_ »}), :80batch) { say "Got {.stdout} for command {.tag}" }
15:42 Element80 linuksz: and it'll run 2000 cal procs for each year and grab stdout
15:43 timotimo but it doesn't have any positional options there? only nameds? i don't see why MAIN wouldn't be able to do it for you completely
15:43 nadim_ linuksz:  maybe a look at sub MAIN and how argument parsing for the command line is a good read
15:43 Element80 m: say ^1 .map: {«cal $_»}
15:43 camelia rakudo-moar 93d81d: OUTPUT: «Potential difficulties:␤    Ambiguous use of »; use >> instead to mean hyper, or insert whitespace before » to mean a quote terminator (or use different delimiters?)␤    at <tmp>:1␤    ------> 3say ^1 .map: {«cal $_7⏏5»}␤((cal 0))␤»
15:43 Element80 What's the ambiguity here, exactly?
15:44 timotimo Element80: you could be trying to have a hyper work on the $_
15:44 Element80 Man, it worked fine before.
15:44 timotimo m: my @foo = <foo bar baz>; say <<$_>>.uc>>
15:44 camelia rakudo-moar 93d81d: OUTPUT: «5===SORRY!5===␤Malformed postfix␤at <tmp>:1␤------> 3my @foo = <foo bar baz>; say <<$_>>.uc>>7⏏5<EOL>␤    expecting any of:␤        method arguments␤        postfix␤Other potential difficulties:␤    Ambiguous use of >>; use » i…»
15:44 linuksz the reason is why i wrote an own getopt is that if the user gives wrong values for arguments, it responds to him with more details than MAIN
15:44 timotimo m: my @foo = <foo bar baz>; say <<$_≫.uc>>
15:44 camelia rakudo-moar 93d81d: OUTPUT: «Use of uninitialized value $_ of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤  in block <unit> at <tmp> line 1␤(≫.uc)␤»
15:44 timotimo m: my @foo = <foo bar baz>; say <<@foo≫.uc>>
15:44 camelia rakudo-moar 93d81d: OUTPUT: «@foo≫.uc␤»
15:44 timotimo um, that's not the ≫ i wanted
15:45 timotimo m: my @foo = <foo bar baz>; say <<@foo».uc>>
15:45 camelia rakudo-moar 93d81d: OUTPUT: «@foo».uc␤»
15:45 timotimo *fumble*
15:45 timotimo linuksz: you can get better errors from sub main, i'll find that one blog post for you
15:46 timotimo actually, i was wrong about the blog post
15:46 Element80 I really want the $*STFU-I-KNOW-WHAT-I'M-DOING option that silences all the "Potential difficulties: " warnings.
15:46 nadim_ linuksz: also, IMO, listing all the sub function before main, is so 1970
15:47 linuksz where should i list them? after main?
15:47 timotimo https://docs.perl6.org/language/functions#index-entry-MAIN - this has an example for an error message
15:47 Element80 linuksz: anyway, where in that script are you running your 300 procs? Is it the test_mirror one?
15:47 Ven`` did we get rid of the old /features page?
15:48 Ven`` my bad, found it
15:49 linuksz Element80: my @mirrors = await read_mirrorlist.map({start test_url $_});
15:49 linuksz there are about 350 lines in the mirrorlist file
15:49 linuksz each one with an url
15:50 Element80 linuksz: ok, then forget about Proc::Q
15:50 linuksz it cannot be done without proc::q?
15:50 linuksz you said something about pools
15:50 Ven`` er, in https://youtu.be/EwQoSZdEl2s?t=342 – does someone know which file TimToady++ is reading from? It rings some kind of bell but I can't seem to find it
15:51 Element80 linuksz: It can be done without Proc::Q. The module is for running multiple procs, but you're not doing that directly. Forget about pools, it's not important :)
15:51 Element80 linuksz: 1 sec
15:53 linuksz i don't like using modules, because i prefer my distro's packaging system, and not all modules are packaged (proc::q aren't)
15:54 * Element80 rolls eyes
15:54 Element80 is that why you're using a dev commit of perl6 compiler? :)
15:55 linuksz no, almost all packages in AUR are packaged with alacryd, and the stable release of rakudo couldn't run it
15:56 Element80 linuksz: my @mirrors = await Supply.from-list(read_mirrorlist).throttle: 80, *.&test_url
15:56 Element80 give that a spin
15:56 Element80 80 is the number of procs you wanna run at one time
15:57 linuksz i have to read about Supply
15:57 Element80 huggable: Supply
15:57 huggable Element80, Asynchronous data stream with multiple subscribers: https://docs.perl6.org/type/Supply
15:59 Cabanossi joined #perl6
16:00 Element80 huggable: total commits
16:00 huggable Element80, cd $(mktemp -d); perl6 -MJSON::Fast -MLWP::Simple -e 'run |<git clone --bare>, $_ for from-json(LWP::Simple.get("https://api.github.com/orgs/perl6/repos")).map(*.<git_url>); my $total; for dir(".") { my $n = run(:out, |<git --git-dir>, $_, |<rev-list HEAD --count --author=zoffix>).out.slurp-rest.trim.Int; say "$n commits in $_"; $total += $n;}; say "Total: $total"'
16:00 timotimo Ven``: it's a file TimToady means to post soon
16:00 Element80 Ven``: maybe repurposing that ^ to grep all perl6 repos for the words in that doc could yield something? :)
16:00 Element80 Oh. ok
16:01 linuksz i want to do it with some of Perl6's native tools. it is not clear to me that what's what (yet), but i will read about Supply.
16:01 timotimo linuksz: jnthn just held a presentation the other day that also had supplies in it
16:02 Element80 linuksz: Supply *is* Perl 6's native tool
16:02 linuksz i know it :)
16:02 Element80 Aforementioned presentation: https://www.youtube.com/watch?v=VqhLWgvIbz0
16:02 pmurias joined #perl6
16:02 linuksz but it's not clear for me what is the difference between the native tools (proc::async, promises, and supply)
16:03 Element80 linuksz: all are asynchronous tools. Proc::Async runs external programs. Promise is a way to get one value. Supply is a way to get a bunch of values.
16:04 Element80 In the snippet I gave you, the bunch of values are the URLs to test and we use a supply there to asyncronously test them, testing at most 80 at a time, using .throttle
16:04 linuksz but what is the difference between proc::async and running 'run' with 'start' and 'await'?
16:05 Element80 linuksz: in the grand scheme of things, no difference.
16:05 Element80 `run` uses Proq, which is implemented in terms of Proc::Async
16:06 Element80 But using Proc::Async you can, for example, tap stdout and read it asynchronously too, while `run` gives you a synchronous interface, where you'd just read it as from the pipe
16:07 linuksz but 'run' uses proc::async?
16:07 jnthn One benefit of working directly with Proc::Async, however, is that it works entirely in terms of Promise
16:07 Element80 linuksz: on latest Rakudo, yeah
16:07 Element80 Under the hood.
16:07 jnthn linuksz: Under the hood yes, but it layers a blocking synchronous interface atop of it, which won't help your goal to scale up to running a lot of processes at all
16:08 * Element80 &
16:08 Element80 left #perl6
16:09 linuksz ok, and what are the difference between supply and promise?
16:09 lichtkind joined #perl6
16:09 jnthn linuksz: The presentation that was just linked has examples of Promise and Supply in the context of Proc::Async. If you don't want to watch a video, the slides are at https://t.co/TpljDe3uVO
16:09 jnthn One value and many values
16:10 jnthn A Proc::Async has one exit code (Promise) but may write to stdout/stderr many times (Supply)
16:18 nadim_ joined #perl6
16:20 dmaestro joined #perl6
16:27 dmaestro hoping someone will review nqp pull request #364 - simple change (with tests) to better align sprintf() with POSIX.
16:29 Cabanossi joined #perl6
16:36 setty1 joined #perl6
16:36 pmurias is anyone working on a docs.perl6.org replacement?
16:46 pmurias (replacement of the docs viewer)
16:50 TEttinger joined #perl6
16:51 tbrowder timotimo: i don't think many would think that is a good solution given the seemingly tight coupling between rakudo, nqp, and moar with stable releases.
16:56 domidumont joined #perl6
17:00 timotimo it's not a good situation, yeah
17:02 Geth ¦ specs: 4ea8b15425 | (Zoffix Znet)++ (committed using GitHub Web editor) | v6d.pod
17:02 Geth ¦ specs: Split features into sections
17:02 Geth ¦ specs:
17:02 Geth ¦ specs: - Already implemented
17:02 Geth ¦ specs: - Yet to be implemented
17:02 Geth ¦ specs: review: https://github.com/perl6/specs/commit/4ea8b15425
17:02 mr_ron joined #perl6
17:04 mr_ron m: grammar G { token digitz { <[0..9]> }; our token DIGIT is export(:UC) { <G::digitz> } }; import G :UC; say so "1" ~~ /<DIGIT>/ # any way to define DIGIT without hard coding grammar G:: in G::digitz (maybe $?PACKAGE)
17:04 camelia rakudo-moar d7e104: OUTPUT: «True␤»
17:08 Ven`` joined #perl6
17:09 ChoHag joined #perl6
17:11 Geth ¦ specs: 6eff18021f | (Zoffix Znet)++ (committed using GitHub Web editor) | v6d.pod
17:11 Geth ¦ specs: Add reasoning for IO::*.chdir/.slurp-rest deprecations
17:11 Geth ¦ specs: review: https://github.com/perl6/specs/commit/6eff18021f
17:17 setty1 joined #perl6
17:20 Ven`` TimToady: in your QA session, you have your "principled" file listing the perl5 improvements and what role they performed in 6, do you have it uploaded somewhere?
17:22 Actualeyes left #perl6
17:29 davidnek joined #perl6
17:39 TimToady Ven``: not yet
17:39 TimToady been a bit busy with busted drains
17:39 Ven`` oh okay. thanks!
17:40 Ven`` good luck with those :/
17:40 perigrin Busted drains suck ...
17:44 TimToady in this case they blow, but yeah...
17:45 mr-foobar joined #perl6
18:01 setty1 joined #perl6
18:02 troys joined #perl6
18:08 pilne joined #perl6
18:13 espadrine joined #perl6
18:17 dct joined #perl6
18:21 Geth ¦ doc: 83f2ff5fe2 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/traps.pod6
18:21 Geth ¦ doc: Add section on parsing and whitespace issues
18:21 Geth ¦ doc:
18:21 Geth ¦ doc: And rename regex section to whitespace and just stuff the
18:21 Geth ¦ doc: single regex whitespace trap up in there.
18:21 Geth ¦ doc: review: https://github.com/perl6/doc/commit/83f2ff5fe2
18:23 Geth ¦ doc: 7a05709537 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/traps.pod6
18:23 Geth ¦ doc: reword
18:23 Geth ¦ doc: review: https://github.com/perl6/doc/commit/7a05709537
18:25 Geth ¦ doc: 3835783997 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/traps.pod6
18:25 Geth ¦ doc: Fix minor factual error
18:25 Geth ¦ doc: review: https://github.com/perl6/doc/commit/3835783997
18:40 uberbaud joined #perl6
18:45 skids joined #perl6
18:45 Cabanossi joined #perl6
18:45 mr-foobar joined #perl6
18:58 nadim_ joined #perl6
19:11 travis-ci joined #perl6
19:11 travis-ci Doc build errored. Zoffix Znet 'Add section on parsing and whitespace issues
19:11 travis-ci https://travis-ci.org/perl6/doc/builds/250463942 https://github.com/perl6/doc/compare/b7d08b58cde7...83f2ff5fe2b3
19:11 travis-ci left #perl6
19:13 travis-ci joined #perl6
19:13 travis-ci Doc build errored. Zoffix Znet 'reword'
19:13 travis-ci https://travis-ci.org/perl6/doc/builds/250464736 https://github.com/perl6/doc/compare/83f2ff5fe2b3...7a0570953781
19:13 travis-ci left #perl6
19:14 wamba joined #perl6
19:16 travis-ci joined #perl6
19:16 travis-ci Doc build errored. Zoffix Znet 'Fix minor factual error'
19:16 travis-ci https://travis-ci.org/perl6/doc/builds/250465661 https://github.com/perl6/doc/compare/7a0570953781...383578399729
19:16 travis-ci left #perl6
19:17 andrzejku joined #perl6
19:21 Geth ¦ doc: db26e3b3ad | (Jan-Olof Hendig)++ | 2 files
19:21 Geth ¦ doc: Change result of some code examples
19:21 Geth ¦ doc:
19:21 Geth ¦ doc: In order to take the new baggy semantics into account
19:21 Geth ¦ doc: review: https://github.com/perl6/doc/commit/db26e3b3ad
19:26 Geth ¦ doc: 93499fa061 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/traps.pod6
19:26 Geth ¦ doc: Remove hyper vs. «» trap
19:26 Geth ¦ doc:
19:26 Geth ¦ doc: The ambiguity warning for the more common case was made[^1]
19:26 Geth ¦ doc: not to warn for cases shown in the examples and the much less
19:26 Geth ¦ doc: common cases don't warrant a Trap entry (a warning is generated
19:26 Geth ¦ doc: by the compiler in those cases anyway).
19:26 Geth ¦ doc:
19:26 Geth ¦ doc: [1] https://github.com/rakudo/rakudo/commit/d39f7b9aff
19:26 Geth ¦ doc: review: https://github.com/perl6/doc/commit/93499fa061
19:32 Element80 joined #perl6
19:33 buggable joined #perl6
19:33 Element80 https://travis-ci.org/perl6/doc/builds/250465661
19:33 buggable [travis build above] ☠ Did not recognize some failures. Check results manually.
19:34 zengargoyle huggable: eco strptime
19:34 huggable zengargoyle, nothing found
19:36 * zengargoyle wonders if someone has done a NativeCall strptime in lieu of DateTime::Format's strptime being NYI as a stopgap measure....
19:37 zengargoyle or is this along the lines of not being too POSIXy?
19:40 buggable joined #perl6
19:40 Element80 https://travis-ci.org/perl6/doc/builds/250465661
19:40 buggable [travis build above] ✓ All failures are due to timeout (1), missing build log (0), GitHub connectivity (0), or failed make test (0).
19:41 Element80 buggable++
19:41 Element80 left #perl6
19:42 seatek joined #perl6
19:45 grumble joined #perl6
19:47 nadim_ hi, what the reverse of //= ? IE assign to the lhs only if it is defined.
19:49 moritz andthen=
19:49 setty1 joined #perl6
19:51 nadim_ seriously?
19:51 nadim_ well, it makes sense at least
19:51 moritz m: for 42, 0, Any -> $x is copy { $x andthen= 23; say $x }
19:51 camelia rakudo-moar d39f7b: OUTPUT: «23␤23␤(Any)␤»
19:52 moritz srsly
19:52 nadim_ wow!
19:53 ChoHag joined #perl6
19:54 lucasb m: (my $x = 10) andthen .say
19:54 camelia rakudo-moar d39f7b: OUTPUT: «10␤»
19:54 lucasb m: (my $x = 10) andthen= .say
19:54 camelia rakudo-moar d39f7b: OUTPUT: «(Any)␤»
19:54 lucasb should andthen= also topicalize?
19:55 kyclark joined #perl6
19:56 kyclark left #perl6
19:58 TreyHarris joined #perl6
19:58 tbrowder timotimo: actually i think you're onto something. it may be easier to untangle the pieces in the star package and build each in place, then install them individually into the correct positions in $INSTDIR. or assemble the pieces differently in the first place.
20:00 tbrowder has anyone considered using cmake for all the builds?
20:01 nadim_ There must be a much better way towrite this https://nopaste.linux-dev.org/?1159371  what it does  is set class variables only if the corresponding argument is defined in the mothod call. Don't know why but I find this a tad ugly.
20:01 timotimo tbrowder: running nqp from outside the install directory is probably troublesome, though
20:02 tbrowder ok
20:03 zengargoyle tbrowder: probably not helpful, but last time i did manual install thing...  i sudo mkdir /install; sudo chown -R me:me /install; install rakudo; sudo chown bin:bin /install :)
20:03 moritz nadim_: you use the conditional if $selected_line.defined twice
20:03 moritz if that's intentional, a single "if" is enough
20:03 AlexDaniel joined #perl6
20:03 moritz nadim_: and you can get rid of all the $x < 0 ?? 0 !! ... by sticking a 'max 0' to it
20:04 moritz m: say $_ max 0 for -4, 0, 4;
20:04 camelia rakudo-moar d39f7b: OUTPUT: «0␤0␤4␤»
20:06 nadim_ copy paste and not thinking. I'll try the max thingy
20:06 tbrowder zengaroyle: basically same here, but the docs don't tell people new to rakudo to do that (but my PR awaits approval). but i would really like to see configure separate from any building. i did notice moritz has a rakudo bug filed for that in 2013.
20:08 Element80 joined #perl6
20:09 Element80 nadim_: use `with` instead of if defined
20:09 nadim_ example please
20:09 Element80 lucasb: definitely. I'm surprised it doesn't =(
20:10 Element80 m .say with 42
20:10 Element80 m: .say with 42
20:10 camelia rakudo-moar d39f7b: OUTPUT: «42␤»
20:10 Element80 m: .say with Int
20:10 camelia rakudo-moar d39f7b: ( no output )
20:10 lucasb Element80: thanks for confirming
20:10 itaylor57 joined #perl6
20:12 travis-ci joined #perl6
20:12 travis-ci Doc build errored. Jan-Olof Hendig 'Change result of some code examples
20:12 travis-ci https://travis-ci.org/perl6/doc/builds/250485525 https://github.com/perl6/doc/compare/383578399729...db26e3b3ad67
20:12 travis-ci left #perl6
20:12 buggable [travis build above] ✓ All failures are due to timeout (1), missing build log (0), GitHub connectivity (0), or failed make test (0).
20:12 AlexDaniel dogbert17++
20:12 nadim_ m: with Int {.say}
20:12 camelia rakudo-moar d39f7b: ( no output )
20:13 nadim_ m: with 7 {.say}
20:13 camelia rakudo-moar d39f7b: OUTPUT: «7␤»
20:13 mr-foobar joined #perl6
20:14 Element80 nadim_: postfix `with` is same as `andthen` btw
20:14 zengargoyle m: given Int { .say }
20:14 camelia rakudo-moar d39f7b: OUTPUT: «(Int)␤»
20:14 zengargoyle ah
20:15 Cabanossi joined #perl6
20:16 Element80 m: .say without Int
20:16 camelia rakudo-moar d39f7b: OUTPUT: «(Int)␤»
20:16 Element80 m: Int notandthen .say
20:16 camelia rakudo-moar d39f7b: OUTPUT: «(Int)␤»
20:18 zengargoyle m: b => 42 andthen -> (:$key, *%) { $key.say }
20:18 camelia rakudo-moar d39f7b: OUTPUT: «b␤»
20:20 raschipi joined #perl6
20:20 nadim_ getting better https://nopaste.linux-dev.org/?1159372
20:21 Element80 tbrowder: for your star PR, it's confusing that it says $INSTDIR directories instead on $INSTDIR/install/bin
20:21 Element80 tbrowder: also, is that the only one that needs to be added? I thought there was a second 'site' one where binaries installed from modules are kept
20:22 lucasb m: -> (:$re, :$im) { say "($re, $im)" }.(2+3i)
20:22 camelia rakudo-moar d39f7b: OUTPUT: «(2, 3)␤»
20:22 Element80 nadim_: you got it wrong with the max op
20:22 nadim_ ha!
20:22 lucasb I didn't know I could unpack things like that. nice, zengargoyle.
20:22 Element80 nadim_: moritz meant replace your ternary with max
20:23 nadim_ I removed a ternary and replaced it with a max
20:23 Element80 lucasb: works in `if` and `else` and `for` and all the rest of blocks too; not just in standalone ones
20:24 tbrowder Element80: i'll look at a reword. from my installations with rakudo star all seems to install in $INSTDIR or underneath it.
20:24 FROGGS joined #perl6
20:24 Element80 nadim_: I still see two terbaries and seemingly pointless max call
20:24 Element80 three seemingly pointless max calla
20:26 Element80 nadim_: you missed the '0' portion of '$_ max 0'
20:26 Element80 (or '0 max $_')
20:28 Element80 nadim_: right you had a pair of nested ternaries, replace each pair with a single max call with the two of the args and the zero
20:29 Element80 $!topline = max 0, $topline, +$foldable.lines
20:30 Element80 m: say max 0, (1, 2, 0).Seq
20:30 camelia rakudo-moar d39f7b: OUTPUT: «(1 2 0)␤»
20:30 AlexDaniel joined #perl6
20:30 zengargoyle Element80: share/perl6/{,site/,vendor/}bin
20:31 nadim_ I understoo that "max $a" did not need zero, I thought it curious though, but I guess it is needed, max -4 must be -4
20:32 zengargoyle i only see files in the .../share/perl6/site/bin and not in the .../share/perl6/bin or .../share/perl6/vendor/bin
20:34 zengargoyle it's really easy to have 5 bin directories where things might end up....  ~/.perl6, INSTALL/bin, INSTALL/share/perl6/bin, INSTALL/share/perl6/{site,vendor}/bin
20:34 Element80 nadim_: where is max $a ? It should be fixed if the docs say that's zero
20:34 Element80 m: say max -4
20:34 camelia rakudo-moar d39f7b: OUTPUT: «-4␤»
20:34 Element80 Ah, k, I see why andthen= doesn't topicalize
20:35 nadim_ Element80: no, I misunderstood it when looking at the examples here
20:35 Element80 Ah ok
20:35 nadim_ Element80: I think it can be reduced to: $!selected_line = max(min($selected_line, $!foldable.lines.elems), 0) with $selected_line
20:35 Element80 zengargoyle: where are all of those coming from?
20:36 Element80 nadim_: ah right. I misread original ternary
20:38 Element80 tbrowder: merged thanks
20:38 * Element80 &
20:38 Element80 left #perl6
20:40 nadim_ without ternary at all https://nopaste.linux-dev.org/?1159376 3 lines instead for 18 lines
20:40 zengargoyle p6 gets installed to INSTALL/bin, modules can be installed to locations: home, site, vendor, (not sure what the bare .../perl6/bin maps to)
20:41 zengargoyle rakudobrew wraps those scripts and places the wrappers in a common bin directory for convienence
20:42 zengargoyle maybe zef does as well.  but the actual scripts installed by the modules go into the home/site/vendor bin directories.
20:43 zengargoyle distro packagers usually do some wrapping or moving them to a common bin directory.
20:43 pmurias joined #perl6
20:44 zengargoyle basically each CUR in the REPO chain can have it's own bin directory.
20:44 pmurias tbrowder: re tight coupling, having a simple script that checks out and build or installs a proper version of moar/nqp for the given rakudo could help making as user and installing as root
20:45 pmurias tbrowder: even one to checkout should be enough
20:46 pmurias tbrowder: something like: perl tools/checkout-nqp; cd nqp; make; sudo make install
20:48 tbrowder pmurias: thnx
20:48 Ven joined #perl6
20:48 iH2O joined #perl6
20:48 pmurias note 'the tools/checkout-nqp' doesn't exit yet :)
20:49 tbrowder roger!
20:50 epony joined #perl6
20:51 iH2O is this automatically initialized to 0 (False): my Bool @v[25];
20:56 zengargoyle m: my Bool @v[25] is default(False); say @v[0].perl;
20:56 camelia rakudo-moar d39f7b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤is default on shaped Array[Bool] not yet implemented. Sorry.␤at <tmp>:1␤------> 3my Bool @v[25] is default(False)7⏏5; say @v[0].perl;␤    expecting any of:␤        constraint␤»
20:56 zengargoyle m: my Bool @v is default(False); say @v[0].perl;
20:56 camelia rakudo-moar d39f7b: OUTPUT: «Bool::False␤»
20:56 zengargoyle :/
20:57 iH2O great
20:57 zengargoyle m: my Bool @v is default(False); say @v[0].perl; say @v.default;
20:57 camelia rakudo-moar d39f7b: OUTPUT: «Bool::False␤False␤»
20:59 zengargoyle m: my Bool @v[25] = False xx 25; say @v[0].perl;
20:59 camelia rakudo-moar d39f7b: OUTPUT: «Bool::False␤»
20:59 Element80 joined #perl6
20:59 Element80 zengargoyle: we were talking about default install instruction for Rakudo Star tho. There's no rakudobrew involved and, I'm guessing, no weird CUR setups.
20:59 zengargoyle TIMTOWTDI
21:00 Element80 m: my Bool @v[25] = False xx *; say @v[0].perl;
21:00 camelia rakudo-moar d39f7b: OUTPUT: «Bool::False␤»
21:00 zengargoyle Element80: there will still be site and vendor and home and INSTALL/bin to be in the PATH
21:01 Element80 OK
21:01 zengargoyle unless nobody ever installs modules to the system.... then i guess it's only INSTALL/bin and ~/.perl6/bin
21:04 zengargoyle my by-the-books install just has moar,nqp,perl6 in INSTALL/bin, zef,mi6,panda,p6doc,lwp-get etc are in INSTALL/share/perl6/site/bin
21:07 Element80 That sounds like what I usually have
21:07 zengargoyle (because i gave myself write permissions to INSTALL/**, otherwise they'd be in ~/.perl6/bin)
21:08 zengargoyle i do a group write+sticky to INSTALL so i can put things in one tree and rsync it between machines.... :P
21:08 zengargoyle panda failed at this, but zef does it just fine.
21:08 iH2O Given two variables "my Int $i=20; my Int $j=40;" I'd like to construct a pattern that will match strings in their range $i..$j, like '35' ~~ /pattern/
21:09 Element80 iH2O: why does it have to be a pattern?
21:09 iH2O ?
21:09 iH2O it's part of a larger pattern
21:09 zengargoyle m: my Int $i=20; my Int $j=40; say so 30 ~~ Range.new($i, $j);
21:09 camelia rakudo-moar d39f7b: OUTPUT: «True␤»
21:09 iH2O which i simplify here
21:09 Element80 Ah
21:10 zengargoyle m: my Int $i=20; my Int $j=40; say so 90 ~~ Range.new($i, $j);
21:10 camelia rakudo-moar d39f7b: OUTPUT: «False␤»
21:10 Element80 iH2O: /$<range>=\d+ <{ $i ≤ $<range> ≤ $j }>/
21:11 zengargoyle m: my Int $i=20; my Int $j=40; say so 90 ~~ /\d+ <?{ +$/ ~~ $i .. $j }/
21:11 camelia rakudo-moar d39f7b: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in metachar:sym<assert>; couldn't find final '>' ␤at <tmp>:1␤------> 3 say so 90 ~~ /\d+ <?{ +$/ ~~ $i .. $j }7⏏5/␤    expecting any of:␤        horizontal whitespa…»
21:11 Element80 iH2O: /$<range>=[<[+-]>?\d+ [\.\d+]?] <{ $i ≤ $<range> ≤ $j }>/
21:11 zengargoyle m: my Int $i=20; my Int $j=40; say so 90 ~~ /\d+ <?{ +$/ ~~ $i .. $j }>/
21:11 camelia rakudo-moar d39f7b: OUTPUT: «False␤»
21:11 Element80 iH2O: not sure how many digital formats you wanna handle
21:11 zengargoyle m: my Int $i=20; my Int $j=40; say so 30 ~~ /\d+ <?{ +$/ ~~ $i .. $j }>/
21:11 camelia rakudo-moar d39f7b: OUTPUT: «True␤»
21:12 iH2O ideally, I'd like a pattern that matches directly the range, rather than throwing away results that don't match
21:12 iH2O aybe that requires an extra level of eval
21:12 iH2O maybe
21:12 * zengargoyle -ish. :)
21:14 zengargoyle you could turn the range into a list and interpolate that, but it might get hairy for large ranges.
21:14 mr-foobar joined #perl6
21:15 zengargoyle m: my Int $i=20; my Int $j=40; my @r = ($i..$j).Array; say @r; say so "30" ~~ /@r/;
21:15 camelia rakudo-moar d39f7b: OUTPUT: «[20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40]␤True␤»
21:15 zengargoyle m: my Int $i=20; my Int $j=40; my @r = ($i..$j).Array; say @r; say so "90" ~~ /@r/;
21:15 camelia rakudo-moar d39f7b: OUTPUT: «[20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40]␤False␤»
21:16 Element80 :|
21:16 zengargoyle not really a good idea i think...
21:16 Element80 No, it isn't :)
21:18 zengargoyle m: my Int $i=20; my Int $j=40; my token range { \d+ <?{ +$/ ~~ $i..$j }>/; say so "30" ~~ /<range>/;
21:18 camelia rakudo-moar d39f7b: OUTPUT: «5===SORRY!5===␤Unrecognized regex metacharacter / (must be quoted to match literally)␤at <tmp>:1␤------> 3y token range { \d+ <?{ +$/ ~~ $i..$j }>7⏏5/; say so "30" ~~ /<range>/;␤Malformed regex␤at <tmp>:1␤------> 3 token range { \d…»
21:18 * Element80 still has no idea what iH2O actually wants
21:18 Element80 No idea what "directly the range" means
21:19 zengargoyle m: my Int $i=20; my Int $j=40; my token range { \d+ <?{ +$/ ~~ $i..$j }> }; say so "30" ~~ /<range>/;
21:19 camelia rakudo-moar d39f7b: OUTPUT: «True␤»
21:19 iH2O I have a larger pattern that include numbers from variable ($i and $j) as well as alphabetic characters together
21:20 zengargoyle i think maybe a regex like /2[0..9]|30/
21:20 iH2O I do something like that at this moment
21:20 iH2O but I think it's patching
21:20 iH2O :)
21:20 zengargoyle i'd totally go for the range things...
21:21 Ven_ joined #perl6
21:22 Element80 iH2O: yeah, but what's "directly the range"? If my Int $i=20; and my Int $j=40; is "20.5" supposed to match? What about "20e0" or "+20.0e-0"? That's all "in range" as far as Perl 6 Range object is concerned.
21:23 zengargoyle or Element80's $i <= +$/ <= $j sort of thing.
21:23 zengargoyle Int's because $i and $j are Int. :P
21:23 iH2O I'm talking of integers only. I guess that perl6 cannot match the Integer type directly in a pattern unless a new pattern is created and recompiled with eval
21:23 Element80 huh?
21:24 Element80 I've no idea where evals come into play
21:24 * Element80 gives up and goes to try to fix andthen=
21:24 iH2O :)
21:24 Element80 But so far sounds like you're premature optimizing
21:25 * zengargoyle thinks the token and range and <?{ ... } things are much better than any sort of crafting a regex ala p5
21:26 zengargoyle a regex to match IP in p5 is hairy without the eval-ish stuff.  you'll get it wrong.
21:27 iH2O yes, I think I'll stick to the simpler solution
21:27 * zengargoyle remembers to wonder if Regexp::Common type stuff has a p6 module yet.  ecosystem of grammars wise.
21:30 Cabanossi joined #perl6
21:33 iH2O left #perl6
21:35 Ven_ joined #perl6
21:47 mr-foobar joined #perl6
21:52 Element80 m: (my $x = 42) andthen -> $a is rw { $a = $a.say }; dd $x
21:52 camelia rakudo-moar d39f7b: OUTPUT: «42␤Bool $x = Bool::True␤»
21:52 Element80 m: (my $x = 42) andthen= -> $a is rw { $a = $a.say }; dd $x
21:52 camelia rakudo-moar d39f7b: OUTPUT: «Block $x = -> $a is rw { #`(Block|36689304) ... }␤»
21:52 * Element80 gives up on andthen= for now
21:53 Element80 It gets a wrong thunk so fixing it ain't a couple keypresses
22:01 Element80 /part
22:01 Element80 left #perl6
22:07 [Coke] what about doc site changes?
22:12 mr-foobar joined #perl6
22:14 AlexDaniel what changes?
22:15 AlexDaniel [Coke]: hey, by the way
22:15 AlexDaniel [Coke]: I think there is an easy fix for exact matches
22:15 AlexDaniel [Coke]: right now the first entry in the search list is highlighted whenever you type something
22:16 AlexDaniel [Coke]: just highlight the exact match and this will make things much better
22:16 AlexDaniel e.g. you will be able to type “ord”, hit enter and it will get you to the useful link
22:22 Geth ¦ doc: ffca24bd12 | (Will "Coke" Coleda)++ | doc/Language/traps.pod6
22:22 Geth ¦ doc: use nbsp
22:22 Geth ¦ doc: review: https://github.com/perl6/doc/commit/ffca24bd12
22:22 Geth ¦ doc: 8f852456f6 | (Will "Coke" Coleda)++ | doc/Language/traps.pod6
22:22 Geth ¦ doc: remove trailing whitespace
22:22 Geth ¦ doc: review: https://github.com/perl6/doc/commit/8f852456f6
22:22 Geth ¦ doc: 9c77d5affd | (Will "Coke" Coleda)++ | doc/Language/traps.pod6
22:23 Geth ¦ doc: only skip-test the parts marked WRONG
22:23 Geth ¦ doc: review: https://github.com/perl6/doc/commit/9c77d5affd
22:33 BenGoldberg joined #perl6
22:34 Geth ¦ doc: 0b3a800580 | (Will "Coke" Coleda)++ | doc/Language/unicode_texas.pod6
22:34 Geth ¦ doc: remove superfluous commas (which also cause xt/ failure)
22:34 Geth ¦ doc: review: https://github.com/perl6/doc/commit/0b3a800580
22:35 uberbaud joined #perl6
22:47 Geth ¦ doc: 6beae1e8d6 | (Will "Coke" Coleda)++ | template/search_template.js
22:47 Geth ¦ doc: Allow search for '.foo', which searches for foo but only in Methods
22:47 Geth ¦ doc:
22:47 Geth ¦ doc: Part of #1086
22:47 Geth ¦ doc: review: https://github.com/perl6/doc/commit/6beae1e8d6
22:48 [Coke] ^^ with that, a search for '.sin' will find the sink method, but not the sin sub.
22:51 * seatek resolves that despite emotional trauma, "_" should remain "_" and not converted to "-" when refactoring from p5
22:53 AlexDaniel seatek: why?
22:54 seatek because there are just too many all over the place, and you can never get them all
22:54 seatek my hands have memory muscle now even
22:54 Juerd So we build entire worlds but we can't rename variables? :)
22:55 seatek let them eat cake ;)
22:58 cpage__ joined #perl6
22:58 Juerd I want to have a vim extension to rename variables. Damian Conway wrote a script, but it doesn't do lexical scoping
22:59 Juerd So the script isn't really useful for what I'm running into: inherited projects, where the same variable names are used for different concepts.
22:59 Juerd But I don't want it badly enough to build it myself :)
22:59 Juerd It'd take a year...
23:01 seatek it can get so tangled. and then it's that question... a year sounds to me like you should jsut do it by hand ;)
23:01 seatek and then there's updating the DOCS. no more conversions of _ to - for me.
23:02 seatek i'll just have  pretty new code, or hideous dilapedated code - and i won't have to wonder any more
23:02 b2gills joined #perl6
23:07 raschipi Yeah, if it's not possible to just do a s/ol_d/ne-w/g I wouldn't bother renaming either.
23:08 seatek one of the nice things about refactoring is that you can discover bugs you never knew you had. for years.
23:08 seatek i don't know how i've survived
23:13 travis-ci joined #perl6
23:13 travis-ci Doc build errored. Will "Coke" Coleda 'only skip-test the parts marked WRONG'
23:13 travis-ci https://travis-ci.org/perl6/doc/builds/250549650 https://github.com/perl6/doc/compare/93499fa061c2...9c77d5affd8c
23:13 travis-ci left #perl6
23:13 buggable [travis build above] ✓ All failures are due to timeout (1), missing build log (0), GitHub connectivity (0), or failed make test (0).
23:15 zengargoyle Juerd: i wonder if DC's rename thing could be hacked to work on a visual (or otherwise specified) range of lines?
23:18 seatek maybe he could add in converting attributes from moose to p6, ->attr($thing) to  attr = $thing with some smart way to differentiate between method calls
23:18 zengargoyle Juerd: it already does just work on a Visual!
23:19 Juerd zengargoyle: So it says in the source but I can't gather *how*. Do you know?
23:20 seatek see it would be easier to take the year and write your own ;)
23:24 travis-ci joined #perl6
23:24 travis-ci Doc build errored. Will "Coke" Coleda 'remove superfluous commas (which also cause xt/ failure)'
23:24 travis-ci https://travis-ci.org/perl6/doc/builds/250553530 https://github.com/perl6/doc/compare/9c77d5affd8c...0b3a80058092
23:24 travis-ci left #perl6
23:24 buggable [travis build above] ✓ All failures are due to timeout (1), missing build log (0), GitHub connectivity (0), or failed make test (0).
23:24 travis-ci joined #perl6
23:24 travis-ci Doc build passed. Will "Coke" Coleda 'Allow search for '.foo', which searches for foo but only in Methods
23:24 travis-ci https://travis-ci.org/perl6/doc/builds/250557301 https://github.com/perl6/doc/compare/0b3a80058092...6beae1e8d60a
23:24 travis-ci left #perl6
23:26 zengargoyle Juerd: it seems you have to arrange that your cursor is on the variable withing the visual range.  so select a first line, Shift-V down to the last line with the var in it and h/j so cursor is in variable, then 'cv' prompts to change in Visual Block.
23:28 zengargoyle Juerd: acutally, that's from the year old DC vim talk, so maybe older version of the plugin...  i haven't re-upped this years vim+perl talk/tarball yet.
23:30 zengargoyle Juerd: you can also have cursor in variable and do like :.,+12 call TPV_rename_perl_var('visual')
23:32 zengargoyle there's basically a 'normal' mode that does the whole file and a 'visual' mode that does a range.  an extra function with a shorter name would be nice for the range case....
23:33 mr-foobar joined #perl6
23:36 epony joined #perl6
23:41 raschipi One could take the time to fix the problem of reusing variable names in different scopes.
23:44 zengargoyle heh.  :cmap cv :call TPV_rename_perl_var ('visual')  -- :.,+10 cv<RET>
23:45 Cabanossi joined #perl6
23:56 zengargoyle Juerd: aha, you can also do somethingn like: goto first line, 'ma' to set mark-a, goto last line, 'mb' to set mark-b, move cursor to variable, :'a,'b cv<RET>  (assuming earlier cmap is in place)

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

Perl 6 | Reference Documentation | Rakudo