Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-08-20

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:04 bjz joined #perl6
00:16 lambd0x joined #perl6
00:17 lambd0x Hello everyone!
00:20 timotimo greetings lambd0x
00:34 MilkmanDan joined #perl6
00:41 tadzik joined #perl6
00:56 unmatched} m: my $a = "10000000"; say $a.flip.comb(3).reverse».flip.join(',')
00:56 camelia rakudo-moar 4674f1: OUTPUT«10,000,000␤»
00:58 BenGoldberg joined #perl6
01:02 unmatched} m: my $a = "10000000.42424242424"; $_[0].flip.comb(3).join(',').flip.&[~]('.' ~ $_[1]).say given $a.split('.')
01:02 camelia rakudo-moar 4674f1: OUTPUT«10,000,000.42424242424␤»
01:03 grondilu m: say 100000000.subst(/\d ** 3/, ",$/", :g)
01:03 camelia rakudo-moar 4674f1: OUTPUT«Use of Nil in string context  in block <unit> at <tmp> line 1␤,,,␤»
01:03 grondilu m: say 100000000.subst(/\d ** 3/, ",{$/ // "?"}", :g)
01:03 camelia rakudo-moar 4674f1: OUTPUT«,?,?,?␤»
01:04 unmatched} m: say 100000000.subst(/\d ** 3/, {",$/"}, :g)
01:04 camelia rakudo-moar 4674f1: OUTPUT«,100,000,000␤»
01:04 unmatched} m: say 100000000.subst(/\d ** 3/, {~$/ ?? "" !! ",$/"}, :g)
01:04 camelia rakudo-moar 4674f1: OUTPUT«␤»
01:05 grondilu maybe with the position adverb.  Forgot the syntax.
01:06 grondilu m: say 100000000.subst(/\d ** 3/, ", {",$/"}, :g)
01:06 camelia rakudo-moar 4674f1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in double quotes; couldn't find final '"' ␤at <tmp>:1␤------> 0000000.subst(/\d ** 3/, ", {",$/"}, :g)7⏏5<EOL>␤    expecting any of:␤        horizontal whitespace…»
01:06 grondilu wth
01:06 grondilu m: say 100000000.subst(/\d ** 3/, {",$/"}, :g)
01:06 camelia rakudo-moar 4674f1: OUTPUT«,100,000,000␤»
01:07 grondilu m: say 100000000.subst(rx:c(1)/\d ** 3/, {",$/"}, :g)
01:07 camelia rakudo-moar 4674f1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Adverb c not allowed on rx␤at <tmp>:1␤------> 3say 100000000.subst(rx:c(1)/\d ** 3/7⏏5, {",$/"}, :g)␤»
01:07 grondilu m: say 100000000.subst(m:c(1)/\d ** 3/, {",$/"}, :g)
01:07 camelia rakudo-moar 4674f1: OUTPUT«Method 'match' not found for invocant of class 'Any'␤  in block <unit> at <tmp> line 1␤␤»
01:07 grondilu m: say 100000000.subst(m:c(1)/(\d ** 3)/, {",$0"}, :g)
01:07 camelia rakudo-moar 4674f1: OUTPUT«Method 'match' not found for invocant of class 'Any'␤  in block <unit> at <tmp> line 1␤␤»
01:08 grondilu m: say 100000000.subst(/(\d ** 3)+$$/, $0.join(','))
01:08 camelia rakudo-moar 4674f1: OUTPUT«Use of Nil in string context  in block <unit> at <tmp> line 1␤␤»
01:08 grondilu m: say 100000000.subst([/\d ** 3]+$$/, "X")
01:08 camelia rakudo-moar 4674f1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse regex; couldn't find final '/'␤at <tmp>:1␤------> 3say 100000000.subst([/\d ** 37⏏5]+$$/, "X")␤    expecting any of:␤        infix stopper␤»
01:08 grondilu m: say 100000000.subst(/[/\d ** 3]+$$/, "X")
01:08 camelia rakudo-moar 4674f1: OUTPUT«5===SORRY!5===␤Null regex not allowed␤at <tmp>:1␤------> 3say 100000000.subst(/[7⏏5/\d ** 3]+$$/, "X")␤Unable to parse expression in metachar:sym<[ ]>; couldn't find final ']' ␤at <tmp>:1␤------> 3say 100000000.subst(/[7⏏5/\d ** …»
01:08 grondilu m: say 100000000.subst(/[\d ** 3]+$$/, "X")
01:08 camelia rakudo-moar 4674f1: OUTPUT«X␤»
01:09 grondilu m: say 100000000.subst(/[\d ** 3]+$$/, $/)
01:09 camelia rakudo-moar 4674f1: OUTPUT«Use of Nil in string context  in block <unit> at <tmp> line 1␤␤»
01:09 grondilu wth
01:09 grondilu how can $/ be Nil in a subst??
01:10 grondilu m: say 100000000.subst(/[\d ** 3]+$$/, {$/})
01:10 camelia rakudo-moar 4674f1: OUTPUT«100000000␤»
01:10 grondilu m: say 100000000.subst(/[\d ** 3]+$$/, {$/.join(',')})
01:10 camelia rakudo-moar 4674f1: OUTPUT«␤»
01:10 M-Illandan joined #perl6
01:10 Matthew[m] joined #perl6
01:10 grondilu m: say 100000000.subst(/(\d ** 3)+$$/, {$0.join(',')})
01:10 camelia rakudo-moar 4674f1: OUTPUT«100,000,000␤»
01:10 grondilu ah
01:11 timotimo is it because of the curly block getting $_ and not $/ ?
01:11 idiosyncrat_ joined #perl6
01:11 timotimo we've had that problem for some time
01:11 timotimo that we can't properly set a $/ in there
01:12 grondilu m: say 10000000000.subst: /(\d ** 3)+$$/, {$0.join(',')}
01:12 camelia rakudo-moar 4674f1: OUTPUT«10000,000,000␤»
01:12 grondilu damn
01:12 timotimo huh, why doesn't that work?
01:12 grondilu m: say 10000000000.subst: /(\d ** 3)+$$/, {"=> " ~ $0.join(',')}
01:12 camelia rakudo-moar 4674f1: OUTPUT«10=> 000,000,000␤»
01:12 timotimo oh, duh :)
01:13 timotimo how about an empty match ta the beginning?
01:13 grondilu m: say 10000000000.subst: /(\d ** {1,3})+$$/, {$0.join(',')}
01:13 camelia rakudo-moar 4674f1: OUTPUT«10,00,00,00,0,00␤»
01:13 grondilu :facepalm:
01:13 timotimo :D :D :D
01:13 grondilu m: say 10000000000.subst: /(\d ** {1,3})+$$/, .join(',')}
01:13 camelia rakudo-moar 4674f1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unexpected closing bracket␤at <tmp>:1␤------> 00.subst: /(\d ** {1,3})+$$/, .join(',')7⏏5}␤»
01:13 grondilu m: say 10000000000.subst: /(\d ** {1,3})+$$/, *.join(',')
01:13 camelia rakudo-moar 4674f1: OUTPUT«10 00 00 00 0 00␤»
01:14 grondilu m: say 10000000000.subst: /(\d ** {1..3})+$$/, *.join(',')
01:14 camelia rakudo-moar 4674f1: OUTPUT«100 000 000 00␤»
01:14 timotimo oh, we don't warn on ** {1,3}?
01:14 pierre_ joined #perl6
01:14 grondilu apparently not
01:14 grondilu seems fine not to though
01:14 tailgate I have a question about unit module Foo; sub bar ($baz) is export {$baz;} .  if you use Foo; in a file should bar be avalaible as Foo::bar() or just bar() ?
01:15 timotimo should be just bar
01:15 grondilu if it's exported it's just bar()
01:16 grondilu m: module Foo { sub bar is export {} }; import Foo; bar;
01:16 camelia rakudo-moar 4674f1: ( no output )
01:17 grondilu m: say 10000000000.subst: /(\d ** 3)+$$/, { ','~ .join(',') }
01:17 camelia rakudo-moar 4674f1: OUTPUT«10,000 000 000␤»
01:18 grondilu m: say 10000000000.subst: /(\d ** 3)+$$/, { ','~ $/.join(',') }
01:18 camelia rakudo-moar 4674f1: OUTPUT«10,000 000 000␤»
01:18 grondilu m: say 1_000.subst: /(\d ** 3)+$$/, { ','~ .join(',') }
01:18 camelia rakudo-moar 4674f1: OUTPUT«1,000␤»
01:18 grondilu m: say 1_000_000.subst: /(\d ** 3)+$$/, { ','~ .join(',') }
01:18 camelia rakudo-moar 4674f1: OUTPUT«1,000 000␤»
01:19 grondilu m: say 1_000_000.subst: /(\d ** 3)+$$/, { ','~ .list.join(',') }
01:19 camelia rakudo-moar 4674f1: OUTPUT«1,000 000␤»
01:19 grondilu m: say 1_000_000.subst: /(\d ** 3)+$$/, { ','~ .perl }
01:19 camelia rakudo-moar 4674f1: OUTPUT«1,Match.new(ast => Any, list => ([Match.new(ast => Any, list => (), hash => Map.new(()), orig => "1000000", to => 4, from => 1), Match.new(ast => Any, list => (), hash => Map.new(()), orig => "1000000", to => 7, from => 4)],), hash => Map.new(()), orig => …»
01:19 grondilu m: say 1_000_000.subst: /(\d ** 3)+$$/, { ','~ .list.perl }
01:19 camelia rakudo-moar 4674f1: OUTPUT«1,([Match.new(ast => Any, list => (), hash => Map.new(()), orig => "1000000", to => 4, from => 1), Match.new(ast => Any, list => (), hash => Map.new(()), orig => "1000000", to => 7, from => 4)],)␤»
01:19 * grondilu shrugs
01:20 kalkin- joined #perl6
01:21 pierre_ joined #perl6
01:28 grondilu m: say 1_000_000.subst: /(\d ** 3)+$$/, { ','~ .[].perl }
01:28 camelia rakudo-moar 4674f1: OUTPUT«1,Match.new(ast => Any, list => ([Match.new(ast => Any, list => (), hash => Map.new(()), orig => "1000000", to => 4, from => 1), Match.new(ast => Any, list => (), hash => Map.new(()), orig => "1000000", to => 7, from => 4)],), hash => Map.new(()), orig => …»
01:28 grondilu m: say 1_000_000.subst: /(\d ** 3)+$$/, { ','~ .[] }
01:28 camelia rakudo-moar 4674f1: OUTPUT«1,000000␤»
01:29 grondilu m: say 1_000_000.subst: /(\d ** 3)+$$/, { ','~ .[].join(',') }
01:29 camelia rakudo-moar 4674f1: OUTPUT«1,000 000␤»
01:29 timotimo tbh
01:29 timotimo i'd totally use comb for this
01:29 timotimo m: say 1_000_000.flip.comb(/\d ** 3/).join(",").flip
01:29 camelia rakudo-moar 4674f1: OUTPUT«000,000␤»
01:29 timotimo whoops, that discards the rest
01:29 timotimo m: say 1_000_000.flip.comb(/\d ** {1..3}/).join(",").flip
01:29 camelia rakudo-moar 4674f1: OUTPUT«1,000,000␤»
01:29 timotimo there we go
01:29 timotimo can you try to break that?
01:31 grondilu m: say 10_000_000.flip.comb(/\d ** {1..3}/).join(",").flip
01:31 camelia rakudo-moar 4674f1: OUTPUT«10,000,000␤»
01:31 grondilu m: say 100_000_000.flip.comb(/\d ** {1..3}/).join(",").flip
01:31 camelia rakudo-moar 4674f1: OUTPUT«100,000,000␤»
01:31 grondilu I can't break it
01:31 timotimo cool
01:31 grondilu I don't get why the subst didn't work though
01:32 timotimo well, for one you're forcing it to be digits until the end of the string
01:32 timotimo i'm surprised it even works properly with _ in the middle
01:32 timotimo er, i mean
01:32 timotimo that it does anything much
01:32 grondilu m: say '1_000' ~~ /\d+/
01:32 camelia rakudo-moar 4674f1: OUTPUT«「1」␤»
01:33 grondilu m: say 1000000.subst: /(\d ** 3)+$$/, { ','~ .[].join(',') }
01:33 camelia rakudo-moar 4674f1: OUTPUT«1,000 000␤»
01:33 grondilu ^I don't get where this space comes from
01:33 grondilu m: say 1000000.subst: /(\d ** 3)+$$/, { ','~ .[0].join(',') }
01:33 camelia rakudo-moar 4674f1: OUTPUT«1,000,000␤»
01:33 grondilu ah
01:33 grondilu m: say 100000000000.subst: /(\d ** 3)+$$/, { ','~ .[0].join(',') }
01:33 camelia rakudo-moar 4674f1: OUTPUT«,100,000,000,000␤»
01:34 grondilu *
01:37 bjz joined #perl6
01:39 timotimo hah! :)
01:40 timotimo oh, that's not my code, though :)
01:40 timotimo but you can just <!after ^^>
01:46 grondilu m: say 100000000000.subst: /(.*)(\d ** 3)+$$/, { ','~ .[].join(',') }
01:46 camelia rakudo-moar 4674f1: OUTPUT«,100000000,000␤»
01:46 grondilu m: say 100000000000.subst: /(.*)(\d ** 3)+$$/, { ','~ .[0,1].join(',') }
01:46 camelia rakudo-moar 4674f1: OUTPUT«,100000000,000␤»
01:46 grondilu m: say 100000000000.subst: /(.*?)(\d ** 3)+$$/, { ','~ .[0,1].join(',') }
01:46 camelia rakudo-moar 4674f1: OUTPUT«,,100 000 000 000␤»
01:46 grondilu m: say 100000000000.subst: /(.*?)(\d ** 3)+$$/, { ','~ (.[0],.[1]).join(',') }
01:46 camelia rakudo-moar 4674f1: OUTPUT«,,100 000 000 000␤»
01:46 grondilu m: say 100000000000.subst: /(.*?)(\d ** 3)+$$/, { .[0] ~ ',' ~ .[1].join(',') }
01:46 camelia rakudo-moar 4674f1: OUTPUT«,100,000,000,000␤»
01:46 grondilu damn it
01:46 grondilu I guess I'm dumb
01:46 timotimo no, no, look at this
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:47 grondilu m: say 1000000000.subst: /<!before ^^>(\d ** 3)+$$/, { ','~.[0].join(',') }
01:47 camelia rakudo-moar 4674f1: OUTPUT«1,000,000,000␤»
01:47 grondilu m: say 100000000.subst: /<!before ^^>(\d ** 3)+$$/, { ','~.[0].join(',') }
01:47 camelia rakudo-moar 4674f1: OUTPUT«100,000,000␤»
01:47 grondilu yeah, works.
01:48 bjz joined #perl6
01:48 grondilu I don't quite understand though.  Nevermind.
02:02 idiosyncrat_ left #perl6
02:05 tailgate what is the diffrence between sub foo(**@args) and sub foo (*@args) ?
02:08 wamba joined #perl6
02:08 ugexe m: sub foo1(*@a) { say @a.perl }; sub foo2(**@a) { say @a.perl }; foo1([1,2,3,4]); foo2([1,2,3,4])
02:08 camelia rakudo-moar 4674f1: OUTPUT«[1, 2, 3, 4]␤[[1, 2, 3, 4],]␤»
02:12 noganex_ joined #perl6
02:41 xdbr joined #perl6
02:52 MilkmanDan joined #perl6
02:53 vcv m: 100_000_000.comb.reverse.rotor(3, :partial)>>.join.join(',').comb.reverse.join
02:53 camelia rakudo-moar 4674f1: ( no output )
02:53 vcv m: 100_000_000.comb.reverse.rotor(3, :partial)>>.join.join(',').comb.reverse.join.say
02:53 camelia rakudo-moar 4674f1: OUTPUT«100,000,000␤»
02:53 vcv Complete overkill
02:55 vcv m: 100_000_000.comb.reverse.rotor(3, :partial)>>.join.join(',').flip.say
02:55 camelia rakudo-moar 4674f1: OUTPUT«100,000,000␤»
02:57 vcv m: 100_000_000.flip.comb.rotor(3, :partial)>>.join.join(',').flip.say
02:57 camelia rakudo-moar 4674f1: OUTPUT«100,000,000␤»
03:02 TimToady joined #perl6
03:05 grondilu well you know what they say.  "If it's worth doing, it's worth overdoing."
03:10 jack_rabbit joined #perl6
03:13 labster joined #perl6
03:21 japhb I'm getting a 'Malformed UTF-8' error trying to read binary output from a program using Proc::Async.new(...).stdout(:bin).tap({ ... }).  Shouldn't that be impossible in :bin mode?
03:23 pierre_ joined #perl6
03:25 canopus joined #perl6
03:32 bjz joined #perl6
04:05 sQuEE joined #perl6
04:18 Cabanossi joined #perl6
04:35 kurahaupo joined #perl6
04:36 zostay m: say 5 ≥ 2;
04:36 camelia rakudo-moar 4674f1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3say 57⏏5 ≥ 2;␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement modifier␤        stateme…»
04:37 zostay sad face
04:37 frew m: use utf8; say 5 ≥ 2;
04:37 camelia rakudo-moar 4674f1: OUTPUT«===SORRY!===␤utf8 is a builtin type, not an external module␤»
04:37 frew m: use unicode; say 5 ≥ 2;
04:37 camelia rakudo-moar 4674f1: OUTPUT«===SORRY!===␤Could not find unicode at line 1 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-2/share/perl6/site␤    /home/camelia/rakudo-m-inst-2/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-2/share/perl6␤    CompUnit::Repos…»
04:37 frew blah
04:38 frew zostay: I thought you had to opt in to the non-texas operators :)
04:39 zostay no, there just isn't those... i was thinking of patching to add support for ⁄ (that's U+2044, not /), but since not even ≤ or ≥ are there, i'm not sure if it'd be wanted
04:39 frew oh wait I think it was called golf mode
04:39 frew m: use golf; say 5 ≥ 2;
04:39 camelia rakudo-moar 4674f1: OUTPUT«===SORRY!===␤Could not find golf at line 1 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-2/share/perl6/site␤    /home/camelia/rakudo-m-inst-2/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-2/share/perl6␤    CompUnit::Reposito…»
04:39 zostay wrong channel for that discussion though
04:40 geekosaur the decision was made that stuff like that belongs in the ecosystem, not in core
04:40 kurahaupo m: sub inline:«≥»($a,$b) { return $a >= $b }; say 2 ≥ 2;
04:40 camelia rakudo-moar 4674f1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot add tokens of category 'inline'␤at <tmp>:1␤------> 3sub inline:«≥»7⏏5($a,$b) { return $a >= $b }; say 2 ≥ 2;␤»
04:40 geekosaur I think a module exists, but it's not a pragma like that
04:40 geekosaur you wanted infix:
04:41 kurahaupo ah, yes
04:41 kurahaupo m: sub infix:«≥»($a,$b) { return $a >= $b }; say 2 ≥ 2;
04:41 camelia rakudo-moar 4674f1: OUTPUT«True␤»
04:41 kurahaupo yay
04:43 zostay m: sub infix:<⁄>($a, $b) { return $a / $b }; say -⁷⁄₃;
04:43 camelia rakudo-moar 4674f1: OUTPUT«-2.333333␤»
04:45 zostay m: say -2.3Ì…
04:45 camelia rakudo-moar 4674f1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤'3̅' is not a valid number␤at <tmp>:1␤------> 3say -2.3̅7⏏5<EOL>␤»
04:45 zostay i also have a perverse desire for that to be a number in perl 6
05:17 wamba joined #perl6
05:28 ghih joined #perl6
05:31 CIAvash joined #perl6
05:45 CIAvash zostay, frew: http://irclog.perlgeek.de/perl6/2016-01-09#i_11859391
05:48 BenGoldberg m: my &≥ := &[>=];
05:48 camelia rakudo-moar 4674f1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Name must begin with alphabetic character␤at <tmp>:1␤------> 3my &7⏏5≥ := &[>=];␤    expecting any of:␤        constraint␤        infix␤        infix stopper␤        postfix␤        s…»
05:49 BenGoldberg m: my &infix<<≥>> := &[>=];
05:49 camelia rakudo-moar 4674f1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Shaped variable declarations not yet implemented. Sorry. ␤at <tmp>:1␤------> 3my &infix<<≥>>7⏏5 := &[>=];␤»
05:53 CIAvash ShimmerFairy: ↑
05:53 ShimmerFairy m: my &infix:<<≥>> := &[>=];
05:53 camelia rakudo-moar 4674f1: ( no output )
05:56 CIAvash ShimmerFairy: I was refering to the link, I saw these operators were mentioned in #perl6-dev too http://irclog.perlgeek.de/perl6/2016-01-09#i_11859391
05:59 ShimmerFairy ah
06:08 darutoko joined #perl6
06:10 bjz joined #perl6
06:13 dalek doc: a04a945 | titsuki++ | predefined-search-items:
06:13 dalek doc: Add ;; (long name) to the list of the predefined-search-items
06:13 dalek doc: review: https://github.com/perl6/doc/commit/a04a94501a
06:13 dalek doc: 7c190ed | titsuki++ | predefined-search-items:
06:13 dalek doc: Merge pull request #846 from titsuki/add-predefined-search-item
06:13 dalek doc:
06:13 dalek doc: Add ;; (long name) to the list of the predefined-search-items
06:13 dalek doc: review: https://github.com/perl6/doc/commit/7c190ed606
06:14 TheLemonMan joined #perl6
06:23 pierre_ joined #perl6
06:30 smls joined #perl6
06:35 jack_rabbit left #perl6
06:41 domidumont joined #perl6
06:46 domidumont joined #perl6
06:47 pRiVi_ joined #perl6
06:48 notostraca joined #perl6
06:49 rjbs- joined #perl6
06:49 [Coke]_ joined #perl6
06:49 MilkmanD1n joined #perl6
06:49 erdic_ joined #perl6
06:49 alnewkir1 joined #perl6
06:49 ilmari_ joined #perl6
06:49 TheDir_ joined #perl6
06:49 smash_ joined #perl6
06:50 maddingu1 joined #perl6
06:50 sQuEE` joined #perl6
06:51 jnap__ joined #perl6
06:51 rafl_ joined #perl6
06:52 PotatoGim_ joined #perl6
06:53 simcop2387_ joined #perl6
06:55 xdbr joined #perl6
06:56 Fleurety_ joined #perl6
06:57 Spot__ joined #perl6
06:59 BuildTheRobots joined #perl6
07:00 erdic_ joined #perl6
07:08 firstdayonthejob joined #perl6
07:11 rindolf joined #perl6
07:17 cognominal joined #perl6
07:19 pierre_ joined #perl6
07:21 Wiertek joined #perl6
07:35 pierre_ joined #perl6
07:43 cognominal joined #perl6
07:49 zengargoyle joined #perl6
07:53 pierre_ joined #perl6
07:55 rba__ joined #perl6
07:57 pierre_ joined #perl6
08:00 rba_ joined #perl6
08:06 xdbr joined #perl6
08:08 dalek joined #perl6
08:09 dalek perl6-most-wanted: 2ede61c | (Jeffrey Goff)++ | most-wanted/modules.md:
08:09 dalek perl6-most-wanted: Put Perl6::Tidy into play, reserve namespace
08:09 dalek perl6-most-wanted: review: https://github.com/perl6/perl6-most-wanted/commit/2ede61c2ac
08:09 dalek perl6-most-wanted: d687238 | drforr++ | most-wanted/modules.md:
08:09 dalek perl6-most-wanted: tyop
08:09 dalek perl6-most-wanted: review: https://github.com/perl6/perl6-most-wanted/commit/d687238433
08:09 dalek perl6-most-wanted: 18f6f36 | drforr++ | most-wanted/modules.md:
08:09 dalek perl6-most-wanted: Merge pull request #35 from drforr/jgoff-perl6-tidy
08:09 dalek perl6-most-wanted:
08:09 dalek perl6-most-wanted: Add Perl6::Tidy as WIP
08:09 dalek perl6-most-wanted: review: https://github.com/perl6/perl6-most-wanted/commit/18f6f36663
08:18 pierre_ joined #perl6
08:39 AlexDaniel joined #perl6
08:40 bisectable6 joined #perl6
08:48 xdbr joined #perl6
08:55 andrzejku joined #perl6
09:29 simcop2387 joined #perl6
10:04 wamba joined #perl6
10:27 darutoko- joined #perl6
10:31 m0ltar joined #perl6
10:39 hankache joined #perl6
10:40 hankache hello #perl6
10:40 yoleaux 13 Aug 2016 16:35Z <TimToady> hankache: the original motivation for making $ assignment tighter than @ assignment was actually so that things like loop ($i = 100, $j = 0; $i; --$i, ++$j) {} would work the way C/P5 people expect, while not requiring parens on @foo = 1,2,3
10:40 mvorg joined #perl6
10:40 hankache what is the status of panda vs zef?
11:00 araujo joined #perl6
11:23 rindolf joined #perl6
11:55 smls joined #perl6
11:58 hankache joined #perl6
11:59 nadim joined #perl6
12:20 bjz_ joined #perl6
12:28 tomboy65 joined #perl6
12:56 pochi m: https://gist.github.com/anonymous/5bb458d515c1a49d6bcf58173fd5801f
12:56 camelia rakudo-moar c201a7: OUTPUT«Nil␤»
12:57 pochi why would the grammar fail to parse? Can I not nest ('xxx' % 'seperators')-rules?
13:07 domidumont joined #perl6
13:08 nadim hi, installed P6 and panda from git repo. after boostrap, panda says "add path xxxx to PATH", but it's completely empty in that directory. what am I doing wrong?
13:10 unmatched} nothing, that's the dir where dist binaries will go to when you install them with panda
13:11 xinming_ joined #perl6
13:11 smls pochi: The default <ws> (whitespace rule) makes the <line> rule eat the newline and spaces that follow it
13:13 smls pochi: Either define your own <ws> that only takes horizontal whitespace, or use `token` instead of `rule` and manually match whitespace everywhere it's allowed
13:14 RabidGravy joined #perl6
13:14 AlexDaniel bisect: my $foo = True; END say $foo
13:14 bisectable6 AlexDaniel, Exit code is 0 on both starting points (good=2015.12 bad=6e84a5e), bisecting by using the output
13:14 bisectable6 AlexDaniel, bisect log: https://gist.github.com/96d6959a1cc0a44302c2ec3180a362e5
13:14 bisectable6 AlexDaniel, (2016-08-03) https://github.com/rakudo/rakudo/commit/5e61516
13:15 AlexDaniel it's great to stumble upon bugs that are already fixed
13:15 * AlexDaniel runs ï½¢rakudobrew build moarï½£
13:16 sena_kun joined #perl6
13:25 zakharyas joined #perl6
13:26 Actualeyes joined #perl6
13:29 jameslenz joined #perl6
13:31 pochi smls: thanks for looking into my little conundrum. I've tried to change it into a token instead of rule, but I'm not sure how to add the whitespace...
13:32 smls Add  \h*  I guess
13:32 pochi smls: removing whitespace from the input string makes it match though
13:32 nadim unmatched}:  and how does panda install itself? isn't bootstraping enough, does one need to copy something aor changes paths?
13:32 smls \h matches a horizontal whitespace character
13:33 pochi I thought this was a set pattern: 'string'+ % 'separator', where am I allowed to "interrupt" it (so to speak) with whitespace rules?
13:38 unmatched} nadim: no idea. I use zef, 'cause it's better :)
13:39 unmatched} pochi: that may be:    ['string' ]+ % 'separator'
13:41 smls pochi: mith `rule` and explicit \h* and \s* where needed, it matches: https://gist.github.com/smls/622180c2b721ae78b07932a4466097e2
13:42 smls but it's ugly, of course
13:42 smls *with
13:42 unmatched} m: https://gist.github.com/smls/622180c2b721ae78b07932a4466097e2
13:42 camelia rakudo-moar c201a7: OUTPUT«「␤block {␤   line␤   line & line␤   line␤}␤」␤ definition => ï½¢block {␤   line␤   line & line␤   line␤}␤」␤  line => ï½¢line」␤  line => ï½¢   line & line」␤  line => ï½¢   line」␤»
13:43 pochi smls: ah, everything becomes tokens. I misunderstood, and thought you meant only the last line-rule needed to change
13:44 wamba joined #perl6
13:44 unmatched} m: https://gist.github.com/zoffixznet/1e4e52152e906470531f7ab8b92d6f21
13:44 camelia rakudo-moar c201a7: OUTPUT«「␤block {␤   line␤   line & line␤   line␤}␤」␤ definition => ï½¢block {␤   line␤   line & line␤   line␤}␤」␤  line => ï½¢line␤   」␤  line => ï½¢line & line␤   」␤  line => ï½¢line␤」␤»
13:45 smls pochi: Yeah, it seems `rule` (i.e. :sigspace) also matches whitespace after the separator of `<element>+ % <sep> `
13:45 smls It's explained in-depth here: http://design.perl6.org/S05.html#line_1147
13:45 smls kinda confusing, tbh
13:47 MilkmanDan joined #perl6
13:47 pochi smls: thank you :-)
13:55 MilkmanDan joined #perl6
14:01 harmil joined #perl6
14:03 smls pochi: Here's a variant with custom <ws> and explicitly matching newlines where they are allowed: https://gist.github.com/smls/2c8d4439ab82b450647435f203699904
14:04 harmil .tell geekosaur WRT Range.new, no if you look at Range.pm, the ..^ op definitely calls Range.new with min, max and excludes-max. It's not clear to me why doing so from user code doesn't work...
14:04 yoleaux harmil: I'll pass your message to geekosaur.
14:04 smls pochi: Of course, this <ws> is not as smart as the default one, which actually *requires* whitespace between tokens that have word characters at the boundary.
14:05 pochi smls: but that is redefining an already existing rule (<ws>)? So it would affect the entire grammar?
14:06 smls yes
14:06 harmil m: my $min = 0; my $max = 3; my $excludes-max = True; say Range.new($min, $max, :$excludes-max).excludes-max;
14:06 camelia rakudo-moar c201a7: OUTPUT«True␤»
14:07 harmil Oh, man, that's unfair! It was failing last night!
14:07 unmatched} :)
14:07 harmil m: say Range.new(:excludes-min(True)).excludes-min
14:07 camelia rakudo-moar c201a7: OUTPUT«False␤»
14:08 harmil Only with excludes-min perhaps?!
14:08 unmatched} s: &<^..>
14:08 unmatched} s: &infix:<^..>
14:08 unmatched} oh bot is ded
14:08 harmil long live bot
14:08 harmil m: my $min = 0; my $max = 3; my $excludes-min = True; say Range.new($min, $max, :$excludes-min).excludes-min;
14:08 camelia rakudo-moar c201a7: OUTPUT«True␤»
14:09 harmil dafuq?
14:09 harmil m: say Range.new(:max(0), :min(2), :excludes-min(True)).excludes-min
14:09 camelia rakudo-moar c201a7: OUTPUT«False␤»
14:09 unmatched} m: Range.new(:excludes-min).excludes-min.say
14:09 camelia rakudo-moar c201a7: OUTPUT«False␤»
14:09 unmatched} m: Range.new(:2min, :4max, :excludes-min).excludes-min.say
14:09 camelia rakudo-moar c201a7: OUTPUT«False␤»
14:10 harmil oh, I had a typo....
14:10 harmil m: my $min = 0; my $max = 3; my $excludes-min = True; say Range.new(:$min, :$max, :$excludes-min).excludes-min;
14:10 camelia rakudo-moar c201a7: OUTPUT«False␤»
14:11 harmil So, if you try to pass $min, $max positionally it fails. That's useful. I'll look into that later.
14:11 harmil Off to give tours...
14:11 unmatched} Oh, right, min max aren't pos
14:11 unmatched} *named
14:11 unmatched} m: Range.new(2, 4, :excludes-min).excludes-min.say
14:11 camelia rakudo-moar c201a7: OUTPUT«True␤»
14:12 bjz joined #perl6
14:13 SourceBaby joined #perl6
14:13 unmatched} m: Range, "new", \(:excludes-min)
14:13 camelia rakudo-moar c201a7: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant string "new" in sink context (lines 1, 1)␤»
14:13 unmatched} s: Range, "new", \(:excludes-min)
14:13 SourceBaby unmatched}, Sauce is at https://github.com/rakudo/rakudo/blob/c201a76/src/core/Mu.pm#L90
14:14 unmatched} s: Range, "new", \(:42min, :45max)
14:14 SourceBaby unmatched}, Sauce is at https://github.com/rakudo/rakudo/blob/c201a76/src/core/Mu.pm#L90
14:15 unmatched} harmil: basically, if you try to pass min/max as named args, you call the default contructor, and it doesn't set :excludes-min because it's a private attribute. You need to pass min/max as positionals
14:26 kentnl joined #perl6
14:27 MilkmanDan joined #perl6
14:34 khw joined #perl6
14:38 skids joined #perl6
14:46 BenGoldberg joined #perl6
14:50 kurahaupo joined #perl6
14:52 kentnl joined #perl6
14:52 kentnl joined #perl6
15:10 pierre_ joined #perl6
15:15 dLeCamarae joined #perl6
15:16 Ven joined #perl6
15:18 mohae joined #perl6
15:27 canopus joined #perl6
15:37 pmurias joined #perl6
15:38 pmurias timotimo: what's the status of your PR?
15:39 MilkmanDan joined #perl6
15:40 TheLemonMan pmurias, thanks for merging the PR o/
15:41 smls m: say (1/3).fmt("%.20f")
15:41 camelia rakudo-moar c201a7: OUTPUT«0.33333333333333300000␤»
15:42 smls ^^ Is there a way to get an exact decimal representation of a Rat to 20 decimal places without floating-point errors?
15:42 pmurias TheLemonMan: thanks for fixing things \o
15:44 aries_liuxueyang joined #perl6
15:45 TheLemonMan pmurias, if you have some time could you please read the #170? I have a possible fix ready but need some input (and apparently you're not in #perl6-dev, the proliferation of channels isn't that nice heh)
15:49 BenGoldberg m: my num64 $i = 1; $i /= 3; printf "%.20f", $i;
15:49 camelia rakudo-moar c201a7: OUTPUT«This type cannot unbox to a native number: P6opaque, Int␤  in block <unit> at <tmp> line 1␤␤»
15:50 BenGoldberg m: my num64 $i = 1; $i /= 3e0; printf "%.20f", $i;
15:50 camelia rakudo-moar c201a7: OUTPUT«This type cannot unbox to a native number: P6opaque, Int␤  in block <unit> at <tmp> line 1␤␤»
15:50 BenGoldberg m: my num64 $i = 1; $i /= 3e0; $i.WHAT.say;
15:50 camelia rakudo-moar c201a7: OUTPUT«This type cannot unbox to a native number: P6opaque, Int␤  in block <unit> at <tmp> line 1␤␤»
15:50 BenGoldberg m: my num64 $i = 1; $i /= 3e0; printf "%.20f", Num.new($i);
15:50 camelia rakudo-moar c201a7: OUTPUT«This type cannot unbox to a native number: P6opaque, Int␤  in block <unit> at <tmp> line 1␤␤»
15:51 BenGoldberg m: my num64 $i = 1; printf "%.20f", Num.new($i);
15:51 camelia rakudo-moar c201a7: OUTPUT«This type cannot unbox to a native number: P6opaque, Int␤  in block <unit> at <tmp> line 1␤␤»
15:51 BenGoldberg m: my num64 $i = 1e0; printf "%.20f", Num.new($i);
15:51 camelia rakudo-moar c201a7: OUTPUT«1.00000000000000000000»
15:51 BenGoldberg m: my num64 $i = 1e0; $i /= 3e0; printf "%.20f", Num.new($i);
15:51 camelia rakudo-moar c201a7: OUTPUT«0.33333333333333300000»
15:53 BenGoldberg smls, Doing printf with %f will, by definition, always convert to a machine native floating point value.
15:54 BenGoldberg m: (1/3).base-repeating(10).perl.say;
15:54 camelia rakudo-moar c201a7: OUTPUT«("0.", "3")␤»
15:54 Khisanth joined #perl6
15:55 BenGoldberg You could probably take the return value of .base-repeating, and use x on the second part to make the output as long as you want.
15:55 grondilu $ perl Configure.pl --gen-moar --gen-nqp --backends=moar --prefix=/usr/local/
15:55 grondilu error: pathspec '2016.08' did not match any file(s) known to git.
15:55 grondilu Command failed (status 256): git checkout 2016.08
15:56 smls m: say (1/3).base(10, 20)
15:56 camelia rakudo-moar c201a7: OUTPUT«0.33333333333333333333␤»
15:56 smls BenGoldberg: Or that ^^ :)
15:57 smls I didn't even know about those methods.
15:57 BenGoldberg Oh, I didn't see that, thanks :)
16:00 BenGoldberg m: pi.Rat(2**(-53)).nude.say;
16:00 camelia rakudo-moar c201a7: OUTPUT«(245850922 78256779)␤»
16:00 BenGoldberg m: pi.Rat(2**(-64)).nude.say;
16:00 camelia rakudo-moar c201a7: OUTPUT«(245850922 78256779)␤»
16:01 BenGoldberg m: sub ratify(Num $n is copy) { my $s = sign($n) or return 0.Rat; $n .= abs; my $denom = 2**(53-log( $n, 2 ).Int); $s * ($n*$denom).Int / $denom }; say ratify(pi).nude
16:01 camelia rakudo-moar c201a7: OUTPUT«(884279719003555 281474976710656)␤»
16:01 BenGoldberg m: pi.Rat(2**(-128)).nude.say;
16:01 camelia rakudo-moar c201a7: OUTPUT«(245850922 78256779)␤»
16:02 BenGoldberg m: pi.Rat(1e-3).nude.say;
16:02 camelia rakudo-moar c201a7: OUTPUT«(333 106)␤»
16:05 smls Also didn't know that the .Rat coercers takes a precision argument...
16:07 smls m: Rat(pi, 2**-64).nude
16:07 camelia rakudo-moar c201a7: ( no output )
16:07 smls m: say Rat(pi, 2**-64).nude
16:07 camelia rakudo-moar c201a7: OUTPUT«(2 1)␤»
16:07 smls Doesn't exactly work with the function-like form
16:08 BenGoldberg m: say Rat.new(pi, 2**-64).nude
16:08 camelia rakudo-moar c201a7: OUTPUT«Type check failed in binding to nu; expected Int but got Num (3.14159265358979e0)␤  in block <unit> at <tmp> line 1␤␤»
16:10 Dunearhp joined #perl6
16:18 Dunearhp joined #perl6
16:30 nadim perl6 -Ilib bin/zef install . core dumps on my box, any way to help debug that?
16:52 cuonglm joined #perl6
16:53 RabidGravy just discovered that rakudo builds far more quickly on a RPi if you set gpu_mem=16 in the boot config
16:53 cuonglm Hi, anyone got trouble when building 2016.08 rakudo release from source
16:54 cuonglm I got `error: pathspec '2016.08' did not match any file(s) know to git
16:57 cuonglm Sounds like git history was overriden
16:57 cuonglm The commit of release https://github.com/perl6/nqp/commit/944cf37c95a0a8a5c9cfb45acec52953683d5eb2
16:57 cuonglm did not match the one in git history
16:58 cuonglm https://github.com/perl6/nqp/commit/2164cccd0d72f2fc1472fdb8d9c85748277c0f35
17:00 AndyBotwin joined #perl6
17:00 Zoffix joined #perl6
17:00 Zoffix Oh crap
17:00 Zoffix cuonglm, curious, how did you build it?
17:01 Zoffix Maybe I should do a 2016.08.1 :/
17:02 cuonglm Zoffix: I just `git pull`, `perl Configure.pl "--gen-moar" "--gen-nqp" "--backends=moar" "--prefix=/usr/local/stow/perl6"`
17:02 cuonglm as I usual do
17:03 cuonglm THe latest commit https://github.com/perl6/nqp/commit/ca75b3ecb8fd3f23c6016bcee32461ffa836747a
17:03 cuonglm was pushed after the commit of release
17:03 cuonglm maybe it rewrote the history :|
17:03 Zoffix cuonglm, yeah, I messed up the tag. I basically tagged, then did git pull --rebase to bring in commits from the repo and that doesn't actually update the tag.
17:04 cuonglm Zoffix: Why don't remove the invalid release and push a new one
17:04 Zoffix cuonglm, the invalid tag you mean?
17:04 cuonglm This one https://github.com/perl6/nqp/commit/944cf37c95a0a8a5c9cfb45acec52953683d5eb2
17:05 cuonglm which doesn't exist in main tree anymore
17:05 Zoffix Right. So what happens if I just delete the tag and add a new one again, with the same name?
17:05 itaipu joined #perl6
17:05 Zoffix Basically, I discussed it elsewhere and I was told changing tags like that is a Bad Idea.
17:06 Zoffix And Rakudo actually does build from scratch. I'm unsure why it doesn't with just `git pull` :/
17:07 cuonglm Zoffix: Because the tag release commit does not exist from source anymore, so `git pull` did not bring you the tag
17:09 cuonglm Zoffix: From rakudo source, try: `(cd nqp; git tag --list | grep 2016)
17:09 cuonglm and you can see `2016.08` was missed in that list
17:09 cuonglm and you can see `2016.08` was missed in that output
17:10 Zoffix I do have it: https://gist.github.com/zoffixznet/3f9b7118d6cc287a768235092422a3eb
17:10 pecastro_ joined #perl6
17:10 petercommand joined #perl6
17:11 Zoffix OK. I'm gonna do a 2016.08.1 'cause I'm not 100% sure just changing the tag will fix everything and won't introduce new problems.
17:13 cuonglm because you are the one create the tag
17:13 cuonglm show the tag exists in your local
17:13 cuonglm Can you try with a new clone from github
17:14 Zoffix cuonglm, works just fine. But if I do a `git pull` on one of my older checkout then I have the same issue as you
17:15 cuonglm Zoffix: I also did it on my older checkout
17:15 Zoffix I wonder if the Rakudo release is fine as it is, and we can just bump NQP
17:16 * Zoffix does that first
17:17 cuonglm I don't know what logic is used to determine the wanted nqp version
17:17 domidumont joined #perl6
17:18 cuonglm quick read from `Configure.pl` show that it read from `tools/build/NQP_REVISION`
17:18 Zoffix Just this file: https://github.com/rakudo/rakudo/blob/nom/tools/build/NQP_REVISION
17:24 Zoffix commitable: HEAD say 'hello'
17:24 Zoffix committable6, HEAD say 'hello'
17:24 committable6 Zoffix, ¦«HEAD»: hello
17:25 Zoffix committable6, HEAD dd [ $*PERL.compiler.version, $*VM.version ]
17:25 committable6 Zoffix, ¦«HEAD»: [v2016.07.1.220.g.6.e.84.a.5.e, v2016.07.17.g.40948.f.6]
17:29 Zoffix (half-way through the release; just running the test suite)
17:33 BenGoldberg bisectable6, dd [ $*PERL.compiler.version, $*VM.version ]
17:33 bisectable6 BenGoldberg, Exit code is 0 on both starting points (good=2015.12 bad=6e84a5e), bisecting by using the output
17:33 bisectable6 BenGoldberg, bisect log: https://gist.github.com/1db5fa9c38776953bf82424e42f33f9c
17:33 bisectable6 BenGoldberg, (2015-12-25) https://github.com/rakudo/rakudo/commit/07fecb5
17:41 zacts joined #perl6
17:45 timotimo pmurias: i'm not sure which PR you're asking about
17:49 canopus joined #perl6
17:51 llfourn joined #perl6
17:53 pmurias timotimo: https://github.com/perl6/nqp/pull/283
17:55 timotimo oh. no clue
17:55 timotimo i think it needs some decision what to expose it to rakudo as
17:55 timotimo or maybe that'd be a thing the optimizer would do? not sure
17:56 timotimo BBIAB
17:56 Zoffix cuonglm, if you `git pull` it should work now
17:56 cuonglm Zoffix; Yes, building it :+1:
18:08 prussian joined #perl6
18:19 shlomif joined #perl6
18:21 timotimo pmurias: i think the pr is good to merge, because it doesn't damage anything. however, someone would have to implement the same thing for the JVM first, i expect :)
18:21 timotimo (and then javascript)
18:41 canopus joined #perl6
18:46 pmurias timotimo: I can implement it on the js backend if it will be useful for rakudo
18:49 pmurias timotimo: can't it be implemented on the moarvm backend first?
18:52 pmurias timotimo: the jvm backend has a broken implementation of that which I can fix up
18:53 pmurias timotimo: isn't that op just an explicit version of the implicit int to num conversion?
19:16 cognominal joined #perl6
19:17 AlexDaniel joined #perl6
19:18 ItayAlmog joined #perl6
19:20 timotimo yup
19:22 thundergnat joined #perl6
19:24 thundergnat Hi all you sixy people.
19:24 ZoffixLappy joined #perl6
19:24 ZoffixLappy \o \o
19:24 mls joined #perl6
19:25 timotimo hey you
19:26 mst ZoffixLappy: I always think there needs to be a gif of a cat attempting to lap your head
19:26 ZoffixLappy :)
19:28 thundergnat I have a perl6 problem that has been baffling me.
19:29 timotimo go on?
19:29 thundergnat I have a string containing ASCII characters that MAY contain "escape sequences" (\ followed by another character)
19:29 thundergnat However, the only escapes that are legal in my case are \n and \\. I need to detect any non-valid escapes and deal with them.
19:29 thundergnat But I haven't been able to come up with a regex to detect a string that contains any escape sequence other than \n or \\.
19:29 thundergnat m: for < \ / b t m n >  -> $i { say '  \\' ~ $i, ' ', not qq|\\$i| ~~ m:r/ \\ <?before <-[n\\]>> / }
19:29 camelia rakudo-moar a07a2e: OUTPUT«  \\ False␤  \/ False␤  \b False␤  \t False␤  \m False␤  \n True␤»
19:30 thundergnat \n is detected (True) but \\ isn't
19:30 timotimo i'm not sure why you use a <?before> there and not the char class directly
19:31 thundergnat Like how?
19:31 timotimo m: for < \ / b t m n >  -> $i { say '  \\' ~ $i, ' ', not qq|\\$i| ~~ m:r/ \\ <-[n\\]> / }
19:31 camelia rakudo-moar a07a2e: OUTPUT«  \\ True␤  \/ False␤  \b False␤  \t False␤  \m False␤  \n True␤»
19:32 timotimo oddly enough that also accepts \\
19:32 dataangel If you don't have to around function arguments, and functions can take a variable number of arguments, how does the parser know one an argument list ends?
19:33 dataangel * have to put () around
19:33 timotimo dataangel: you have to use parens if you want an argument list to end
19:34 thundergnat timotimo: yeah, that may be why I started getting more intricate. (\\\ also matching)
19:35 timotimo ah, of course
19:35 timotimo my brain is pretty tired right now. not sure if i'll get to something better any time soon
19:36 thundergnat thanks for looking
19:38 timotimo it'd be good if your test code also had some examples for \\\n and such
19:38 TimToady dataangel: or use an operator that is looser than list ops
19:39 timotimo TimToady: say sum 1, 2, 3 (what goes here?), "lol" # can you drop to another sub's/listop's arglist?
19:39 lizmat joined #perl6
19:39 thundergnat timotimo: Actually \\n would be legal. Its \\ followed by n.
19:39 timotimo right
19:39 timotimo does the code i last gave you do that properly?
19:40 TimToady m: say sum 1, 2, 3 and say 4
19:40 camelia rakudo-moar a07a2e: OUTPUT«6␤4␤»
19:40 timotimo i don't let that count :)
19:40 geekosaur dataangel, functions can have prototypes. but if a function's prototype involves +@something then it eats all remaining parameters; you have to use parentheses to delimit in that case
19:40 yoleaux 14:04Z <harmil> geekosaur: WRT Range.new, no if you look at Range.pm, the ..^ op definitely calls Range.new with min, max and excludes-max. It's not clear to me why doing so from user code doesn't work...
19:40 dataangel What is the equivalent of a while loop? Repeat looks like a do while loop but I want just a regular while loop (Where condition is checked even the first time)
19:40 thundergnat timotimo: It seems to, I just need to trap \\\ now.
19:41 geekosaur someone already answered that message
19:41 TimToady you can't drop just stop one level of argument though
19:41 dataangel geekosaur: makes sense thanks
19:41 timotimo right, that's what i meant :)
19:42 labster joined #perl6
19:42 geekosaur dataangel, while exises
19:42 thundergnat timotimo:  Wait, no, that works the way I want. timotimo++
19:42 geekosaur https://docs.perl6.org/language/control#while,_until
19:43 harmil Where is $_ implicitly used in Perl 6? I can think of three cases: .foo method invocation, when and bare regexes.
19:43 dataangel Oh I was looking here which doesn't have it: https://en.wikibooks.org/wiki/Perl_6_Programming/Control_Structures#Loops
19:43 MilkmanDan joined #perl6
19:43 arnsholt harmil: I think it's also passed to for loops (and if, IIRC)
19:44 arnsholt m: if('foo') { .say } # ?
19:44 camelia rakudo-moar a07a2e: OUTPUT«5===SORRY!5===␤Word 'if' interpreted as 'if()' function call; please use whitespace instead of parens␤at <tmp>:1␤------> 3if7⏏5('foo') { .say } # ?␤Unexpected block in infix position (two terms in a row)␤at <tmp>:1␤------> 3if('foo')…»
19:44 harmil arnsholt: yes, but that's not a use. I'm trying to list the places that $_ is the implicit input ala Perl 5
19:44 arnsholt Oh, right
19:44 zakharyas joined #perl6
19:44 Idiosyncrat joined #perl6
19:44 arnsholt In that case, I'd count .foo as half an implicit (per TheDamian)
19:45 geekosaur I think the wikibook is pretty out of date and not being maintained?
19:45 arnsholt That prefix dot is explicit after all, it's just very tiny =)
19:45 harmil It's my claim that this list for P5: http://www.perlmonks.org/?node_id=606237 drops down to three cases, but I want to be sure.
19:45 harmil arnsholt: Yep, I'm linking to Damian's keynote for that bit
19:46 TimToady m: $_ = "foo"; tr/a..z/A..Z/; .say
19:46 camelia rakudo-moar a07a2e: OUTPUT«FOO␤»
19:47 Idiosyncrat I've been reading Noam Chomsky's linguistics stuff and I have a question for Larry for when and if he'd care to address it.
19:47 harmil TimToady: Thanks. That's four (kind of related to bare regex, but worth calling out)
19:47 Idiosyncrat Was his training either structuralist or Chomskyan?
19:47 Idiosyncrat I don't recall him addressing that in any of his talks, etc.
19:49 Idiosyncrat Perl 5 and especially Perl 6 seem structuralist in their underlying outlook, but that's just a wild guess.
19:49 timotimo thundergnat: i'm glad :)
19:50 TimToady Larry is a tagmemicist
19:50 DrForr Wow, a bunch of new faces. I've gotta stay up later more often :)
19:51 * harmil saves https://en.wikipedia.org/wiki/Tagmeme for later reading
19:51 dataangel I know there is a set type, but is there a way in the type system to express a set of a particular type? So I can restrict a function to only take sets of Foos?
19:52 Idiosyncrat Gives me something to look up.  Thanks!
19:52 Idiosyncrat Reading Chomsky for the 1st time I realized that, without knowing it, I've been a Chomskyan all these years.
19:53 Idiosyncrat It comes from having learned parsing in the 1970's, when a Chomskyan framework was simply assumed.
19:54 ZoffixLappy dataangel, I think that's what my $s = Set[Type].new: ... would do
19:54 ZoffixLappy m: my $s = Set[Str].new: 'a', 'b', 'c';
19:54 camelia rakudo-moar a07a2e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Set cannot be parameterized␤at <tmp>:1␤------> 3my $s = Set[Str]7⏏5.new: 'a', 'b', 'c';␤»
19:54 ZoffixLappy Oh. Never mind then
19:54 ZoffixLappy m: my $s = Hash[Str].new: 'a', 'b', 'c';
19:54 camelia rakudo-moar a07a2e: OUTPUT«Odd number of elements found where hash initializer expected:␤Found 3 (implicit) elements:␤Last element seen: "c"␤  in block <unit> at <tmp> line 1␤␤»
19:54 ZoffixLappy m: my $s = Hash[Str].new: 'a', 1, 'c', 2;
19:54 camelia rakudo-moar a07a2e: ( no output )
19:54 ZoffixLappy m: my $s = Hash[Str].new: 'a', 1, 42, 2;
19:54 camelia rakudo-moar a07a2e: ( no output )
19:54 ZoffixLappy :/
19:55 ZoffixLappy (it coerces it?)
19:57 TimToady apparently, but it shouldn't, unless you use Str()
19:58 dataangel So that's a bug?
19:58 dataangel Also why can't set be parameterized?
19:59 TimToady we're kinda waiting for a real object-key hash implementation, I suspect
20:00 TimToady but yeah, sets are presumably a valid kind of functor that should have a functor type
20:02 dataangel It also feels a little weird that there are two container types that have a special sigil, arrays and hashes, but then for set I use the scaler sigil
20:04 TimToady my %foo := set <a b c>; say %foo
20:04 TimToady m: my %foo := set <a b c>; say %foo
20:04 camelia rakudo-moar a07a2e: OUTPUT«set(a, c, b)␤»
20:04 TimToady they have more affinity to hashes than arrays, since they're unordered
20:05 dataangel Now I'm really confused O_o https://docs.perl6.org/type/Set uses $
20:05 dataangel So can you just use any sigil you want or...?
20:05 TimToady you can use $ on anything that you want to treat as a singular item
20:05 TimToady even if it's plural inside
20:06 dataangel What does it mean to "treat" it as a singular item? Is there a behavior difference?
20:06 ZoffixLappy m: my %hash = <a b c d>; my $also-hash = %hash; dd $also-hash
20:06 camelia rakudo-moar a07a2e: OUTPUT«Hash $also-hash = ${:a("b"), :c("d")}␤»
20:06 dataangel dafuq
20:06 ZoffixLappy dataangel, basically @ and % are not about hashes or arrays but about giving you a Positional/Associative role as well
20:06 ZoffixLappy (or something along those lines, I don't fully understand that yet myself)
20:07 TimToady m: my $s = set <a b c>; my %s = set <d e f>; .say for $s; .say for %s
20:07 camelia rakudo-moar a07a2e: OUTPUT«set(a, c, b)␤d => True␤e => True␤f => True␤»
20:07 TimToady m: my $l = <a b c>; my @l = <d e f>; .say for $s; .say for %s
20:07 camelia rakudo-moar a07a2e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$s' is not declared␤at <tmp>:1␤------> 3$l = <a b c>; my @l = <d e f>; .say for 7⏏5$s; .say for %s␤»
20:08 TimToady m: my $l = <a b c>; my @l = <d e f>; .say for $s; .say for @s
20:08 camelia rakudo-moar a07a2e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$s' is not declared␤at <tmp>:1␤------> 3$l = <a b c>; my @l = <d e f>; .say for 7⏏5$s; .say for @s␤»
20:08 TimToady m: my $l = <a b c>; my @l = <d e f>; .say for $l; .say for @l
20:08 camelia rakudo-moar a07a2e: OUTPUT«(a b c)␤d␤e␤f␤»
20:08 TimToady m: my $l = <a b c>; my @l = <d e f>; .say for @$l; .say for $@l
20:08 camelia rakudo-moar a07a2e: OUTPUT«a␤b␤c␤[d e f]␤»
20:09 itaipu joined #perl6
20:09 dataangel My brain is exploding
20:09 smls dataangel: A $ variable can hold any object, and is treated as a single item for iteration purposes.
20:09 smls A @ variable can hold a defined object of type Array (or any other type that does the Positional role), and is treated as its elements when iterated
20:10 smls A % variable can hold a defined object of type Hash (or any other type that does the Associative role), and is treated as its key=>value pairs when iterated
20:10 TimToady singular/plural is more of a natural language distinction
20:10 masak dataangel: most languages only have the $ treatment, but having the @ and % plural forms available can be terribly useful sometimes
20:10 TimToady "The team walked out the door."
20:11 TimToady is team singular or plural there?
20:11 masak dataangel: for example, if I write `for $something { }`, I know it'll make exactly *one* iteration, over that single thing
20:11 masak but if I see `for @something { }`, then I know it's going to loop 0..* times
20:11 TimToady "The hospital decided to paint itself white."  :)
20:11 masak TimToady: do people actually talk like that? :P
20:12 masak also, that last one doesn't seem to have anything to do with plurals
20:12 TimToady no, that's given as an example of not-acceptable English
20:12 dataangel So they're namespaced separately, and if for some reason you want to loop over a container where you don't actually want to loop over the container and have no reason to write a loop but for some reason feel like exercising the loop syntax you can put $ in front? :p I'm trying to fathom why you would ever ever want that behavior
20:12 TimToady the hospital that decided are plural in the sense that it's a bunch of people
20:12 woolfy joined #perl6
20:13 TimToady The team voted to go home.
20:15 TimToady The team is deciding to go home. VS The team are deciding to go hom.
20:15 b2gills dataangel: The reason you can put an Array or Hash in a $ is so that you can have multidimensional Arrays
20:15 TimToady $ is really a Scalar container
20:16 TimToady m: say $_.VAR
20:16 camelia rakudo-moar a07a2e: OUTPUT«Any␤»
20:16 TimToady m: say VAR($_).WHAT
20:16 camelia rakudo-moar a07a2e: OUTPUT«(Scalar)␤»
20:18 masak dataangel: the example was silly and not real and can easily be picked apart
20:18 masak dataangel: but in order to make it more believeable, consider `for $array1, $array2, $array3 { }`
20:19 masak I think I've decided what the perfect "first macro example" is
20:19 dataangel masak: didn't know that was a syntax. Is that implicitly making an array of three arrays, or does for just let you give it multiple things to iterate over?
20:19 masak C#'s `nameof` operator
20:19 masak dataangel: the latter
20:20 masak dataangel: commas can occur in expressions, so it's not even `for` doing anything, it's just... expressions in general
20:20 masak m: my @a = 1..20; say @a[5, 7, 3]
20:20 camelia rakudo-moar a07a2e: OUTPUT«(6 8 4)␤»
20:20 dataangel masak: so in that case it will iterate three times, but if you are using @ it would iterate over all of the elements of each?
20:20 masak dataangel: uhm
20:21 masak dataangel: my intuition is sometimes slightly pre-GLR
20:21 dataangel GLR?
20:21 masak m: my @a1 = <a b>; my @a2 = <c d>; for @a1, @a2 { .say }
20:21 camelia rakudo-moar a07a2e: OUTPUT«[a b]␤[c d]␤»
20:22 dataangel So no
20:22 masak no, it seems using $ is no different from using @ in the example I gave
20:22 masak ...nowadays, after the Great List Refactor
20:22 b2gills m: my @a1 = <a b>; my @a2 = <c d>; for |@a1, |@a2 { .say }
20:22 camelia rakudo-moar a07a2e: OUTPUT«a␤b␤c␤d␤»
20:22 masak you'd have to write it like that, yeah
20:22 masak I've been putting more |s in my code lately
20:22 b2gills which is the way Perl's before 6 handle arrays
20:23 dataangel So when does the sigil change the iteration behavior and when doesn't it?
20:24 b2gills m: my @a1 = <a b>; my $a2 = <c d>; for @a1 { .say }; for $a2 { .say };
20:24 camelia rakudo-moar a07a2e: OUTPUT«a␤b␤(c d)␤»
20:24 smls m: my @a = [1, 2];  my $a = [3, 4];  say <a b> X @a;  say <a b> X $a
20:24 camelia rakudo-moar a07a2e: OUTPUT«((a 1) (a 2) (b 1) (b 2))␤((a [3 4]) (b [3 4]))␤»
20:24 smls m: my @a = [1, 2];  my $a = [3, 4];  for flat @a, $a { .say }
20:24 camelia rakudo-moar a07a2e: OUTPUT«1␤2␤[3 4]␤»
20:24 masak dataangel: what I said for a single array still holds
20:25 masak m: my @a = 1, 2, 3; .say for @a; .say for $@a
20:25 camelia rakudo-moar a07a2e: OUTPUT«1␤2␤3␤[1 2 3]␤»
20:25 b2gills m: #`(note that you can put an @ in front of a $ var; ) my $a = <a b>; for @$a {.say}
20:25 camelia rakudo-moar a07a2e: OUTPUT«a␤b␤»
20:25 dataangel masak: so the sigil changes the behavior when you give the loop one argument, but not when you give it multiple?
20:25 masak dataangel: post-GLR, that's correct
20:26 b2gills a ï½¢,ï½£ infix operator creates a list, and that list is the one you are iterating over
20:26 masak dataangel: so if your next question is "why", it would serve you to understand what went into that refactor :)
20:27 dataangel b2gills: that was actually my original guess but masak said that was wrong :p
20:27 b2gills pre-GLR was an absolute mess, and very difficult to remember where flattening happened and where it didn't
20:29 dataangel If ï½¢,ï½£ is an infix operator, does that mean when I comma separate arguments to a function that I am actually constructing a list and passing a list?
20:30 smls exactly
20:30 smls Keywords or routines (e.g. `for` or `X`) that iterate over values, look at the *top-level* of the exp[ression they're given, and try to iterate that
20:31 smls for $a, @a { }  # the thing to iterate is a list of 2 other things --> 2 iterations
20:31 smls for @a { }      # the thing to iterate is an array of n items --> n iterations
20:31 smls for $a { }      # the thing to iterate is an item variable --> one iteration
20:31 dataangel Gnarly
20:32 masak you quickly get used to it and exploit it to your advantage
20:32 b2gills m: say (   (1)   ).perl ; say (   (1,)   ).perl
20:32 camelia rakudo-moar a07a2e: OUTPUT«1␤(1,)␤»
20:33 canopus joined #perl6
20:33 masak b2gills: the (1,) thing for one-element lists is a local optimum that lots of languages have landed on. no-one seems to like it much, but it seems less bad than the obvious alternatives
20:33 dataangel So in the post GLR world, what is a a beneficial example of the difference in iteration behavior caused by sigils? The for loop example doesn't really work because you have no reason to ever deliberately right for $one-thing {}
20:34 dataangel s/right/write
20:34 b2gills masak: I'm aware, and was pointing that out
20:34 masak goodie -- thought so :)
20:34 b2gills m: sub foo ( $,$,$ ){}; my @a = 1,2,3; foo @a
20:34 camelia rakudo-moar a07a2e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Calling foo(Positional) will never work with declared signature ($,,)␤at <tmp>:1␤------> 3sub foo ( $,$,$ ){}; my @a = 1,2,3; 7⏏5foo @a␤»
20:34 b2gills m: sub foo ( $,$,$ ){}; my @a = 1,2,3; foo |@a
20:34 camelia rakudo-moar a07a2e: ( no output )
20:36 ZoffixLappy joined #perl6
20:36 dataangel m: sub foo ( $,$,$ ){}; my $a = 1,2,3; foo |$a
20:36 camelia rakudo-moar a07a2e: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 2 in sink context (lines 1, 1)␤Useless use of constant integer 3 in sink context (lines 1, 1)␤Too few positionals passed; expected 3 arguments but got 1␤  in sub foo at <tmp> line 1␤  in block <…»
20:36 b2gills dataangel: note that in a subroutine call, the compiler sort of cheats, and it is effectively creating a Capture instead of a List when you use commas
20:37 El_Che when is the weekly perl6 bulleting suppose to come out?
20:37 smls dataangel: See the `X` operator and `flat` examples I posted above
20:37 dataangel smls: I assumed that X was just you using a placeholder... Forgot I'm dealing with perl ;p
20:37 masak b2gills: isn't it a Capture only if you use the parentheses form of the call? and a list in the case of a listop?
20:38 b2gills m: sub foo ( $,$,$ ){}; my $a = 1,2,3; foo |@$a # I think this should work
20:38 camelia rakudo-moar a07a2e: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 2 in sink context (lines 1, 1)␤Useless use of constant integer 3 in sink context (lines 1, 1)␤Too few positionals passed; expected 3 arguments but got 1␤  in sub foo at <tmp> line 1␤  in block <…»
20:38 ZoffixLappy El_Che, some time Monday, sometimes on Tuesday. If I'm not mistaken, lizmat++ who usually handles the work is currently traveling, so there may be some delays if she doesn't have time.
20:39 ZoffixLappy And she's planning to move in to Sunday (I recall her mentioning).
20:39 ZoffixLappy s/in/it/;
20:39 lizmat El_Che: I might be a bit late on Monday, as we will have had a long day travelling to Cluj (and lost one hour on the way)
20:39 lizmat I might actually do it this Sunday, it would make things a lot easier  :-)
20:40 lizmat .oO( A Quick One From Budapest )
20:40 El_Che lizmat: maybe a call for tester for the vim syntax check plugin could be added
20:41 El_Che I'll try to write a blogpost about it
20:41 lizmat El_Che: what was the URL again ?
20:41 lizmat ok
20:41 lizmat let me know on #perl6-dev and I'll include it  :-)
20:41 harmil b2gills: Either parens around the list or making the target an array makes that work
20:42 b2gills masak: I think the compiler always creates a Capture when calling a Callable
20:42 harmil m: sub foo ( $,$,$ ){}; my @a = 1,2,3; foo |@a # I think this should work
20:42 camelia rakudo-moar a07a2e: ( no output )
20:42 El_Che lizmat: https://github.com/nxadm/syntastic-perl6, I'll post the url of the small announcement on #perl6-dev then
20:42 lizmat El_Che++
20:42 canopus joined #perl6
20:43 El_Che nothing too fancy. I am pretty sure that there is a lot of cargo cult in my vimscript :)
20:43 b2gills m: sub foo ( $,$,$ ){}; my $a = (1,2,3); foo |$a # forgot the parens
20:43 camelia rakudo-moar a07a2e: ( no output )
20:43 dataangel smls: it seems like for the cross product sometimes you might want to use $ or @ on the same object, which makes me think that the sigil should just be allowed to vary at the use site... I get that you can make a new variable that points to the same object with a different sigil, but why not just have all of the sigils share the same namespace and let you choose which sigil to use for a variable at the site that you use it?
20:44 El_Che lizmat: also the code is a living proof why we need json error output :)
20:45 b2gills dataangel: what about subroutines with the same name as a scalar?
20:45 masak dataangel: congratulations, you have re-invented an RFC ;)
20:46 b2gills A lot of what has been discussed has origins in the first release of Perl, which was back in 1987
20:46 masak dataangel: search for "RFC 009" in http://www.perl6.org/archive/doc/design/apo/A02.html for the answer to your question
20:46 smls dataangel: You *can* vary the behavior at the use-site by wrapping an expression in $( )  or @( ), and in when using it on a variable you don't even need the parens
20:46 smls i.e. @$foo lets variable $foo acts like an array variable
20:47 smls and $@foo lets variable @foo acts like a single item
20:48 dataangel oic
20:48 b2gills m: my \var = [1,]; var[5] = 3; for @(var) {.say}
20:48 camelia rakudo-moar a07a2e: OUTPUT«1␤(Any)␤(Any)␤(Any)␤(Any)␤3␤»
20:48 dataangel god there is so much depth to this
20:48 smls or if that's too much line noise for you, you can also write  @$foo  as  $foo.list, and  $@foo  as @foo.item
20:48 itaipu joined #perl6
20:50 b2gills dataangel: think of it this way, you stumbled on a rock, if you start digging it out, you will find it is actually Mount Everest
20:50 gtdBFmKOXx joined #perl6
20:51 dataangel Going back to the original question, the sigil to use with set -- I definitely expect to be iterating over the contents, which I take to mean that I need to use either @ or %. @ means positional though, which the set is not. % means associative which the set isn't either. $ will give me the wrong iteration behavior. They all seem equally bad?
20:52 smls dataangel: Set is Associative in Perl 6
20:52 smls it maps from any object to True ("in the set") or False ("not in the set")
20:53 dataangel smls: what does it mean for a set to be associative? I just want a bunch of file paths stored in some container that will efficiently make sure that there aren't duplicates
20:53 dataangel oh that's an interesting take
20:54 Ven joined #perl6
20:54 dataangel Will something bad happen if I use @? Or will it just prevent me from being able to look up whether something is in the set since I assume that % is necessary for my-set{my-object} to work and that's the way to check for presence of items in the set I assume given how you described it being associative?
20:55 lizmat dataangel: if you really don't want duplicates, then .unique might be another tale
20:55 mvorg joined #perl6
20:55 lizmat dataangel: because then you would preserve order
20:55 smls dataangel: It won't let you bind a non-Positional object to a @ variable
20:56 jnthn m: my @a is Set
20:56 camelia rakudo-moar a07a2e: ( no output )
20:56 jnthn um
20:56 jnthn m: my @a := Set.new
20:56 camelia rakudo-moar a07a2e: OUTPUT«Type check failed in binding; expected Positional but got Set (set())␤  in block <unit> at <tmp> line 1␤␤»
20:56 jnthn Ah, smls just said what I showed :)
20:56 jnthn So @ isn't an option
20:57 smls m: my %foo := set <a a a b b c>;  say %foo.keys
20:57 camelia rakudo-moar a07a2e: OUTPUT«(a c b)␤»
20:57 dataangel Cool... It is all actually logically consistent ;)
20:59 smls if you want to modify it after creation, you'll need to use SetHash instead of Set though:
20:59 smls m: my %foo := SetHash.new: <a b c>;  %foo<d> = True;  %foo<a> = False;  say %foo.keys
20:59 camelia rakudo-moar a07a2e: OUTPUT«(c b d)␤»
21:00 TEttinger joined #perl6
21:00 smls because Set is an immutable type by design
21:01 smls of course if you only want to remove duplicates from a list as a one-time operation, you can just call .unique on the list as lizmat said
21:05 canopus joined #perl6
21:07 MilkmanDan joined #perl6
21:12 masak m: constant %h = foo => 1, bar => 2; say %h
21:12 camelia rakudo-moar a07a2e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Type check failed in constant declaration of %h; expected Associative but got List (List)␤at <tmp>:1␤------> 3constant %h = foo => 1, bar => 27⏏5; say %h␤    expecting any of:␤        postfix␤»
21:12 masak ^ throws me off now and then
21:13 masak m: constant %h = hash foo => 1, bar => 2; say %h
21:13 camelia rakudo-moar a07a2e: OUTPUT«{bar => 2, foo => 1}␤»
21:14 benjikinz joined #perl6
21:15 benjikinz how do I loop through each character in a string
21:15 benjikinz the shortest way
21:15 timotimo with comb
21:15 timotimo m: for "hello how are you".comb { say "char: $_" }
21:15 camelia rakudo-moar a07a2e: OUTPUT«char: h␤char: e␤char: l␤char: l␤char: o␤char:  Ã¢ÂÂ¤char: h␤char: o␤char: w␤char:  Ã¢ÂÂ¤char: a␤char: r␤char: e␤char:  Ã¢ÂÂ¤char: y␤char: o␤char: u␤»
21:16 benjikinz tyvm
21:16 timotimo YW
21:16 Idiosyncrat left #perl6
21:16 timotimo don't hesitate to ask more questions d)
21:16 timotimo :)
21:17 smls D'oh! I was about to file an RT about \c[COMBINING OVERLINE] being shown one character to the right of where it's supposed to be, but it turns out Perl 6 handles it correctly and it's my editor and terminal that both screw up and draw it in the wrong position...
21:18 timotimo yeah, that thing tends to be broken in many programs
21:18 smls how come?
21:18 timotimo i haven't a clue
21:18 timotimo just speaking from experience here
21:20 jnthn Rendering combining chars is a hard problem I guess...
21:20 El_Che https://nxadm.wordpress.com/2016/08/20/please-test-first-release-of-syntastic-perl6-a-vim-syntax-checker/
21:20 jnthn Heck, I suspect rendering all the Unicode things correctly in general is.
21:21 jnthn When I encountered those areas of the spec when figuring out how to implement NFG, I was glad I wasn't doing rendering stuff :P
21:21 timotimo yeah, jnthn's job isn't to draw zalgo. just to represent it properly in memory :)
21:26 zacts joined #perl6
21:28 khw joined #perl6
21:31 BenGoldberg joined #perl6
21:33 benjikinz How would I make my anagram checker shorter? http://pastebin.com/raw/ca0eQhVv
21:34 ZoffixLappy :/
21:35 ZoffixLappy benjikinz, does it even work? that .sort looks suspicious
21:35 benjikinz yeah it works fine
21:35 benjikinz sorry if I've done something wrong
21:36 ZoffixLappy benjikinz, it may be just that I may be unaware of an anagram checking algorithm you're using :)
21:36 smls @*ARGS.fc.comb.sort eqv @*ARGS[0].fc.comb.sort
21:36 jnthn m: my @a = 'slaughter', 'laughters'; say [eq] (.comb.sort for @a)
21:36 camelia rakudo-moar a07a2e: OUTPUT«True␤»
21:36 benjikinz jnthn, that is way better jeez
21:36 benjikinz god im so dumb why did I loop through each character lmao
21:37 lizmat m: my @a = 'slaughter', 'laughters'; say [eq] (.comb.bag for @a)
21:37 camelia rakudo-moar a07a2e: OUTPUT«Method 'bag' not found for invocant of class 'Seq'␤  in block <unit> at <tmp> line 1␤␤»
21:37 ZoffixLappy Oh. I confused anagram with palindrome doh >_<
21:37 lizmat m: my @a = 'slaughter', 'laughters'; say [eq] (.comb.Bag for @a)
21:37 camelia rakudo-moar a07a2e: OUTPUT«True␤»
21:38 smls lizmat: Is it safe to rely on the string representation of a Bag to be returned in the same order twice?
21:39 lizmat guess not
21:39 ZoffixLappy m: say 'slaughter'.comb.Bag eqv 'laughters.comb.Bag
21:39 camelia rakudo-moar a07a2e: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in single quotes; couldn't find final "'" ␤at <tmp>:1␤------> 3ughter'.comb.Bag eqv 'laughters.comb.Bag7⏏5<EOL>␤    expecting any of:␤        single quotes␤        Ã¢â‚¬Â¦Ã‚»
21:39 ZoffixLappy m: say 'slaughter'.comb.Bag eqv 'laughters'.comb.Bag
21:39 camelia rakudo-moar a07a2e: OUTPUT«True␤»
21:39 ZoffixLappy m: say 'slaughter'.comb.Bag eqv 'laughtersz'.comb.Bag
21:39 camelia rakudo-moar a07a2e: OUTPUT«False␤»
21:39 lizmat m: my @a = 'slaughter', 'laughters'; say [~~] (.comb.Bag for @a)
21:39 camelia rakudo-moar a07a2e: OUTPUT«True␤»
21:40 smls m: my @a = <slaughter laughters>; say [===] (.comb.Bag for @a)
21:40 camelia rakudo-moar a07a2e: OUTPUT«True␤»
21:40 lizmat that I think you *can* depend on
21:40 lizmat ~~ I mean
21:40 lizmat Bag ~~ Bag
21:40 jnthn ~~ is probably safe, yeah
21:40 jnthn I suspect my way is cheaper though :)
21:41 jnthn Well, though interestingly I guess big-O wise, lizmat's one is cheaper, so it's only in constant factor :)
21:41 benjikinz what does bag do?
21:41 lizmat jnthn: actually, atm it's not cheaper, but I could make it cheaper  :-)
21:41 AlexDaniel joined #perl6
21:41 ZoffixLappy benjikinz, Bag is a type where items have integer weights: https://docs.perl6.org/language/setbagmix
21:42 jnthn lizmat: Oh, curious. Bag is apparently more performant than I expect :)
21:42 jnthn That makes me happy
21:42 ZoffixLappy m dd bag <a b c d a a a a c c>
21:42 ZoffixLappy m: dd bag <a b c d a a a a c c>
21:42 camelia rakudo-moar a07a2e: OUTPUT«("a"=>5,"c"=>3,"b"=>1,"d"=>1).Bag␤»
21:42 ZoffixLappy benjikinz, ^ useful when you want to count things
21:43 benjikinz I see
21:51 b2gills m: dd bag flat '1', 1,2,3,1 # note that it knows the difference between '1' and 1
21:51 camelia rakudo-moar a07a2e: OUTPUT«(3=>1,"1"=>1,1=>2,2=>1).Bag␤»
21:52 ZoffixLappy And it can be a gotcha for stuff coming in from @*ARGS or <a b c> lists.
21:53 ZoffixLappy m dd bag flat <1 2 3>, 1, '2', 3;
21:53 ZoffixLappy m: dd bag flat <1 2 3>, 1, '2', 3;
21:53 camelia rakudo-moar a07a2e: OUTPUT«(3=>1,IntStr.new(1, "1")=>1,1=>1,IntStr.new(2, "2")=>1,IntStr.new(3, "3")=>1,"2"=>1).Bag␤»
21:59 pochi_ joined #perl6
22:00 Zoffix__ joined #perl6
22:00 espadrine joined #perl6
22:00 Xliff_ joined #perl6
22:01 llfourn_ joined #perl6
22:01 john51_ joined #perl6
22:02 paraboli` joined #perl6
22:02 nebuchad` joined #perl6
22:02 Xliff_ m: my @a = 1 xx 2, 3 xx 4, 5 xx 6; say @a.bag
22:02 camelia rakudo-moar a07a2e: OUTPUT«Method 'bag' not found for invocant of class 'Array'␤  in block <unit> at <tmp> line 1␤␤»
22:03 Xliff_ m: my @a = 1 xx 2, 3 xx 4, 5 xx 6; say @a.Bag
22:03 jnthn_ joined #perl6
22:03 camelia rakudo-moar a07a2e: OUTPUT«bag((3 3 3 3), (5 5 5 5 5 5), (1 1))␤»
22:03 krakan_ joined #perl6
22:03 bitmap_ joined #perl6
22:03 tadzik1 joined #perl6
22:03 esh_ joined #perl6
22:03 ggherdov_ joined #perl6
22:03 dataangel joined #perl6
22:03 sno joined #perl6
22:04 DrForr joined #perl6
22:04 khagan joined #perl6
22:05 hcit joined #perl6
22:05 jdv79 joined #perl6
22:05 petercommand joined #perl6
22:05 Util joined #perl6
22:05 cxreg joined #perl6
22:06 lizmat m: my @a = 1 xx 2, 3 xx 4, 5 xx 6; dd @a   # underlying issue
22:06 camelia rakudo-moar a07a2e: OUTPUT«Array @a = [(1, 1), (3, 3, 3, 3), (5, 5, 5, 5, 5, 5)]␤»
22:06 lizmat m: my @a = flat 1 xx 2, 3 xx 4, 5 xx 6; dd @a   # underlying issue
22:06 camelia rakudo-moar a07a2e: OUTPUT«Array @a = [1, 1, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5]␤»
22:08 woodruffw joined #perl6
22:09 woodruffw joined #perl6
22:11 remmie joined #perl6
22:12 nadim joined #perl6
22:12 flobbertygibbet joined #perl6
22:13 itaipu joined #perl6
22:15 tbrowder joined #perl6
22:15 pnu_ joined #perl6
22:16 ssm joined #perl6
22:16 RabidGravy joined #perl6
22:18 pierrot joined #perl6
22:18 tbrowder m: my $s = '1.2.3.4'; say "True" if $s ~~ /([^\\])\./;
22:18 camelia rakudo-moar 5a4ec5: ( no output )
22:20 tbrowder Can anyone please tell me why the match above isn't true?
22:21 ZoffixLappy m: my $s = '1.2.3.4'; say "True" if $s ~~ /<-[\\]>\./;
22:21 camelia rakudo-moar 5a4ec5: OUTPUT«True␤»
22:21 ZoffixLappy ([^\\]) is Perl 5/PCRE-ism
22:21 ZoffixLappy m: my $s = '1.2.3.4'; say "True" if $s ~~ m:P5/([^\\])\./;
22:21 camelia rakudo-moar 5a4ec5: OUTPUT«True␤»
22:23 tbrowder Argh! Thanks.  I tried the <[]> construct but I guess I fumbled it because I used the ^ instead of the -.  Thanks again, Zoffix.
22:26 shadowpaste joined #perl6
22:27 timotimo m: /[^a-z]/ # do we warn about this at all?
22:27 camelia rakudo-moar 5a4ec5: OUTPUT«5===SORRY!5===␤Unrecognized regex metacharacter - (must be quoted to match literally)␤at <tmp>:1␤------> 3/[^a7⏏5-z]/ # do we warn about this at all?␤Unable to parse expression in metachar:sym<[ ]>; couldn't find final ']' ␤at <tmp>:1…»
22:27 timotimo m: /[a-z]/ # do we warn about this at all?
22:27 camelia rakudo-moar 5a4ec5: OUTPUT«5===SORRY!5===␤Unrecognized regex metacharacter - (must be quoted to match literally)␤at <tmp>:1␤------> 3/[a7⏏5-z]/ # do we warn about this at all?␤Unable to parse expression in metachar:sym<[ ]>; couldn't find final ']' ␤at <tmp>:1␤…»
22:27 timotimo no "this looks like a perl5 character class" warning?
22:28 grondilu that would be usefull indeed.
22:28 grondilu it's an easy mistake to make.
22:29 * ZoffixLappy nods
22:30 grondilu on the other hand someone trying this is probably a big newb.  I'm not sure it's reasonable to try to catch all the mistakes newbs will do.
22:31 grondilu we could put "Listen: this is Perl 6.  Stop trying all your Perl 5 idioms and instead RTFM."   (just kidding of course)
22:33 ZoffixLappy It's not just P5, but PCRE in general.
22:33 timotimo and every other regex dialect out there
22:33 ZoffixLappy [and I'd avoid refering to P5 in this particular warning/error, if it's added]
22:34 grondilu true
22:34 timotimo we have :m and :i and such that can go anywhere inside a regex, but :P5 can't :P
22:35 grondilu so a message could be.  This looks like a Perl Compatible Regular Expression (PCRE).  Perl 6 does not use them by default.  Use the :P5 adverb to use PCREs.
22:36 grondilu timotimo: surely there is a way to put an adverb inside the regex, isn't there?
22:36 grondilu oh wait, I did not read you corectly.
22:37 grondilu m: say "foo" ~~ / :P5 [a-z] /
22:37 camelia rakudo-moar 5a4ec5: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unrecognized regex modifier :P5␤at <tmp>:1␤------> 3say "foo" ~~ / :7⏏5P5 [a-z] /␤    expecting any of:␤        term␤»
22:37 chris2 joined #perl6
22:37 grondilu indeed.
22:37 grondilu I actually did not know one could put the adverb inside so simply (except for P5)
22:38 grondilu m: say "foo" ~~ / :i F /
22:38 camelia rakudo-moar 5a4ec5: OUTPUT«「f」␤»
22:38 grondilu neat
22:41 timotimo goes inside of parens and such, too
22:44 zacts joined #perl6
23:05 woolfy left #perl6
23:08 b2gills To be fair :P5 changes regexes to be parsed as PCRE which wouldn't support something like :P5 being there
23:13 tadzik joined #perl6
23:18 El_Che https://nxadm.wordpress.com/2016/08/21/vim-as-a-perl-6-editor/
23:22 perlawhirl joined #perl6
23:23 perlawhirl hi perlers
23:24 perlawhirl i was just reading the above on anagram solving and P5-isms which is exactly what i was playing with earlier
23:24 perlawhirl https://gist.github.com/0racle/644a656d327a5e78e8d3c5d039d5cfd5
23:24 perlawhirl if your wanna test it, you'll need a wordlist, I'm using the SOWPODS list.
23:25 perlawhirl so there's 2 subs... iter() is the more P5-ish way you would do it
23:25 perlawhirl bags() is with bags. whats nice, is that while bags is slower, it's only slightly slower. i was pleasantly surprised to find that
23:26 perlawhirl on my 32-bit machine (*cry*), gathering the iter() sub takes 10 seconds, bags() takes 14
23:28 masak perlawhirl: did you consider `next WORD if !%tiles{$_} || $letters{$_} > %tiles{$_} for $letters.keys` ?
23:28 masak or maybe flip and de Morgan the condition: `next WORD unless %tiles{$_} && $letters{$_} <= %tiles{$_} for $letters.keys`
23:29 perlawhirl no i didn't, but will give it a go.... essentially, just trying to see how fast i can get this
23:30 masak got it
23:30 ZoffixLappy New blog post: "I Botched a Perl 6 Release And Now a Robot Is Taking My Job": http://perl6.party/post/I-Botched-A-Perl-6-Release-And-Now-A-Robot-Is-Taking-My-Job
23:38 ZoffixLappy Randal Schwartz is in the hospital :/ http://blogs.perl.org/users/brian_d_foy/2016/08/randal-schwartz-is-in-the-hospital-and-could-use-some-help.html
23:38 * ZoffixLappy still recalls him being an abusive asshole in #perl a decade ago, just 'cause people would type 'i' instead of 'I' :/
23:43 El_Che are the 2 lines connected? What did you do with merilyn? :)
23:44 ZoffixLappy i didn't do anything.
23:45 ZoffixLappy wink wink
23:45 El_Che :)
23:53 labster joined #perl6
23:55 lizmat_ joined #perl6
23:56 MilkmanDan joined #perl6

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

Perl 6 | Reference Documentation | Rakudo