»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:00 tadzik left, Matthew[m] left, M-Illandan left 00:04 bjz joined 00:16 bjz left, cdg left, lambd0x joined
lambd0x Hello everyone! 00:17
timotimo greetings lambd0x 00:21
00:32 lambd0x left 00:34 MilkmanDan joined 00:41 tadzik joined
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
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␤»
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␤,,,␤»
grondilu m: say 100000000.subst(/\d ** 3/, ",{$/ // "?"}", :g)
camelia rakudo-moar 4674f1: OUTPUT«,?,?,?␤»
unmatched} m: say 100000000.subst(/\d ** 3/, {",$/"}, :g) 01:04
camelia rakudo-moar 4674f1: OUTPUT«,100,000,000␤»
unmatched} m: say 100000000.subst(/\d ** 3/, {~$/ ?? "" !! ",$/"}, :g)
camelia rakudo-moar 4674f1: OUTPUT«␤»
grondilu maybe with the position adverb. Forgot the syntax. 01:05
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␤------> 030000000.subst(/\d ** 3/, ", {",$/"}, :g)7⏏5<EOL>␤ expecting any of:␤ horizontal whitespace…»
grondilu wth
m: say 100000000.subst(/\d ** 3/, {",$/"}, :g)
camelia rakudo-moar 4674f1: OUTPUT«,100,000,000␤»
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)␤»
grondilu m: say 100000000.subst(m:c(1)/\d ** 3/, {",$/"}, :g)
camelia rakudo-moar 4674f1: OUTPUT«Method 'match' not found for invocant of class 'Any'␤ in block <unit> at <tmp> line 1␤␤»
grondilu m: say 100000000.subst(m:c(1)/(\d ** 3)/, {",$0"}, :g)
camelia rakudo-moar 4674f1: OUTPUT«Method 'match' not found for invocant of class 'Any'␤ in block <unit> at <tmp> line 1␤␤»
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␤␤»
grondilu m: say 100000000.subst([/\d ** 3]+$$/, "X")
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␤»
grondilu m: say 100000000.subst(/[/\d ** 3]+$$/, "X")
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 ** …»
grondilu m: say 100000000.subst(/[\d ** 3]+$$/, "X") 01:09
camelia rakudo-moar 4674f1: OUTPUT«X␤»
grondilu m: say 100000000.subst(/[\d ** 3]+$$/, $/)
camelia rakudo-moar 4674f1: OUTPUT«Use of Nil in string context in block <unit> at <tmp> line 1␤␤»
grondilu wth
how can $/ be Nil in a subst??
m: say 100000000.subst(/[\d ** 3]+$$/, {$/}) 01:10
camelia rakudo-moar 4674f1: OUTPUT«100000000␤»
grondilu m: say 100000000.subst(/[\d ** 3]+$$/, {$/.join(',')})
camelia rakudo-moar 4674f1: OUTPUT«␤»
01:10 M-Illandan joined, Matthew[m] joined
grondilu m: say 100000000.subst(/(\d ** 3)+$$/, {$0.join(',')}) 01:10
camelia rakudo-moar 4674f1: OUTPUT«100,000,000␤»
grondilu ah
timotimo is it because of the curly block getting $_ and not $/ ? 01:11
01:11 idiosyncrat_ joined
timotimo we've had that problem for some time 01:11
that we can't properly set a $/ in there
grondilu m: say 10000000000.subst: /(\d ** 3)+$$/, {$0.join(',')} 01:12
camelia rakudo-moar 4674f1: OUTPUT«10000,000,000␤»
grondilu damn
timotimo huh, why doesn't that work?
grondilu m: say 10000000000.subst: /(\d ** 3)+$$/, {"=> " ~ $0.join(',')}
camelia rakudo-moar 4674f1: OUTPUT«10=> 000,000,000␤»
timotimo oh, duh :)
how about an empty match ta the beginning? 01:13
grondilu m: say 10000000000.subst: /(\d ** {1,3})+$$/, {$0.join(',')}
camelia rakudo-moar 4674f1: OUTPUT«10,00,00,00,0,00␤»
grondilu :facepalm:
timotimo :D :D :D
grondilu m: say 10000000000.subst: /(\d ** {1,3})+$$/, .join(',')}
camelia rakudo-moar 4674f1: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unexpected closing bracket␤at <tmp>:1␤------> 0300.subst: /(\d ** {1,3})+$$/, .join(',')7⏏5}␤»
grondilu m: say 10000000000.subst: /(\d ** {1,3})+$$/, *.join(',') 01:14
camelia rakudo-moar 4674f1: OUTPUT«10 00 00 00 0 00␤»
grondilu m: say 10000000000.subst: /(\d ** {1..3})+$$/, *.join(',')
camelia rakudo-moar 4674f1: OUTPUT«100 000 000 00␤»
timotimo oh, we don't warn on ** {1,3}?
01:14 pierre_ joined
grondilu apparently not 01:14
seems fine not to though
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() ?
timotimo should be just bar 01:15
grondilu if it's exported it's just bar()
m: module Foo { sub bar is export {} }; import Foo; bar; 01:16
camelia ( no output )
01:17 pierre_ left
grondilu m: say 10000000000.subst: /(\d ** 3)+$$/, { ','~ .join(',') } 01:17
camelia rakudo-moar 4674f1: OUTPUT«10,000 000 000␤»
grondilu m: say 10000000000.subst: /(\d ** 3)+$$/, { ','~ $/.join(',') } 01:18
camelia rakudo-moar 4674f1: OUTPUT«10,000 000 000␤»
grondilu m: say 1_000.subst: /(\d ** 3)+$$/, { ','~ .join(',') }
camelia rakudo-moar 4674f1: OUTPUT«1,000␤»
grondilu m: say 1_000_000.subst: /(\d ** 3)+$$/, { ','~ .join(',') }
camelia rakudo-moar 4674f1: OUTPUT«1,000 000␤»
grondilu m: say 1_000_000.subst: /(\d ** 3)+$$/, { ','~ .list.join(',') } 01:19
camelia rakudo-moar 4674f1: OUTPUT«1,000 000␤»
grondilu m: say 1_000_000.subst: /(\d ** 3)+$$/, { ','~ .perl }
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 => …»
grondilu m: say 1_000_000.subst: /(\d ** 3)+$$/, { ','~ .list.perl }
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)],)␤»
grondilu shrugs
01:21 kalkin- joined, pierre_ joined 01:23 kurahaupo left 01:24 kalkin-_ left
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 => …»
grondilu m: say 1_000_000.subst: /(\d ** 3)+$$/, { ','~ .[] } 01:29
camelia rakudo-moar 4674f1: OUTPUT«1,000000␤»
grondilu m: say 1_000_000.subst: /(\d ** 3)+$$/, { ','~ .[].join(',') }
camelia rakudo-moar 4674f1: OUTPUT«1,000 000␤»
timotimo tbh
i'd totally use comb for this
m: say 1_000_000.flip.comb(/\d ** 3/).join(",").flip
camelia rakudo-moar 4674f1: OUTPUT«000,000␤»
timotimo whoops, that discards the rest
m: say 1_000_000.flip.comb(/\d ** {1..3}/).join(",").flip
camelia rakudo-moar 4674f1: OUTPUT«1,000,000␤»
timotimo there we go 01:30
can you try to break that?
grondilu m: say 10_000_000.flip.comb(/\d ** {1..3}/).join(",").flip 01:31
camelia rakudo-moar 4674f1: OUTPUT«10,000,000␤»
grondilu m: say 100_000_000.flip.comb(/\d ** {1..3}/).join(",").flip
camelia rakudo-moar 4674f1: OUTPUT«100,000,000␤»
grondilu I can't break it
timotimo cool
grondilu I don't get why the subst didn't work though
01:32 pierre_ left
timotimo well, for one you're forcing it to be digits until the end of the string 01:32
i'm surprised it even works properly with _ in the middle
er, i mean
that it does anything much
grondilu m: say '1_000' ~~ /\d+/
camelia rakudo-moar 4674f1: OUTPUT«「1」␤»
grondilu m: say 1000000.subst: /(\d ** 3)+$$/, { ','~ .[].join(',') } 01:33
camelia rakudo-moar 4674f1: OUTPUT«1,000 000␤»
grondilu ^I don't get where this space comes from
m: say 1000000.subst: /(\d ** 3)+$$/, { ','~ .[0].join(',') }
camelia rakudo-moar 4674f1: OUTPUT«1,000,000␤»
grondilu ah
m: say 100000000000.subst: /(\d ** 3)+$$/, { ','~ .[0].join(',') } 01:34
camelia rakudo-moar 4674f1: OUTPUT«,100,000,000,000␤»
grondilu *
01:36 sufrostico left 01:37 bjz joined
timotimo hah! :) 01:40
oh, that's not my code, though :)
but you can just <!after ^^>
grondilu m: say 100000000000.subst: /(.*)(\d ** 3)+$$/, { ','~ .[].join(',') } 01:43
camelia rakudo-moar 4674f1: OUTPUT«,100000000,000␤»
grondilu m: say 100000000000.subst: /(.*)(\d ** 3)+$$/, { ','~ .[0,1].join(',') } 01:44
camelia rakudo-moar 4674f1: OUTPUT«,100000000,000␤»
grondilu m: say 100000000000.subst: /(.*?)(\d ** 3)+$$/, { ','~ .[0,1].join(',') }
camelia rakudo-moar 4674f1: OUTPUT«,,100 000 000 000␤»
grondilu m: say 100000000000.subst: /(.*?)(\d ** 3)+$$/, { ','~ (.[0],.[1]).join(',') }
camelia rakudo-moar 4674f1: OUTPUT«,,100 000 000 000␤»
grondilu m: say 100000000000.subst: /(.*?)(\d ** 3)+$$/, { .[0] ~ ',' ~ .[1].join(',') }
camelia rakudo-moar 4674f1: OUTPUT«,100,000,000,000␤» 01:45
grondilu damn it
I guess I'm dumb
timotimo no, no, look at this
01:45 ilbot3 left
timotimo looks for a suitable one to copy 01:45
m: say 100000000000.subst: /<!after ^^>(\d ** 3)+$$/, { ','~ .[].join(',') }
camelia rakudo-moar 4674f1: OUTPUT«,100 000 000 000␤»
timotimo whoops %) 01:46
m: say 100000000000.subst: /<!before ^^>(\d ** 3)+$$/, { ','~ .[].join(',') }
camelia rakudo-moar 4674f1: OUTPUT«100,000 000 000␤»
timotimo there, that's the one
01:47 bjz left
grondilu m: say 100000000000.subst: /<!before ^^>(\d ** 3)+$$/, { ','~.[0].join(',') } 01:47
camelia rakudo-moar 4674f1: OUTPUT«100,000,000,000␤»
grondilu m: say 10000000000.subst: /<!before ^^>(\d ** 3)+$$/, { ','~.[0].join(',') }
camelia rakudo-moar 4674f1: OUTPUT«10,000,000,000␤»
01:47 ilbot3 joined
grondilu m: say 1000000000.subst: /<!before ^^>(\d ** 3)+$$/, { ','~.[0].join(',') } 01:47
camelia rakudo-moar 4674f1: OUTPUT«1,000,000,000␤»
grondilu m: say 100000000.subst: /<!before ^^>(\d ** 3)+$$/, { ','~.[0].join(',') }
camelia rakudo-moar 4674f1: OUTPUT«100,000,000␤»
grondilu yeah, works.
01:48 bjz joined
grondilu I don't quite understand though. Nevermind. 01:48
02:02 idiosyncrat_ left
tailgate what is the diffrence between sub foo(**@args) and sub foo (*@args) ? 02:05
02:08 wamba joined, sena_kun left
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 02:15 noganex left 02:18 MilkmanDan left 02:41 xdbr joined 02:51 labster left 02:53 MilkmanDan joined
vcv m: 100_000_000.comb.reverse.rotor(3, :partial)>>.join.join(',').comb.reverse.join 02:53
camelia ( no output )
vcv m: 100_000_000.comb.reverse.rotor(3, :partial)>>.join.join(',').comb.reverse.join.say
camelia rakudo-moar 4674f1: OUTPUT«100,000,000␤»
vcv Complete overkill 02:54
02:55 TimToady left
vcv m: 100_000_000.comb.reverse.rotor(3, :partial)>>.join.join(',').flip.say 02:55
camelia rakudo-moar 4674f1: OUTPUT«100,000,000␤»
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
grondilu well you know what they say. "If it's worth doing, it's worth overdoing." 03:05
03:10 jack_rabbit left, jack_rabbit joined 03:13 labster joined 03:19 canopus left
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:21
03:23 pierre_ joined 03:25 canopus joined 03:31 bjz left 03:32 bjz joined 04:05 sQuEE joined 04:16 Cabanossi left 04:19 Cabanossi joined 04:21 khw left 04:35 kurahaupo joined
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…»
zostay sad face 04:37
frew m: use utf8; say 5 ≥ 2;
camelia rakudo-moar 4674f1: OUTPUT«===SORRY!===␤utf8 is a builtin type, not an external module␤»
frew m: use unicode; say 5 ≥ 2;
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…»
frew blah
zostay: I thought you had to opt in to the non-texas operators :) 04:38
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
m: use golf; say 5 ≥ 2;
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…»
zostay wrong channel for that discussion though
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;
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;␤»
geekosaur I think a module exists, but it's not a pragma like that
you wanted infix:
kurahaupo ah, yes 04:41
m: sub infix:«≥»($a,$b) { return $a >= $b }; say 2 ≥ 2;
camelia rakudo-moar 4674f1: OUTPUT«True␤»
kurahaupo yay
zostay m: sub infix:<⁄>($a, $b) { return $a / $b }; say -⁷⁄₃; 04:43
camelia rakudo-moar 4674f1: OUTPUT«-2.333333␤»
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>␤»
zostay i also have a perverse desire for that to be a number in perl 6 04:46
05:00 holyghost left 05:17 wamba left, wamba joined 05:19 kurahaupo is now known as kurahaupo_reboot 05:20 kurahaupo_reboot is now known as kurahaupo 05:28 ghih joined, ghih left 05:31 CIAvash joined 05:32 wamba left
CIAvash zostay, frew: irclog.perlgeek.de/perl6/2016-01-09#i_11859391 05:45
BenGoldberg m: my &≥ := &[>=]; 05:49
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…»
BenGoldberg m: my &infix<<≥>> := &[>=];
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 := &[>=];␤»
CIAvash ShimmerFairy: ↑ 05:53
05:53 BenGoldberg left
ShimmerFairy m: my &infix:<<≥>> := &[>=]; 05:53
camelia ( no output )
CIAvash ShimmerFairy: I was refering to the link, I saw these operators were mentioned in #perl6-dev too irclog.perlgeek.de/perl6/2016-01-09#i_11859391 05:56
ShimmerFairy ah 05:59
06:05 bjz left 06:07 skids left 06:08 darutoko joined 06:10 bjz joined
dalek c: a04a945 | titsuki++ | predefined-search-items:
Add ;; (long name) to the list of the predefined-search-items
06:13
c: 7c190ed | titsuki++ | predefined-search-items:
Merge pull request #846 from titsuki/add-predefined-search-item

