Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-09-18

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:07 AlexDaniel asdfgh: I wonder, why not use opengl directly?
00:07 asdfgh I've never done that before
00:09 timotimo we don't have an opengl binding, is why
00:09 AlexDaniel ah well, somehow I assumed that this question is not perl6-specific, oops
00:10 AlexDaniel but yeah, I'm not saying that this is the right way (or the easiest one), but it worked great for me several times (especially for game-related stuff). This was not perl 6 though
00:10 AlexDaniel perhaps it's a great opportunity to get opengl bindings done, right? ;)
00:12 timotimo *shrug*
00:12 timotimo we have some start of an opengl binding by someone who intentionally abandoned it immediately after the PoC was done
00:12 timotimo (a colored rotating triangle)
00:14 timotimo GTG
00:20 asdfgh Is opengl any harder to use directly?
00:22 xinming joined #perl6
00:29 AlexDaniel asdfgh: I think so
00:37 cpage joined #perl6
00:39 BenGoldberg I just learned of a new (to me), cool way of using reference counting for automatic memory management <http://hboehm.info/popl04/refcnt.pdf> ... now if only it could properly free circular reference loops as a mark-and-sweep gc can, then it would be awesome :)
00:41 girafe2 joined #perl6
00:45 BenGoldberg The interesting thing about the scheme is that, when an object's refcnt goes to 0, it's not freed right away, but pushed onto a stack of to-be-freed objects.  Whenever a new memory allocation of N bytes is about to be done, repeat the following: {one object, O, is popped from the stack. if O is a container, it's contents get their refcnts decremented, and perhaps pushed onto the stack.  O is then freed.} until either at least N
00:45 BenGoldberg bytes have been freed, or the stack is empty.
00:49 BenGoldberg This avoids both the typical program pause which happens when a conventional gc is done, or the pause which happens in a conventional (like perl5!) refcounting scheme, in which freeing a container results in some *recursive* refcount decrementing, which can result in a program pause.
00:57 tushar joined #perl6
00:59 tushar my attribute definition is "has Array @.data is rw = [];". I would like to access it in a private method. I am achieving it as "@!data". Am I doing it a right way? When I attempted to access it as "self@!data", I experienced an error.
01:00 tushar Error Message: "Invocant requires a type object of type Array[Array], but an object instance was passed.  Did you forget a 'multi'?"
01:00 tushar Any thoughts?
01:16 MasterDuke @!data is correct
01:16 MasterDuke https://docs.perl6.org/language/classtut#index-entry-twigils_%21 has some info about the ! twigil
01:17 tushar MasterDuke, thanks.
01:18 tushar MasterDuke, I read that doc. Any thoughts on the error that I am experiencing while using "self@!data"?
01:18 tushar just curious..
01:18 timotimo i can't get that error
01:18 timotimo i always get "two terms in a row"
01:19 MasterDuke m: class A { has Array @.data is rw = []; method !a() { dd self.@.data }; method b() { self!a() }; }; my $a = A.new; $a.data.push: []; $a.b
01:19 camelia rakudo-moar 31c4c6: OUTPUT«Invocant requires a type object of type List, but an object instance was passed.  Did you forget a 'multi'?␤  in method a at <tmp> line 1␤  in method b at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
01:19 MasterDuke m: class A { has Array @.data is rw = []; method !a() { dd self@!data }; method b() { self!a() }; }; my $a = A.new; $a.data.push: []; $a.b
01:19 camelia rakudo-moar 31c4c6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3@.data is rw = []; method !a() { dd self7⏏5@!data }; method b() { self!a() }; }; my␤    expecting any of:␤        infix␤        infix stopper␤        …»
01:19 MasterDuke m: class A { has Array @.data is rw = []; method !a() { dd self.@!data }; method b() { self!a() }; }; my $a = A.new; $a.data.push: []; $a.b
01:19 camelia rakudo-moar 31c4c6: OUTPUT«Invocant requires a type object of type List, but an object instance was passed.  Did you forget a 'multi'?␤  in method a at <tmp> line 1␤  in method b at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
01:21 MasterDuke i agree the error is weird, but i wouldn't have expected self@!data to be valid syntax
01:22 tushar timotimo, I got the same error as MasterDuke. my class definition and method definition is also similar to what he tried.
01:22 tushar yes, I am expecting the same. Doc shows the same syntax and I am just following it.
01:22 MasterDuke tushar: what is the exact line you're using? i can't seem to get that error with 'self@<anything>', but 'self.@<things>' sometimes does
01:27 tushar m: unit class DataTable:ver<0.0.1>:auth<github:tushardave26>; has Array @.data is rw = []; method !sanity-check { unless [==] self@!data { fail "The number of observations in each rows are not equal.!!"; } method dim { self!sanity-check; } my $dt = DataTable.new(data => [["Tushar", "Dave", 29], ["John", "Adams", 30]]); $dt.dim();
01:27 camelia rakudo-moar 31c4c6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3 method !sanity-check { unless [==] self7⏏5@!data { fail "The number of observation␤    expecting any of:␤        block or pointy block␤        infix␤     …»
01:28 tushar oopss.. I believe syntax is incorrect..
01:28 tushar I attempting to use REPL here first time..
01:29 tushar I hope it make sense.:(
01:32 tushar here is the paste bin link (http://pastebin.com/wLyjBbyB) for .pm file and here is link (http://pastebin.com/pRatgrUz) for the executable file..
01:33 timotimo m: http://pastebin.com/wLyjBbyB
01:33 camelia rakudo-moar 31c4c6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3http:7⏏5//pastebin.com/wLyjBbyB␤    expecting any of:␤        colon pair␤»
01:33 timotimo :(
01:33 tushar timotimo, can you use it like that?
01:33 timotimo only with some sites
01:33 timotimo gist.github.com definitely works
01:34 timotimo there are at least two others, but i forgot which ones
01:34 MasterDuke m: unit class DataTable:ver<0.0.1>:auth<github:tushardave26>; has Array @.data is rw = []; method !sanity-check { unless [==] @!data { fail "The number of observations in each rows are not equal.!!"; }; }; method dim { self!sanity-check; }; my $dt = DataTable.new(data => [["Tushar", "Dave", 29], ["John", "Adams", 30]]); $dt.dim()
01:34 tushar alright let me try that then.. knowledge, knowledge.. Lots of new knowledge... :)
01:34 camelia rakudo-moar 31c4c6: ( no output )
01:34 MasterDuke m: unit class DataTable:ver<0.0.1>:auth<github:tushardave26>; has Array @.data is rw = []; method !sanity-check { unless [==] self@!data { fail "The number of observations in each rows are not equal.!!"; }; }; method dim { self!sanity-check; }; my $dt = DataTable.new(data => [["Tushar", "Dave", 29], ["John", "Adams", 30]]); $dt.dim()
01:34 camelia rakudo-moar 31c4c6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3 method !sanity-check { unless [==] self7⏏5@!data { fail "The number of observation␤    expecting any of:␤        block or pointy block␤        infix␤     …»
01:35 MasterDuke m: unit class DataTable:ver<0.0.1>:auth<github:tushardave26>; has Array @.data is rw = []; method !sanity-check { unless [==] self.@!data { fail "The number of observations in each rows are not equal.!!"; }; }; method dim { self!sanity-check; }; my $dt = DataTable.new(data => [["Tushar", "Dave", 29], ["John", "Adams", 30]]); $dt.dim()
01:35 timotimo well, our logic is "most errors are Two Terms In A Row, but sometimes we can make a better guess", so i suppose in this case it sees "you've put an 'unless' in front" and says "that's not just a TTIAR, it's a missing block!"
01:35 camelia rakudo-moar 31c4c6: OUTPUT«Invocant requires a type object of type List, but an object instance was passed.  Did you forget a 'multi'?␤  in method sanity-check at <tmp> line 1␤  in method dim at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
01:35 pierre_ joined #perl6
01:37 MasterDuke m: unit class DataTable:ver<0.0.1>:auth<github:tushardave26>; has Array @.data is rw = []; method !sanity-check { unless [==] self.@.data { fail "The number of observations in each rows are not equal.!!"; }; }; method dim { self!sanity-check; }; my $dt = DataTable.new(data => [["Tushar", "Dave", 29], ["John", "Adams", 30]]); $dt.dim()
01:37 camelia rakudo-moar 31c4c6: OUTPUT«Invocant requires a type object of type List, but an object instance was passed.  Did you forget a 'multi'?␤  in method sanity-check at <tmp> line 1␤  in method dim at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
01:37 timotimo m: class A { method t { self.@ } }; A.t
01:37 camelia rakudo-moar 31c4c6: OUTPUT«Invocant requires a type object of type List, but an object instance was passed.  Did you forget a 'multi'?␤  in method t at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
01:38 timotimo interesting
01:38 timotimo m: say @
01:38 camelia rakudo-moar 31c4c6: OUTPUT«[]␤»
01:39 timotimo @ is an anonymous state variable of listy type, and self.@ just calls the list with self
01:39 timotimo m: say &
01:39 camelia rakudo-moar 31c4c6: OUTPUT«(Callable)␤»
01:39 timotimo m: say "hello".&
01:39 camelia rakudo-moar 31c4c6: OUTPUT«Cannot invoke this object (REPR: Uninstantiable; Callable)␤  in block <unit> at <tmp> line 1␤␤»
01:39 timotimo m: "hello".&say
01:39 camelia rakudo-moar 31c4c6: OUTPUT«hello␤»
01:39 timotimo m: my @foo := -> { say "heyo $_ !!!" } but Positional; 100.@foo
01:39 camelia rakudo-moar 31c4c6: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
01:39 timotimo m: my @foo := { say "heyo $_ !!!" } but Positional; 100.@foo
01:39 camelia rakudo-moar 31c4c6: OUTPUT«heyo 100 !!!␤»
01:39 timotimo m: my @ := { say "heyo $_ !!!" } but Positional; 100.@
01:39 camelia rakudo-moar 31c4c6: OUTPUT«Invocant requires a type object of type List, but an object instance was passed.  Did you forget a 'multi'?␤  in block <unit> at <tmp> line 1␤␤»
01:41 timotimo can't do it like this, but you should be able to see the similarity
01:42 tushar timotimo, hmmm.. can you elaborate your statement about error (statement on 21:35)?
01:46 timotimo 033618  timotimo │ @ is an anonymous state variable of listy type, and self.@ just calls the list with self
01:46 timotimo ^- this one?
01:46 tushar no, this one "well, our logic is ..."
01:46 timotimo ah
01:46 timotimo hm
01:46 timotimo m: say "hello"␤say "how are you"
01:46 camelia rakudo-moar 31c4c6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row across lines (missing semicolon or comma?)␤at <tmp>:2␤------> 3say "hello"7⏏5<EOL>␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        sta…»
01:46 timotimo this is an example where we encounter two terms in a row, but have some extra information for the user
01:47 ilbot3 joined #perl6
01:47 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:48 tushar timotimo, no worries, you have done a lot.. thanks for all your help and efforts..
01:48 timotimo you're welcome
01:48 timotimo seeya! :)
01:48 tushar good night!!
01:55 FROGGS_ joined #perl6
02:19 noganex_ joined #perl6
02:34 BenGoldberg m: sub prefix:<∑>(\args) { [+] |args }; say ∑ 1..3;
02:34 camelia rakudo-moar 31c4c6: OUTPUT«1..3␤»
02:34 BenGoldberg m: sub prefix:<∑>(\args) { [+] |args }; say [+] 1..3;
02:34 camelia rakudo-moar 31c4c6: OUTPUT«6␤»
02:35 BenGoldberg m: sub prefix:<∑>(\args) { [+] |args }; say [+] |(1..3);
02:35 camelia rakudo-moar 31c4c6: OUTPUT«6␤»
02:35 BenGoldberg m: sub prefix:<∑>(\args) { [+] |args }; say ∑ 1, 2, 3;
02:35 camelia rakudo-moar 31c4c6: OUTPUT«123␤»
02:36 BenGoldberg m: sub ∑(\args) { [+] |args }; say ∑ 1, 2, 3;
02:36 camelia rakudo-moar 31c4c6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3sub7⏏5 ∑(\args) { [+] |args }; say ∑ 1, 2, 3;␤    expecting any of:␤        new name to be defined␤»
02:38 BenGoldberg m: sub prefix:<∑>(@_) { [+] @_ }; say ∑ 1, 2, 3;
02:38 camelia rakudo-moar 31c4c6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Calling prefix:<∑>(Int) will never work with declared signature (@_)␤at <tmp>:1␤------> 3sub prefix:<∑>(@_) { [+] @_ }; say 7⏏5∑ 1, 2, 3;␤»
02:39 BenGoldberg m: sub prefix:<∑>(@_) { [+] @_ }; say ∑ (1, 2, 3);
02:39 camelia rakudo-moar 31c4c6: OUTPUT«6␤»
02:39 BenGoldberg m: sub prefix:<∑>(@_) { [+] @_ }; say ∑ 1..3;
02:39 camelia rakudo-moar 31c4c6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Calling prefix:<∑>(Int) will never work with declared signature (@_)␤at <tmp>:1␤------> 3sub prefix:<∑>(@_) { [+] @_ }; say 7⏏5∑ 1..3;␤»
02:39 BenGoldberg m: sub prefix:<∑>(@_) { [+] @_ }; say ∑ (1..3);
02:39 camelia rakudo-moar 31c4c6: OUTPUT«6␤»
02:42 BenGoldberg m: sub prefix:<∑>(@_) is looser(&infix:<,>)  { [+] @_ }; say ∑ (1..3);
02:42 camelia rakudo-moar 31c4c6: OUTPUT«6␤»
02:42 BenGoldberg m: sub prefix:<∑>(@_) is looser(&infix:<,>)  { [+] @_ }; say ∑ 1..3;
02:42 camelia rakudo-moar 31c4c6: OUTPUT«6␤»
02:42 BenGoldberg m: sub prefix:<∑>(@_) is equiv(&infix:<[+]>)  { [+] @_ }; say ∑ 1..3;
02:42 camelia rakudo-moar 31c4c6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    infix:<[+]> used at line 1. Did you mean 'infix:<+|>', 'infix:<∖>', 'infix:<lt>'?␤␤»
02:42 japhb m: sub prefix:<∑>(+@_) { [+] @_ }; say ∑ 1..3; say ∑ (1..3); say ∑ 1, 2, 3; say ∑ (1, 2, 3);
02:42 camelia rakudo-moar 31c4c6: OUTPUT«1..3␤6␤123␤6␤»
02:43 japhb m: sub prefix:<∑>(*@_) { [+] @_ }; say ∑ 1..3; say ∑ (1..3); say ∑ 1, 2, 3; say ∑ (1, 2, 3);
02:43 camelia rakudo-moar 31c4c6: OUTPUT«1..3␤6␤123␤6␤»
02:43 japhb m: sub prefix:<∑>(+@_) { [+] |@_ }; say ∑ 1..3; say ∑ (1..3); say ∑ 1, 2, 3; say ∑ (1, 2, 3);
02:43 camelia rakudo-moar 31c4c6: OUTPUT«1..3␤6␤123␤6␤»
02:43 japhb m: sub prefix:<∑>(+@_) { [+] @_.list }; say ∑ 1..3; say ∑ (1..3); say ∑ 1, 2, 3; say ∑ (1, 2, 3);
02:43 camelia rakudo-moar 31c4c6: OUTPUT«1..3␤6␤123␤6␤»
02:43 japhb m: sub prefix:<∑>(+@_) { [+] @_.list.flat }; say ∑ 1..3; say ∑ (1..3); say ∑ 1, 2, 3; say ∑ (1, 2, 3);
02:43 camelia rakudo-moar 31c4c6: OUTPUT«1..3␤6␤123␤6␤»
02:44 japhb m: sub prefix:<∑>(*@_) { [+] @_.list.flat }; say ∑ 1..3; say ∑ (1..3); say ∑ 1, 2, 3; say ∑ (1, 2, 3);
02:44 camelia rakudo-moar 31c4c6: OUTPUT«1..3␤6␤123␤6␤»
02:44 BenGoldberg The default precedence is wrong for it to work properly without some sort of 'is looser' or 'is tighter'
02:45 japhb m: sub prefix:<∑>(*@_) is looser(&infix:<,>) { [+] @_.list.flat }; say ∑ 1..3; say ∑ (1..3); say ∑ 1, 2, 3; say ∑ (1, 2, 3);
02:45 camelia rakudo-moar 31c4c6: OUTPUT«6␤6␤6␤6␤»
02:45 japhb m: sub prefix:<∑>(*@_) is looser(&infix:<,>) { [+] @_.list }; say ∑ 1..3; say ∑ (1..3); say ∑ 1, 2, 3; say ∑ (1, 2, 3);
02:45 camelia rakudo-moar 31c4c6: OUTPUT«6␤6␤6␤6␤»
02:45 japhb m: sub prefix:<∑>(*@_) is looser(&infix:<,>) { [+] @_ }; say ∑ 1..3; say ∑ (1..3); say ∑ 1, 2, 3; say ∑ (1, 2, 3);
02:45 camelia rakudo-moar 31c4c6: OUTPUT«6␤6␤6␤6␤»
02:45 japhb m: sub prefix:<∑>(@_) is looser(&infix:<,>) { [+] @_ }; say ∑ 1..3; say ∑ (1..3); say ∑ 1, 2, 3; say ∑ (1, 2, 3);
02:45 camelia rakudo-moar 31c4c6: OUTPUT«6␤6␤6␤6␤»
02:46 BenGoldberg m: my sub prefix:<∑> := &infix:<+>;
02:46 camelia rakudo-moar 31c4c6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3my sub prefix:<∑>7⏏5 := &infix:<+>;␤    expecting any of:␤        new name to be defined␤»
02:49 djbkd joined #perl6
02:53 pierre_ joined #perl6
02:54 tushar left #perl6
02:56 bisectable6oops joined #perl6
02:58 labster joined #perl6
03:04 bisectable6oops joined #perl6
03:07 skids joined #perl6
03:10 bisectable6oops joined #perl6
03:15 sufrostico joined #perl6
03:15 sufrostico joined #perl6
03:19 pierre_ joined #perl6
04:07 kaare__ joined #perl6
04:40 cyphase joined #perl6
04:55 committable6 joined #perl6
04:57 Cabanossi joined #perl6
05:28 wamba joined #perl6
05:29 rgrinberg joined #perl6
05:56 poohman joined #perl6
05:57 djbkd joined #perl6
06:11 committable6 joined #perl6
06:12 poohman joined #perl6
06:15 poohman Hello all, I have a question on Grammars, if I parse a file using the parse file function using an actionclass and assign it to a variable and print it I get the entire tree as ouput
06:16 poohman If I assign .ast of the parsefile to it I get no output even though I have a make
06:17 poohman It just outputs (Any)
06:17 poohman How can I access the data member that I made??
06:27 rindolf joined #perl6
06:29 moritz poohman: you also need to make in the TOP rule
06:29 moritz poohman: then .ast on the result should give you something
06:29 poohman ah
06:30 poohman ok I made it in a lower token
06:30 poohman ok thanks for the help, ill give it a shot
06:32 poohman moritz: I already called a new in the method - how do I call the same object back in TOP - timotimo told me yesterday that it is referenced by self
06:33 poohman Or can I make it only in the TOP rule?
06:33 moritz poohman: can you show your code please?
06:33 TimToady all make ever does is just stow a pointer to some object
06:33 moritz poohman: in many cases, you call make() in most action methods
06:34 TimToady doesn't care where you did .new
06:34 moritz and basically create a tree of result objects, that partially mirrors three of matches in the match object
06:34 TimToady { make $<something>.made } should oughta be enough
06:35 moritz poohman: https://github.com/moritz/json/ is an example that builds a data structure mirroring a JSON string as it's parsed
06:36 moritz in lib/JSON/Tiny/Grammar.pm and Actions.pm
06:46 poohman thanks will check it out - for the code can I cut and paste here - not able to run directly on Camelia as it is usually done here - new here and new to IRC -sorry
06:52 moritz poohman: use a paste bin
06:52 moritz like http://pastebin.com/ or https://gist.github.com/
06:52 rindolf joined #perl6
06:53 poohman ok let me look it up
06:56 domidumont joined #perl6
06:59 poohman http://pastebin.com/X07bggnw
07:00 poohman hope that works
07:01 moritz poohman: first of all, you should really add whitespace to your regexes to make them more readable
07:01 moritz poohman: second, you call make() in name, so only the 'name' match object has an .ast
07:02 poohman moritz: how can I access name in MAIN?
07:02 moritz so you can add a  method assigns($/) { make $<name>.ast } to propagate it to the 'assign' match object
07:02 domidumont joined #perl6
07:02 poohman and then all the way to TOP?
07:03 moritz right
07:03 poohman I was trying with make $<name>.made
07:03 moritz and then  method line($/) { make $<assigns>.ast if $<assigns> }
07:03 moritz .made and .ast are synonyms
07:03 moritz I think .made is more politically correct these days :-)
07:04 poohman ah ok - but is there any way I can access name directly in main?
07:04 moritz and method TOP ($/) { make $<lines>.map: *.made }
07:05 moritz and *then* in the mainline, you can say  $times.ast -> $thing { say $thing }
07:06 moritz better: and method TOP ($/) { make $<lines>.grep(&so).map: *.made }
07:06 moritz afk&
07:08 poohman cool thanks will try it out - coding after a decade and directly in Perl6 - awk brought me here - a big change from C++ - loving it
07:08 poohman so the code may be messy
07:15 darutoko joined #perl6
07:16 CIAvash joined #perl6
07:21 pierre_ joined #perl6
07:22 firstdayonthejob joined #perl6
07:34 bob777 joined #perl6
07:43 moritz PSA: I've tweaked some permissions of the perl6 org on github, making them more liberal
07:44 moritz the default permissions on the perl6 org now contain write permissions for members
07:44 moritz everybody in the org can create new repos in the perl6/ namespace
07:45 moritz and Zoffix++ is now an Owner, meaning he can invite new people to the org
07:58 dalek ecosystem: bf59c19 | (Pierre VIGIER)++ | META.list:
07:58 dalek ecosystem: Add Data::MessagePack to ecosystem
07:58 dalek ecosystem:
07:58 dalek ecosystem: See https://github.com/pierre-vigier/Perl6-Data-MessagePack
07:58 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/bf59c1958c
07:58 dalek ecosystem: c2408f8 | (Siavash Askari Nasr)++ | META.list:
07:58 dalek ecosystem: Merge pull request #251 from pierre-vigier/master
07:58 dalek ecosystem:
07:58 dalek ecosystem: Add Data::MessagePack to ecosystem
07:58 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/c2408f80b1
08:09 holyghost joined #perl6
08:10 domidumont joined #perl6
08:21 canopus joined #perl6
08:27 kaare__ joined #perl6
08:33 domidumont joined #perl6
08:41 bazzaar joined #perl6
08:46 Woodi hi today :)
08:46 Woodi pierre_++
08:48 pierre_ As i might need that in production for work, i first push the pure perl version
08:49 pierre_ slower, but it's working
08:49 pierre_ native version is harder than what i thought :)
08:55 dalek Inline-Perl5: 8ab2ba4 | niner++ | lib/Inline/Perl5.pm6:
08:55 dalek Inline-Perl5: Add a FIXME comment
08:55 dalek Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/8ab2ba4538
08:55 dalek Inline-Perl5: ac303a2 | niner++ | t/globals.t:
08:55 dalek Inline-Perl5: Test accessing package variables via %*PERL5
08:56 dalek joined #perl6
09:02 rcy joined #perl6
09:03 labster joined #perl6
09:05 eliasr joined #perl6
09:11 RabidGravy joined #perl6
09:18 Ven_ joined #perl6
09:29 domidumont joined #perl6
09:30 bazzaar \o perl6
09:31 bazzaar p6: my @fmts = split(',', 'a1,i3,i5,i5,i5,1x,a3');
09:31 camelia rakudo-moar 86d9e9: ( no output )
09:32 poohman joined #perl6
09:32 bazzaar p6: my @fmts = split(',', 'a1,i3,i5,i5,i5,1x,a3'); @fmts.say
09:32 camelia rakudo-moar 86d9e9: OUTPUT«[a1 i3 i5 i5 i5 1x a3]␤»
09:33 bazzaar p6: my @ranges-good; my $pos = -1; for @fmts { $_ ~~ /\d+/ and @ranges-good.push(($pos += 1).perl..($pos += ~$/ - 1).perl) }; @ranges-good.say
09:33 camelia rakudo-moar 86d9e9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@fmts' is not declared␤at <tmp>:1␤------> 3my @ranges-good; my $pos = -1; for 7⏏5@fmts { $_ ~~ /\d+/ and @ranges-good.pus␤»
09:35 bazzaar p6: my @fmts = split(',', 'a1,i3,i5,i5,i5,1x,a3');  my @ranges-good; my $pos = -1; for @fmts { $_ ~~ /\d+/ and @ranges-good.push(($pos += 1).perl..($pos += ~$/ - 1).perl) }; @ranges-good.say
09:35 camelia rakudo-moar 86d9e9: OUTPUT«["0".."0" "1".."3" "4".."8" "9".."13" "14".."18" "19".."19" "20".."22"]␤»
09:36 bazzaar p6: my @fmts = split(',', 'a1,i3,i5,i5,i5,1x,a3');  my @ranges-bad; my $pos = -1; for @fmts { $_ ~~ /\d+/ and @ranges-bad.push(($pos += 1)..($pos += ~$/ - 1)) }; @ranges-bad.say
09:36 camelia rakudo-moar 86d9e9: OUTPUT«[0..0 3..3 8..8 13..13 18..18 19..19 22..22]␤»
09:38 bazzaar would someone be so kind as to explain why .perl makes the ranges different?
09:45 domidumont joined #perl6
09:49 bazzaar apologies if my question is ambiguous, it's not that the range numbers are quoted, it's that the range numbers are actually different.
09:50 bazzaar I'm wondering if it could be a bug (or I might be doing something daft)
09:53 bob777 joined #perl6
09:56 girafe3 joined #perl6
10:00 domidumont joined #perl6
10:01 domidumont joined #perl6
10:02 gfldex m: my @fmts = split(',', 'a1,i3,i5,i5,i5,1x,a3');  my @ranges-good; my $pos = -1; for @fmts { $_ ~~ /\d+/ and @ranges-good.push(($pos += 1) .. ($pos += ~$/ - 1)) }; @ranges-good.say
10:02 camelia rakudo-moar 86d9e9: OUTPUT«[0..0 3..3 8..8 13..13 18..18 19..19 22..22]␤»
10:03 gfldex m: my @fmts = split(',', 'a1,i3,i5,i5,i5,1x,a3');  my @ranges-good; my $pos = -1; for @fmts { $_ ~~ /\d+/ and @ranges-good.push(($pos += 1).perl .. ($pos += ~$/ - 1)) }; @ranges-good.say
10:03 camelia rakudo-moar 86d9e9: OUTPUT«["0"..0 "1"..3 "4"..8 "9"..13 "14"..18 "19"..19 "20"..22]␤»
10:03 CIAvash m: my $num1; say ($num1 += 1) .. ($num1 += 5); my $num2; say +($num2 += 1) .. ($num2 += 5)
10:03 camelia rakudo-moar 86d9e9: OUTPUT«6..6␤1..6␤»
10:04 gfldex bazzaar: ^^^
10:05 nadim joined #perl6
10:06 gfldex m: my $num1; my &f = { dd $^a, $^b }; f(($num1 += 1),($num1 += 5));
10:06 camelia rakudo-moar 86d9e9: OUTPUT«Int $a = 6␤Int $b = 6␤»
10:06 gfldex bazzaar: ^^^ that's what's going on
10:09 bazzaar gfldex: and CIAvash, thanks so much for your help, I will study your solutions, learning all the time
10:26 spider-mario joined #perl6
10:28 nadim_ joined #perl6
10:30 pierre_ joined #perl6
10:45 inra joined #perl6
10:54 brrt joined #perl6
11:00 cpage_ joined #perl6
11:10 Woodi today HN promotes dislikeing OO :)  http://www.yegor256.com/2016/08/15/what-is-wrong-object-oriented-programming.html  but we still don't have replacement or recipe
11:12 tadzik hehe, pointing out flaws is always easier than coming up with alternatives :)
11:13 tadzik a lot of this criticism seems more directed either at people who misunderstand/misuse OO or particular languages
11:14 Woodi Linus T. was probably closes with recipe :)
11:15 brrt i think object oriented programming has been hugely succesful at enabling the development of large programs
11:16 brrt the problem is of course that we are now stuck with large programs
11:16 tadzik funny thing about that C quote is it's very carefully cropped
11:16 tadzik IIRC he also says "We've been writing object oriented code in the kernel in C for years and it's perfect"
11:16 tadzik but that would not work towards the author's point, would it ;)
11:17 Woodi also Kay sayd "messages!" but we read it "messages everywhere!", but inside objects messages are harmfull, IMO
11:17 brrt tadzik: i recall that bit too
11:18 tadzik the biggest takeaway for me from Kay's idea is "object are there to ensure that the data they encapsulate is always correct"
11:18 tadzik so: managing responsibility
11:19 tadzik which is something we need to be doing one way or another
11:19 brrt true
11:19 nine I think of the listed quote the one by Oscar Nierstrasz is the most sensible.
11:19 tadzik the biggest thing to criticise in OO is imho the way it's taught
11:19 Woodi tadzik: structs are realy nice :) struct Driver { int fd; void*mem; } + some functions totally skipping VirtualDriver, etc. but then C have EnhancedDriver { struct Driver *dprt; ... } ...
11:19 tadzik "OO is when you do classes. Also, inheritance can help you with code reuse"
11:19 tadzik AAAAAA
11:20 brrt the only alternative is taking a god-overview to your program... which is feasible for small things
11:20 nine tadzik: oh yes, absolutely
11:20 brrt and OOP doesnt eliminate it
11:21 nine Btw tadzik, p6profiler-qt has been my most favorite tool in the past few weeks :)
11:21 FROGGS_ OO is about encapsulation and behaviour
11:21 tadzik Rob Pike's quote I also like
11:21 timotimo i wish we could give p6profiler-qt a bit more love. i wanted to build a view for GC runs, but it seemed like a boatload of work to build a "progress bar" with text in it into the table
11:21 tadzik nine :) I'm glad it's helpful
11:21 FROGGS_ I think that I quite rarely make use of inheritance btw
11:22 tadzik who would've thought that spending few days writing C++ on a Perl hackathon would do anything good :P
11:22 FROGGS_ hehe
11:22 * FROGGS_ .oO( C deserves karma, rally )
11:22 FROGGS_ really*
11:22 tadzik .karma C
11:23 FROGGS_ ENOBOT
11:23 tphilipp joined #perl6
11:23 tadzik this used to be funny when it worked
11:23 FROGGS_ since years
11:23 timotimo tadzik: are you interested in building a few more cool things into the p6profiler-qt? like, we're currently throwing away a whole lot of information the call graph could give us
11:23 tadzik :(
11:23 tadzik timotimo: sure
11:23 timotimo like "this routine is 90% jitted but 10% speshed-only. give me a list of the callers and how many entries are jitted vs speshed"
11:23 tadzik I mean, a feature parity with the angulailer would be a good start :P
11:23 tadzik oooh
11:23 tadzik this sounds lovely
11:23 timotimo or "this routine really deopts often. i wonder what callers are responsible for that"
11:24 nine Well getting a list of callers of a routine would be a great start anyway
11:25 timotimo right. and it should be trivial to do, too
11:25 timotimo this is one of the feature requests i have for coke's angular 2 rewrite of the html profiler
11:25 tadzik except for the part when you need to hammer your thoughts into Qt
11:25 timotimo ... yes
11:25 tadzik I can carry that ring to mordor though :P
11:25 timotimo that'd be fantastic
11:26 timotimo the qt model/view framework is a destroyer of my brain
11:26 timotimo when i don't have to work with it, i tend to be pretty darn pleased with qt
11:27 brrt hehehe
11:27 tphilipp joined #perl6
11:28 tadzik yeah, the complexity is mind-boggling
11:29 tadzik but it's one of the things that you eventually realize that are complex only becuase they solve a very complex problem
11:29 timotimo right
11:29 tadzik or at least I don't see any prior art proving otherwise
11:29 tadzik see also: HTML+CSS+JS
11:31 brrt tk?
11:32 timotimo :D
11:32 pierre_ joined #perl6
11:32 Woodi here is small script just for benchmarking our OO:  https://github.com/slunski/caffeeExample/blob/master/caffeExample.pl6  anyone can tell me what I'm doing wrong ? :)
11:33 brrt or maybe i'm saying: i dont see which problems qt solves that tk does not
11:33 Woodi brrt: tk is hibernated in ugliness, that all whar is wrong with it...
11:34 timotimo "small script" :\
11:34 Woodi maybe modules will cam later :)
11:35 brrt i have very little experience with gui programming in general of course
11:35 tadzik I'm not knowledgable in Tk enough to give you a clear answer. IIRC as far as styling your UI goes, Tk is massively behind other toolkits, which is where the ugliness probably comes from
11:35 brrt so im literally being naive
11:36 timotimo Qt lets you style most things with CSS
11:36 brrt hmm yeah. i dont really think Tk is ugly though
11:37 timotimo it doesn't have any rounded corners!!!!
11:37 brrt okay. so self-imposed pain on that front :-p
11:39 brrt (i guess that shows how much i know about it)
11:39 poohman joined #perl6
11:39 tadzik :)
11:39 tadzik I think its tcl roots make its bindability a bit limited
11:40 tadzik even in python, tkinter would accept some code that "pure python", with its strong typing would not
11:42 timotimo yeah, tk is stringy-typed even in python
11:42 timotimo it's really bad we don't have a tk binding for perl6, it could be the killer feature
11:43 * brrt exits train
11:49 CIAvash joined #perl6
11:54 nadim joined #perl6
11:58 dalek Inline-Perl5: ec9399d | niner++ | / (3 files):
11:58 dalek Inline-Perl5: Do not itemize the Perl5Hash in the constructor
11:58 dalek Inline-Perl5:
11:58 dalek Inline-Perl5: With this a for %my_perl5_hash { } now correctly iterates
11:58 dalek Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/ec9399d6ac
12:05 domidumont joined #perl6
12:07 dalek Inline-Perl5: fcc97c0 | niner++ | / (5 files):
12:07 dalek Inline-Perl5: Wrap Perl 5 arrays instead of copying them
12:07 dalek Inline-Perl5:
12:07 dalek Inline-Perl5: This allows for writing back to the underlying Perl 5 array through normal
12:07 dalek Inline-Perl5: assignments. Also improves performance in cases where not all entries are
12:07 dalek Inline-Perl5: accessed.
12:07 dalek Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/fcc97c0691
12:25 _sfiguser joined #perl6
12:25 _sfiguser hello everyone... is there an equivalent metacpan for perl 6  ?
12:26 MasterDuke _sfiguser: not really, but the closest thing is https://modules.perl6.org/
12:26 timotimo we're moving towards having perl6 stuff on cpan, and we have a "fork" of metacpan (i think?) that's working better for perl6 stuff
12:26 timotimo but nothing final yet
12:28 _sfiguser ok thanks...
12:30 zakharyas joined #perl6
12:43 pierre_ joined #perl6
12:47 dalek Inline-Perl5: 5e0dba3 | niner++ | / (2 files):
12:47 dalek Inline-Perl5: Don't set up an array of return values if there are none
12:47 dalek Inline-Perl5:
12:47 dalek Inline-Perl5: Saves not only the setup but also the conversion to Perl 6
12:47 dalek Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/5e0dba330a
12:57 dalek Inline-Perl5: e2f8f0b | niner++ | / (2 files):
12:57 dalek Inline-Perl5: Bring the "no return values" optimization to package methods, too
12:57 dalek Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/e2f8f0b9cd
13:01 firstdayonthejob joined #perl6
13:08 poohman joined #perl6
13:22 bioduds question, guys. Will a 256 Mb ubuntu with say, 2gb swap install perl6?
13:24 Woodi bioduds: no :)
13:25 timotimo it could, but it'll be extremely slow to build the core setting
13:25 timotimo by extremely i mean something like "come back next week"
13:25 bioduds im testing c9 min slice vps
13:25 bioduds the free tier
13:26 timotimo you can, however, copy an already built rakudo onto another system, if the paths are all the same
13:26 timotimo and if the architecture matches, of course
13:26 bioduds oh
13:26 bioduds that would be interesting, i'll try
13:26 timotimo i tend to build my moarvm with -march=native, but that's not the default. that would probably break when you transfer from your home computer to an amazon cloud server thingie
13:26 timotimo it'll potentially give wrong results in some compile-time-decided config hashes, like $*VM or $*COMPILER or whatever
13:48 kaare__ joined #perl6
13:48 rgrinberg joined #perl6
13:54 Actualeyes joined #perl6
13:57 _sfiguser joined #perl6
14:10 AlexDaniel joined #perl6
14:18 khw joined #perl6
14:18 zakharyas joined #perl6
14:33 holyghost joined #perl6
14:37 dalek Inline-Perl5: 51ec79d | niner++ | / (2 files):
14:37 dalek Inline-Perl5: Don't create arrays for single return values
14:37 dalek Inline-Perl5:
14:37 dalek Inline-Perl5: Saves the native calls to unpack the 1-element array in a very common situation.
14:37 dalek Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/51ec79dd1a
14:37 dalek Inline-Perl5: 85188d0 | niner++ | lib/Inline/Perl5.pm6:
14:37 dalek Inline-Perl5: Fix memory leaks in Perl5Hash and Perl5Array creation
14:37 dalek Inline-Perl5:
14:37 dalek Inline-Perl5: The constructors already increase the refcnt of the actually referenced objects.
14:37 dalek Inline-Perl5: No need to keep the referencing SVs alive.
14:37 dalek Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/85188d01b1
14:48 blahman123 joined #perl6
14:49 blahman123 left #perl6
14:54 dalek ecosystem: 70867a8 | titsuki++ | META.list:
14:54 dalek ecosystem: Add Algorithm::LBFGS to ecosystem
14:54 dalek ecosystem:
14:54 dalek ecosystem: See https://github.com/titsuki/p6-Algorithm-LBFGS
14:54 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/70867a8426
14:54 dalek ecosystem: f2144dd | titsuki++ | META.list:
14:54 dalek ecosystem: Merge pull request #252 from titsuki/add-lbfgs
14:55 dalek ecosystem:
14:55 dalek ecosystem: Add Algorithm::LBFGS to ecosystem
14:55 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/f2144ddba7
14:57 El_Che bioduds: you could install my deb
14:58 El_Che bioduds: https://github.com/nxadm/rakudo-pkg/releases <- 32- and 64-bit ubuntu pkgs
15:03 El_Che bioduds: I use it on the smallest digicialocean machine (I chose 32-bit ubuntu because of the low memory)
15:04 dalek Inline-Perl5: 8374645 | niner++ | / (2 files):
15:04 dalek Inline-Perl5: Save a boat load of native calls by moving type introspection to C
15:04 dalek Inline-Perl5:
15:04 dalek Inline-Perl5: Instead of doing one native call for every type we test for, move that elsif
15:04 dalek Inline-Perl5: cascade to C code and just return a number indicating the type found.
15:04 dalek Inline-Perl5: review: https://github.com/niner/Inline-Perl5/commit/83746454ce
15:05 espadrine joined #perl6
15:05 timotimo cool!
15:06 timotimo boatloads are big amounts
15:10 DrForr Woo, I finally have a grammar change to test my test suite.
15:12 winfred_ joined #perl6
15:14 BenGoldberg joined #perl6
15:17 DrForr Is there a handy class that use 'HAS' declarations?
15:17 DrForr *uses
15:20 Sgeo joined #perl6
15:21 timotimo i ... don't think so?
15:23 DrForr Fair 'nuff. I'm just going through the grammar as rigorously as I can.
15:24 pierrot joined #perl6
15:25 DrForr I'm just testing it on 'is repr("CStruct"){ HAS int $x }' and that's throwing a warning.
15:26 DrForr (obviously a class) - If you know offhand what type I can use to get rid of the type warning that gives me I'd appreciate it. Not a big deal though.
15:26 timotimo yeah, HAS is for putting other CStructs into a CStruct
15:26 winfred_ hello all, what exactly does grep(&so) do? I googled it and could find only 2 instances - both in irc by moritz - does it remove gaps in arrays?
15:27 DrForr So I'd probably need to declare a CStruct class and *then * the HAS-using class.
15:27 DrForr mumble.
15:28 timotimo winfred_: it only lets things through that will boolify to True
15:28 timotimo it just uses the "so" sub as the matcher for grepping
15:30 winfred_ thanks , ill try looking up the so sub
15:31 ufobat joined #perl6
15:39 bioduds please, very simple question. How do I access an attribute in a class? with dot syntaxe not working
15:42 bioduds never mind, it is working
15:43 bioduds just now interpolating I guess
15:43 bioduds not interpolating
15:46 wamba joined #perl6
15:54 * DrForr returns to grumbling at here-docs. OTOH they're the last big thing, I think.
15:58 timotimo bioduds: if you want it to interpolate, put () after the attribute name
15:58 bioduds tx
15:59 DrForr You can think of it as using the accessor *method*. (which you really are.)
16:04 optikalmouse joined #perl6
16:05 optikalmouse is there an oauth lib for perl6? and I think today I'm gonna need to make me a perl6 rest api-ish thing, I'm working on an elm tutorial today and need a backend that isn't nodejs heh
16:06 araujo__ joined #perl6
16:07 DrForr optikalmouse: modules.perl6.org - Look for OAuth2::Client::Google
16:07 optikalmouse DrForr, thanks!
16:09 winfred_ joined #perl6
16:11 eythian joined #perl6
16:12 optikalmouse is there a variable naming convention or is everyone still deciding on if they want to camelCase or lisp-case?
16:14 mst lisp-case seems to be it
16:15 optikalmouse my $var-is-long; sub another-function() { }; class HelloWorld {}; ?
16:16 DrForr I figure we ave up some whitespace insensitivity to be ale to have it, may as well use the hell out of it :)
16:17 mst optikalmouse: that seems to be what everything I see does.
16:18 optikalmouse ok cool, when is the underscore naming convention used...if ever? private vars or anything like that?
16:18 cbk_ joined #perl6
16:20 El_Che you mean as in perl5 "private methods"? -> https://docs.perl6.org/language/objects#Private_Methods
16:21 DrForr I use it on occasion to delineate NQP stuff, but that's not something you're going to encounter in typical code.
16:23 Michael__ joined #perl6
16:26 cdg joined #perl6
16:28 cdg joined #perl6
16:30 Actualeyes joined #perl6
16:32 cbk_ joined #perl6
16:32 Michael__ joined #perl6
16:39 optikalmouse given %hash { say .<key> }
16:39 optikalmouse ^ would that work?
16:40 mst m: my %hash = (foo => 1, bar => 2); given %hash { say .<bar> }
16:40 camelia rakudo-moar 363a3a: OUTPUT«2␤»
16:40 mst apparently, yes
16:40 optikalmouse neato :D
16:46 optikalmouse how do I do string interpolation? like "#{$var}" ?
16:46 mst m: my $var = 'bar'; say "foo {$var} baz"
16:46 camelia rakudo-moar 363a3a: OUTPUT«foo bar baz␤»
16:47 mst not sure what that # is but that isn't perl6
16:47 DrForr Drop the '#'- That's Ruby.
16:47 DrForr Or just "foo $bar baz"
16:48 mst oh, right
16:48 DrForr The braces should only be needed if you're inlining code, or you don't want spacing between a variable and some text.
16:48 optikalmouse that's a rubyish, yah
16:48 * mst doesn't ruby, the OO is too restricted and bare bones compared to perl5
16:48 mst "I have to write my own constructor? Are you kidding me? *goes back to Moo*"
16:53 avar mst: https://github.com/peczenyj/MooseX ?
16:55 mst avar: ooh, that's come along quite a bit since I last looked at it
16:59 smls joined #perl6
17:02 smls m: "a" ~~ / [(a) b]? (a) /;  say $1;  say $/.list;
17:02 camelia rakudo-moar 363a3a: OUTPUT«「a」␤()␤»
17:03 smls ^^ Why is $/.list not (Nil, 「a」) in this case?
17:06 mst is the () inside the [] creating a capture at all?
17:07 smls Yes
17:07 smls Shorter golf:
17:07 smls m: "b" ~~ / (a)? (b) /;  say $1;  say $/.list;
17:07 camelia rakudo-moar 363a3a: OUTPUT«「b」␤()␤»
17:07 smls m: "ab" ~~ / (a)? (b) /;  say $1;  say $/.list;
17:07 camelia rakudo-moar 363a3a: OUTPUT«「b」␤(「a」 「b」)␤»
17:08 smls Interestingly, $/[*] works as expected, just not .list
17:08 * smls writes RT
17:09 moritz m: "b" ~~ / (a)? (b) /;  say $/.list.elems
17:09 camelia rakudo-moar 363a3a: OUTPUT«2␤»
17:09 moritz m: "b" ~~ / (a)? (b) /;  say $/.list.map: *.^name
17:09 camelia rakudo-moar 363a3a: OUTPUT«()␤»
17:10 moritz m: "b" ~~ / (a)? (b) /;  say $/.list.map(&so).elems
17:10 camelia rakudo-moar 363a3a: OUTPUT«0␤»
17:10 moritz so, .elems reports the size correctly, but iteration fails
17:10 mst did somebody accidentally acpture InterationEnd? ;)
17:11 optikalmouse sigh, got tripped on hash assignment, {} vs [] ;/
17:16 spidermario joined #perl6
17:16 optikalmouse my first http + json parsing thing: https://gist.github.com/omouse/eb1b37783cf4952a08d15f0b55d33350
17:16 optikalmouse grabs the list of radio stations from digitally imported, because I can't seem to find the url list on their site ;/ ;/
17:18 noganex joined #perl6
17:19 optikalmouse welp, I just wasted my time creating that script. DI.fm has forced people, just like the rest of the damned internet to use their proprietary web app. "licensing restrictions".
17:20 optikalmouse somehow it's ok to stream techno for a decade using icecast/shoutcast but now it's not allowed :|
17:20 RabidGravy we still use icecast
17:21 RabidGravy I'm actually surprised that doesn't use JSPF
17:23 RabidGravy "we" being futuremusic.fm
17:25 optikalmouse ^ cool!
17:26 optikalmouse welp time to dive into the api requests the digitally imported player uses.
17:26 RabidGravy a lot the stuff I have been making is toward making the radio management software in Perl 6
17:26 optikalmouse aha, I see what they did, " Adobe Flash Player is required for browser-based audio playback on Digitally Imported. "
17:27 optikalmouse it's no longer 2016 people, it's 2001.
17:27 RabidGravy yeah that's crap
17:27 El_Che optimized for 1024*768
17:27 RabidGravy don't all browsers support HTML5 audio players of some sort these days?
17:28 RabidGravy (apart from you know lynx and w3m ;)
17:29 optikalmouse $8/month for premium and then you can use external players. I guess that isn't too bad...but they insert ads into the free stream anyway. confusing.
17:29 jkramer joined #perl6
17:29 krakan joined #perl6
17:29 bartolin joined #perl6
17:29 Guest68452 joined #perl6
17:29 xxpor joined #perl6
17:29 bitmap joined #perl6
17:29 musca joined #perl6
17:29 dustinm` joined #perl6
17:29 ponbiki joined #perl6
17:29 imcsk8 joined #perl6
17:29 decent joined #perl6
17:29 ab5tract_ joined #perl6
17:29 silug_ joined #perl6
17:29 salparadise joined #perl6
17:29 Kaffe joined #perl6
17:29 atta joined #perl6
17:29 DrForr joined #perl6
17:29 Exodist joined #perl6
17:29 [particle]1 joined #perl6
17:29 ilbelkyr joined #perl6
17:29 maddingue joined #perl6
17:29 protium joined #perl6
17:29 risou_ joined #perl6
17:29 timotimo joined #perl6
17:29 jstimpfle joined #perl6
17:29 b^_^d joined #perl6
17:29 freeze joined #perl6
17:29 1JTAAJ4WM joined #perl6
17:29 rblackwe joined #perl6
17:29 SHODAN joined #perl6
17:31 Guest64580 joined #perl6
17:32 perlawhirl_ joined #perl6
17:35 bob777 joined #perl6
17:36 bioduds subset Genero of Str where * eq "Homem" or * eq "Mulher"
17:36 bioduds accepts Homem but not Mulher
17:36 bioduds why?
17:36 RabidGravy Well http://stream.futuremusic.fm:8000/mp3 all free, though Lenny of Noxegenus appears to have gone bonkers and is playing New Orleans jazz :-\
17:38 RabidGravy bioduds: you may want to do something like "subset Genero of Str where "Homem"|"Mulher""
17:38 bioduds RabidGravy : tx
17:38 sjoshi joined #perl6
17:38 smls bioduds: The `or * eq "Mulher"` is parsed as a statement prefix, not part of the where expression.
17:39 bioduds :)
17:40 mst so presumably where (* eq "Homem" or * eq "Mulher") would work
17:40 mst 'or' binds quite loosely
17:40 mst I mean, RabidGravy's answer is better for that case
17:41 smls mst: Except that the short-circuting operators don't play nice with WhateverCode, last I checked.
17:41 mst ah
17:41 smls mst: See RT #116208
17:41 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=116208
17:43 mst so where any(* eq 'Homen', * eq 'Mulher') would probably work?
17:43 smls hm.
17:43 mst I mean, we're well into "but probably don't" here
17:43 mst I'm just interested because of my own thoughts about whatever star abuse ;)
17:44 smls mst: Apparently it does work, yes :P
17:44 mst \o/
17:45 mst note that short circuiting messing stuff up is a problem I've encountered in perl5 as well trying to build DSLs
17:45 mst usually ended up abusing | and & overloads
17:45 mst which, well, it works, but it's not as elegant as I'd like
17:48 RabidGravy in that place  the "Goo"|"Bar" forms a Junction that is smart-matched with the value
17:49 mst right, so my any() thing is pretty much an overcomplicated way to achieve basically the same behaviour
17:49 RabidGravy anyhow my smoke test of 57 modules now completes in 23 minutes (from a max of double that)
17:50 RabidGravy mst, yeah
17:50 mst \o/
17:50 dalek evalbot: 611df54 | (Zoffix Znet)++ | freenode.org.conf:
17:50 dalek evalbot: Add camelia to #zofbot
17:50 dalek evalbot:
17:50 dalek evalbot: It's where all the other bots already are and having `camelia` too would be helpful when writing tests, so you don't have to switch channel/PM all the time.
17:50 dalek evalbot: review: https://github.com/perl6/evalbot/commit/611df54e71
17:50 camelia joined #perl6
17:54 confundus joined #perl6
18:03 girafe joined #perl6
18:06 _slade_ joined #perl6
18:18 perlawhirl joined #perl6
18:21 AlexDaniel haha, I like this reasoning. “some bots are already here, let's bring them all!” :)
18:21 AlexDaniel zofcave++
18:23 bioduds anyone has an easy link for a module tutorial in p6?
18:27 k-man joined #perl6
18:27 Matthew[m] joined #perl6
18:38 moritz bioduds: for starting a module? Or using one? Or installing?
18:38 bioduds starting
18:39 bioduds i want to learn how to write them
18:39 bioduds :)
18:39 bioduds to contribute and to make my code modular too
18:39 Sgeo_ joined #perl6
18:41 imcsk8_ joined #perl6
18:41 moritz bioduds: https://docs.perl6.org/language/modules
18:42 zakharyas joined #perl6
18:42 [particle] joined #perl6
18:44 bioduds moritz : tx as usual bro
18:44 moritz bioduds: you're welcome
18:44 bioduds having huge pleasure learning perl6 man
18:45 bioduds :)
18:45 moritz .tell Zoffix if you're looking for a good project to use your super powers: Build a github bot that invites everybody to the perl6 org how gets a PR merged in a repo under the perl6 org
18:45 yoleaux moritz: I'll pass your message to Zoffix.
18:47 protium joined #perl6
18:58 firstdayonthejob joined #perl6
19:10 newbie1 joined #perl6
19:12 silug_ joined #perl6
19:13 cyphase joined #perl6
19:15 Cabanossi joined #perl6
19:23 adu joined #perl6
19:24 freeze joined #perl6
19:25 djbkd joined #perl6
19:28 KotH joined #perl6
19:40 sufrostico joined #perl6
19:45 TEttinger joined #perl6
19:52 skids joined #perl6
19:55 itaipu joined #perl6
19:58 labster joined #perl6
20:14 bioduds panda install MongoDB failed
20:15 mst good
20:15 mst otherwise you might end up using mongodb
20:15 mst get DBIish and a postgres instance instead ;)
20:15 timotimo well, mongodb is still better than using /dev/null for writing and /dev/urandom for reading
20:16 bioduds mst : no other alternatives
20:17 moritz unless you really want random data :-)
20:17 mst bioduds: why?
20:17 bioduds mst : I don't want RDBs
20:17 bioduds I want NoSQL
20:17 mst why?
20:17 bioduds cause I like them better
20:17 mst MongoDB is pretty crippled as NoSQL stuff goes
20:17 bioduds I agree
20:18 bioduds My first option is DynamoDB but it is expensive
20:18 mst personally, I'd go for storing JSON documents in postgres
20:18 mst you get the same querying capacity as mongodb
20:18 mst and it actually works
20:19 bioduds I always disliked RDBs, now that it is no longer the *only* choice, I'm happy :)
20:19 mst http://trout.me.uk/mongodb.jpg
20:19 bioduds not going back to them no more
20:19 mst disliked why/how?
20:20 bioduds schemas for instance
20:20 bioduds fixed
20:20 bioduds I really find it not good
20:20 bioduds NoSQL is shemaless
20:20 bioduds you may have different versions of data
20:21 mst right, which means it can easily accept broken data
20:21 bioduds not if you aggregate it correctly
20:21 mst MongoDB is 'your data is a giant chunk of JSON that may or mayt not make sense'
20:21 bioduds correct
20:21 mst Postgres, OTOH, lets you have validated fields (columns)
20:21 mst *and* JSON for stuff that varies
20:21 bioduds it is up to you to make it have sense I guess
20:21 mst and query into the JSON
20:21 mst personally, I prefer being able to have tiehr
20:22 mst same as perl6 has types but doesn't require you to always use them
20:22 mst but I don't find schemas hard
20:22 bioduds I don't find them hard, I find them wrong
20:23 mst need a new column? add two lines to a DBix::Class::Candy file, generate the ALTERs, apply to database, keep programming
20:23 canopus joined #perl6
20:23 bioduds if your model changes during dev
20:23 bioduds you need to re-make it
20:23 mst then that's trivial to fix
20:23 mst two or three lines of code
20:23 bioduds with nosql you dont
20:23 mst less code than I need to validate the nosql stuff
20:23 bioduds not if you already have millions of entries
20:24 mst well, yes, but then you have to make a decision about how to handle the eixtsing data *somewhere*
20:24 timotimo schemas aren't fixed
20:24 bioduds subsets are great for validation
20:24 timotimo good RDB systems allow you to modify tables
20:24 mst NoSQL lets you make the decision somewhere else
20:24 bioduds I am betting on subsets and nosql
20:24 mst but it doesn't get rid of it
20:24 mst right, so, again, use postgres and a JSON column
20:24 mst then you can have schemaless *and* a database that doesn't eat your data
20:25 Cabanossi joined #perl6
20:25 mst seems like the best of both worlds to me :D
20:25 bioduds nevertheless, I have no alternative in this thing I'm doing now
20:25 bioduds my "front" is Meteor
20:25 mst oh, and meteor requires mongo?
20:25 timotimo not even couchdb?
20:26 bioduds yep
20:26 bioduds I have used DynamoDB in other project
20:26 bioduds which is, I believe, ideal
20:26 bioduds but as I said, DynamoDB is expensive
20:26 bioduds and this project I'm working now must be cheap
20:27 mst https://github.com/Urigo/awesome-meteor#alternative-databases
20:27 mst happily, meteor supports postgresql
20:27 mst so I return to my previous recommendation
20:28 bioduds but I don't like RDBs. I know it is strange to say it
20:28 mst ...
20:28 bioduds but the whole NoSQL paradigm seems so right to me
20:28 mst your only complaint so far is "I don't like schemas"
20:28 mst I already told you how to not need schemas
20:28 mst so what's the problem?
20:28 mst looks like there's also rethinkdb support
20:28 bioduds scalability
20:28 mst rethink looks kinda nice
20:29 mst postgres scales fine
20:29 mst I've replaced mongodb with postgres because postgres scales better more than once now
20:29 cbk_ joined #perl6
20:29 bioduds mongodb scales too
20:29 bioduds codefights is done in meteor
20:29 bioduds works great
20:29 mst ...
20:30 mst yes. you *can* scale mongodb
20:30 bioduds Meteor is awesome javascript framework
20:30 mst it's easier to scale a system designed by adults though
20:30 mst still not understanding what's wrong with meteor+postgres+JSON
20:30 mst no schema required. scales fine.
20:30 mst anything else?
20:32 bioduds cause I believe in mongodb
20:32 mst wat
20:32 bioduds i really don't think I need to go for postgres
20:32 bioduds which is RDB and I want to run away from it
20:32 mst you believe in a database that doesn't always return matching records for a query
20:32 mst ok
20:33 mst guess accuracy and data loss don't matter to you
20:33 mst fair enough
20:33 bioduds consistency
20:33 * timotimo would go for redis under these circumstances
20:33 mst mongodb isn't
20:33 bioduds is not required for db system, it is a choice
20:33 geekosaur wat
20:33 bioduds my case, I don't require it
20:33 bioduds mongodb is not ACID
20:33 mst mongodb is for unstructured data that fits in RAM that you can afford to lose
20:34 bioduds not a problem for this project I'm doing
20:34 mst but at that point I'd use redis, yes
20:34 bioduds DynamoDB is ACID
20:34 bioduds I can choose developping and using it with consistency
20:34 bioduds but as I said, this project doesn't require it
20:35 bioduds you're making the assumption that all systems require consistency
20:35 bioduds they don't
20:35 bioduds some do, some don't
20:37 mst I'm not making that assumption
20:37 mst anyway, your argument at this point is "I believe in MongoDB" rather than anything technical
20:37 mst so, whatever, have fun
20:37 mst your religion is between you and your church, I try and stick to facts ;)
20:38 * geekosaur considers nosql a failed experiment; increasingly the nosql folks are realizing that there's an actual reason for relational databases and adding the functionality back in, at least optionally
20:39 mst NewSQL
20:40 bioduds it's new, only needs to improve
20:40 bioduds but it is better in my opinion
20:40 geekosaur nope
20:40 bioduds roughly putting
20:41 geekosaur open source folks alwats want to believe the stuff that works is overengineered and they can do it better. years later they have rediscovered the hard way why it was done that way... and then the next generation believes it's overengineered and they can do it better
20:41 geekosaur lather, rinse, repeat
20:42 nine geekosaur: I see nothing special with open source folks about that. That's the same with all programmers
20:46 user10 joined #perl6
20:46 firstdayonthejob joined #perl6
20:49 firstdayonthejob joined #perl6
20:57 dalek whateverable: ca77fb5 | (Aleks-Daniel Jakimenko-Aleksejev)++ | / (2 files):
20:57 dalek whateverable: Bisectable: “good”/“bad” → “old”/“new”, support for signals
20:57 dalek whateverable:
20:57 dalek whateverable: The main purpose of this commit was to make bisectable understand segfaults (and
20:57 dalek whateverable: other signals). As it required a major rework in the logic, I've also changed
20:57 timotimo mst: the term is NuSQL
20:58 dalek joined #perl6
20:59 AlexDaniel dalek: we are not getting along very well, right? I should make a cake for you or something :)
21:01 pmichaud joined #perl6
21:10 KotH joined #perl6
21:18 firstdayonthejob joined #perl6
21:21 bioduds I don't quite go with the crowd on that matter
21:22 bioduds it is reasonable to acknowledge that there is a problem that caused the need for developing non-relational dbs
21:22 bioduds a problem needed to be solved
21:22 bioduds it is being solved. surely there is a need for further improvement
21:23 geekosaur no, I don't think it did. the problem was "we thought slowness was just because stupid, we didn't think that maybe it's because people don't want their purchases dropped on the floor"
21:23 bioduds seeing this as an adventure of people who wanted simply to do something new is not reallistic
21:23 geekosaur if you want an unreliable data store, use a text file
21:24 bioduds it is, in my view, sticking to what exists for years because it exists for years
21:24 bioduds there are problems with this model for many huge role players out there
21:25 bioduds and that is why they came up with these new solutions
21:25 geekosaur yes, you always are doing something completely different
21:25 geekosaur that's why nosql has been rewriting itself into newsql ever since it was creared
21:26 bioduds now, rejecting it on the basis that it is not as reliable as the old ones is, in my view, turning your face away from the problem and pretending it doesn't exist
21:26 geekosaur this was, very literally and explicitly, "it's just key-value, how hard can it be?" followed by years of "...oh"
21:26 geekosaur it solves no problems
21:26 geekosaur except the "problem" that rdbms was reliable
21:27 Cabanossi joined #perl6
21:30 timotimo geekosaur: the term has to be NuSQL
21:31 tailgate How does one do something like **kwargs in python for a perl6 function?
21:32 ugexe *%args
21:33 bioduds geekosaur : I disagree
21:33 ugexe i thought that said kvargs, oopes
21:33 bioduds solves many problems
21:33 geekosaur ues, I noticed you disagrwee
21:33 bioduds :)
21:33 geekosaur you have not named a single problem it solves
21:33 bioduds respectfully, of course
21:33 bioduds scalability
21:33 bioduds I have
21:33 geekosaur scalability... what planet are you on
21:33 bioduds modelling after having huge data
21:34 bioduds re-modelling
21:34 bioduds these are real problems
21:34 geekosaur I grant postgresql has had scalability problems. rdbms in general does not
21:34 bioduds why didn't they make messenger in it?
21:34 geekosaur and keeps going long after every single one of your nosql solutions has encountered true big data
21:35 geekosaur and failed
21:35 bioduds why does google have big data, then?
21:35 geekosaur because they don;t want to pay for oracle
21:35 bioduds it does not work with sql
21:35 bioduds omg, oracle?
21:35 geekosaur riiight
21:35 bioduds nope
21:35 geekosaur yes, its useless completely
21:35 bioduds same problem with oracle
21:35 bioduds won't handle petabytes of user data like they need it to
21:36 geekosaur right
21:36 bioduds no sharding
21:36 geekosaur dude, financial folks handle bigger data than you have ever seen
21:36 bioduds it is a need that came to solve scalability problems
21:37 bioduds you seem not to grasp that point, really
21:37 geekosaur somehow oracle scales to handle it when nosql falls on its face
21:37 geekosaur I grasp it fine
21:37 geekosaur I say your big data is small potatoes
21:38 bioduds well, facebook, google, yahoo, paypal, stripe, ... , * seem to disagree with you
21:38 bioduds otherwise, they would simply put oracle to do the job
21:38 geekosaur nom, they wouldn;t because they don't want to pay for it
21:39 timotimo oracle is hella expensive
21:39 stmuk the KV stores are ok to store cookies or throw away information on free systems
21:39 bioduds geekosaur : that is naive, man
21:39 geekosaur facebook google etc. are infamous for scrounging out solutions with cheap hardware
21:39 geekosaur yes, you are painfully naive
21:39 timotimo and the way to find out how much you have to pay ... it's also hell
21:40 bioduds thinking that major players wouldn't go with the *best* cause it is expensive is naive, I believe
21:40 bioduds that is not how this game is played
21:40 stmuk data lost is acceptable for most facebook or google customers (they don't pay anything or have terms of service)
21:40 bioduds they have no data loss
21:40 bioduds they run on distributed machines
21:40 geekosaur that is exactly how the game is played
21:41 _slade_ joined #perl6
21:41 bioduds they may choose whether it is going to be consistent or not
21:41 geekosaur you can find this out very easily, there have beenendless articles about how google, amazon, facebook, etc. work
21:41 Woodi memcache is nice :)
21:41 firstdayonthejob joined #perl6
21:41 geekosaur it's all scrounging to build something quaireliable from the cheapest possible stuff
21:41 timotimo bioduds: in a world where people chant "worse is better", it makes sense not to go to oracle
21:42 timotimo also, when you start small, you'd have to have a crazy significant investment if you wanted to start with oracle
21:42 geekosaur google's pub;ished academic papers that say that right out as part of the problem they were trying to solve (for example figuring out a dirt cheap datacenter router without having to buy cisco)
21:42 AlexDaniel umm, I have a solution for you guys :)
21:42 bioduds well, anyhow, you are building these assumptions on stereotypes, I think.
21:42 Cabanossi joined #perl6
21:42 bioduds and not looking torwards the future
21:43 bioduds NoSQL is here to stay
21:43 geekosaur yes, history is nothing but a stereotype
21:43 geekosaur experience is nothing but a stereotype
21:43 timotimo i wonder how strong proponents of object databases were about their opinions
21:43 bioduds and to be better than old-school DBs
21:43 bioduds my opinion
21:43 bioduds I may be wrong of course
21:43 bioduds and I respect all your opinions as well
21:43 bioduds :)
21:43 AlexDaniel just refrain from working on systems that are even slightest bit complex, so that you can always just use a file system and that's it
21:43 * AlexDaniel hides
21:44 geekosaur watching youngsters throw out all the "stupid pointless" old stuff and then relearn the hard way over and over again why it was done that way, is something that has never happened and never will happen --- notwithstanding that you can ee it happening constantly, you habv deytermined it never will happen
21:44 stmuk is anyone testing much on *BSDs .. there is a report that installing panda on FreeBSD causes a moar core dump (which I've just seen on OpenBSD)
21:44 geekosaur oh, and knowledge is clearly just a stereotype too
21:49 timotimo i don't think any of you is going to convince anyone else of any opinion on that kind of stuff tonight
21:49 timotimo i suggest we just drop the topic
21:51 AlexDaniel is there any channel on freenode for holy wars?
21:52 stmuk all of them :)
21:52 AlexDaniel huggable: holy war :is: I don't think any of you is going to convince anyone else of any opinion on that kind of stuff tonight. I suggest we just drop the topic
21:52 huggable AlexDaniel, Added holy war as I don't think any of you is going to convince anyone else of any opinion on that kind of stuff tonight. I suggest we just drop the topic
21:53 AlexDaniel huggable: source
21:53 huggable AlexDaniel, See https://github.com/zoffixznet/huggable
21:53 tushar joined #perl6
21:54 tailgate So if I have a role Foo and class Bar does Foo, is bar a Foo?
21:54 AlexDaniel is it using sqlite or something?
21:54 tailgate is a Bar a Foo? Like the type objects
21:54 AlexDaniel m role Foo {}; class Bar does Foo {}; say Bar ~~ Foo
21:54 AlexDaniel m: role Foo {}; class Bar does Foo {}; say Bar ~~ Foo
21:54 camelia rakudo-moar 641ee1: OUTPUT«True␤»
21:55 AlexDaniel tailgate: does it answer your question?
21:55 tushar How to get an index of a specific element of an array? I was searching for a solution to it and found Gabor's article on it where he explained "grep-index" method. When I tried it I got an error saying that no method found.
21:56 tushar I have also found a reddit thread but it has no comments yet.
21:57 Zoffix joined #perl6
21:57 Zoffix first :k
21:57 yoleaux 18:45Z <moritz> Zoffix: if you're looking for a good project to use your super powers: Build a github bot that invites everybody to the perl6 org how gets a PR merged in a repo under the perl6 org
21:57 AlexDaniel m: my @x = <a b c d e f>; say @x.kv.reverse.Hash
21:57 camelia rakudo-moar 641ee1: OUTPUT«{a => 0, b => 1, c => 2, d => 3, e => 4, f => 5}␤»
21:58 AlexDaniel I wonder why we have no kv
21:58 Zoffix m: say <a b c d e>.first: :k, 'c'
21:58 camelia rakudo-moar 641ee1: OUTPUT«2␤»
21:58 AlexDaniel m: my @x = <a b c d e f>; say @x.first(‘c’):k
21:58 camelia rakudo-moar 641ee1: OUTPUT«2␤»
21:58 AlexDaniel Zoffix++
21:59 Zoffix moritz, that sounds like a pain in the ass to test :) Maybe next year
21:59 AlexDaniel tushar: but keep in mind that if you are planning to do a bunch of lookups like this it is probably a good idea to convert it to Hash
22:00 Zoffix m: my @i; <a b c d e>.first(:k, <c e>.any).map: {@i.push: $_}; dd @i
22:00 camelia rakudo-moar 641ee1: OUTPUT«Array @i = [2, 4]␤»
22:00 Zoffix HAH :D
22:00 Zoffix Junction abuse
22:01 _sfiguser joined #perl6
22:01 AlexDaniel committable6: releases my @i; <a b c d e>.first(:k, <c e>.any).map: {@i.push: $_}; dd @i
22:01 committable6 AlexDaniel, ¦«2015.10,2015.11»: Array $var = $[2]␤¦«2015.12,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07.1,2016.08.1»: Array @i = [2]␤¦«HEAD»: Array @i = [2, 4]
22:01 AlexDaniel huh?
22:01 Zoffix m: say gather { <a b c d e>.first(:k, <c e>.any).map: *.take }
22:01 camelia rakudo-moar 641ee1: OUTPUT«(2 4)␤»
22:01 AlexDaniel bisectable6: my @i; <a b c d e>.first(:k, <c e>.any).map: {@i.push: $_}; dd @i
22:01 bisectable6 AlexDaniel, Exit code is 0 on both starting points (good=2015.12 bad=c9b18c6), bisecting by using the output
22:01 Zoffix neat. Perl 6++
22:02 geekosaur heh
22:02 bisectable6oops joined #perl6
22:02 AlexDaniel don't worry, that's normal
22:02 tushar AlexDaniel, Zoffix, thanks.
22:04 Zoffix m: my @x = <a b c d e f>; say @x.kv
22:04 camelia rakudo-moar 641ee1: OUTPUT«(0 a 1 b 2 c 3 d 4 e 5 f)␤»
22:04 Zoffix m: my @x = <a b c d e f>; say @x.antipairs
22:04 camelia rakudo-moar 641ee1: OUTPUT«(a => 0 b => 1 c => 2 d => 3 e => 4 f => 5)␤»
22:04 bisectable6 joined #perl6
22:04 committable6 joined #perl6
22:04 AlexDaniel bisectable6: my @i; <a b c d e>.first(:k, <c e>.any).map: {@i.push: $_}; dd @i
22:04 bisectable6 AlexDaniel, Exit code is 0 on both starting points (good=2015.12 bad=c9b18c6), bisecting by using the output
22:04 Zoffix m: my @x = <a b c d e f>; say @x.antipairs<c>.say
22:04 camelia rakudo-moar 641ee1: OUTPUT«Type Seq does not support associative indexing.␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
22:04 Zoffix m: my @x = <a b c d e f>; say @x.antipairs.hash<c>
22:04 camelia rakudo-moar 641ee1: OUTPUT«2␤»
22:05 bisectable6 joined #perl6
22:05 AlexDaniel come on!
22:05 AlexDaniel bisectable6: my @i; <a b c d e>.first(:k, <c e>.any).map: {@i.push: $_}; dd @i
22:05 bisectable6 AlexDaniel, Exit code is 0 on both starting points (good=2015.12 bad=c9b18c6), bisecting by using the output
22:05 AlexDaniel DO IT
22:05 bisectable6 joined #perl6
22:05 AlexDaniel bisectable6: my @i; <a b c d e>.first(:k, <c e>.any).map: {@i.push: $_}; dd @i
22:05 bisectable6 AlexDaniel, Exit code is 0 on both starting points (good=2015.12 bad=c9b18c6), bisecting by using the output
22:05 bisectable6 AlexDaniel, bisect log: https://gist.github.com/bf56609dd63f2a6c50a058a98eccf4cc
22:05 bisectable6 AlexDaniel, (2016-08-23) https://github.com/rakudo/rakudo/commit/157b46e
22:05 AlexDaniel thank you very much
22:06 AlexDaniel Zoffix: so what does it mean?
22:07 Zoffix AlexDaniel, what what means?
22:08 itaipu joined #perl6
22:08 timotimo might want to have a test for this case?
22:09 Zoffix It's not thread safe
22:09 Zoffix No idea about gather/take one
22:10 Zoffix star: my @i; <a b c d e>.first(:k, <c e>.any).map: {@i.push: $_}; dd @i
22:10 camelia star-m 2016.04: OUTPUT«Array @i = [2]␤»
22:10 Zoffix star: my @i; <a b c d e>.first(:k, <c e>.any).map: {say "non-juncted"}; dd @i
22:10 camelia star-m 2016.04: OUTPUT«non-juncted␤Array @i = []␤»
22:10 Zoffix star: my @i; <a b c d e>.first(:k, <c e>.any).map: {say "$_: non-juncted"}; dd @i
22:10 camelia star-m 2016.04: OUTPUT«2: non-juncted␤Array @i = []␤»
22:10 Zoffix Seems like Junctions were simply broken in the past
22:11 Zoffix star: my @i; <a b c d e>.first(:k, <c e>.any).say
22:11 camelia star-m 2016.04: OUTPUT«2␤»
22:11 pecastro joined #perl6
22:11 Zoffix Oh wait. They *got* broken. Since we're asking for ANY of the first ones
22:11 Zoffix star: my @i; <a b c d e>.first(:k, <c e>.all).say
22:11 camelia star-m 2016.04: OUTPUT«Nil␤»
22:11 AlexDaniel yeah
22:12 AlexDaniel well, how can .first return more than one element, uh?
22:13 Zoffix Well, it'd return a Junction
22:13 Zoffix m: sub foo ($x) { say $x+2 }; say foo 2|3
22:13 camelia rakudo-moar 641ee1: OUTPUT«4␤5␤any(True, True)␤»
22:13 Zoffix star: sub foo ($x) { say $x+2 }; say foo 2|3
22:13 camelia star-m 2016.04: OUTPUT«4␤5␤any(True, True)␤»
22:14 Zoffix m: say <a b c d e>.first(<c e>.any)
22:14 camelia rakudo-moar 641ee1: OUTPUT«any(c, e)␤»
22:14 AlexDaniel committable6: 2015.12,HEAD <a b c d b e>.first(‘b’).say
22:14 Zoffix star: say <a b c d e>.first(<c e>.any)
22:14 camelia star-m 2016.04: OUTPUT«c␤»
22:14 committable6 AlexDaniel, ¦«2015.12,HEAD»: b
22:14 AlexDaniel committable6: 2015.12,HEAD <a b c d b e>.first(/b/).say
22:14 committable6 AlexDaniel, ¦«2015.12,HEAD»: b
22:14 AlexDaniel committable6: 2015.12,HEAD <a b c d b e>.first(any ‘b’).say
22:14 committable6 AlexDaniel, ¦«2015.12»: b␤¦«HEAD»: any(b)
22:15 AlexDaniel I guess that I just don't get it
22:15 masak Zoffix: why would it return a junction if you don't pass a junction into it?
22:15 AlexDaniel committable6: 2015.12,HEAD <a b c d b e>.first(‘b’|‘a’).say
22:15 committable6 AlexDaniel, ¦«2015.12»: a␤¦«HEAD»: any(b, a)
22:16 masak wouldn't that be extremely surprising if it did that?
22:16 Zoffix masak, but we do
22:16 wamba star: my @i;  <a b c d e>.first(<c e>.any):k.say
22:16 camelia star-m 2016.04: OUTPUT«2␤»
22:16 Zoffix It can be argued both ways, I think. Either you get a Junction of several results, or the Junction argument gets used to mean that you want it to use as a matcher
22:16 wamba m: my @i;  <a b c d e>.first(<c e>.any):k.say
22:16 camelia rakudo-moar 641ee1: OUTPUT«any(2, 4)␤»
22:16 cyphase joined #perl6
22:16 masak I'm fine with it working like every other method *if a junction is passed in*.
22:17 AlexDaniel committable6: 2015.12,HEAD <a b c d b e>.first(/b|a/).say
22:17 committable6 AlexDaniel, ¦«2015.12,HEAD»: a
22:17 masak but maybe I misunderstood what you were saying above, then.
22:17 Zoffix m: my @i;  say <a b c d e>.first(<c e>.any, :)
22:17 camelia rakudo-moar 641ee1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3 @i;  say <a b c d e>.first(<c e>.any, :7⏏5)␤    expecting any of:␤        colon pair␤»
22:17 Zoffix m: my @i;  say <a b c d e>.first(<c e>.any)
22:17 camelia rakudo-moar 641ee1: OUTPUT«any(c, e)␤»
22:17 Zoffix masak, ^ <c e>.any is a Junction
22:17 Zoffix I'm also fine with it working like every other method
22:18 timotimo we're really hoping to use a matcher there, i think
22:18 masak aye
22:18 masak ok, now I'm in agreement, I think
22:18 timotimo so i'd want it to behave just like * ~~ any <c e> would
22:18 masak .grep uses a matcher, and so .first ought to also
22:18 Zoffix m: my @i;  say <a b c d e>.grep(<c e>.any)
22:18 camelia rakudo-moar 641ee1: OUTPUT«(c e)␤»
22:18 Zoffix ¯\_(ツ)_/¯
22:19 * Zoffix is too tired for it
22:19 Zoffix left #perl6
22:19 AlexDaniel committable6: 2015.12,HEAD <a b c d b e>.first(/b|a/, :end).say
22:19 committable6 AlexDaniel, ¦«2015.12,HEAD»: b
22:19 AlexDaniel committable6: 2015.12,HEAD <a b c d b e>.first(‘b’|‘a’, :end).say
22:19 committable6 AlexDaniel, ¦«2015.12»: b␤¦«HEAD»: any(b, a)
22:19 AlexDaniel committable6: 2015.12,HEAD <a b c d b e>.first(‘b’|‘a’).say
22:19 committable6 AlexDaniel, ¦«2015.12»: a␤¦«HEAD»: any(b, a)
22:22 AlexDaniel ok, let's see…
22:22 * AlexDaniel is starting to rakudobug it
22:22 masak 'night, #perl6
22:23 AlexDaniel if some sane behavior was changed just like that, should I call it a regression?
22:23 timotimo hmm, would we only call it a regression if it broke a test?
22:24 AlexDaniel no, because otherwise it wouldn't have existed
22:26 BenGoldberg m: <a b c d b e>.first(* ~~ ‘b’|‘a’).say
22:26 camelia rakudo-moar 641ee1: OUTPUT«a␤»
22:26 BenGoldberg bisectable: <a b c d b e>.first(* ~~ ‘b’|‘a’).say
22:26 AlexDaniel timotimo: for example, there was no test for #129296, but so what? My legit code got broken, so it sounds like a regression
22:26 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=129296
22:26 AlexDaniel bisectable6: <a b c d b e>.first(* ~~ ‘b’|‘a’).say
22:26 bisectable6 AlexDaniel, On both starting points (good=2015.12 bad=c9b18c6) the exit code is 0 and the output is identical as well
22:26 bisectable6 AlexDaniel, Output on both points: a
22:27 timotimo fair enough
22:27 BenGoldberg bisectable: <c d b e>.first(* ~~ ‘b’|‘a’).say
22:27 BenGoldberg m: <c d b e>.first(* ~~ ‘b’|‘a’).say
22:27 camelia rakudo-moar 641ee1: OUTPUT«b␤»
22:27 AlexDaniel BenGoldberg: it is now bisectable6
22:27 AlexDaniel BenGoldberg: it is now or just bisect:
22:27 BenGoldberg m: <c d e f>.first(* ~~ ‘b’|‘a’).say
22:27 camelia rakudo-moar 641ee1: OUTPUT«Nil␤»
22:27 BenGoldberg m: <c d e f>.first(‘b’|‘a’).say
22:27 camelia rakudo-moar 641ee1: OUTPUT«any(Nil, Nil)␤»
22:28 BenGoldberg m: <c d e f>.first(‘b’|‘a’).so.say
22:28 camelia rakudo-moar 641ee1: OUTPUT«False␤»
22:28 mule joined #perl6
22:28 mule left #perl6
22:31 BenGoldberg m: <c d e f>.first(‘b’|‘a’, :k).say
22:31 camelia rakudo-moar 641ee1: OUTPUT«any(Nil, Nil)␤»
22:31 BenGoldberg m: <a c d e f>.first(‘b’|‘a’, :k).say
22:31 camelia rakudo-moar 641ee1: OUTPUT«any(Nil, 0)␤»
22:31 BenGoldberg m: <a c d e f>.first(‘b’|‘a’, :kv).say
22:31 camelia rakudo-moar 641ee1: OUTPUT«any(Nil, (0 a))␤»
22:31 BenGoldberg m: <a c d e f v>.first(‘b’|‘a’, :kv).say
22:31 camelia rakudo-moar 641ee1: OUTPUT«any(Nil, (0 a))␤»
22:31 BenGoldberg m: <a c d e f b>.first(‘b’|‘a’, :kv).say
22:31 camelia rakudo-moar 641ee1: OUTPUT«any((5 b), (0 a))␤»
22:35 BenGoldberg m: ('a', 42, 'b', 22/7, 'c').first(Int|Rat, :kv).say
22:35 camelia rakudo-moar 641ee1: OUTPUT«any((1 42), (3 3.142857))␤»
22:35 BenGoldberg m: ('a', 42, 'b', 22/7, 'c', 23).first(Int|Rat, :kv).say
22:35 camelia rakudo-moar 641ee1: OUTPUT«any((1 42), (3 3.142857))␤»
22:35 BenGoldberg m: ('a', 42, 'b', 22/7, 'c', 23).first(Int|Rat, :kv, :end).say
22:35 camelia rakudo-moar 641ee1: OUTPUT«any((5 23), (3 3.142857))␤»
22:36 BenGoldberg According to the docs, "Autothreading is what happens if you pass a Junction to a subroutine that expects a parameter of type Any or a subtype thereof (such as anything Cool)"
22:37 timotimo that's right
22:37 BenGoldberg Which means that *if* the $matcher argument of method .first were specced as an Any, or a Cool, etc, then the results that we are getting would be correct.
22:38 BenGoldberg Except that $matcher is a Mu, and therefor autothreading should not happen.
22:38 BenGoldberg m: first( Int|Rat, ['a', 42, 'b', 22/7, 'c', 23], :kv, :end).say
22:38 camelia rakudo-moar 641ee1: OUTPUT«any((5 23), (3 3.142857))␤»
22:40 BenGoldberg What do you suppose could be causing the autothreading to happen?
22:43 BenGoldberg s: List, 'first'
22:43 SourceBaby BenGoldberg, Something's wrong: ␤ERR: Type check failed in binding to &code; expected Callable but got Method+{<anon|46968048>} (Method+{<anon|4696804...)␤  in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42␤  in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33␤  in block <unit> at -e
22:43 BenGoldberg s: List, 'first', Mu
22:43 SourceBaby BenGoldberg, Something's wrong: ␤ERR: Cannot resolve caller sourcery(List, Str, Mu); none of these signatures match:␤    ($thing, Str:D $method, Capture $c)␤    ($thing, Str:D $method)␤    (&code)␤    (&code, Capture $c)␤  in block <unit> at -e line 6␤␤
22:44 bioduds Please, what should I do if a module does not install on panda?
22:44 BenGoldberg s: List, 'first', \(Int|Rat)
22:44 SourceBaby BenGoldberg, Sauce is at https://github.com/rakudo/rakudo/blob/641ee1e/src/core/Any-iterable-methods.pm#L1180
22:44 timotimo bioduds: you could open an issue on its issue tracker for example
22:45 bioduds on modules.perl6.org ?
22:45 timotimo well, you find the repo from there
22:45 KotH joined #perl6
22:46 bioduds here? https://github.com/MARTIMM/mongo-perl6-driver/issues
22:46 AlexDaniel #129304
22:46 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=129304
22:47 AlexDaniel bioduds: yes
22:47 bioduds okeydokey, just did
22:47 bioduds thanks
22:48 BenGoldberg Aha!  https://github.com/rakudo/rakudo/blob/641ee1e/src/core/Any-iterable-methods.pm#L1185 and https://github.com/rakudo/rakudo/blob/641ee1e/src/core/Any-iterable-methods.pm#L1201 both have a parameter $test, which is not prototyped as Mu!
22:53 ugexe bioduds: if you read the error you see its OpenSSL causing the problem
22:53 ugexe and that you need to install openssl libs through your package manager
22:53 bioduds ok
22:54 bioduds let me try it
22:54 timotimo >_>
22:54 timotimo it spewed the error at you like five times
22:55 timotimo of course panda's backtrace for the "the test run didn't succeed" thing is pretty big and useless
22:59 bioduds code highlighting for perl6 in IDEs may become a challenge
23:00 bioduds I downloaded Perl Plugin for NetBeans and it is getting confused
23:00 bioduds with kebab case for instance
23:00 BenGoldberg .first fudgeup, now rakudobug-ed.
23:00 bioduds and also with unicode characters
23:01 BenGoldberg That's cause perl and perl6 are two differnt languages.
23:01 BenGoldberg Although it should not be having any trouble with the unicode, as perl5 also accepts unicode source programs.
23:02 bioduds for instance, $prédio will stop highlighting on é
23:02 BenGoldberg bioduds, does your NetBeans thing comprehend any unicode at all?  It might not have anything to do with the syntax highlighter, as such, and simply be a poor choice of tool.
23:03 ugexe it shouldnt be that big of a surprise that invalid perl5 syntax highlights funny using a perl5 syntax highlighter
23:03 firstdayonthejob joined #perl6
23:04 bioduds it is expected, for me. I believe it will be hard to have it corrected or even created for some IDEs i guess
23:04 bioduds since the whole idea is quite odd
23:04 BenGoldberg The following is perfectly valid perl5 code: use utf8; my $prédio = 3;
23:04 BenGoldberg (and it's valid perl6 code, too)
23:04 bioduds yep
23:04 bioduds stops highlighting though
23:05 BenGoldberg If your syntax hilighter has problems with that, it's not *our* fault, but that of the author of the syntax hilighter.
23:05 bioduds kebab case also, for instance, $some-var stops highlighting on -var
23:05 BenGoldberg Find out who wrote it, and complain to them.
23:05 timotimo yeah, that part would be expected
23:06 bioduds sure, man, I'm just mentioning, I believe you are all interested in all that is going on related to Perl6
23:06 BenGoldberg $some-var is only valid perl5, and is not valid perl6, so it's not unsurprising that a perl5 syntax hilighter parses it wrong.
23:06 BenGoldberg Err, tr/56/65/ :)
23:07 ugexe my $some = 1; sub thing { 0 }; print $some-thing
23:10 BenGoldberg Heh.  But a proper perl5 syntax hiliter should display $some-thing with a different color for each of $some, subtraction, and thing.
23:12 AlexDaniel perl6-mode in emacs is above my expectations, by the way
23:12 AlexDaniel for example it recognizes curly quotes
23:13 wamba joined #perl6
23:13 AlexDaniel BenGoldberg: am I in your ignore list or something?
23:14 firstdayonthejob joined #perl6
23:14 bpmedley joined #perl6
23:15 BenGoldberg No?
23:15 BenGoldberg But I'm slightly multitasking.
23:15 AlexDaniel BenGoldberg: #129304
23:15 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=129304
23:20 _slade_ joined #perl6
23:24 BenGoldberg Cool :)
23:25 lambd0x joined #perl6
23:25 lambd0x Hi everyone!
23:27 lambd0x m: sub a([$first, *@tmp]) {say $first; }; my @a = <1 2 3>; a @a;
23:27 camelia rakudo-moar 641ee1: OUTPUT«1␤»
23:29 lambd0x I was wondering is there a way to get instead of the first el, the last el. above?
23:31 timotimo https://docs.perl6.org/routine/first
23:38 ugexe in the signature? or just in general?
23:38 ugexe m: my @a = <1 2 3>; say @a.tail
23:38 camelia rakudo-moar 641ee1: OUTPUT«(3)␤»
23:38 AlexDaniel m: my @a = <1 2 3>; say @a.head
23:38 camelia rakudo-moar 641ee1: OUTPUT«(1)␤»
23:38 lambd0x ugexe: in the signature really
23:38 AlexDaniel ah you mean like [*@tmp, $last] ? hm
23:39 lambd0x AlexDaniel: Ideally, yes.
23:39 lambd0x I tried it actually ahaha
23:40 AlexDaniel m: sub a(*@tmp) { my $last = @tmp.tail; say $last; }; my @a = <1 2 3>; a @a
23:40 camelia rakudo-moar 641ee1: OUTPUT«(3)␤»
23:40 telex joined #perl6
23:40 AlexDaniel this is not too bad actually
23:41 AlexDaniel hmm I think there is a way
23:45 AlexDaniel nah, no
23:45 AlexDaniel I was hoping for something like this
23:45 AlexDaniel m: sub a(@array(**, $z)) { say @_; }; my @a = <1 2 3>; a @a
23:45 camelia rakudo-moar 641ee1: OUTPUT«5===SORRY!5===␤Shape declaration with () is reserved;␤  please use whitespace if you meant a subsignature for unpacking,␤  or use the :() form if you meant to add signature info to the function's type␤at <tmp>:1␤------> 3sub a(@array7⏏5(…»
23:48 ugexe m: my @a = <1 2 3>; say @a.tail; say @a.roll # dunno why no-arg .tail returns a seq but no-arg roll/pick return an item
23:48 camelia rakudo-moar 641ee1: OUTPUT«(3)␤1␤»
23:49 lambd0x AlexDaniel: sad :/
23:50 lambd0x ugexe: I'm also curious about that, I used that feature for .pick: * and it worked so nicely with that kind of signature above :D
23:50 AlexDaniel ugexe: while .tail and .roll with arg return a seq. Indeed, weird
23:51 ugexe the roll/pick not returning a seq with no args (which differs from .pick(1) .roll(1)) was said to be expected when i asked. so no arg tail doesnt match that
23:51 AlexDaniel ugexe: will you rakudobug this?
23:53 AlexDaniel m: sub a(@array (@*a;; $z)) { say $z }; my @a = <1 2 3>; a @a; say ‘hello’
23:53 camelia rakudo-moar 641ee1: OUTPUT«cannot stringify this␤  in sub a at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
23:53 AlexDaniel cannot stringify what…
23:54 ugexe s/@*a/*@a/
23:56 AlexDaniel ugexe: I know. But it should be smarter than me

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

Perl 6 | Reference Documentation | Rakudo