Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-09-17

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:05 ipatrol AlexDaniel: can you amend the commit to link to my github page?
00:05 ipatrol https://github.com/ipatrol
00:10 raschipi Soon Zoffix will get you to work for him.
00:14 ipatrol lol
00:15 ipatrol Anyway, is there a way to have one hash partially overwrite another, similar to push(), but without the array semantics?
00:16 raschipi Yes
00:18 ipatrol raschipi: which is...?
00:18 raschipi No idea.; I just remember there is a simple way.
00:19 raschipi It's common for people to ask in the channel. I don't remember what the solution is, though.
00:19 ipatrol raschipi: python has dict.update(), I can only presume P6 has something similar
00:20 raschipi Let me think about it for one minute more.
00:20 Guest23973 joined #perl6
00:20 Guest23973 joined #perl6
00:21 grondilu Is there a simple way to "negate" an Order?
00:21 grondilu lol nevermind I can just reverse the arguments
00:21 grondilu :P
00:22 grondilu (silly thing is : that's what I did, but I forgot I did it :/)
00:23 raschipi ipatrol: Maybe %h{%g.keys} =  %g.values ?
00:24 grondilu can you rely on them being in the same order?
00:24 raschipi Yes, it will call sort beforehand.
00:25 timotimo not sure if .keys and .values are always guaranteed to be in sync?
00:25 grondilu you may need a prefix:<|> though
00:25 raschipi Worked for me without the slip
00:25 ipatrol m: %h = 'a'=>'b','c'=>'d'; %g = 'f'=>'g','c'=>'e'; %h{%g.keys} =  %g.values; say %h;
00:25 camelia rakudo-moar 488ca6: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '%h' is not declared␤at <tmp>:1␤------> 3<BOL>7⏏5%h = 'a'=>'b','c'=>'d'; %g = 'f'=>'g','c␤»
00:25 timotimo my at the very beginning
00:25 ipatrol m: my %h = 'a'=>'b','c'=>'d'; my %g = 'f'=>'g','c'=>'e'; %h{%g.keys} =  %g.values; say %h;
00:25 camelia rakudo-moar 488ca6: OUTPUT: «{a => b, c => e, f => g}␤»
00:25 raschipi how do I ask the bot to link source? Most compli9cated bot ever that one
00:26 ipatrol m: my %h = 'a'=>'b','c'=>'d'; my %g = 'f'=>'g','c'=>'e'; %h.push(%g); say %h;
00:26 camelia rakudo-moar 488ca6: OUTPUT: «{a => b, c => [d e], f => g}␤»
00:26 grondilu evalable6: help
00:26 evalable6 grondilu, Like this: evalable6: say ‘hello’; say ‘world’ # See wiki for more examples: https://github.com/perl6/whateverable/wiki/Evalable
00:26 raschipi SourceBaby: help
00:26 SourceBaby raschipi, Use s: trigger with args to give to sourcery sub. e.g. s: Int, 'base'. See http://modules.perl6.org/dist/CoreHackers::Sourcery
00:26 grondilu lol I found the evalbot help on first try :)
00:27 headcase joined #perl6
00:27 ipatrol raschipi: at any rate, it seems like something that ought to exist as a method. Perhaps a feature request is in order?
00:27 timotimo m: my %h = :1a, :1c; my %g = :2a, :3g; my %comb = %h, %g; say %comb
00:27 camelia rakudo-moar 488ca6: OUTPUT: «{a => 2, c => 1, g => 3}␤»
00:27 timotimo this is probably more correct
00:27 raschipi ipatrol: It does exist, I just don't remember what it is.
00:28 ipatrol timotimo: that would be a non-destructive way to do it, apparently
00:29 timotimo well, you can also %h ,= %g
00:29 timotimo m: my %h = :1a, :1c; my %g = :2a, :3g; %h ,= %g; say %h
00:29 camelia rakudo-moar 488ca6: OUTPUT: «{a => 2, c => 1, g => 3}␤»
00:29 timotimo ^- there you go
00:29 raschipi there it is, told you ipatrol
00:30 raschipi thanks timotimo
00:30 ipatrol so the comma operator joins hashes?
00:31 raschipi ope, comma operator builds lists
00:31 raschipi nope*
00:31 ipatrol raschipi: normally, but I take it in hash context it will join hashes?
00:33 ipatrol or more precisely, it turns both hashes to lists of pairs, makes a list of each of them, and when one then assigns that nested list to a hash container, it is then flattened?
00:33 timotimo that's how i assume it goes, yeah
00:33 raschipi Not the comma operator
00:33 raschipi The asignement to the hash does that
00:34 ipatrol m: my %h = :1a, :1c; my %g = :2a, :3g; say %h, %g;
00:34 camelia rakudo-moar 488ca6: OUTPUT: «{a => 1, c => 1}{a => 2, g => 3}␤»
00:34 timotimo yes, the list assignment part is the important bit
00:36 raschipi m: my %h = :1a, :1c; my %g = :2a, :3g; dd (%h, %g);
00:36 camelia rakudo-moar 488ca6: OUTPUT: «({:a(1), :c(1)}, {:a(2), :g(3)})␤»
00:37 ipatrol would love a debug mode that will tell you what is the canonical equivalent, in terms of explicit function calls, of whatever was just executed
00:37 raschipi Not everything can be done with function calls
00:38 Cabanossi joined #perl6
00:38 raschipi OPerators don't need to map to function calls. Some are even special cased in the compiler and there would be no way of doing what the do with function calls.
00:38 timotimo a desugar module would be nice
00:39 timotimo i'd say it'd be fine to "bottom out" in those cases without making it any simpler
00:39 ipatrol right, what timotimo said
00:39 grondilu what's the syntax to make a unicode character from its english description?
00:40 headcase joined #perl6
00:40 ipatrol \c[NAME]
00:40 grondilu oh yeah, thanks
00:41 timotimo there's also a function for that
00:41 ipatrol \c[YOU ARE WELCOME]
00:45 MasterDuke ipatrol: it's not quite exactly what you said. but if you use MVM_COVERAGE_LOG=<something> and MVM_COVERAGE_CONTROL=1, you could put an nqp::coveragecontrol(1) right before the part you're interested in and nqp::coveragecontrol(0) right after
00:45 ipatrol MasterDuke: I have no idea how one would even go about doing that
00:46 ipatrol are those pragmas or something?
00:46 MasterDuke and the log would show you what lines in the rakudo source are being executed
00:46 MasterDuke environment variables
00:46 AlexDaniel ipatrol: aw yeah, should've use “@ipatrol” to link it automatically. I guess it's too late now, but will do next time :)
00:46 ipatrol AlexDaniel: I know you can amend commits in git
00:47 AlexDaniel last commit yeah, two commits deep requires some kind of rebase magic
00:47 AlexDaniel I have a better solution, hold on
00:47 raschipi Not when they are merged upstream
00:47 raschipi In local only commits, that's possible.
00:48 AlexDaniel raschipi: you can still force-push it, not that big of a deal for small repos like whateverable
00:48 timotimo git rebase -i origin/master will let you change a "pick" to "reword" and then it'll let you rewrite the commit message and you'll still end up with all commits you had in the same order
00:48 timotimo if you have already pushed it, you can use a different commit from origin/master, like HEAD~4 or so
00:48 raschipi Right, it's only a problem is a fork pulls it.
00:48 grondilu say I have two types Foo and Bar and I defined multi infix:<leg>(Foo $, Bar $).  I shouldn't have to define multi infix:<leg>(Bar $, Foo $), shoud I?  I mean, can't I use the antisymmetricity or something?
00:48 raschipi if a fork*
00:48 MasterDuke `MVM_COVERAGE_LOG=<something> MVM_COVERAGE_CONTROL=1 perl6 -e 'use nqp; my %h = :1a, :1c; my %g = :2a, :3g; nqp::coveragecontrol(1); my %i = %h, %g; nqp::coveragecontrol(0); say %i'`
00:48 MasterDuke something like that ^^^
00:49 timotimo grondilu: it won't do that for you, i don't think
00:49 grondilu well, that's LTA
00:49 grondilu can't someone write a "is antisymmetric" trait or something?
00:52 grondilu no seriously it's LTA.  If there is a candidate for foo leg bar, but none for bar leg foo, it should fall back on the former to define the latter.
00:52 ipatrol m: %h = :a(1), :b(2), :c(4); %h = %h , %h.invert; say %h;
00:52 camelia rakudo-moar 488ca6: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '%h' is not declared␤at <tmp>:1␤------> 3<BOL>7⏏5%h = :a(1), :b(2), :c(4); %h = %h , %h.i␤»
00:52 grondilu because duplicating the declarations feels very dumb.
00:52 ipatrol m: my %h = :a(1), :b(2), :c(4); %h = %h , %h.invert; say %h;
00:52 camelia rakudo-moar 488ca6: OUTPUT: «Odd number of elements found where hash initializer expected:␤Found 7 (implicit) elements:␤Last element seen: $((1 => "a", 4 => "c", 2 => "b").Seq)␤  in block <unit> at <tmp> line 1␤␤»
00:52 timotimo probably have to |%h.invert that
00:52 * timotimo goes to bed
00:52 ipatrol m: my %h = :a(1), :b(2), :c(4); %h = %h , |%h.invert; say %h;
00:52 camelia rakudo-moar 488ca6: OUTPUT: «{1 => a, 2 => b, 4 => c, a => 1, b => 2, c => 4}␤»
00:53 ipatrol m: my %h = :a(1), :b(2), :c(4); say %h, %h.invert;
00:53 camelia rakudo-moar 488ca6: OUTPUT: «{a => 1, b => 2, c => 4}(1 => a 4 => c 2 => b)␤»
00:54 headcase joined #perl6
00:54 ipatrol m: my %h = :a(1), :b(2), :c(4); %h = %h , %h.invert.Hash; say %h;
00:54 camelia rakudo-moar 488ca6: OUTPUT: «{1 => a, 2 => b, 4 => c, a => 1, b => 2, c => 4}␤»
00:54 raschipi m: my %h = :a(1), :b(2), :c(4), :d('d'); %h = %h , |%h.invert; say %h;
00:54 camelia rakudo-moar 488ca6: OUTPUT: «{1 => a, 2 => b, 4 => c, a => 1, b => 2, c => 4, d => d}␤»
00:54 raschipi Now which is mine and which is yours?
00:55 piojo joined #perl6
00:55 raschipi The second one is mine because of the d
00:55 ipatrol actually, it should use antipairs to avoid array expansion
00:55 AlexDaniel ipatrol: here https://github.com/perl6/whateverable/wiki/Evalable#magical-code-auto-detection
00:56 ipatrol m: my %h = :a(1), :b(2), :c(4); %h = %h , %(%h.antipairs); say %h;
00:56 camelia rakudo-moar 488ca6: OUTPUT: «{1 => a, 2 => b, 4 => c, a => 1, b => 2, c => 4}␤»
00:56 ipatrol AlexDaniel: thank you
00:56 ipatrol And next time, please ask me before including my quips into some random project.
00:56 AlexDaniel ipatrol: you are right
00:57 AlexDaniel ipatrol: I didn't quite think it through, sorry :)
00:59 ipatrol $ipatrol.ACCEPTS($AlexDaniel::apology)
00:59 ipatrol ;-)
01:00 raschipi ipatrol: That's better written as '$AlexDaniel::apology ~~ $ipatrol'
01:01 ipatrol ordinarily, but sometimes, explicit is better than implicit :-P
01:01 raschipi I think I know what you guys wanted above, a way for the debbuger to print which functions are being called?
01:01 ipatrol raschipi: some kind of desugaring apparatus
01:02 raschipi so, to know $AlexDaniel::apology ~~ $ipatrol calls $ipatrol.ACCEPTS($AlexDaniel::apology), you'd want thew debugger to go into it...
01:03 ipatrol something like that
01:08 raschipi There's also a bot around that can tell you things like that.
01:09 AlexDaniel m: say 42
01:09 camelia rakudo-moar 488ca6: OUTPUT: «42␤»
01:10 headcase joined #perl6
01:11 itaipu joined #perl6
01:12 ipatrol why does using packages cause these two statements to compile differently?
01:12 ipatrol m: my @Characters::Hiragana = ("\x3040".."\x3050").list; my @Characters::Katakana = ("\x30A0".."\x30AA").list; say %({ my %h = @Characters::Hiragana Z=> @Characters::Katakana; %(%h , |%h.antipairs)}());
01:12 camelia rakudo-moar 488ca6: OUTPUT: «{぀ ぁ あ ぃ い ぅ う ぇ え ぉ お か が き ぎ く ぐ => (゠ ァ ア ィ イ ゥ ウ ェ エ ォ オ), ゠ ァ ア ィ イ ゥ ウ ェ エ ォ オ => ぀ ぁ あ ぃ い ぅ う ぇ え ぉ お か が き ぎ く ぐ}␤»
01:14 ipatrol m: my @Hiragana = ("\x3040".."\x3050").list; my @Katakana = ("\x30A0".."\x30AA").list; say %({ my %h = @Hiragana Z=> @Katakana; %h , |%h.antipairs}());
01:14 camelia rakudo-moar 488ca6: OUTPUT: «{぀ => ゠, ぁ => ァ, あ => ア, ぃ => ィ, い => イ, ぅ => ゥ, う => ウ, ぇ => ェ, え => エ, ぉ => ォ, お => オ, ゠ => ぀, ァ => ぁ, ア => あ, ィ => ぃ, イ => い, ゥ => ぅ, ウ => う, ェ => ぇ, エ => え, ォ => ぉ, …»
01:15 headcase joined #perl6
01:15 ipatrol m: my @Characters::Hiragana = ("\x3040".."\x3050").list; my @Characters::Katakana = ("\x30A0".."\x30AA").list; dd %({ my %h = @Characters::Hiragana Z=> @Characters::Katakana; %(%h , |%h.antipairs)}());
01:15 camelia rakudo-moar 488ca6: OUTPUT: «Hash % = {"぀ ぁ あ ぃ い ぅ う ぇ え ぉ お か が き ぎ く ぐ" => $("゠", "ァ", "ア", "ィ", "イ", "ゥ", "ウ", "ェ", "エ", "ォ", "オ"), "゠ ァ ア ィ イ ゥ ウ ェ エ ォ オ" => "぀ ぁ あ ぃ い ぅ う ぇ え ぉ …»
01:16 ipatrol m: my @Characters::Hiragana = ("\x3040".."\x3050").list; my @Characters::Katakana = ("\x30A0".."\x30AA").list; dd { my %h = @Characters::Hiragana Z=> @Characters::Katakana; %(%h , |%h.antipairs)}();
01:16 camelia rakudo-moar 488ca6: OUTPUT: «Hash % = {"぀ ぁ あ ぃ い ぅ う ぇ え ぉ お か が き ぎ く ぐ" => $("゠", "ァ", "ア", "ィ", "イ", "ゥ", "ウ", "ェ", "エ", "ォ", "オ"), "゠ ァ ア ィ イ ゥ ウ ェ エ ォ オ" => "぀ ぁ あ ぃ い ぅ う ぇ え ぉ …»
01:17 ipatrol m: my @Characters::Hiragana = ("\x3040".."\x3050").list; my @Characters::Katakana = ("\x30A0".."\x30AA").list; dd { @Characters::Hiragana }();
01:17 camelia rakudo-moar 488ca6: OUTPUT: «List $v = $("぀", "ぁ", "あ", "ぃ", "い", "ぅ", "う", "ぇ", "え", "ぉ", "お", "か", "が", "き", "ぎ", "く", "ぐ")␤»
01:17 ipatrol m: my @Hiragana = ("\x3040".."\x3050").list; my @Characters::Katakana = ("\x30A0".."\x30AA").list; dd { @Hiragana }();
01:17 camelia rakudo-moar 488ca6: OUTPUT: «Array @Hiragana = ["぀", "ぁ", "あ", "ぃ", "い", "ぅ", "う", "ぇ", "え", "ぉ", "お", "か", "が", "き", "ぎ", "く", "ぐ"]␤»
01:17 ipatrol list versus array
01:18 ipatrol but why?
01:20 ipatrol m: my @Characters::Hiragana = ("\x3040".."\x3050").Array; my @Characters::Katakana = ("\x30A0".."\x30AA").Array; dd { @Characters::Hiragana }();
01:20 camelia rakudo-moar 488ca6: OUTPUT: «Array $v = $["぀", "ぁ", "あ", "ぃ", "い", "ぅ", "う", "ぇ", "え", "ぉ", "お", "か", "が", "き", "ぎ", "く", "ぐ"]␤»
01:21 ipatrol m: my @Characters::Hiragana = ("\x3040".."\x3050").Array; my @Characters::Katakana = ("\x30A0".."\x30AA").Array; dd %({ my %h = @Characters::Hiragana Z=> @Characters::Katakana; %(%h , |%h.antipairs)}());
01:21 camelia rakudo-moar 488ca6: OUTPUT: «Hash % = {"぀ ぁ あ ぃ い ぅ う ぇ え ぉ お か が き ぎ く ぐ" => $["゠", "ァ", "ア", "ィ", "イ", "ゥ", "ウ", "ェ", "エ", "ォ", "オ"], "゠ ァ ア ィ イ ゥ ウ ェ エ ォ オ" => "぀ ぁ あ ぃ い ぅ う ぇ え ぉ …»
01:21 ipatrol no, still not right
01:22 ipatrol m: my @Characters::Hiragana = ("\x3040".."\x3050").Array; my @Characters::Katakana = ("\x30A0".."\x30AA").Array; dd %({ my %h = (@Characters::Hiragana Z=> @Characters::Katakana).Array; %(%h , |%h.antipairs)}());
01:22 camelia rakudo-moar 488ca6: OUTPUT: «Hash % = {"぀ ぁ あ ぃ い ぅ う ぇ え ぉ お か が き ぎ く ぐ" => $["゠", "ァ", "ア", "ィ", "イ", "ゥ", "ウ", "ェ", "エ", "ォ", "オ"], "゠ ァ ア ィ イ ゥ ウ ェ エ ォ オ" => "぀ ぁ あ ぃ い ぅ う ぇ え ぉ …»
01:23 AlexDaniel m: my @A::B = (0..5); my @C = (0..5); dd @A::B; dd @C
01:23 camelia rakudo-moar 488ca6: OUTPUT: «Range $v = 0..5␤Array @C = [0, 1, 2, 3, 4, 5]␤»
01:23 AlexDaniel what a wonderful question :)
01:23 Cabanossi joined #perl6
01:24 MasterDuke ?!
01:24 ipatrol AlexDaniel: that's never a good thing to hear in a programming language chat room
01:24 AlexDaniel MasterDuke: why is it different?
01:24 MasterDuke tiny elves
01:25 ipatrol ha
01:25 ipatrol the module form stores it as an object, but the regular form stores it as an unrolled array
01:26 AlexDaniel fwiw that's not some new behavior, we had it like this at least since 2014.10
01:27 ipatrol AlexDaniel: how can you tell?
01:27 AlexDaniel committable6: all my @A::B = (0..5); my @C = (0..5); dd @A::B; dd @C
01:27 ipatrol ?
01:27 committable6 AlexDaniel, https://gist.github.com/a1d7f902c1e25317c7c0993e0cc7e10d
01:27 AlexDaniel ipatrol: ^
01:29 ipatrol ok
01:29 headcase joined #perl6
01:29 ipatrol http://i0.kym-cdn.com/entries/icons/original/000/022/978/yNlQWRM.jpg
01:30 AlexDaniel timotimo: maybe you know?
01:35 BenGoldberg joined #perl6
01:42 ipatrol AlexDaniel: lacking a convincing explanation, I'd go ahead and say that the behavior is wrong, since is appears to violate the specifications for both hashes and packages.
01:52 ipatrol As well as for ranges
01:52 AlexDaniel ipatrol: feel free to create a ticket. At this time of the day most people are asleep, and I am not knowledgable enough to give a proper answer :(
01:52 AlexDaniel huggable: rakudobug
01:52 huggable AlexDaniel, Report bugs by emailing to <rakudobug@perl.org>. See also: https://github.com/rakudo/rakudo/wiki/rt-introduction
01:54 ilbot3 joined #perl6
01:54 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:56 raschipi ipatrol: You really like redudancy...
01:56 ipatrol raschipi: no, what makes you say that?
01:57 raschipi say calls .gist
01:58 ipatrol raschipi: being explicit in order to rule out any other edge cases
01:59 raschipi Well, that looks like the opposite to me, because it will call .gist twice...
01:59 raschipi It will call .gist on the result of .gist
02:00 ipatrol raschipi: I don't know what the bot does though
02:00 headcase joined #perl6
02:00 raschipi Why would you suppose it's different?
02:01 ipatrol raschipi: I don't know if it rebinds it to send the output to the channel instead of stdout
02:01 raschipi redirection? why would it matter...
02:04 ipatrol Don't know if it does other formatting things instead of gist
02:05 raschipi Well, call 'put $var.gist' so it do what you're asking for.
02:06 kaare__ joined #perl6
02:06 ipatrol or I can check it in my console, which I know is stock
02:06 noganex joined #perl6
02:08 Cabanossi joined #perl6
02:10 headcase joined #perl6
02:12 ipatrol AlexDaniel: another thing: the Z metaop apparently doesn't treat iterables properly that it gets through package references, instead wrapping them like scalar values
02:15 ipatrol m: my @A::B = (1..8); my @A::C = ('A'..'H'); say @A::B Z @A::C; say @(@A::B) Z @(@A::C);
02:15 camelia rakudo-moar 488ca6: OUTPUT: «((1..8 "A".."H"))␤((1 A) (2 B) (3 C) (4 D) (5 E) (6 F) (7 G) (8 H))␤»
02:18 ipatrol bbl
02:18 mst lizmat:
02:18 mst bah, paste error, ignore me
02:26 ipatrol m: my @A::B = [1,2,3,4]; my @A::C = [5,6,7,8]; say @A::B Z @A::C; say @(@A::B) Z @(@A::C);
02:26 camelia rakudo-moar 488ca6: OUTPUT: «(([1 2 3 4] [5 6 7 8]))␤((1 5) (2 6) (3 7) (4 8))␤»
02:26 ipatrol m: my @A::B = (1,2,3,4); my @A::C = (5,6,7,8); say @A::B Z @A::C; say @(@A::B) Z @(@A::C);
02:26 camelia rakudo-moar 488ca6: OUTPUT: «(((1 2 3 4) (5 6 7 8)))␤((1 5) (2 6) (3 7) (4 8))␤»
02:31 headcase_ joined #perl6
02:50 Actualeyes joined #perl6
02:55 itaipu joined #perl6
03:01 headcase joined #perl6
03:06 headcase joined #perl6
03:07 headcase_ joined #perl6
03:11 aborazmeh joined #perl6
03:11 aborazmeh joined #perl6
03:23 Cabanossi joined #perl6
03:37 Cabanossi joined #perl6
03:43 simonm joined #perl6
04:03 zakame joined #perl6
04:07 Cabanossi joined #perl6
04:14 headcase joined #perl6
04:26 skids joined #perl6
04:31 wander4096 joined #perl6
04:32 wander4096 doc writes
04:32 wander4096 multi sub    perl(Mu --> Str)
04:32 wander4096 but
04:32 wander4096 m: perl 42
04:32 camelia rakudo-moar b76f7c: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    perl used at line 1␤␤»
04:32 wander4096 m: perl("String")
04:32 camelia rakudo-moar b76f7c: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    perl used at line 1␤␤»
04:32 wander4096 so what does this line in doc mean?
04:34 wander4096 also it says that `multi method Str(--> Str)`
04:34 wander4096 and `method self(--> Mu)`
04:34 wander4096 m: Str(42:)
04:34 camelia rakudo-moar b76f7c: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')'␤at <tmp>:1␤------> 3Str(42:7⏏5)␤    expecting any of:␤        colon pair␤»
04:34 wander4096 m: self(42:)
04:34 camelia rakudo-moar b76f7c: ( no output )
04:34 wander4096 m: say self(42:)
04:34 camelia rakudo-moar b76f7c: OUTPUT: «42␤»
04:35 wander4096 what happens?
05:08 grondilu m: proto f($? --> Int) {*}; multi f() { rand }; f()
05:08 camelia rakudo-moar b76f7c: ( no output )
05:09 grondilu what's the point of having a return type in the proto signature if it has no impact on the multis??
05:10 grondilu I mean come on
05:14 Geth ¦ doc: 2e8bfea37f | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Mu.pod6
05:14 Geth ¦ doc: We don't have sub form of `perl`
05:14 Geth ¦ doc: review: https://github.com/perl6/doc/commit/2e8bfea37f
05:16 headcase joined #perl6
05:28 Lasse_ joined #perl6
05:40 headcase joined #perl6
05:47 geekosaur m: proto f($? --> Int) {*}; multi f() { rand }; say f()
05:47 camelia rakudo-moar b76f7c: OUTPUT: «0.966105556137982␤»
05:48 u-ou what does proto do?
05:50 headcase joined #perl6
05:52 geekosaur sets up for what C++/Java call overloading (multiple definitions distinguished and dispatched based on different signatures)
05:52 geekosaur without that you get a multiple definition error
05:58 u-ou ah
05:58 geekosaur actually that is multi, not sure how proto fits in with that (actually the combination seems slightly odd tbh)
05:59 u-ou but you can't have one without the other?
05:59 geekosaur that is what is confusing me. proto is something I think fo as being in the declaration for each impl because that;s how they're dispatched
05:59 headcase joined #perl6
05:59 geekosaur so a single common proto seems contradictory to me as it implies no way to dispatch on proto
06:00 * geekosaur is poking at docs...
06:01 geekosaur well, the doc I just read implies what I said was right...
06:01 geekosaur ah, it allows abstracting out a common core
06:02 geekosaur including common code, apparently, by providing a body with {*} where dispatch to the specific candidate should happen
06:04 geekosaur so, given that, brings me to what I was thinking of about it: it was degtermined that letting the return type specification be obeyed at all implies return type polymorphism (a la Haskell typeclasses), which has been rejected
06:04 geekosaur but in that case it should probably at least warn
06:05 geekosaur also the docs say nothing whatsoever about the return type, but: "It acts as a wrapper that can validate but not modify arguments."
06:05 geekosaur implying it doesn't act as a normal declarator at all
06:07 geekosaur so, might be worth a LTA bug (although I am not sure if it should error or warn)
06:09 headcase joined #perl6
06:22 Cabanossi joined #perl6
06:28 piojo joined #perl6
06:35 piojo_ joined #perl6
06:36 nadim joined #perl6
06:39 ufobat___ joined #perl6
06:43 entonian joined #perl6
06:51 setty1 joined #perl6
07:09 konsolebox joined #perl6
07:10 ufobat_ joined #perl6
07:15 orac1e_ joined #perl6
07:20 darutoko joined #perl6
07:23 rindolf joined #perl6
07:23 piojo joined #perl6
07:23 headcase joined #perl6
07:32 headcase joined #perl6
07:38 headcase joined #perl6
07:39 domidumont joined #perl6
07:44 domidumont joined #perl6
07:53 headcase joined #perl6
08:02 LanceW joined #perl6
08:07 Cabanossi joined #perl6
08:10 headcase joined #perl6
08:12 Rawriful joined #perl6
08:13 LanceW Hi all, I have been experimenting with Perl6 on a Windows 10 laptop (using berrybrew for perl5 and then rakudobrew for perl6). So far all good... at least until I tried to use zef to install Bailador, DBIish etc. I get and error about "No such method 'subst' for invocant of type 'Any'" anyone got some ideas. Googling turned up https://rt.perl.org/Public/Bug/Display.html?id=131815 but even after reinstall same issue. I have a gist of full
08:13 LanceW error: https://gist.github.com/lancew/f1d5d4af5175c28ed32b77c81c992601 ANy assistance appreciated.
08:17 okl joined #perl6
08:19 headcase joined #perl6
08:21 zakharyas joined #perl6
08:33 headcase joined #perl6
08:37 gfldex LanceW: we dont got recent binaries for windows. So you would have to build rakudo by hand.
08:40 LanceW gfldex, building with rakudobrew is not sufficient?
08:45 HoboWithAShotgun joined #perl6
08:47 headcase joined #perl6
08:47 HoboWithAShotgun good localtime you wonderful people
08:48 pecastro joined #perl6
08:50 HoboWithAShotgun what a lovely day this is
08:51 HoboWithAShotgun nothing beats sitting on your desk with a huge weekend joint and a cold german beer, after a wakeup bj and a rich breakfast
08:56 headcase joined #perl6
08:56 gfldex LanceW: we are at This is Rakudo version 2017.08-155-gc3a71acb3 built on MoarVM version 2017.08.1-171-gcf95892e6
08:56 gfldex implementing Perl 6.c.
09:00 stmuk LanceW: I can try in an hour or so
09:03 konsolebox joined #perl6
09:05 headcase joined #perl6
09:07 Cabanossi joined #perl6
09:07 LanceW thanks stmuk
09:14 headcase joined #perl6
09:15 piojo joined #perl6
09:29 headcase joined #perl6
09:41 jcallen joined #perl6
09:42 headcase joined #perl6
09:47 pecastro joined #perl6
09:48 piojo perlpilot: are you around?
09:52 headcase joined #perl6
09:57 headcase joined #perl6
09:58 Geth ¦ doc: W4anD0eR96++ created pull request #1562: It seems we have sub form of `Str`
09:58 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1562
10:00 piojo On the topic of doc changes, I really think "regexes" should also be indexed as "Regular Expressions". Can I PR this change, or is there a reason it's not searchable that way?
10:00 piojo I'd like to change that, if nobody has serious objections
10:11 pecastro joined #perl6
10:14 moritz please go ahead
10:20 headcase joined #perl6
10:22 piojo thanks moritz. Will do after `make html` finishes
10:27 eliasr joined #perl6
10:38 margeas joined #perl6
10:39 pecastro joined #perl6
10:44 headcase joined #perl6
10:46 Skarsnik joined #perl6
10:58 pmurias joined #perl6
10:58 piojo joined #perl6
11:01 ShalokShalom joined #perl6
11:02 Geth ¦ doc: lefth++ created pull request #1563: Make the "Regexes" page also searchable as "Regular Expressions".
11:02 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1563
11:03 zura joined #perl6
11:11 stmuk LanceW: I had the same error as you but following the fix at the bottom of https://rt.perl.org/Public/Bug/Display.html?id=131815 fixed it
11:11 stmuk its basically the windows version of rm -rf ~/.zef and ~/.perl6
11:20 LanceW stmuk, I tried that and had no success
11:20 LanceW stmuk, I shall do again
11:23 LanceW Tried that again.. same issue with No such method 'subst' for invocant of type 'Any'
11:25 orac1e_ joined #perl6
11:27 nine Pretty off topic, but just hilarious and with good lessons: https://www.pentestpartners.com/security-blog/vulnerable-wi-fi-dildo-camera-endoscope-yes-really/
11:29 headcase joined #perl6
11:39 timotimo IoT: Not Even Once
11:44 Skarsnik_ joined #perl6
11:44 headcase joined #perl6
11:52 ShalokShalom_ joined #perl6
12:01 stmuk LanceW: you could also try "zef nuke" with various options and also checking the directories are being removed with "dir"
12:01 LanceW Shall do. :-)
12:06 LanceW hmmm.... "zef nuke site" zapped everything including zef. So I then ran rakudobrew build zef, followed by zef install Bailador. Same error ( No such method 'subst' for invocant of type 'Any' ) in  in method ver at C:\Users\akage\rakudobrew\moar-2017.07\install\share\perl6\site\sources\138DF35FA08A8D5EDA4A76A105D44F4FFBEDB983 (Zef::Distribution) line 127
12:08 timotimo hm, is there some distribution that doesn't have a version field set?
12:09 Skarsnik most of my module have * as version x)
12:10 LanceW I don't seem to be able to install any modules. All with same error.
12:12 LanceW https://gist.github.com/lancew/169b27599a06ada019fb8d35f02055f2 <- Here is me trying to install JSON::Fast
12:17 BenGoldberg joined #perl6
12:18 timotimo i'm trying to install Bailador, too. so many dependencies %)
12:19 timotimo anything when you "zef update"?
12:20 piojo LanceW: you're not using cygwin, are you?
12:22 LanceW Not installed it. BUT... I have been using chocolatey to install various things so could be installed as a dependency perhaps?
12:23 timotimo you'd probably notice if you were using cygwin
12:23 headcase joined #perl6
12:23 LanceW using CMDer, but typing cyg TAB TAB does seem to come up with a couple of cyg tools.cygcheck.exe cygpath.exe cygwin-console.helper.exe
12:32 nattefrost joined #perl6
12:38 headcase joined #perl6
12:49 headcase joined #perl6
12:57 pmurias timotimo: aren't technically the "sane" devices like laptops and smartphones parts of the IoT?
12:58 wander4096 joined #perl6
12:58 timotimo not in the way the IoT buzzword is used
13:00 LanceW Hmmm so deleted rakudobrew, installed via the MSI. Same error. Some presume the cygwin issue needs resolving. /me goes off to work out what installed cygwin
13:04 headcase joined #perl6
13:05 piojo LanceW: does it work in cmd.exe?
13:06 piojo If not, then I think the fact that cygwin is installed isn't part of the problem. Unrelated.
13:07 wander4096 m: my $c = class Foo { has $.foo = 42; }.new.Capture; say $c{"foo"}; say $c.does(Associative);
13:07 camelia rakudo-moar b76f7c: OUTPUT: «42␤False␤»
13:08 wander4096 `class Capture does Positional does Associative { }`
13:08 wander4096 m: my $c = class Foo { has $.foo = 42; }.new.Capture; say $c[0]; say $c.does(Positional);
13:08 camelia rakudo-moar b76f7c: OUTPUT: «Nil␤False␤»
13:08 Geth ¦ doc: titsuki++ created pull request #1564: Quoting adverbs
13:08 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1564
13:09 piojo m: say class { has $.foo }.new
13:09 camelia rakudo-moar b76f7c: OUTPUT: «<anon|56789568>.new(foo => Any)␤»
13:09 piojo woo hoo, anonymous classes
13:09 piojo didn't know we had those.
13:11 wander4096 m: say Capture.does(Associative)
13:11 camelia rakudo-moar b76f7c: OUTPUT: «False␤»
13:11 wander4096 m: say Capture.does(Positional)
13:11 camelia rakudo-moar b76f7c: OUTPUT: «False␤»
13:12 espadrine joined #perl6
13:13 LanceW no it does not work in cmd.exe either
13:14 piojo thanks for testing--that closes one can of worms.
13:15 LanceW Here is output in cmd.exe: https://gist.github.com/lancew/9ce4ec6cc20beab84afc60f575d4770c
13:16 llfourn joined #perl6
13:20 headcase joined #perl6
13:20 piojo could someone try running this:
13:20 piojo touch module.pm6; perl6 -I. -Mmodule -e ''
13:21 piojo It gave me a funny warning message
13:21 timotimo ti works here
13:21 piojo timotimo: huh. thanks.
13:22 piojo ghost in the machine. It's not happening anymore. (must have been a warning only during compilation to bytecode)
13:23 timotimo in that case delete the .precomp folder and try again
13:29 piojo timotimo: thanks for that tip, I've wanted to know that before. But really can't reproduce. oh, well
13:34 headcase joined #perl6
13:36 Geth ¦ doc/master: 4 commits pushed by titsuki++, (Itsuki Toyota)++
13:36 Geth ¦ doc/master: 737c4a0b12 | Use Point instead of IntStruct
13:36 Geth ¦ doc/master: 18f32afe93 | Merge remote-tracking branch 'upstream/master'
13:36 Geth ¦ doc/master: 17c918591e | Add indexes for quoting adverb
13:36 Geth ¦ doc/master: 9f6daf09a0 | Merge pull request #1564 from titsuki/quoting-adverbs
13:36 Geth ¦ doc/master: review: https://github.com/perl6/doc/compare/2e8bfea37f...9f6daf09a0
13:40 titsuki .tell piojo2 Thanks for your kindly reminder. I closed https://github.com/perl6/doc/issues/1102
13:40 yoleaux titsuki: I'll pass your message to piojo2.
13:42 headcase joined #perl6
13:43 piojo titsuki: I think that note was the grand total of my contribution to the doc hackathon :P
13:44 piojo fortunately, I started making other small changes where possible
13:44 piojo like the Android sale that marked a bunch of apps at US$0.10 -- basically no profit, but it helped start a habit
13:44 timotimo squashable6: info
13:44 squashable6 timotimo, I cannot recognize this command. See wiki for some examples: https://github.com/perl6/whateverable/wiki/Squashable
13:45 timotimo squashable6: status
13:45 squashable6 timotimo, Next SQUASHathon in 18 days and ≈20 hours (2017-10-07 UTC-12⌁UTC+14)
13:45 piojo is there a topic yet?
13:46 timotimo rakudo tickets, seems like
13:46 moritz I have no idea, but I'd hope "testneeded" tickets
13:49 titsuki piojo: oh, that's good to hear :)
13:51 piojo Has anybody seen this error when loading a module for the first time?:
13:51 piojo Use of uninitialized value $repo-id of type Any in string context.
13:51 piojo Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
13:51 piojo I can't reproduce, but I've seen it twice in the past half hour
13:52 timotimo do you have a backtrace to go with it?
13:52 piojo *warning, not error
13:52 piojo timotimo: no, it just prints twice, then continues with the correct program output
13:52 timotimo OK
13:55 nadim joined #perl6
13:55 Zoffix joined #perl6
13:59 robertle joined #perl6
14:01 dogbert2 joined #perl6
14:07 Cabanossi joined #perl6
14:14 LanceW Hmm... removed Gow (which removed cygwin exes) same issue. :-(
14:15 piojo I noticed we have 3 pages about OOP, which come at the problem from different angles. Typesystem, Object Orientation, and 'Classes and Objects'
14:15 piojo Can we add a "See Also" section to the bottom of these pages so they can reference each other?
14:17 piojo One might think perfect organization would negate the need for "see also", but if you type "object orient...", you'll find yourself on one page, and typing "OOP" will land you on another.
14:18 piojo This seems like a minor stylistic change, but I think it would be useful
14:19 yht joined #perl6
14:28 headcase joined #perl6
14:33 huf the mysterious object orient... the famous explorer marco sweepo travelled there
14:34 grondilu joined #perl6
14:34 grondilu m: say Set().Mix{Set()}
14:34 camelia rakudo-moar b76f7c: OUTPUT: «1␤»
14:34 piojo huf: haha
14:34 grondilu m: say Set.new..Mix{Set.new}
14:34 camelia rakudo-moar b76f7c: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Autovivifying object closures not yet implemented. Sorry.␤at <tmp>:1␤------> 3say Set.new..Mix{Set.new}7⏏5<EOL>␤»
14:35 Skarsnik_ joined #perl6
14:35 grondilu m: say Set.new.Mix{Set.new}
14:35 camelia rakudo-moar b76f7c: OUTPUT: «0␤»
14:35 grondilu m: say Set.new.Mix{Set.new} == Set().Mix{Set()}
14:35 camelia rakudo-moar b76f7c: OUTPUT: «False␤»
14:35 grondilu ^weird
14:35 timotimo huf: aah the pun! :)
14:35 grondilu m: Set() == Set.new
14:35 camelia rakudo-moar b76f7c: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "==" in expression "Set() == Set.new" in sink context (line 1)␤Use of uninitialized value of type Set(Any) in numeric context␤  in block <unit> at <tmp> line 1␤»
14:35 grondilu m: say Set() == Set.new
14:35 camelia rakudo-moar b76f7c: OUTPUT: «Use of uninitialized value of type Set(Any) in numeric context␤True␤  in block <unit> at <tmp> line 1␤»
14:36 grondilu m: say Set() === Set.new
14:36 camelia rakudo-moar b76f7c: OUTPUT: «False␤»
14:36 timotimo well, == gives you numeric equivalence?
14:36 timotimo and Set.new is empty and Set() is also empty
14:37 huf and anyway, i think object orientalism is frowned upon these days :)
14:43 headcase joined #perl6
14:43 lizmat m: dd Set()
14:43 camelia rakudo-moar b76f7c: OUTPUT: «Set(Any)␤»
14:43 lizmat Set() is a coercion type, not a Set
14:43 lizmat m: dd Set().^name
14:43 camelia rakudo-moar b76f7c: OUTPUT: «"Set(Any)"␤»
14:43 lizmat m: dd Set().HOW.name
14:43 camelia rakudo-moar b76f7c: OUTPUT: «Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
14:43 lizmat m: dd Set().HOW
14:43 camelia rakudo-moar b76f7c: OUTPUT: «No such method 'dispatch:<.?>' for invocant of type 'Perl6::Metamodel::CoercionHOW'␤  in block <unit> at <tmp> line 1␤␤»
14:44 lizmat m: dd Set().HOW.name
14:44 camelia rakudo-moar b76f7c: OUTPUT: «Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
14:44 lizmat m: dd Set().HOW.name(Set())
14:44 camelia rakudo-moar b76f7c: OUTPUT: «"Set(Any)"␤»
14:44 lizmat hmmm
14:44 lizmat m: dd set().HOW.name
14:44 camelia rakudo-moar b76f7c: OUTPUT: «Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at <tmp> line 1␤␤»
14:44 lizmat m: dd set().^name
14:44 camelia rakudo-moar b76f7c: OUTPUT: «"Set"␤»
14:44 lizmat m: dd set().HOW
14:44 camelia rakudo-moar b76f7c: OUTPUT: «Perl6::Metamodel::ClassHOW.new␤»
14:46 lizmat m: use nqp; dd nqp::istype(Set(),Set)   # perhaps more clearly: Set() is *not* a Set
14:46 camelia rakudo-moar b76f7c: OUTPUT: «0␤»
14:49 jnthn Indeed, it's the coercion type from Any -> Set
14:49 grondilu m: say Set() ~~ Set
14:49 camelia rakudo-moar b76f7c: OUTPUT: «No such method 'does' for invocant of type 'Perl6::Metamodel::CoercionHOW'␤  in block <unit> at <tmp> line 1␤␤»
14:51 grondilu that's weird.  I have a Mix of Set and I wanted to retrieve the mix value of the empty set.  'Set()' worked, 'Set.new' didn't.
14:51 grondilu But if Set() is not a Set, I would have expected Set.new to work instead of Set()
14:52 headcase joined #perl6
14:52 * grondilu realizes there is also the option of "set()"
14:52 grondilu 'set()' actually workds
14:53 grondilu m: say set().Mix{set()}
14:53 camelia rakudo-moar b76f7c: OUTPUT: «0␤»
14:53 grondilu hum :/
14:53 grondilu I though it worked
14:53 Zoffix set() is empty set
14:53 Zoffix not a set with an empty set
14:54 leont joined #perl6
14:54 Zoffix Oh, and yeah, it coerceres its contents to Mix, not itself
14:54 Zoffix m: say set(∅).Mix{∅}
14:54 camelia rakudo-moar b76f7c: OUTPUT: «1␤»
14:54 headcase_ joined #perl6
14:55 Zoffix grondilu: as for return type in protos you mentioned yesterday. I suspect it's just NYI.
14:55 grondilu m: say (set().Mix){set()}
14:55 camelia rakudo-moar b76f7c: OUTPUT: «0␤»
14:55 grondilu Zoffix: noted
14:56 * grondilu doesn't understand why his code work while the above line doesn't
14:56 * grondilu tries to golf it
14:57 Zoffix (set().Mix){set()} => (mix()){set()} => "find an an object (empty Set) in an empty Mix" => 0
14:58 Zoffix grondilu: ensure your rakudo version is recent-enough. There were some nail-downings of Set/Mix/Bag stuff a couple of months ago.
14:58 grondilu well my rakudo is rarely more than a few days old
15:00 grondilu though today !?Configure returns nothing, so I guess I haven't compiled rakudo for a while
15:01 HoboWithAShotgun joined #perl6
15:03 Sgeo_ joined #perl6
15:03 grondilu Zoffix: shouldn't set().Mix return a Mix with a single empty set in it?
15:04 grondilu m: say set().Mix
15:04 camelia rakudo-moar b76f7c: OUTPUT: «Mix()␤»
15:04 grondilu oh wait
15:04 grondilu m: say (set(),).Mix
15:04 camelia rakudo-moar b76f7c: OUTPUT: «Mix(set())␤»
15:04 grondilu I see, makes sense
15:04 grondilu m: say set(set()).Mix
15:04 camelia rakudo-moar b76f7c: OUTPUT: «Mix(set())␤»
15:06 Zoffix That happens only for type objects. Set:D coerces its contents, not itself.
15:06 Zoffix m: dd Set.Mix
15:06 camelia rakudo-moar b76f7c: OUTPUT: «(Set).Mix␤»
15:06 nadim joined #perl6
15:15 skids joined #perl6
15:15 grondilu if you're curious about what I'm doing with those Mix of sets, check out my Polynomial class in the symbolic branch of my Clifford module:  https://github.com/grondilu/clifford/blob/symbolic/lib/Polynomial.pm6
15:16 grondilu I'm implementing monomials as bags, and polynomials as Mix of monomials
15:16 grondilu I found the idea quite elegant.
15:17 grondilu and now I'm trying to do the same for MultiVectors as Mix of Sets of basisvectors
15:18 grondilu now that I think about it, I should consider the constant as the empty bag
15:20 grondilu my ultimate goal is to do algebra with things like 1 + x²*y + y²*e0 - x*e1∧e2
15:21 Zoffix neat
15:25 grondilu I'm hoping that if Polynomials implements Real, I will be able to consistently use them as value in Mix
15:25 headcase joined #perl6
15:25 vike joined #perl6
15:29 grondilu m: class MInt does Real { has Int $.n; method Bridge { $n % 13 } }; say ('foo' xx 12).
15:29 camelia rakudo-moar b76f7c: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$n' is not declared. Did you mean '$!n'?␤at <tmp>:1␤------> 3oes Real { has Int $.n; method Bridge { 7⏏5$n % 13 } }; say ('foo' xx 12).␤»
15:29 grondilu oops sorry
15:30 grondilu m: class MInt does Real { has Int $.n; method Bridge { $n % 3 } }; say ('foo' => MInt.new(:n(2))).Mix
15:30 camelia rakudo-moar b76f7c: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$n' is not declared. Did you mean '$!n'?␤at <tmp>:1␤------> 3oes Real { has Int $.n; method Bridge { 7⏏5$n % 3 } }; say ('foo' => MInt.new(:n(2)␤»
15:30 grondilu m: class MInt does Real { has Int $.n; method Bridge { $!n % 3 } }; say ('foo' => MInt.new(:n(2))).Mix
15:30 camelia rakudo-moar b76f7c: OUTPUT: «Mix(foo(2))␤»
15:31 Sgeo joined #perl6
15:31 grondilu m: class MInt does Real { has Int $.n; method Bridge { $!n % 3 } }; constant two = MInt.new(:n(2)); say ("foo" => two, "foo" => two).Mix
15:31 camelia rakudo-moar 855147: OUTPUT: «Mix(foo(4))␤»
15:31 grondilu hum, not what I was hoping
15:32 * grondilu was hoping Mix(foo(1))
15:33 grondilu m: class MInt does Real { has Int $.n; method Bridge { $!n % 3 } }; constant two = MInt.new(:n(2)); say ("foo" => two, "foo" => two).Mix<foo>.WHAT
15:33 camelia rakudo-moar 855147: OUTPUT: «(Int)␤»
15:33 grondilu m: class MInt does Real { has Int $.n; method Bridge { $!n % 3 } }; constant two = MInt.new(:n(2)); say ("foo" => two).Mix<foo>.WHAT
15:33 camelia rakudo-moar 855147: OUTPUT: «(MInt)␤»
15:34 Zoffix m: class MInt does Real { has Int $.n; method Bridge { $!n % 3 } }; constant two = MInt.new(:n(2)); say (2 + two).^name
15:34 camelia rakudo-moar 855147: OUTPUT: «Num␤»
15:34 Zoffix Same problem basically.
15:34 Zoffix Methods/ops don't carry over the types
15:35 headcase_ joined #perl6
15:35 Zoffix m: class MInt is Int { has Int $.n; method Bridge { $!n % 3 } }; constant two = MInt.new(:n(2)); say (2 + two).^name # better example
15:35 camelia rakudo-moar 855147: OUTPUT: «Int␤»
15:35 grondilu except I did not introduce a Int
15:35 wamba joined #perl6
15:35 grondilu I only added two and two (or thought I did)
15:36 grondilu I don't see why a Int should show up
15:36 grondilu oh wait
15:36 grondilu hang on
15:36 Zoffix The mix added the weights together
15:37 grondilu m: class MInt does Real { has Int $.n; method Bridge { self.new: n => ($!n % 3) } }; constant two = MInt.new(:n(2)); say ("foo" => two, "foo" => two).Mix
15:37 grondilu lol
15:37 camelia rakudo-moar 855147: OUTPUT: «(timeout)»
15:37 Zoffix That's the dispatch infiniloop I mentioned the other day
15:37 Cabanossi joined #perl6
15:37 grondilu m: role MInt does Real { has Int $.n; method Bridge { ($!n % 3) but MInt } }; constant two = MInt.new(:n(2)); say ("foo" => two, "foo" => two).Mix
15:37 Zoffix You keep giving it a thing it doesn't know how to handle and it loops calling .Bridge
15:37 camelia rakudo-moar 855147: OUTPUT: «Invocant of method 'Bridge' must be an object instance of type 'Int', not a type object of type 'Int'.  Did you forget a '.new'?␤  in method Bridge at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:38 grondilu I guess I could make it work if instead of just providing a Bridge I implement enough arithmetics operators
15:39 grondilu and make sure they return a MInt
15:39 Zoffix That might not make ().Mix work. Not only your custom ops will not be in its lexical scope, I don't think it uses them at all.
15:40 grondilu Mix is supposed to accept Real as values. It should be agnostic about what actual class is implementing it
15:40 Zoffix Maybe in a perfect world.
15:41 Zoffix Currently, that'd make them like 100+ times slower, To satisfy an edge case
15:41 grondilu :/
15:42 Zoffix All part of this ticket, I'd guess: https://rt.perl.org/Ticket/Display.html?id=130020#ticket-history
15:43 grondilu worst case scenario I'll write my own Mix :/
15:43 grondilu it'd be LTA, though
15:45 headcase joined #perl6
15:47 lizmat grondilu: perhaps an approach such as with Date.new would help
15:49 okl joined #perl6
15:51 domidumont joined #perl6
15:52 andrzejku joined #perl6
15:53 * grondilu doesn't know about tha
15:53 grondilu t
15:58 lizmat afk&
16:03 geekosaur joined #perl6
16:05 headcase joined #perl6
16:06 HoboWithAShotgun what do i have to add to my class so I can do the equality check?
16:07 Cabanossi joined #perl6
16:07 Zoffix HoboWithAShotgun: what sort of equality?
16:07 Zoffix (numeric, stringy, object)
16:08 khw joined #perl6
16:09 HoboWithAShotgun for my angle class. when i say $alpha = 45°; $beta = 45°; say $alpha == $beta; i get a cannot resolve caller ...
16:09 HoboWithAShotgun oh. also override ==
16:09 HoboWithAShotgun *facepalm
16:09 headcase joined #perl6
16:11 Zoffix m: sub postfix:<°> { class Deg { has $.d; method Numeric { $!d } }.new: :$^d }; my $alpha = 45°; my $beta = 45°; say $alpha == $beta
16:11 camelia rakudo-moar 9073a4: OUTPUT: «True␤»
16:11 Zoffix m: sub postfix:<°> { class Deg { has $.d; method Numeric { $!d } }.new: :$^d }; my $alpha = 45°; my $beta = 35°; say $alpha == $beta
16:11 camelia rakudo-moar 9073a4: OUTPUT: «False␤»
16:12 Zoffix You could also add a multi for `==`, but keep in mind it'd have to be available in lexical scope for it to work (so if you pass your custom class objects somewhere else, and do comparison there, it won't work right)
16:15 HoboWithAShotgun this is the error i get with my actual class
16:15 HoboWithAShotgun Cannot resolve caller Numeric(Math::Angle: ); none of these signatures match: (Mu:U \v: *%_)
16:15 bobv joined #perl6
16:15 Zoffix HoboWithAShotgun: right, add method Numeric {} to Math::Angle that returns some core numeric
16:16 nadim joined #perl6
16:17 HoboWithAShotgun yup, that did it
16:17 HoboWithAShotgun take my dearest gratidude good sir
16:19 * Zoffix takes it
16:24 HoboWithAShotgun allright. next textcase fails ok 45° > 30°. cannot resolve caller Real
16:25 HoboWithAShotgun i mean i got it fixed but why does it need a Real to a larger than?
16:27 headcase joined #perl6
16:29 awwaiid joined #perl6
16:31 Zoffix HoboWithAShotgun: because that operator works with numbers and only Real numbers can be compared
16:32 Zoffix m: sub postfix:<°> { class Deg { has $.d; method Real { $!d }; method Numeric { $!d } }.new: :$^d }; my $alpha = 45°; my $beta = 45°; say $alpha == $beta; say $alpha > $beta
16:32 camelia rakudo-moar 9073a4: OUTPUT: «True␤False␤»
16:32 Zoffix m: say 42i > 70i
16:32 camelia rakudo-moar 9073a4: OUTPUT: «Cannot convert 0+42i to Real: imaginary part not zero␤  in block <unit> at <tmp> line 1␤␤»
16:32 Zoffix New blog post: "The Rakudo Book Project": https://rakudo.party/post/The-Rakudo-Book-Project
16:36 moritz Zoffix++
16:36 moritz Zoffix: I'll be happy to proof-read for you :-)
16:36 Zoffix :)
16:37 headcase joined #perl6
16:37 Cabanossi joined #perl6
16:41 headcase joined #perl6
16:44 pecastro joined #perl6
16:45 headcase_ joined #perl6
16:49 headcase joined #perl6
17:01 moritz Zoffix: I don't know if you are open to such ideas, but one thing you could do is self-publish, and come up with a rule like selling the books for the first one or two years, and then making them freely available
17:03 headcase joined #perl6
17:04 moritz I made about $870 off the first book before going to Apress, and about $400 selling the second one
17:04 moritz and both didn't even have a proper launch at that time (so they were never advertised as "finished" and on sale at the same time)
17:06 moritz so I think with a proper launch, it's not unreasonable to expect to make betwee 2k und 3k USD per book (at least the beginner books; I expect the more advanced ones to sell less)
17:07 Cabanossi joined #perl6
17:09 robertle_ joined #perl6
17:14 headcase joined #perl6
17:16 robertle joined #perl6
17:16 moritz maybe more with good marketing
17:28 dogbert2 joined #perl6
17:29 robertle joined #perl6
17:35 headcase joined #perl6
17:38 Zoffix Nah. The primary goal is to have good information for Rakudo users, hence the freeness. Rakudo Core Fundraisers are just a cherry on top.
17:41 mspo hey is there an 09 release?
17:41 timotimo mspo: almost!
17:42 mspo timotimo: new/stable CURI stuff in there?
17:43 mspo timotimo: also how long is almost? :)
17:46 timotimo could still happen today
17:48 timotimo i'm not sure about the CURI situation in general, it's not something i've worked on at all
17:49 mspo that would be nice
17:57 headcase joined #perl6
17:58 Skarsnik releasable6, status
17:58 releasable6 Skarsnik, Next release will happen when it's ready. 1 blocker. 154 out of 167 commits logged
17:58 releasable6 Skarsnik, Details: https://gist.github.com/b563d635b0e17740348e07f9123334a2
18:02 pecastro joined #perl6
18:04 shlomif joined #perl6
18:05 headcase joined #perl6
18:07 Cabanossi joined #perl6
18:25 headcase joined #perl6
18:44 headcase joined #perl6
18:55 headcase joined #perl6
18:56 pecastro joined #perl6
18:58 emeric joined #perl6
19:00 tyil is there some matrix showing all elements of unicode and a bunch of popular languages, where you can easily look up which langs support which parts of the unicode spec?
19:01 tyil (and if there isn't, would it be an idea to make one to showcase perl 6's support for it?)
19:02 leont I remember Tom Christiansen doing a presentation on this a few years ago (comparing perl5 to other languages), focussing on regexes in articular. Haven't seen such a thing in perl6 context.
19:06 tyil maybe someone with a lot of unicode experience ( samcv ?) could distill the spec into implementable parts and make a list of it, but we'd need some good info on what other langs support as well
19:10 leont https://www.azabani.com/pages/gbu/
19:12 tyil interesting
19:12 tyil thanks leont
19:12 tyil (wonder if its still up to date)
19:13 leont I should warn you though if you plan on emailing TomC about this, he has a tendency to write 10000 word emails :-p
19:14 headcase joined #perl6
19:14 tyil I have the bandwidth :p
19:15 leont "For example, this talk originally included a bunch of pain about Unicode in Python v2.7, but I deleted all the v2.7 material to get past the profanity filters." :-D
19:17 tyil lol
19:18 Jurgen joined #perl6
19:19 timotimo :D
19:19 timotimo well, python 2.7 isn't in use any more, so ... :P
19:19 headcase joined #perl6
19:20 tyil timotimo: we wish
19:20 tyil py2.7 still seems to be more popular than the 3 series from what i've seen at meetups
19:26 headcase joined #perl6
19:28 BenGoldberg joined #perl6
19:31 leont Yeah, that's also my impression
19:36 timotimo not a problem
19:45 kyan joined #perl6
19:46 _28_ria joined #perl6
19:56 _28_ria joined #perl6
19:56 pecastro joined #perl6
19:59 kaare__ joined #perl6
19:59 TEttinger joined #perl6
20:00 pmurias joined #perl6
20:02 pmurias Zoffix: what makes writing books more fun the writing reference docs for docs.perl6.org?
20:03 headcase_ joined #perl6
20:04 telex joined #perl6
20:16 tabv left #perl6
20:22 Cabanossi joined #perl6
20:25 Cabanossi joined #perl6
20:32 telex joined #perl6
20:32 lizmat Zoffix: re https://rakudo.party/post/The-Rakudo-Book-Project , I would argue that the Green Book already exists: it's called "Think Perl 6"
20:34 lizmat oh, and by the way, Zoffix++  # excellent ide and blog post
20:34 lizmat *idea rather  :-)
20:37 Aaronepower joined #perl6
20:38 MasterDuke .oO(Zoffix is writing a Perl 6 IDE, woot!)
20:39 MasterDuke can only dream, but the books are a great endeavor also
20:39 Zoffix pmurias: not having 100 others users bikeshedding your every decision.
20:41 [Coke] Zoffix++
20:44 pmurias joined #perl6
20:49 skids m: say so rx/foo/; # Root reason behind test failure of RT#124527 spectest
20:49 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=124527
20:49 camelia rakudo-moar 3f47eb: OUTPUT: «False␤»
20:50 skids But I cannot edit that ticket.
20:52 orac1e_ joined #perl6
20:54 Aaronepower Is there any shorter way of saying `if $<match>.Bool { $result = 1 }`?
20:54 [Coke] ?$<match>
20:55 [Coke] ?
20:55 Aaronepower [Coke]: Where do I put `$result = 1`?
20:55 [Coke] $result = 1 if ?$<match>;
20:56 skids if you don't care if result gets set to 0, $result = +?$<match>
20:56 Aaronepower [Coke]: That works for me. thanks!
20:58 Aaronepower skids: I'm doing something more complex than setting something to zero or one. So I couldn't golf it that far. What does the + do in that context?
20:58 skids converts the Bool to an Int
21:02 Aaronepower [Coke]: Can you add an else to an inline if?
21:02 timotimo you can also $result ||= +?$<match>
21:02 Aaronepower timotimo: What's `||=`?
21:02 BooK where do you people find all the time?
21:02 timotimo well, it'll only set $result to 1 if it was falsy before
21:02 timotimo it's the same as writing $result = $result || +?$<match>
21:03 skids Well, you could ?$<match> ?? dostuff !! dootherstuff
21:12 _28_ria joined #perl6
21:13 Geth ¦ doc: 7f12deab88 | Coke++ | doc/Language/testing.pod6
21:13 Geth ¦ doc: simplify phrasing
21:13 Geth ¦ doc: review: https://github.com/perl6/doc/commit/7f12deab88
21:14 _28_ria joined #perl6
21:17 travis-ci joined #perl6
21:17 travis-ci Doc build errored. Coke 'simplify phrasing'
21:17 travis-ci https://travis-ci.org/perl6/doc/builds/276617419 https://github.com/perl6/doc/compare/9f6daf09a08c...7f12deab88ac
21:17 travis-ci left #perl6
21:17 buggable [travis build above] ☠ Did not recognize some failures. Check results manually.
21:19 _28_ria joined #perl6
21:21 _28_ria joined #perl6
21:25 _28_ria joined #perl6
21:26 Aaronepower Is there a way to substitute where the substitution generates a new value?
21:26 timotimo yes
21:26 timotimo use S/// instead of s/// or the .subst method
21:27 okl joined #perl6
21:28 * leont didn't know S/// :-o
21:30 _28_ria joined #perl6
21:32 _28_ria joined #perl6
21:34 Aaronepower timotimo: My code is `make (join ' ', $/.list) ~~ S/'(' .* ')'//` which gives me the same `Cannot assign to read-only value` and says `Smartmatch with S/// is not useful`
21:35 _28_ria joined #perl6
21:35 BenGoldberg In perl5, the way to make s/// (or tr///) generate a new value is by passing a /r flag at the end.
21:36 * BenGoldberg wonders whether it would be useful to have s:r/// do the same ;)
21:38 geekosaur Aaronepower, in perl 5 ~~ temporarily binds something to $_. in perl 6 it is *always* a smartmatch, and it would be smartmatching against the *reslt* of the S///
21:38 geekosaur use 'given' instead of ~~
21:38 skids Aaronepower: S/// works on the topic.  Instead  S/'(' .* ')'// given $/.list.join(' ')
21:39 Aaronepower geekosaur: The compiler said that too. I just assumed given was part of the error message, not an operator.
21:41 _28_ria joined #perl6
21:44 Aaronepower skids: That gives me `Cannot assign to a readonly variable ($/) or a value`
21:52 Cabanossi joined #perl6
21:53 skids Hrm I suspect some issues with $/ due to the rx-inside-rx.
21:53 skids m: "f,g,h,i" ~~ /([<alpha>])+ % "," { say "nay"; make "foo"} /; $/.made.perl.say
21:53 camelia rakudo-moar 68e54f: OUTPUT: «nay␤"foo"␤»
21:53 skids m: "f,g,h,i" ~~ /([<alpha>])+ % "," { say my $a = S/./y/ given "nay"; make "foo"} /; $/.made.perl.say
21:53 camelia rakudo-moar 68e54f: OUTPUT: «yay␤Nil␤»
21:54 skids That seems broken to me at first glance.
21:55 LanceW joined #perl6
21:59 Aaronepower skids: Mine is in a Action object for a Grammar I don't know if that makes it different?
21:59 skids Maybe.
22:00 skids Hrm well maybe not so broken on second thought
22:02 skids m: perl6 -e '"f,g,h,i" ~~ /([<alpha>])+ % "," { my $slash = $/; say my $a = S/./y/ given "nay"; $slash.make("foo")} /; $/.made.perl.say'
22:02 camelia rakudo-moar 68e54f: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3perl6 -e7⏏5 '"f,g,h,i" ~~ /([<alpha>])+ % "," { my ␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement en…»
22:03 skids m: "f,g,h,i" ~~ /([<alpha>])+ % "," { my $slash = $/; say my $a = S/./y/ given "nay"; $slash.make("foo")} /; $/.made.perl.say
22:03 camelia rakudo-moar 68e54f: OUTPUT: «yay␤"foo"␤»
22:03 skids Maybe try routing around your $/ getting clobbered like that.
22:05 Aaronepower skids: I tried `method items($/) { my $a = $/; make S/'(' .* ')'// given $a.list.join(' ') }` no such luck.
22:06 skids You have to do the make on the $a.
22:07 Aaronepower skids: I don't know what you mean by that.
22:08 skids $a.make.  not just "make".
22:08 skids because make works on $/ and after the S/// your $/ is the match from that, not yout current cursor in the grammar.
22:11 skids ("method items($a)" might shorten that fist part up.)
22:11 Aaronepower skids: Tried this. same readonly error. https://paste.rs/zmG
22:12 Zoffix Aaronepower: just don't use $/ as the parameter
22:13 skids Try "method items($a)" maybe?  Might work, might not.
22:14 Aaronepower skids, Zoffix: Yes that worked thanks!
22:15 Zoffix Aaronepower: I also find .subst() easier to use than S///
22:15 Zoffix method items($m) { make .list.subst: /'(' .* ')'/ with $m } # if I understand your original code correctly
22:15 Zoffix method items($m) { .make .list.subst: /'(' .* ')'/ with $m } # if I understand your original code correctly
22:15 Zoffix method items($_) { .make .list.subst: /'(' .* ')'/ } # if I understand your original code correctly
22:15 headcase joined #perl6
22:15 Zoffix ^_^
22:16 Aaronepower Zoffix: There's a join missing, but that looks good!
22:17 skids List.Str is reliably .join(' '), no?
22:17 Zoffix I think so, which is why I left it out
22:17 Aaronepower I never knew that.
22:18 Aaronepower Zoffix: I tried that code, "Too few positionals passed"
22:19 skids Yeah  S02-types/list.t:is (5, 7, 8).Str, '5 7 8', '.Str on a List';.  Should very likely never change.  Aside from that, lots of tests would break.
22:20 Zoffix Aaronepower: ah right, I forgot the replacement part
22:20 Zoffix method items($_) { .make .list.subst: /'(' .* ')'/, '' } # if I understand your original code correctly
22:20 Aaronepower Zoffix: Hah, nope same error. :p
22:21 Zoffix method items($_) { .make: .list.subst: /'(' .* ')'/, '' } # if I understand your original code correctly
22:21 Zoffix Can't type at all :)
22:21 Zoffix 5th time a charm, eh/
22:25 Aaronepower Is there any easy way to remove Hash keys which have a value of Nil?
22:25 kaare__ joined #perl6
22:26 Zoffix m: my %h = :a42, :b70, :c(Nil), :d(Nil); %h .= grep: *.value.defined; dd %h
22:26 camelia rakudo-moar : OUTPUT: «Cannot allocate memory»
22:26 Zoffix m: my %h = :a42, :b70, :c(Nil), :d(Nil); %h .= grep: *.value.defined; dd %h
22:26 camelia rakudo-moar : OUTPUT: «Cannot allocate memory»
22:26 Zoffix m: my %h = :a42, :b70, :c(Nil), :d(Nil); %h .= grep: *.value.defined; dd %h
22:26 camelia rakudo-moar : OUTPUT: «Cannot allocate memory»
22:27 Zoffix :/
22:27 Zoffix c: HEAD my %h = :a42, :b70, :c(Nil), :d(Nil); %h .= grep: *.value.defined; dd %h
22:27 committable6 Zoffix, ¦HEAD(213c3e3): «Hash %h = {:a42, :b70}»
22:28 Zoffix c: HEAD my %h = :a42, :b70, :c(Nil), :d(Nil); dd %h».defined
22:28 committable6 Zoffix, ¦HEAD(213c3e3): «Hash % = {:a42, :b70, :!c, :!d}»
22:28 * Zoffix doesn't get that result....
22:28 AlexDaniel Zoffix: what do you get?
22:28 Zoffix s/get/understand/;
22:28 AlexDaniel ah
22:29 skids m: my $a := :{ "ak" => "av" }; $a.say; $a{Nil}++; $a.say; $a{Nil}:delete.say; $a.say;
22:29 camelia rakudo-moar 213c3e: OUTPUT: «{ak => av}␤Use of Nil in string context␤{Nil => 1, ak => av}␤1␤{ak => av}␤  in block <unit> at <tmp> line 1␤»
22:29 skids Funny it warns on the string context, then works.
22:31 skids Oh it must be warning inside the say"
22:38 headcase_ joined #perl6
22:51 Zoffix lizmat: thanks. I'll try to give Think Perl 6 a more thorough read before writing the Green Book (which will likely be a year or more from now). Just flipped through some of it right now and I think I'm aiming for a much more informal and practical approach. Something Average Joe could pick up and get a new skill to do small one-scripts, rather than necessarily "thinking like a computer scientist". Just today
22:51 Zoffix I was reading about #include's in my C book and I remember how much of a deal the teacher made about them in college, despite them being so trivial to learn. So that's my goal, leave the science well-hidden.
22:55 pecastro joined #perl6
22:55 headcase joined #perl6
23:28 azawawi joined #perl6
23:28 azawawi hi
23:28 * azawawi waves
23:36 azawawi AlexDaniel: ping
23:36 AlexDaniel hello
23:36 azawawi AlexDaniel: sorry for the latest reply for https://github.com/azawawi/perl6-ncurses/issues/16
23:37 Cabanossi joined #perl6
23:37 azawawi AlexDaniel: but i cant replicate it on my system somehow
23:37 AlexDaniel azawawi: oh
23:37 AlexDaniel maybe I fixed it
23:38 azawawi AlexDaniel: can you try it now?
23:38 AlexDaniel sure
23:38 azawawi cool
23:39 * azawawi is waiting for https://travis-ci.org/azawawi/perl6-ncurses/jobs/272484221 to finish
23:41 azawawi first one is working on rakudo latest... waiting for macos ci
23:41 pilne joined #perl6
23:42 AlexDaniel azawawi: yes https://gist.github.com/Whateverable/87fef45a16a912790b468058f001455e
23:43 azawawi so how did you fix it? :)
23:43 AlexDaniel azawawi: so basically we now disable buffering if you use Test
23:43 AlexDaniel azawawi: so we get old behavior in this particular case
23:44 azawawi aha ok
23:44 AlexDaniel azawawi: buffering had to be disabled for RT #132108
23:44 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=132108
23:45 azawawi https://travis-ci.org/azawawi/perl6-ncurses/builds/272484217 # PASS on all supported platforms :)
23:46 AlexDaniel azawawi: note, however, that the test in your module is probably wrong
23:46 AlexDaniel but I couldn't find a way to improve it because newterm is NYI
23:47 azawawi SCREEN * newterm(const char *,FILE *,FILE *)  # ?
23:48 AlexDaniel yea
23:49 azawawi how do you get a FILE pointer from a perl6 IO handle... temporary files?
23:50 AlexDaniel nativecallable6: void newterm(const char *,FILE *,FILE *);
23:50 nativecallable6 AlexDaniel, https://gist.github.com/ed59f2eeb308100d49f730b449dfcc19
23:51 AlexDaniel nativecallable6: #include <stdio.h>; void newterm(const char *,FILE *,FILE *);
23:51 nativecallable6 AlexDaniel, https://gist.github.com/e95ec65f0b9bd40b11bd7595cedf9ba1
23:51 AlexDaniel haha. Well I was just curios as to what it's going to give
23:51 AlexDaniel u
23:52 AlexDaniel azawawi: I don't know :)
23:53 azawawi we can ofcourse native fopen the file and pass it to it
23:58 geekosaur hm, yuck. terminfo is easier, it's a fd. forgot curses does the C thing
23:58 geekosaur er, stdio thing
23:58 geekosaur which actually complicates the buffering issue...
23:58 azawawi like i thought... https://github.com/seanohalpin/ffi-ncurses/blob/master/examples/newterm.rb#L34 # :)

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

Perl 6 | Reference Documentation | Rakudo