Add ;; (long name) to the list of the predefined-search-items
06:14 TheLemonMan joined 06:17 kurahaupo left 06:22 pierre_ left 06:23 pierre_ joined 06:28 xdbr left 06:30 smls joined 06:35 jack_rabbit left 06:37 pierre_ left 06:42 domidumont joined 06:46 domidumont left 06:47 domidumont joined, pRiVi_ joined 06:48 notostraca joined 06:49 rjbs- joined, [Coke]_ joined, MilkmanD1n joined, erdic_ joined, alnewkir1 joined, ilmari_ joined, TheDir_ joined 06:50 smash_ joined, maddingu1 joined, sQuEE` joined 06:51 jnap__ joined, rafl_ joined 06:52 PotatoGim_ joined 06:53 simcop2387_ joined 06:54 sQuEE left, MilkmanDan left, TEttinger left, bisectable6 left, PotatoGim left, dalek left, [Coke] left, Spot__ left, SourceBaby left, jnap_ left, synopsebot6 left, Fleurety left, pRiVi left, maddingue left, smash left, rafl_ is now known as rafl 06:55 xdbr joined, zengargoyle left, jnap__ is now known as jnap_ 06:56 Fleurety_ joined 06:57 PotatoGim_ is now known as PotatoGim, Spot__ joined, BuildTheRobots left 06:59 BuildTheRobots joined 07:00 erdic_ left, erdic_ joined 07:01 erdic_ is now known as erdic 07:08 firstdayonthejob joined 07:10 Fleurety_ is now known as Fleurety 07:11 rindolf joined 07:14 mohae_ left 07:17 cognominal joined 07:19 pierre_ joined 07:21 Wiertek joined 07:29 pierre_ left 07:31 cognominal left 07:35 pierre_ joined 07:43 cognominal joined 07:45 pierre_ left 07:49 zengargoyle joined 07:53 pierre_ joined 07:54 pierre_ left 07:55 rba__ joined 07:57 rba_ left 07:58 pierre_ joined 08:00 rba_ joined 08:01 rba__ left 08:06 xdbr left 08:07 avalenn left, xdbr joined 08:08 pierre_ left 08:09 dalek joined, ChanServ sets mode: +v dalek
dalek rl6-most-wanted: 2ede61c | (Jeffrey Goff)++ | most-wanted/modules.md:
Put Perl6::Tidy into play, reserve namespace
08:10
rl6-most-wanted: d687238 | drforr++ | most-wanted/modules.md:
tyop
rl6-most-wanted: 18f6f36 | drforr++ | most-wanted/modules.md:
Merge pull request #35 from drforr/jgoff-perl6-tidy

Add Perl6::Tidy as WIP
08:17 rindolf left 08:18 pierre_ joined 08:39 AlexDaniel joined 08:40 bisectable6 joined 08:46 xdbr left 08:47 Wiertek left 08:48 xdbr joined 08:55 andrzejku joined 09:00 lizmat left 09:04 notostraca is now known as TEttinger 09:07 andrzejku left 09:23 labster left 09:29 simcop2387_ is now known as simcop2387, simcop2387 left, simcop2387 joined 09:34 pierre_ left 10:03 domidumont left 10:05 wamba joined 10:27 darutoko- joined 10:30 darutoko left 10:31 m0ltar joined 10:39 hankache joined
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
hankache what is the status of panda vs zef? 10:40
10:59 TEttinger left 11:00 araujo joined 11:13 darutoko- left 11:17 ilmari_ is now known as ilmari 11:24 rindolf joined 11:51 hankache left 11:55 smls left, smls joined 11:58 hankache joined 11:59 nadim joined 12:20 bjz_ joined 12:21 bjz left 12:28 tomboy65 joined 12:29 tomboy64 left 12:49 jameslenz left 12:55 MilkmanD1n is now known as MilkmanDan
pochi m: gist.github.com/anonymous/5bb458d5...173fd5801f 12:56
camelia rakudo-moar c201a7: OUTPUT«Nil␤»
pochi why would the grammar fail to parse? Can I not nest ('xxx' % 'seperators')-rules? 12:58
13:02 hankache left 13:03 wamba left 13:07 domidumont joined
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:08
unmatched} nothing, that's the dir where dist binaries will go to when you install them with panda 13:10
13:11 xinming_ joined
smls pochi: The default <ws> (whitespace rule) makes the <line> rule eat the newline and spaces that follow it 13:11
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:13
13:14 RabidGravy joined
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
AlexDaniel, bisect log: gist.github.com/96d6959a1cc0a44302...3180a362e5
AlexDaniel, (2016-08-03) github.com/rakudo/rakudo/commit/5e61516
13:15 xinming left
AlexDaniel it's great to stumble upon bugs that are already fixed 13:15
AlexDaniel runs 「rakudobrew build moar」
13:16 sena_kun joined 13:25 zakharyas joined 13:26 Actualeyes joined 13:29 jameslenz joined
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:31
smls Add \h* I guess 13:32
pochi smls: removing whitespace from the input string makes it match though
nadim unmatched}: and how does panda install itself? isn't bootstraping enough, does one need to copy something aor changes paths? 13:33
smls \h matches a horizontal whitespace character
pochi I thought this was a set pattern: 'string'+ % 'separator', where am I allowed to "interrupt" it (so to speak) with whitespace rules?
unmatched} nadim: no idea. I use zef, 'cause it's better :) 13:38
pochi: that may be: ['string' ]+ % 'separator' 13:39
13:40 MilkmanDan left
smls pochi: mith `rule` and explicit \h* and \s* where needed, it matches: gist.github.com/smls/622180c2b721a...a4466097e2 13:42
but it's ugly, of course
*with
unmatched} m: gist.github.com/smls/622180c2b721a...a4466097e2
camelia rakudo-moar c201a7: OUTPUT«「␤block {␤ line␤ line & line␤ line␤}␤」␤ definition => 「block {␤ line␤ line & line␤ line␤}␤」␤ line => 「line」␤ line => 「 line & line」␤ line => 「 line」␤»
pochi smls: ah, everything becomes tokens. I misunderstood, and thought you meant only the last line-rule needed to change 13:43
13:44 wamba joined
unmatched} m: gist.github.com/zoffixznet/1e4e521...b8b92d6f21 13:45
camelia rakudo-moar c201a7: OUTPUT«「␤block {␤ line␤ line & line␤ line␤}␤」␤ definition => 「block {␤ line␤ line & line␤ line␤}␤」␤ line => 「line␤ 」␤ line => 「line & line␤ 」␤ line => 「line␤」␤»
smls pochi: Yeah, it seems `rule` (i.e. :sigspace) also matches whitespace after the separator of `<element>+ % <sep> `
It's explained in-depth here: design.perl6.org/S05.html#line_1147
kinda confusing, tbh
13:47 MilkmanDan joined
pochi smls: thank you :-) 13:47
13:54 MilkmanDan left 13:55 MilkmanDan joined 14:01 harmil joined
smls pochi: Here's a variant with custom <ws> and explicitly matching newlines where they are allowed: gist.github.com/smls/2c8d4439ab82b...f203699904 14:03
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.
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.
pochi smls: but that is redefining an already existing rule (<ws>)? So it would affect the entire grammar? 14:06
smls yes
harmil m: my $min = 0; my $max = 3; my $excludes-max = True; say Range.new($min, $max, :$excludes-max).excludes-max;
camelia rakudo-moar c201a7: OUTPUT«True␤»
harmil Oh, man, that's unfair! It was failing last night! 14:07
unmatched} :)
harmil m: say Range.new(:excludes-min(True)).excludes-min
camelia rakudo-moar c201a7: OUTPUT«False␤»
harmil Only with excludes-min perhaps?! 14:08
unmatched} s: &<^..>
s: &infix:<^..>
oh bot is ded
harmil long live bot
m: my $min = 0; my $max = 3; my $excludes-min = True; say Range.new($min, $max, :$excludes-min).excludes-min;
camelia rakudo-moar c201a7: OUTPUT«True␤»
harmil dafuq? 14:09
m: say Range.new(:max(0), :min(2), :excludes-min(True)).excludes-min
camelia rakudo-moar c201a7: OUTPUT«False␤»
unmatched} m: Range.new(:excludes-min).excludes-min.say
camelia rakudo-moar c201a7: OUTPUT«False␤»
unmatched} m: Range.new(:2min, :4max, :excludes-min).excludes-min.say 14:10
camelia rakudo-moar c201a7: OUTPUT«False␤»
harmil oh, I had a typo....
m: my $min = 0; my $max = 3; my $excludes-min = True; say Range.new(:$min, :$max, :$excludes-min).excludes-min;
camelia rakudo-moar c201a7: OUTPUT«False␤»
harmil So, if you try to pass $min, $max positionally it fails. That's useful. I'll look into that later. 14:11
Off to give tours...
unmatched} Oh, right, min max aren't pos
*named
m: Range.new(2, 4, :excludes-min).excludes-min.say
camelia rakudo-moar c201a7: OUTPUT«True␤»
14:12 bjz joined 14:13 SourceBaby joined
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 bjz_ left
unmatched} s: Range, "new", \(:excludes-min) 14:13
SourceBaby unmatched}, Sauce is at github.com/rakudo/rakudo/blob/c201.../Mu.pm#L90
unmatched} s: Range, "new", \(:42min, :45max) 14:14
SourceBaby unmatched}, Sauce is at github.com/rakudo/rakudo/blob/c201.../Mu.pm#L90
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:15
14:24 MilkmanDan left 14:26 kentnl joined 14:27 MilkmanDan joined 14:31 kent\n left 14:34 kentnl is now known as kent\n, khw joined 14:38 skids joined 14:46 BenGoldberg joined 14:51 kurahaupo joined 14:52 kentnl joined, kentnl left, kentnl joined 14:53 kent\n left, zakharyas left 14:54 kentnl is now known as kent\n 15:10 pierre_ joined 15:11 MilkmanDan left 15:13 pierre_ left 15:15 dLeCamarae joined 15:16 Ven joined 15:18 mohae joined 15:20 canopus left 15:27 xinming_ left, canopus joined 15:37 pmurias joined
pmurias timotimo: what's the status of your PR? 15:38
15:40 MilkmanDan joined, Khisanth left
TheLemonMan pmurias, thanks for merging the PR o/ 15:40
smls m: say (1/3).fmt("%.20f") 15:41
camelia rakudo-moar c201a7: OUTPUT«0.33333333333333300000␤»
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:42 aries_liuxueyang left 15:44 aries_liuxueyang joined
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:45
15:48 skids left
BenGoldberg m: my num64 $i = 1; $i /= 3; 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␤␤»
BenGoldberg m: my num64 $i = 1; $i /= 3e0; printf "%.20f", $i;
camelia rakudo-moar c201a7: OUTPUT«This type cannot unbox to a native number: P6opaque, Int␤ in block <unit> at <tmp> line 1␤␤»
BenGoldberg m: my num64 $i = 1; $i /= 3e0; $i.WHAT.say;
camelia rakudo-moar c201a7: OUTPUT«This type cannot unbox to a native number: P6opaque, Int␤ in block <unit> at <tmp> line 1␤␤»
BenGoldberg m: my num64 $i = 1; $i /= 3e0; printf "%.20f", Num.new($i);
camelia rakudo-moar c201a7: OUTPUT«This type cannot unbox to a native number: P6opaque, Int␤ in block <unit> at <tmp> line 1␤␤»
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␤␤»
BenGoldberg m: my num64 $i = 1e0; printf "%.20f", Num.new($i);
camelia rakudo-moar c201a7: OUTPUT«1.00000000000000000000»
BenGoldberg m: my num64 $i = 1e0; $i /= 3e0; printf "%.20f", Num.new($i);
camelia rakudo-moar c201a7: OUTPUT«0.33333333333333300000»
BenGoldberg smls, Doing printf with %f will, by definition, always convert to a machine native floating point value. 15:53
m: (1/3).base-repeating(10).perl.say; 15:54
camelia rakudo-moar c201a7: OUTPUT«("0.", "3")␤»
15:54 Khisanth joined
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/
error: pathspec '2016.08' did not match any file(s) known to git.
Command failed (status 256): git checkout 2016.08
smls m: say (1/3).base(10, 20) 15:56
camelia rakudo-moar c201a7: OUTPUT«0.33333333333333333333␤»
smls BenGoldberg: Or that ^^ :)
I didn't even know about those methods. 15:57
BenGoldberg Oh, I didn't see that, thanks :)
m: pi.Rat(2**(-53)).nude.say; 16:00
camelia rakudo-moar c201a7: OUTPUT«(245850922 78256779)␤»
BenGoldberg m: pi.Rat(2**(-64)).nude.say; 16:01
camelia rakudo-moar c201a7: OUTPUT«(245850922 78256779)␤»
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
camelia rakudo-moar c201a7: OUTPUT«(884279719003555 281474976710656)␤»
BenGoldberg m: pi.Rat(2**(-128)).nude.say;
camelia rakudo-moar c201a7: OUTPUT«(245850922 78256779)␤»
BenGoldberg m: pi.Rat(1e-3).nude.say; 16:02
camelia rakudo-moar c201a7: OUTPUT«(333 106)␤»
smls Also didn't know that the .Rat coercers takes a precision argument... 16:05
16:07 TheLemonMan left
smls m: Rat(pi, 2**-64).nude 16:07
camelia ( no output )
smls m: say Rat(pi, 2**-64).nude
camelia rakudo-moar c201a7: OUTPUT«(2 1)␤»
smls Doesn't exactly work with the function-like form
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 16:16 domidumont left 16:18 Dunearhp left, Dunearhp joined 16:27 MilkmanDan left
nadim perl6 -Ilib bin/zef install . core dumps on my box, any way to help debug that? 16:30
16:45 AndyBotwin left 16:53 cuonglm joined, petercommand is now known as PointerCompound
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
I got `error: pathspec '2016.08' did not match any file(s) know to git 16:54
Sounds like git history was overriden 16:57
The commit of release github.com/perl6/nqp/commit/944cf3...53683d5eb2
did not match the one in git history
github.com/perl6/nqp/commit/2164cc...48277c0f35 16:58
17:00 AndyBotwin joined, Zoffix joined
Zoffix Oh crap 17:00
cuonglm, curious, how did you build it?
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"`
as I usual do
THe latest commit github.com/perl6/nqp/commit/ca75b3...ffa836747a 17:03
was pushed after the commit of release
maybe it rewrote the history :|
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
Zoffix cuonglm, the invalid tag you mean?
cuonglm This one github.com/perl6/nqp/commit/944cf3...53683d5eb2
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
Zoffix Basically, I discussed it elsewhere and I was told changing tags like that is a Bad Idea. 17:06
And Rakudo actually does build from scratch. I'm unsure why it doesn't with just `git pull` :/
17:06 cognominal left
cuonglm Zoffix: Because the tag release commit does not exist from source anymore, so `git pull` did not bring you the tag 17:07
Zoffix: From rakudo source, try: `(cd nqp; git tag --list | grep 2016) 17:09
and you can see `2016.08` was missed in that list
and you can see `2016.08` was missed in that output
Zoffix I do have it: gist.github.com/zoffixznet/3f9b711...092422a3eb 17:10
17:10 pecastro left, PointerCompound is now known as petercommand, pecastro_ joined, petercommand left, petercommand joined
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:11
cuonglm because you are the one create the tag 17:13
show the tag exists in your local
Can you try with a new clone from github
17:14 Ven left
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:14
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
cuonglm I don't know what logic is used to determine the wanted nqp version 17:17
17:17 domidumont joined
cuonglm quick read from `Configure.pl` show that it read from `tools/build/NQP_REVISION` 17:18
Zoffix Just this file: github.com/rakudo/rakudo/blob/nom/...P_REVISION
commitable: HEAD say 'hello' 17:24
committable6, HEAD say 'hello'
committable6 Zoffix, ¦«HEAD»: hello
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]
Zoffix (half-way through the release; just running the test suite) 17:30
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
BenGoldberg, bisect log: gist.github.com/1db5fa9c38776953bf...4e42f33f9c
BenGoldberg, (2015-12-25) github.com/rakudo/rakudo/commit/07fecb5
17:41 zacts joined 17:42 canopus left, AlexDaniel left
timotimo pmurias: i'm not sure which PR you're asking about 17:45
17:49 canopus joined 17:51 llfourn joined
pmurias timotimo: github.com/perl6/nqp/pull/283 17:53
timotimo oh. no clue 17:55
i think it needs some decision what to expose it to rakudo as
or maybe that'd be a thing the optimizer would do? not sure
BBIAB 17:56
Zoffix cuonglm, if you `git pull` it should work now
cuonglm Zoffix; Yes, building it :+1:
17:58 cuonglm left 18:02 mvorg left 18:07 prussian left 18:08 zacts left, prussian joined 18:16 BenGoldberg left 18:19 shlomif joined, rindolf left 18:20 shlomif is now known as rindolf, setty1 left
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
(and then javascript)
18:35 canopus left 18:42 canopus joined 18:45 domidumont left
pmurias timotimo: I can implement it on the js backend if it will be useful for rakudo 18:46
timotimo: can't it be implemented on the moarvm backend first? 18:49
timotimo: the jvm backend has a broken implementation of that which I can fix up 18:52
timotimo: isn't that op just an explicit version of the implicit int to num conversion? 18:53
19:06 dLeCamarae left 19:16 cognominal joined 19:17 AlexDaniel joined 19:18 ItayAlmog joined
timotimo yup 19:20
19:22 thundergnat joined
thundergnat Hi all you sixy people. 19:24
19:24 ZoffixLappy joined
ZoffixLappy \o \o 19:24
19:24 mls left 19:25 mls joined
timotimo hey you 19:25
mst ZoffixLappy: I always think there needs to be a gif of a cat attempting to lap your head 19:26
ZoffixLappy :)
thundergnat I have a perl6 problem that has been baffling me. 19:28
timotimo go on? 19:29
thundergnat I have a string containing ASCII characters that MAY contain "escape sequences" (\ followed by another character)
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.
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 \\.
m: for < \ / b t m n > -> $i { say ' \\' ~ $i, ' ', not qq|\\$i| ~~ m:r/ \\ <?before <-[n\\]>> / } 19:30
camelia rakudo-moar a07a2e: OUTPUT« \\ False␤ \/ False␤ \b False␤ \t False␤ \m False␤ \n True␤»
thundergnat \n is detected (True) but \\ isn't
timotimo i'm not sure why you use a <?before> there and not the char class directly
thundergnat Like how? 19:31
timotimo m: for < \ / b t m n > -> $i { say ' \\' ~ $i, ' ', not qq|\\$i| ~~ m:r/ \\ <-[n\\]> / }
camelia rakudo-moar a07a2e: OUTPUT« \\ True␤ \/ False␤ \b False␤ \t False␤ \m False␤ \n True␤»
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
* have to put () around
timotimo dataangel: you have to use parens if you want an argument list to end
thundergnat timotimo: yeah, that may be why I started getting more intricate. (\\\ also matching) 19:34
timotimo ah, of course 19:35
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
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
timotimo TimToady: say sum 1, 2, 3 (what goes here?), "lol" # can you drop to another sub's/listop's arglist? 19:39
19:39 lizmat joined
thundergnat timotimo: Actually \\n would be legal. Its \\ followed by n. 19:39
timotimo right
does the code i last gave you do that properly?
TimToady m: say sum 1, 2, 3 and say 4 19:40
camelia rakudo-moar a07a2e: OUTPUT«6␤4␤»
timotimo i don't let that count :)
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
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...
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)
thundergnat timotimo: It seems to, I just need to trap \\\ now. 19:41
geekosaur someone already answered that message
TimToady you can't drop just stop one level of argument though
dataangel geekosaur: makes sense thanks
timotimo right, that's what i meant :)
19:42 labster joined
geekosaur dataangel, while exises 19:42
thundergnat timotimo: Wait, no, that works the way I want. timotimo++
geekosaur docs.perl6.org/language/control#while,_until
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: en.wikibooks.org/wiki/Perl_6_Progr...ures#Loops
19:43 MilkmanDan joined
arnsholt harmil: I think it's also passed to for loops (and if, IIRC) 19:43
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')…»
harmil arnsholt: yes, but that's not a use. I'm trying to list the places that $_ is the implicit input ala Perl 5
arnsholt Oh, right
19:44 zakharyas joined 19:45 Idiosyncrat joined
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?
arnsholt That prefix dot is explicit after all, it's just very tiny =)
harmil It's my claim that this list for P5: www.perlmonks.org/?node_id=606237 drops down to three cases, but I want to be sure.
arnsholt: Yep, I'm linking to Damian's keynote for that bit
TimToady m: $_ = "foo"; tr/a..z/A..Z/; .say 19:46
camelia rakudo-moar a07a2e: OUTPUT«FOO␤»
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)
Idiosyncrat Was his training either structuralist or Chomskyan?
I don't recall him addressing that in any of his talks, etc.
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 :)
TimToady Larry is a tagmemicist 19:50
DrForr Wow, a bunch of new faces. I've gotta stay up later more often :)
harmil saves en.wikipedia.org/wiki/Tagmeme for later reading 19:51
19:51 rindolf left
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:51
Idiosyncrat Gives me something to look up. Thanks! 19:52
Reading Chomsky for the 1st time I realized that, without knowing it, I've been a Chomskyan all these years. 19:53
It comes from having learned parsing in the 1970's, when a Chomskyan framework was simply assumed.
ZoffixLappy dataangel, I think that's what my $s = Set[Type].new: ... would do 19:54
m: my $s = Set[Str].new: 'a', 'b', 'c';
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';␤»
ZoffixLappy Oh. Never mind then
m: my $s = Hash[Str].new: 'a', 'b', 'c';
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␤␤»
ZoffixLappy m: my $s = Hash[Str].new: 'a', 1, 'c', 2;
camelia ( no output )
ZoffixLappy m: my $s = Hash[Str].new: 'a', 1, 42, 2; 19:55
camelia ( no output )
ZoffixLappy :/
(it coerces it?)
TimToady apparently, but it shouldn't, unless you use Str() 19:57
dataangel So that's a bug? 19:58
Also why can't set be parameterized?
TimToady we're kinda waiting for a real object-key hash implementation, I suspect 19:59
but yeah, sets are presumably a valid kind of functor that should have a functor type 20:00
20:02 itaipu left
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:02
TimToady my %foo := set <a b c>; say %foo 20:04
m: my %foo := set <a b c>; say %foo
camelia rakudo-moar a07a2e: OUTPUT«set(a, c, b)␤»
TimToady they have more affinity to hashes than arrays, since they're unordered 20:05
dataangel Now I'm really confused O_o docs.perl6.org/type/Set uses $
So can you just use any sigil you want or...?
TimToady you can use $ on anything that you want to treat as a singular item
even if it's plural inside
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
camelia rakudo-moar a07a2e: OUTPUT«Hash $also-hash = ${:a("b"), :c("d")}␤»
dataangel dafuq
ZoffixLappy dataangel, basically @ and % are not about hashes or arrays but about giving you a Positional/Associative role as well
(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
camelia rakudo-moar a07a2e: OUTPUT«set(a, c, b)␤d => True␤e => True␤f => True␤»
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␤»
TimToady m: my $l = <a b c>; my @l = <d e f>; .say for $s; .say for @s
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␤»
TimToady m: my $l = <a b c>; my @l = <d e f>; .say for $l; .say for @l
camelia rakudo-moar a07a2e: OUTPUT«(a b c)␤d␤e␤f␤»
TimToady m: my $l = <a b c>; my @l = <d e f>; .say for @$l; .say for $@l
camelia rakudo-moar a07a2e: OUTPUT«a␤b␤c␤[d e f]␤»
20:09 itaipu joined
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:10
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
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
TimToady singular/plural is more of a natural language distinction
masak dataangel: most languages only have the $ treatment, but having the @ and % plural forms available can be terribly useful sometimes
TimToady "The team walked out the door."
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
but if I see `for @something { }`, then I know it's going to loop 0..* times
TimToady "The hospital decided to paint itself white." :)
20:11 MilkmanDan left
masak TimToady: do people actually talk like that? :P 20:12
also, that last one doesn't seem to have anything to do with plurals
TimToady no, that's given as an example of not-acceptable English
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
TimToady the hospital that decided are plural in the sense that it's a bunch of people
20:12 woolfy joined
TimToady The team voted to go home. 20:13
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
TimToady $ is really a Scalar container
m: say $_.VAR 20:16
camelia rakudo-moar a07a2e: OUTPUT«Any␤»
TimToady m: say VAR($_).WHAT
camelia rakudo-moar a07a2e: OUTPUT«(Scalar)␤»
masak dataangel: the example was silly and not real and can easily be picked apart 20:18
dataangel: but in order to make it more believeable, consider `for $array1, $array2, $array3 { }`
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?
masak C#'s `nameof` operator
dataangel: the latter
dataangel: commas can occur in expressions, so it's not even `for` doing anything, it's just... expressions in general 20:20
m: my @a = 1..20; say @a[5, 7, 3]
camelia rakudo-moar a07a2e: OUTPUT«(6 8 4)␤»
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?
masak dataangel: uhm 20:21
dataangel: my intuition is sometimes slightly pre-GLR
dataangel GLR?
masak m: my @a1 = <a b>; my @a2 = <c d>; for @a1, @a2 { .say }
camelia rakudo-moar a07a2e: OUTPUT«[a b]␤[c d]␤»
dataangel So no 20:22
masak no, it seems using $ is no different from using @ in the example I gave
...nowadays, after the Great List Refactor
b2gills m: my @a1 = <a b>; my @a2 = <c d>; for |@a1, |@a2 { .say }
camelia rakudo-moar a07a2e: OUTPUT«a␤b␤c␤d␤»
masak you'd have to write it like that, yeah
I've been putting more |s in my code lately
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?
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)␤»
smls m: my @a = [1, 2]; my $a = [3, 4]; say <a b> X @a; say <a b> X $a
camelia rakudo-moar a07a2e: OUTPUT«((a 1) (a 2) (b 1) (b 2))␤((a [3 4]) (b [3 4]))␤»
smls m: my @a = [1, 2]; my $a = [3, 4]; for flat @a, $a { .say }
camelia rakudo-moar a07a2e: OUTPUT«1␤2␤[3 4]␤»
masak dataangel: what I said for a single array still holds 20:25
m: my @a = 1, 2, 3; .say for @a; .say for $@a
camelia rakudo-moar a07a2e: OUTPUT«1␤2␤3␤[1 2 3]␤»
20:25 canopus left
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␤»
dataangel masak: so the sigil changes the behavior when you give the loop one argument, but not when you give it multiple?
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
masak dataangel: so if your next question is "why", it would serve you to understand what went into that refactor :)
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
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:29
smls exactly 20:30
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
for $a, @a { } # the thing to iterate is a list of 2 other things --> 2 iterations 20:31
for @a { } # the thing to iterate is an array of n items --> n iterations
for $a { } # the thing to iterate is an item variable --> one iteration
dataangel Gnarly
masak you quickly get used to it and exploit it to your advantage 20:32
b2gills m: say ( (1) ).perl ; say ( (1,) ).perl
camelia rakudo-moar a07a2e: OUTPUT«1␤(1,)␤»
20:33 canopus joined
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 {}
s/right/write 20:34
b2gills masak: I'm aware, and was pointing that out
masak goodie -- thought so :)
b2gills m: sub foo ( $,$,$ ){}; my @a = 1,2,3; foo @a
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␤»
b2gills m: sub foo ( $,$,$ ){}; my @a = 1,2,3; foo |@a
camelia ( no output )
20:35 ZoffixLappy left 20:36 ZoffixLappy joined
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 <…»
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?
smls dataangel: See the `X` operator and `flat` examples I posted above
20:37 canopus left
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
20:38 itaipu left
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 <…»
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.
And she's planning to move in to Sunday (I recall her mentioning). 20:39
s/in/it/;
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)
I might actually do it this Sunday, it would make things a lot easier :-)
.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
I'll try to write a blogpost about it 20:41
lizmat El_Che: what was the URL again ?
ok
20:41 wamba left
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
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
camelia ( no output )
El_Che lizmat: github.com/nxadm/syntastic-perl6, I'll post the url of the small announcement on #perl6-dev then
lizmat El_Che++
20:43 canopus joined
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
camelia ( no output )
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?
El_Che lizmat: also the code is a living proof why we need json error output :) 20:44
20:44 harmil left
b2gills dataangel: what about subroutines with the same name as a scalar? 20:45
masak dataangel: congratulations, you have re-invented an RFC ;)
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 www.perl6.org/archive/doc/design/apo/A02.html for the answer to your question
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
i.e. @$foo lets variable $foo acts like an array variable 20:47
and $@foo lets variable @foo acts like a single item
dataangel oic 20:48
b2gills m: my \var = [1,]; var[5] = 3; for @(var) {.say}
camelia rakudo-moar a07a2e: OUTPUT«1␤(Any)␤(Any)␤(Any)␤(Any)␤3␤»
dataangel god there is so much depth to this
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:49 itaipu joined
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
20:50 gtdBFmKOXx joined
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:51
smls dataangel: Set is Associative in Perl 6 20:52
it maps from any object to True ("in the set") or False ("not in the set")
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
oh that's an interesting take
20:54 Ven joined
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
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
camelia ( no output )
jnthn um
m: my @a := Set.new
camelia rakudo-moar a07a2e: OUTPUT«Type check failed in binding; expected Positional but got Set (set())␤ in block <unit> at <tmp> line 1␤␤»
jnthn Ah, smls just said what I showed :)
So @ isn't an option
smls m: my %foo := set <a a a b b c>; say %foo.keys 20:57
camelia rakudo-moar a07a2e: OUTPUT«(a c b)␤»
dataangel Cool... It is all actually logically consistent ;)
20:57 khw left
smls if you want to modify it after creation, you'll need to use SetHash instead of Set though: 20:59
m: my %foo := SetHash.new: <a b c>; %foo<d> = True; %foo<a> = False; say %foo.keys
camelia rakudo-moar a07a2e: OUTPUT«(c b d)␤»
20:59 canopus left 21:00 TEttinger joined
smls because Set is an immutable type by design 21:01
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 21:07 CIAvash left 21:08 MilkmanDan joined 21:12 leedo left
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␤»
masak ^ throws me off now and then 21:13
m: constant %h = hash foo => 1, bar => 2; say %h
camelia rakudo-moar a07a2e: OUTPUT«{bar => 2, foo => 1}␤»
21:14 benjikinz joined
benjikinz how do I loop through each character in a string 21:15
the shortest way
timotimo with comb
m: for "hello how are you".comb { say "char: $_" }
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␤»
benjikinz tyvm 21:16
timotimo YW
21:16 Idiosyncrat left
timotimo don't hesitate to ask more questions d) 21:16
:)
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
smls how come?
timotimo i haven't a clue
just speaking from experience here 21:19
jnthn Rendering combining chars is a hard problem I guess... 21:20
El_Che nxadm.wordpress.com/2016/08/20/ple...x-checker/
jnthn Heck, I suspect rendering all the Unicode things correctly in general is.
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:21 AlexDaniel left 21:26 zacts joined 21:28 khw joined 21:31 BenGoldberg joined 21:32 Ven left
benjikinz How would I make my anagram checker shorter? pastebin.com/raw/ca0eQhVv 21:33
ZoffixLappy :/ 21:35
benjikinz, does it even work? that .sort looks suspicious
benjikinz yeah it works fine
sorry if I've done something wrong
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
jnthn m: my @a = 'slaughter', 'laughters'; say [eq] (.comb.sort for @a)
camelia rakudo-moar a07a2e: OUTPUT«True␤»
benjikinz jnthn, that is way better jeez
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)
camelia rakudo-moar a07a2e: OUTPUT«Method 'bag' not found for invocant of class 'Seq'␤ in block <unit> at <tmp> line 1␤␤»
ZoffixLappy Oh. I confused anagram with palindrome doh >_<
lizmat m: my @a = 'slaughter', 'laughters'; say [eq] (.comb.Bag for @a)
camelia rakudo-moar a07a2e: OUTPUT«True␤»
smls lizmat: Is it safe to rely on the string representation of a Bag to be returned in the same order twice? 21:38
lizmat guess not 21:39
ZoffixLappy m: say 'slaughter'.comb.Bag eqv 'laughters.comb.Bag
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␤ …»
ZoffixLappy m: say 'slaughter'.comb.Bag eqv 'laughters'.comb.Bag
camelia rakudo-moar a07a2e: OUTPUT«True␤»
ZoffixLappy m: say 'slaughter'.comb.Bag eqv 'laughtersz'.comb.Bag
camelia rakudo-moar a07a2e: OUTPUT«False␤»
lizmat m: my @a = 'slaughter', 'laughters'; say [~~] (.comb.Bag for @a)
camelia rakudo-moar a07a2e: OUTPUT«True␤»
smls m: my @a = <slaughter laughters>; say [===] (.comb.Bag for @a) 21:40
camelia rakudo-moar a07a2e: OUTPUT«True␤»
lizmat that I think you *can* depend on
~~ I mean
Bag ~~ Bag
jnthn ~~ is probably safe, yeah
I suspect my way is cheaper though :)
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?
lizmat jnthn: actually, atm it's not cheaper, but I could make it cheaper :-)
21:41 AlexDaniel joined
ZoffixLappy benjikinz, Bag is a type where items have integer weights: docs.perl6.org/language/setbagmix 21:42
jnthn lizmat: Oh, curious. Bag is apparently more performant than I expect :)
That makes me happy
ZoffixLappy m dd bag <a b c d a a a a c c>
m: dd bag <a b c d a a a a c c>
camelia rakudo-moar a07a2e: OUTPUT«("a"=>5,"c"=>3,"b"=>1,"d"=>1).Bag␤»
ZoffixLappy benjikinz, ^ useful when you want to count things
21:43 zakharyas left
benjikinz I see 21:44
21:46 itaipu left
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␤»
ZoffixLappy And it can be a gotcha for stuff coming in from @*ARGS or <a b c> lists. 21:52
m dd bag flat <1 2 3>, 1, '2', 3; 21:53
m: dd bag flat <1 2 3>, 1, '2', 3;
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:58 labster left 22:00 pochi_ joined, Zoffix__ joined, espadrine joined, Xliff_ joined 22:01 llfourn_ joined, john51_ joined 22:02 paraboli` joined, nebuchad` joined
Xliff_ m: my @a = 1 xx 2, 3 xx 4, 5 xx 6; say @a.bag 22:03
camelia rakudo-moar a07a2e: OUTPUT«Method 'bag' not found for invocant of class 'Array'␤ in block <unit> at <tmp> line 1␤␤»
Xliff_ m: my @a = 1 xx 2, 3 xx 4, 5 xx 6; say @a.Bag
22:03 jnthn_ joined
camelia rakudo-moar a07a2e: OUTPUT«bag((3 3 3 3), (5 5 5 5 5 5), (1 1))␤» 22:03
22:03 krakan_ joined, pnu_ left, sno left, tadzik left, bitmap_ joined, pierrot left, bitmap left, jnthn left, hcit left, ggherdov left, pochi left, bitmap_ is now known as bitmap, tadzik1 joined, jnthn_ is now known as jnthn, llfourn left, Zoffix left, RabidGravy left, Xliff left, parabolize left, john51 left, infina left, dataangel left, woodruffw left, Util left, esh_ joined, jdv79 left, esh left, petercommand left, shadowpaste left, nebuchadnezzar left, ggherdov_ joined, dataangel joined 22:04 sno joined, webstrand left, DrForr joined 22:05 khagan joined, hcit joined, jdv79 joined, petercommand joined, Util joined, cxreg joined
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 ggherdov_ is now known as ggherdov
lizmat m: my @a = flat 1 xx 2, 3 xx 4, 5 xx 6; dd @a # underlying issue 22:07
camelia rakudo-moar a07a2e: OUTPUT«Array @a = [1, 1, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5]␤»
22:07 espadrine left 22:08 pmurias left, woodruffw joined, woodruffw left 22:09 woodruffw joined, chris2 left 22:12 nadim left, remmie joined, nadim joined, flobbertygibbet joined 22:13 smls left, itaipu joined 22:15 tbrowder joined, pnu_ joined 22:16 ssm joined, RabidGravy joined 22:18 pierrot joined
tbrowder m: my $s = '1.2.3.4'; say "True" if $s ~~ /([^\\])\./; 22:18
camelia ( no output )
tbrowder Can anyone please tell me why the match above isn't true? 22:20
ZoffixLappy m: my $s = '1.2.3.4'; say "True" if $s ~~ /<-[\\]>\./; 22:21
camelia rakudo-moar 5a4ec5: OUTPUT«True␤»
ZoffixLappy ([^\\]) is Perl 5/PCRE-ism
m: my $s = '1.2.3.4'; say "True" if $s ~~ m:P5/([^\\])\./; 22:22
camelia rakudo-moar 5a4ec5: OUTPUT«True␤»
22:23 zacts left
tbrowder Argh! Thanks. I tried the <[]> construct but I guess I fumbled it because I used the ^ instead of the -. Thanks again, Zoffix. 22:24
22:27 shadowpaste joined
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…»
timotimo m: /[a-z]/ # do we warn about this at all?
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␤…»
timotimo no "this looks like a perl5 character class" warning?
grondilu that would be usefull indeed. 22:28
it's an easy mistake to make.
ZoffixLappy nods 22:29
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:30
we could put "Listen: this is Perl 6. Stop trying all your Perl 5 idioms and instead RTFM." (just kidding of course) 22:31
ZoffixLappy It's not just P5, but PCRE in general. 22:33
timotimo and every other regex dialect out there
ZoffixLappy [and I'd avoid refering to P5 in this particular warning/error, if it's added]
grondilu true 22:34
timotimo we have :m and :i and such that can go anywhere inside a regex, but :P5 can't :P
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:35
timotimo: surely there is a way to put an adverb inside the regex, isn't there? 22:36
oh wait, I did not read you corectly.
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
grondilu indeed. 22:37
I actually did not know one could put the adverb inside so simply (except for P5)
m: say "foo" ~~ / :i F / 22:38
camelia rakudo-moar 5a4ec5: OUTPUT«「f」␤»
grondilu neat
timotimo goes inside of parens and such, too 22:41
22:42 firstdayonthejob left 22:44 zacts joined 22:50 leego is now known as leedo 22:56 flobbertygibbet left 22:57 BenGoldberg left 22:58 Girafferson left 23:00 Matthew[m] left, tadzik1 left, M-Illandan left 23:05 woolfy left 23:06 nadim left
b2gills To be fair :P5 changes regexes to be parsed as PCRE which wouldn't support something like :P5 being there 23:08
23:14 tadzik joined
El_Che nxadm.wordpress.com/2016/08/21/vim...-6-editor/ 23:18
23:23 perlawhirl joined
perlawhirl hi perlers 23:23
i was just reading the above on anagram solving and P5-isms which is exactly what i was playing with earlier 23:24
gist.github.com/0racle/644a656d327...d039d5cfd5
if your wanna test it, you'll need a wordlist, I'm using the SOWPODS list.
so there's 2 subs... iter() is the more P5-ish way you would do it 23:25
23:25 AlexDaniel left
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:25
on my 32-bit machine (*cry*), gathering the iter() sub takes 10 seconds, bags() takes 14 23:26
masak perlawhirl: did you consider `next WORD if !%tiles{$_} || $letters{$_} > %tiles{$_} for $letters.keys` ? 23:28
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
masak got it 23:30
ZoffixLappy New blog post: "I Botched a Perl 6 Release And Now a Robot Is Taking My Job": perl6.party/post/I-Botched-A-Perl-6...ing-My-Job 23:31
23:32 zacts left 23:37 MilkmanDan left
ZoffixLappy Randal Schwartz is in the hospital :/ blogs.perl.org/users/brian_d_foy/20...-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' :/
El_Che are the 2 lines connected? What did you do with merilyn? :) 23:43
ZoffixLappy i didn't do anything. 23:45
wink wink
El_Che :)
23:53 labster joined 23:55 lizmat_ joined, lizmat left 23:56 MilkmanDan joined 23:57 zengargoyle left, canopus left, ZoffixLappy left