Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-10-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:00 dalek whateverable: fcc0eb0 | MasterDuke17++ | Whateverable.pm6:
00:00 dalek whateverable: .get-commits should return to the CWD it came from
00:00 dalek whateverable: review: https://github.com/perl6/whateverable/commit/fcc0eb09ec
00:01 seatek Oh gosh, ok, roles have lots of bells and whistles. almost like subroutiness even sometimes. ok roles are crazy.
00:03 Jesmaybe joined #perl6
00:06 seatek Now I'm thinking of them kinda like little machines you keep on a warehouse shelf that can be plugged in whenever you want, even to already-existing objects. That's pretty cool.
00:07 seatek I was thinking they should remain a discreet as possible (not getting dependent upon any attributes from classes that may use them). Makes much more sense now.
00:13 geekosaur joined #perl6
00:14 pierre_ joined #perl6
00:15 Jesmaybe joined #perl6
00:26 ka joined #perl6
00:46 skids seatek: The flat composition and interface definition are the simple use case, and the paramterization is the advanced use case.
00:46 skids m: role A [$i] { my $.a = $i }; my $a1 = A[1].new; my $a2 = A[2].new; $a1.a.say; $a2.a.say; say so $a1 ~~ A; say so $a2 ~~ A;
00:46 camelia rakudo-moar 2dd0dd: OUTPUT«1␤2␤True␤True␤»
00:49 aborazmeh joined #perl6
00:49 aborazmeh joined #perl6
00:57 Jesmaybe joined #perl6
01:24 Jesmaybe joined #perl6
01:27 Jesmaybe joined #perl6
01:36 dalek ecosystem: 319454a | gfldex++ | META.list:
01:36 dalek ecosystem: add Concurrent::Channelify
01:36 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/319454a79a
01:42 Actualeyes joined #perl6
01:47 ilbot3 joined #perl6
01:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:55 Herby__ m: my @evens-squared = ($_ ** 2 if ($_ % 2 == 0) for 0..20); say @evens-squared;
01:55 camelia rakudo-moar 2dd0dd: OUTPUT«[0 4 16 36 64 100 144 196 256 324 400]␤»
01:55 Herby__ how do I have camelia return output to me privately?
01:56 ugexe use /msg
01:56 Herby__ thanks
01:58 Jesmaybe joined #perl6
02:01 iBakeCake Herby__: we have an operator for % ... == 0, it's %%
02:01 iBakeCake m: my @evens-squared = ($_ ** 2 if ($_ %% 20) for 0..20); say @evens-squared;
02:01 camelia rakudo-moar 2dd0dd: OUTPUT«[0 400]␤»
02:02 iBakeCake :o
02:02 iBakeCake oh, typo :)
02:03 Herby__ typo?
02:03 iBakeCake m: my @evens-squared = ^20 .grep(* %% 2).map: *²; say @evens-squared;
02:03 camelia rakudo-moar 2dd0dd: OUTPUT«Cannot resolve caller Numeric(Whatever: ); none of these signatures match:␤    (Mu:U \v: *%_)␤  in block <unit> at <tmp> line 1␤␤»
02:03 iBakeCake Herby__: I typoed 20 for 2, so that's why result was wrong
02:03 iBakeCake m: my @evens-squared = ^20 .grep(* %% 2).map: ***2; say @evens-squared;
02:03 camelia rakudo-moar 2dd0dd: OUTPUT«[(0) (4) (8) (12) (16) (20) (24) (28) (32) (36)]␤»
02:03 noganex_ joined #perl6
02:03 Herby__ ahh ok. its been a long day :)
02:04 iBakeCake m: my @evens-squared = ^20 .grep(* %% 2).map: |***2; say @evens-squared;
02:04 camelia rakudo-moar 2dd0dd: OUTPUT«Cannot resolve caller Numeric(Sub: ); none of these signatures match:␤    (Mu:U \v: *%_)␤  in block <unit> at <tmp> line 1␤␤»
02:04 Herby__ my @odds-squared = ($_ ** 2 unless ($_ %% 2) for 0..20)
02:04 Herby__ m: my @odds-squared = ($_ ** 2 unless ($_ %% 2) for 0..20)
02:04 camelia rakudo-moar 2dd0dd: ( no output )
02:04 Herby__ m: my @odds-squared = ($_ ** 2 unless ($_ %% 2) for 0..20); say @odds-squared;
02:04 camelia rakudo-moar 2dd0dd: OUTPUT«[1 9 25 49 81 121 169 225 289 361]␤»
02:04 Herby__ iBakeCake: what madness is that?
02:05 iBakeCake Herby__: lol. Ironically, I was thinking the same about your code :P
02:06 Herby__ grep(* %% 2).map: ***2
02:06 Herby__ how does that work?
02:06 Jesmaybe joined #perl6
02:06 ShimmerFairy Herby__: that ***2 would be more intelligible as * ** 2    :)
02:06 iBakeCake Herby__: * is a whatever star
02:07 iBakeCake Herby__: .grep(* %% 2) is same as .grep({ $^a %% 2 })
02:07 Herby__ i keep see that popping up in various docs. does a whatever star do whatever I need it to? :)
02:07 iBakeCake Herby__: pretty much
02:08 iBakeCake Herby__: wanna see a neat trick?
02:10 iBakeCake Do ya? :)
02:11 lucs iBakeCake: I do :)
02:11 Herby__ yes I do!
02:11 iBakeCake Hm.. wait
02:12 iBakeCake Ah. 1 sec
02:12 * iBakeCake fumbles with the magic box and the rabbit
02:12 lucs Nothing up your sleeve...
02:13 iBakeCake damn... didn't work
02:13 * iBakeCake tries the alternative
02:13 iBakeCake Eh
02:13 iBakeCake never mind
02:13 iBakeCake m: my @evens-squared = 4, 16, 36, 64 … 400; say @evens-squared
02:13 camelia rakudo-moar 2dd0dd: OUTPUT«Unable to deduce arithmetic or geometric sequence from 16,36,64 (or did you really mean '..'?)␤  in block <unit> at <tmp> line 1␤␤»
02:14 iBakeCake But you can do doubles:
02:14 iBakeCake m: say 4, 8, 12 … 400;
02:14 camelia rakudo-moar 2dd0dd: OUTPUT«(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 256 260 264 268 272 276 280 2…»
02:15 iBakeCake Ah, here we go
02:15 iBakeCake m: my @evens-squared = 4, {(sqrt($_)+1)**2} … 400; say @evens-squared
02:15 camelia rakudo-moar 2dd0dd: OUTPUT«[4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400]␤»
02:15 iBakeCake ta-da!
02:15 iBakeCake :}
02:16 iBakeCake m: my @evens-squared = 4, {(sqrt($_)+2)²} … 400; say @evens-squared
02:16 camelia rakudo-moar 2dd0dd: OUTPUT«[4 16 36 64 100 144 196 256 324 400]␤»
02:17 Herby__ pretty slick!
02:19 iBakeCake m: say (4, (*.sqrt+2)**2 … ∞)[^10];
02:19 camelia rakudo-moar 2dd0dd: OUTPUT«(4 16 36 64 100 144 196 256 324 400)␤»
02:19 iBakeCake m: say (4, (*.sqrt+2)**2 … ∞)[^20];
02:19 camelia rakudo-moar 2dd0dd: OUTPUT«(4 16 36 64 100 144 196 256 324 400 484 576 676 784 900 1024 1156 1296 1444 1600)␤»
02:19 iBakeCake :)
02:19 iBakeCake I'm slightly bummed ² doesn't work with Whatevers :(
02:19 iBakeCake m: say (4, (*.sqrt+2)² … ∞)[^20];
02:19 camelia rakudo-moar 2dd0dd: OUTPUT«Cannot resolve caller Numeric(WhateverCode: ); none of these signatures match:␤    (Mu:U \v: *%_)␤  in block <unit> at <tmp> line 1␤␤»
02:23 iBakeCake m: say (2, ***.5**2 … ∞)[^10]
02:23 camelia rakudo-moar 2dd0dd: OUTPUT«This Seq has already been iterated, and its values consumed␤(you might solve this by adding .cache on usages of the Seq, or␤by assigning the Seq into an array)␤  in block <unit> at <tmp> line 1␤␤»
02:23 iBakeCake interesting error :/
02:23 pierre_ joined #perl6
02:23 iBakeCake m: say (2, ***.5**2 … 10)[^10]
02:23 camelia rakudo-moar 2dd0dd: OUTPUT«(2 (0.5) (0.5 0.25) (0.5 0.25 0.5) (0.5 0.25 0.5 0.75) (0.5 0.25 0.5 0.75 1) (0.5 0.25 0.5 0.75 1 1.25) (0.5 0.25 0.5 0.75 1 1.25 1.5) (0.5 0.25 0.5 0.75 1 1.25 1.5 1.75) (0.5 0.25 0.5 0.75 1 1.25 1.5 1.75 2))␤»
02:23 iBakeCake huh
02:23 Herby__ uh
02:24 iBakeCake oh, it's interpreting it as HyperWhatevers?
02:25 iBakeCake yup
02:25 iBakeCake m: say (4, (* **½+2)**2 … 400)[^10]
02:25 camelia rakudo-moar 2dd0dd: OUTPUT«(4 16 36 64 100 144 196 256 324 400)␤»
02:25 iBakeCake ehehe :P
02:28 pierre_ joined #perl6
02:31 seatek skids, thank you - yeah i was looking at the parameterized use case. it's quite interesting considering those can be applied to already instantiated objects too.
02:32 aborazmeh joined #perl6
02:32 aborazmeh joined #perl6
02:34 iBakeCake m: 42 does role { method square { self² } }; 42.square.say
02:34 camelia rakudo-moar 2dd0dd: OUTPUT«1764␤»
02:36 iBakeCake m: say WHY 'Life, the Universe and Everything':
02:36 camelia rakudo-moar 2dd0dd: OUTPUT«42␤»
02:36 Actualeyes joined #perl6
02:36 iBakeCake :}
02:41 Herby__ nice :)
02:57 cdg joined #perl6
03:00 cdg joined #perl6
03:02 seatek iBakeCake: just realized what you did there. :) that is bizarre. that self because numeric especially
03:09 labster joined #perl6
03:20 Jesmaybe joined #perl6
03:21 snowman_ joined #perl6
03:22 Jesmaybe joined #perl6
03:40 Jesmaybe joined #perl6
03:47 edgar joined #perl6
03:47 edgar hi
03:51 Derperperd joined #perl6
04:02 Herby__ o/
04:05 djbkd joined #perl6
04:09 wamba joined #perl6
04:20 pierre_ joined #perl6
04:36 ka joined #perl6
04:37 pierre_ joined #perl6
04:42 Cabanossi joined #perl6
04:52 pierrot joined #perl6
05:16 telex joined #perl6
05:29 mohae_ joined #perl6
05:36 brillenfux joined #perl6
05:38 pierre_ joined #perl6
05:50 andrzejku joined #perl6
05:56 RabidGravy joined #perl6
06:05 abraxxa joined #perl6
06:07 domidumont joined #perl6
06:07 hchienjo joined #perl6
06:10 pierre_ joined #perl6
06:23 neuraload joined #perl6
06:25 andrzejku joined #perl6
06:37 killbill joined #perl6
06:39 killbill p6: my $w="a b"; my $text="abba a baab b abab"; $text ~~ s:g/<<<{$w.words}>>>//; say now - INIT now
06:39 camelia rakudo-moar 2dd0dd: OUTPUT«0.11455297␤»
06:39 killbill p6: my $w = "a b"; my $text="abba a baab b abab"; my @list=$w.words; $text~~s:g/<<@list>>//; say now - INIT now
06:39 camelia rakudo-moar 2dd0dd: OUTPUT«0.005421␤»
06:46 domidumont joined #perl6
06:51 bjz joined #perl6
07:03 abraxxa joined #perl6
07:05 pierre_ joined #perl6
07:07 darutoko joined #perl6
07:12 domidumont joined #perl6
07:12 abraxxa joined #perl6
07:14 andrzejku joined #perl6
07:15 zakharyas joined #perl6
07:20 andrzejku hey :)
07:22 bjz joined #perl6
07:26 bjz joined #perl6
07:28 CIAvash joined #perl6
07:33 canopus joined #perl6
07:41 moritz ho
07:52 andrzejku I configured my perl enviroment according Derek Cline presentation and so happy right now ;P
07:52 RabidGravy Morning
07:57 wamba joined #perl6
08:03 llfourn is there a way to check if something matches a regex without setting $/?
08:03 llfourn I'm in grammar actions and doing a match clobbers it
08:03 llfourn I guess I could create a temp lexical scope...
08:06 moritz llfourn: or you could just not use $/ in the signature of your action method
08:06 moritz call it $m instead
08:06 llfourn that's probably the way to go
08:07 llfourn unfortunetly I do some magic like CALLER::<$/> in the .new of all AST nodes so they know from what they were created
08:07 llfourn which I know is fairly evil but it does save a lot of time
08:08 llfourn except that it causes this problem :P
08:08 wamba joined #perl6
08:08 ocbtec joined #perl6
08:12 Actualeyes joined #perl6
08:12 avalokite joined #perl6
08:14 dakkar joined #perl6
08:14 avalokite joined #perl6
08:20 killbill joined #perl6
08:24 FROGGS joined #perl6
08:36 ufobat joined #perl6
08:47 Ven_ joined #perl6
08:47 Ven_ Good *, #perl6.
08:47 gregf_ joined #perl6
08:47 FROGGS hi Ven_
08:48 Ven_ I'm wondering if someone could help me with `run`. It seems the exitcode is discarded if use `:out`.
08:48 Ven_ m: say run(<foo>, :out).exitcode;
08:48 camelia rakudo-moar 2dd0dd: OUTPUT«run is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub run at src/RESTRICTED.setting line 14␤  in block <unit> at <tmp> line 1␤␤»
08:48 FROGGS you have to rean von out and the close it
08:49 Ven_ ^ if I have the `:out` here, the exitcode will be `0`. if I remove it, it'll be 128 (no such command).
08:49 Ven_ FROGGS: oh, slurp-rest will make it all appear?
08:50 FROGGS https://github.com/perl6/roast/blob/d1baf2e7a3e56cd6619c46040d04ed6daebc1d02/S32-io/pipe.t
08:50 FROGGS Ven_: yes
08:51 Ven_ FROGGS: thanks.
09:01 rindolf joined #perl6
09:10 RabidGravy which makes sense really as it will have to wait() on the process to find the exit code and won't do that until the stdout is close
09:10 RabidGravy d
09:14 pierre_ joined #perl6
09:30 Velvet joined #perl6
09:30 nowan joined #perl6
09:36 tbrowder hi #perl6!
09:38 tbrowder is iBakeCake around, or anyone else who can help me understand current implementation of the replication operator infix<x>?
09:44 tbrowder the question i had yesterday was why couldn't the operator be defined with another signature and the two reasons given were too expensive and too much developer time. i'm not satisfied with either of those. perl 6 is full of "syntactic sugar" now (and that makes it much more appealing), and i'm sure each of those could have been turned down on the same
09:44 tbrowder arguments.
09:44 timotimo o/
09:45 timotimo tbrowder: what does "with another signature" mean?
09:45 tbrowder hi, timotimo
09:46 tbrowder i mean (int, str) so one can say "3 x ' 0'
09:47 tbrowder 3 x '0' => '000'
09:47 timotimo but we already have "0" x 3 for that?
09:47 tbrowder it seems more natural to say 3 eggs the eggs x 3
09:47 timotimo in that case
09:47 timotimo m: say 3 Rx '0'
09:47 camelia rakudo-moar 2dd0dd: OUTPUT«000␤»
09:47 jnthn Performance/development time are hardly the issue with that. It's that it's a really bad idea.
09:47 timotimo done.
09:47 tbrowder s/the/than/
09:48 tbrowder why?
09:48 jnthn For the same reason == and + in JavaScript are problematic.
09:48 timotimo though thunking might get disappeared with Rx
09:48 timotimo m: say 3 rX rand
09:48 camelia rakudo-moar 2dd0dd: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say 37⏏5 rX rand␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement modifier␤    …»
09:49 tbrowder hi jnthn, I appreciate you!
09:49 timotimo m: say 3 Rx rand
09:49 camelia rakudo-moar 2dd0dd: OUTPUT«0.1233976090031390.1233976090031390.123397609003139␤»
09:49 timotimo right, it makes thunking disappear
09:49 jnthn Operators should be predictable in their behavior
09:49 jnthn So, == always coerces both sides to numeric, while eq always coerces both sides to strings
09:50 jnthn my $str = prompt 'String? '; my $rep = prompt 'Repetitions? '; say $str x $rep
09:50 tbrowder now that makes more sense
09:52 tbrowder but, as a sop to the situation, couldn't we get some feedback when the RHS becomes zero?
09:52 jnthn I can think I've code I've written that depends on that producing the empty string :)
09:53 jnthn (Was plotting text bar graphs)
09:53 tbrowder okay, i'm satisfied, thanks!
09:54 jnthn fwiw, the reason "operators should do predictable things" argument is why Perl 6 lets you add new operators to the language
09:54 * timotimo initially didn't realize you were proposing multiple signatures
09:54 jnthn (So that you can give a new semantic a new syntax, rather than overloading existing syntax with a confusing meaning)
09:57 tbrowder timotimo: i just really saw what you did!! i read about R but didn't at the the time think of my own use case, pretty cool!
09:59 tbrowder m: say 4 Rx 'c'
09:59 camelia rakudo-moar 2dd0dd: OUTPUT«cccc␤»
09:59 tbrowder slick!!
10:05 timotimo handle with care, though
10:05 timotimo as i said, it will not thunk the RHS for you any more
10:06 timotimo though that makes it possible to obtain a version of x that doesn't thunk if that's what you want: RRx
10:07 jnthn m: say rand x 4
10:07 camelia rakudo-moar 2dd0dd: OUTPUT«0.9604191013640550.9604191013640550.9604191013640550.960419101364055␤»
10:07 jnthn x doesn't anyway; you're thinking of xx
10:07 timotimo oh!
10:07 timotimo silly me! of course i am
10:07 timotimo i should really have some tea
10:11 kurahaupo joined #perl6
10:11 timotimo wow. i just made it and already spilled a big slosh of it on my table
10:11 timotimo this day is ... going to need some getting used to
10:12 arnsholt A caffeination-bootstrapping related incident?
10:12 arnsholt Hard to produce caffeine correctly without first consuming the caffeine
10:12 timotimo yeah
10:15 Bname joined #perl6
10:16 iBakeCake tbrowder: the performance reason I mentioned was for checking for the presence of white-space-only string (which gets .Inted to zero). For your alternative signature I told you it would conflict with current legit code. Along with the prompt() example jnthn++ showed you, I showed you my ($a, $b) = <5 10>; say $a x $b; which in your implementation would throw, because they're IntStrs
10:17 Lucas_One joined #perl6
10:18 iBakeCake tbrowder: And we'd have to add a silly special case to the docs too: "coerces LHS to Str and RHS to Int... UNLESS the LHS is already an Int and RHS is already a Str, in which case the operator will throw"
10:19 iBakeCake And the only reason for that is to, as you phrased it, to prevent "dummies" from writing the operator backwards, which I doubt is a common occurence in the first place.
10:24 salva00 joined #perl6
10:31 iBakeCake Come to think of it, I wouldn't want to complain about white-space only strings either for that same reason. Specialcasing it would need a note in the docs pointing out a behaviour that differs from the rest of the language, where white-space only string Ints to 0
10:31 iBakeCake m: <good stuff>['   '].say
10:31 camelia rakudo-moar 2dd0dd: OUTPUT«good␤»
10:31 * iBakeCake ends the soliloquy
10:34 sergot joined #perl6
10:35 timotimo it's amusing that i only see whitespace in there
10:35 iBakeCake There *is* only whitespace in there.
10:35 timotimo oh
10:35 timotimo i should have probably read the line before that line
10:36 iBakeCake :)
10:36 * timotimo wonders if there's actually caffeine in that tea
10:36 iBakeCake You never listen to me! :P
10:41 hchienjo joined #perl6
10:44 grondilu joined #perl6
10:45 grondilu joined #perl6
10:46 wamba joined #perl6
10:47 user9 joined #perl6
10:51 timotimo FROGGS: ask me if you need help working the coverity website
10:52 timotimo hmpf. the coverity summary page is only updated about 50% :\
10:53 lizmat joined #perl6
10:54 CIAvash joined #perl6
10:55 mxco86 joined #perl6
10:59 FROGGS timotimo: will do once I have access
11:00 timotimo i gave you access (i think)
11:00 FROGGS ahh, I see
11:00 timotimo hm. i gave you contributor/member access, that might not be enough for some things?
11:00 timotimo nah, only thing you can't do is submit new builds or manage users
11:01 timotimo the overview is still showing the version from last time, not the new one :|
11:03 kurahaupo__ joined #perl6
11:03 kurahaupo__ joined #perl6
11:03 FROGGS timotimo: I can see the defects fine
11:04 timotimo good!
11:04 timotimo there's a few false-positives i can see
11:05 timotimo like it's not understanding trycas is an assignment, so it thinks the thing being assigned is falling out of the scope and leaks
11:06 salv0 joined #perl6
11:08 timotimo hooray, it's showing the newest version name, now!
11:12 Actualeyes joined #perl6
11:13 pierre_ joined #perl6
11:17 tbrowder iBakeCake: thanks
11:43 pierre_ joined #perl6
11:43 kent\n joined #perl6
11:45 nadim joined #perl6
11:57 aborazmeh joined #perl6
11:57 aborazmeh joined #perl6
12:13 lucasb_ joined #perl6
12:33 rindolf joined #perl6
12:39 dalek doc: fd7d6ba | coke++ | doc/Language/operators.pod6:
12:39 dalek doc: remove trailing ws
12:39 dalek doc: review: https://github.com/perl6/doc/commit/fd7d6bac5a
12:39 dalek doc/spellcheck: 7bd27cb | Nic++ | doc/Language/traps.pod6:
12:39 dalek doc/spellcheck: Add 'once' Block to Traps (#968)
12:39 dalek doc/spellcheck:
12:39 dalek doc/spellcheck: Added a section to traps about using once blocks within
12:39 dalek doc/spellcheck: other blocks of code.
12:39 dalek doc/spellcheck:
12:39 dalek doc/spellcheck: Resolves issue #959
12:39 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/7bd27cbf79
12:39 dalek doc/spellcheck: 2bc0df8 | (Tom Browder)++ | doc/Language/operators.pod6:
12:39 dalek doc/spellcheck: give fair notice of a possible silent error
12:39 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/2bc0df8430
12:39 dalek doc/spellcheck: f6314f6 | (Tom Browder)++ | doc/Language/operators.pod6:
12:39 dalek doc/spellcheck: give examples of incorrect args
12:39 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/f6314f6bd6
12:39 dalek doc/spellcheck: 9677f76 | (Zoffix Znet)++ | doc/Language/operators.pod6:
12:39 dalek doc/spellcheck: Improve infix:<x>
12:39 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/9677f761c0
12:39 dalek doc/spellcheck: fd7d6ba | coke++ | doc/Language/operators.pod6:
12:39 dalek doc/spellcheck: remove trailing ws
12:39 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/fd7d6bac5a
12:39 dalek doc/spellcheck: 8fb6e69 | coke++ | doc/Language/ (2 files):
12:39 dalek doc/spellcheck: Merge branch 'master' into spellcheck
12:39 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/8fb6e691d7
12:39 iBakeCake weeeee
12:40 iBakeCake ug :( missed the ride.
12:41 timotimo :(
12:41 bjz_ joined #perl6
12:47 m0ltar joined #perl6
12:56 awwaiid joined #perl6
13:02 kjs_ joined #perl6
13:02 iBakeCake When is Murican election gonna be over....  Every time I open Twitter, I see trump this trump that.
13:03 iBakeCake Even TimToady is pitching in heh
13:03 timotimo TrumpToady?
13:03 iBakeCake :}
13:06 timotimo that's a scary thought
13:06 perlpilot Perl has words.  Good words.  Lots of words.  Perl has the best words.
13:10 timotimo you can grab your program by the operators
13:13 dakkar joined #perl6
13:13 perlpilot iBakeCake: Ideally the election will be over by Nov 9, but in practice it will probably take a few more months for it to *really* be over.
13:14 timotimo riots in the streets, hillary and trump supporters bashing each others heads in ...
13:14 iBakeCake perlpilot: Plus 2 more years of "X is doing a bad job", until another election with bought off puppets and the cycle repeats? :)
13:14 dalek doc/spellcheck: 4989cea | coke++ | xt/.aspell.pws:
13:14 dalek doc/spellcheck: more words
13:14 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/4989cea3ee
13:14 perlpilot iBakeCake: yep!
13:15 dalek doc: 8ad2322 | coke++ | doc/Type/Lock.pod6:
13:15 dalek doc: fix typo
13:15 dalek doc: review: https://github.com/perl6/doc/commit/8ad2322934
13:15 perlpilot though, hopefully the next presidential election will have learned from the mistakes of this one.
13:15 dalek doc/spellcheck: 8ad2322 | coke++ | doc/Type/Lock.pod6:
13:15 dalek doc/spellcheck: fix typo
13:15 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/8ad2322934
13:15 dalek doc/spellcheck: 2985d2f | coke++ | doc/Type/Lock.pod6:
13:15 dalek doc/spellcheck: Merge branch 'master' into spellcheck
13:15 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/2985d2f7dd
13:16 perlpilot The one good thing I can think of from this election is the increased use of real time fact checking.
13:17 iBakeCake .oO( but who's factchecking the fact checkers... )
13:17 cdg joined #perl6
13:18 cdg joined #perl6
13:18 perlpilot It'll probably end up like our weather models ... there will be N fact-checkers with some M that agree, so those M have the "real" facts.
13:18 iBakeCake :)
13:22 [Coke] m: say &rand.multiness
13:22 camelia rakudo-moar 2dd0dd: OUTPUT«No such method 'multiness' for invocant of type 'Sub+{Callable[Num:D]}'␤  in block <unit> at <tmp> line 1␤␤»
13:22 [Coke] m: say Int.new.multiness
13:22 camelia rakudo-moar 2dd0dd: OUTPUT«No such method 'multiness' for invocant of type 'Int'␤  in block <unit> at <tmp> line 1␤␤»
13:23 kjs_ joined #perl6
13:24 [Coke] m: Int.can('new')>>.multiness.say
13:24 camelia rakudo-moar 2dd0dd: OUTPUT«No such method 'multiness' for invocant of type 'Method'␤  in block <unit> at <tmp> line 1␤␤»
13:25 iBakeCake .oO( multiness ?? )
13:25 [Coke] oh, it's a method on a very particular exception type, not on all methods. ah
13:27 iBakeCake m: 'multi {}'.EVAL; CATCH { default { dd [ .^name, .multiness ] } }
13:27 camelia rakudo-moar 2dd0dd: OUTPUT«["X::Anon::Multi", "multi"]␤»
13:27 * iBakeCake wonders what other multinesses are there
13:28 iBakeCake m: 'proto {}'.EVAL; CATCH { default { dd [ .^name, .multiness ] } }
13:28 camelia rakudo-moar 2dd0dd: OUTPUT«["X::Anon::Multi", "proto"]␤»
13:28 iBakeCake \o/
13:30 kjs_ joined #perl6
13:34 [Coke] any suggestions for dealing with spellchecking things like variable names and literal constants in the code?
13:35 [Coke] down to 99 pod6 files with spelling issues.
13:35 sftp joined #perl6
13:36 dalek doc/spellcheck: 0e74bc2 | coke++ | xt/.aspell.pws:
13:36 dalek doc/spellcheck: more words
13:36 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/0e74bc267a
13:37 Guest18866 joined #perl6
13:37 Matias[m] joined #perl6
13:38 sftp_ joined #perl6
13:39 skids joined #perl6
13:50 pmurias joined #perl6
13:51 pmurias [Coke]: you want to make sure the variable in the code don't have spelling errors? (or avoid variable mentioned in the docs from causing problems)
13:57 [Coke] pmurias: yes, one of those two things. :)
14:03 dalek doc: f2e063e | coke++ | doc/Type/Str.pod6:
14:03 dalek doc: fix typo
14:03 dalek doc: review: https://github.com/perl6/doc/commit/f2e063e8ea
14:03 [Coke] pmurias: code like this: substr("Long string", 6);        # tring
14:04 [Coke] tring's not a word or a method name, or... so I hesitate to add it to the list of words. I could have a separate list of "stuff that is only on the list because it's in a code sample", or rework the code sample so that -happens- to be a word..
14:10 wamba joined #perl6
14:10 Derperperd joined #perl6
14:13 awwaiid joined #perl6
14:15 wamba joined #perl6
14:17 khw joined #perl6
14:19 araujo joined #perl6
14:19 seatek joined #perl6
14:19 dakkar joined #perl6
14:28 [Coke] hurm. aspell seems to think that doc/Type/Attribute.pod6 contains the word "ew" somewhere. (after running through p6doc). ... anyone see it? I do not
14:29 iBakeCake [Coke]: maybe try changing the \new to new here: https://github.com/perl6/doc/blob/master/doc/Type/Attribute.pod6#L139
14:29 iBakeCake and see if it still tells you about ew? /me shrugs
14:30 sammers joined #perl6
14:31 dalek doc: 2caf533 | coke++ | doc/Type/Str.pod6:
14:31 dalek doc: fix typo
14:31 dalek doc: review: https://github.com/perl6/doc/commit/2caf5337c7
14:31 dalek doc: 8ed3d19 | coke++ | doc/Language/traps.pod6:
14:31 dalek doc: fix typo
14:31 dalek doc: review: https://github.com/perl6/doc/commit/8ed3d19c7e
14:32 dalek doc/spellcheck: f2e063e | coke++ | doc/Type/Str.pod6:
14:32 dalek doc/spellcheck: fix typo
14:32 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/f2e063e8ea
14:32 dalek doc/spellcheck: 2caf533 | coke++ | doc/Type/Str.pod6:
14:32 dalek doc/spellcheck: fix typo
14:32 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/2caf5337c7
14:32 dalek doc/spellcheck: 8ed3d19 | coke++ | doc/Language/traps.pod6:
14:32 dalek doc/spellcheck: fix typo
14:32 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/8ed3d19c7e
14:32 dalek doc/spellcheck: 7577b75 | coke++ | xt/.aspell.pws:
14:32 dalek doc/spellcheck: more words
14:32 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/7577b7544d
14:32 dalek doc/spellcheck: 19affec | coke++ | doc/ (2 files):
14:32 dalek doc/spellcheck: Merge branch 'master' into spellcheck
14:32 dalek doc/spellcheck: review: https://github.com/perl6/doc/commit/19affec9ac
14:32 [Coke] ah, that's probably it, thanks.
14:36 awwaiid joined #perl6
14:39 dalek doc: 9398f28 | coke++ | doc/Language/traps.pod6:
14:39 dalek doc: fix typos
14:39 dalek doc: review: https://github.com/perl6/doc/commit/9398f28fff
14:43 pmurias [Coke]: if it's a single example (or a couple of those) I would just change it instead of doing something complex
14:46 [Coke] no, it's more like 100s of instances.
14:47 [Coke] hurm. anyone know what aspell means when it says:
14:47 [Coke] --extra-dicts=<list>
14:47 [Coke] (What is a list, in this context?)
14:49 [Coke] (it's not a space or comma separted list; multiple instances of --extra-dicts results seems to result in using only the last specified)
14:50 * [Coke] puts this down and works on something else for a while. whoops
14:57 iBakeCake [Coke]: maybe it's --extra-dicts=one --extra-dicts=two ... ?
14:59 awwaiid joined #perl6
15:03 fumlead joined #perl6
15:03 m0ltar joined #perl6
15:05 [Coke] that results in using just two, as I read it
15:14 hchienjo joined #perl6
15:15 ggoebel joined #perl6
15:16 awwaiid joined #perl6
15:23 dalek doc: d2574de | (Zoffix Znet)++ | doc/Type/Numeric.pod6:
15:23 dalek doc: Clarify special cases in Numeric.log
15:23 dalek doc: review: https://github.com/perl6/doc/commit/d2574de2a8
15:24 iBakeCake kinda LTA that Cool.pod6 duplicates a ton of routines from Numeric.pod6
15:25 AlexDaniel joined #perl6
15:26 seatek joined #perl6
15:28 dalek doc: db56afa | (Zoffix Znet)++ | doc/Type/Cool.pod6:
15:28 dalek doc: Replicate Numeric.log changes in Cool.log
15:28 dalek doc:
15:28 dalek doc: (why is all of this stuff duplicated like this? Cool really just does a
15:28 dalek doc: coersion to Numeric for all of these mathematical methods and
15:28 dalek doc: maintaining docs for them in 2 places is LTA)
15:28 dalek doc: review: https://github.com/perl6/doc/commit/db56afa780
15:29 dalek doc: d2f47ac | (Zoffix Znet)++ | doc/Type/Cool.pod6:
15:29 dalek doc: Clarify special cases in Numeric.log10
15:29 dalek doc: review: https://github.com/perl6/doc/commit/d2f47acffa
15:30 dalek doc: 59efbe2 | (Zoffix Znet)++ | doc/Type/Numeric.pod6:
15:30 dalek doc: Clarify special cases in Numeric.log10
15:30 dalek doc: review: https://github.com/perl6/doc/commit/59efbe21be
15:31 iBakeCake m: say log NaN
15:31 camelia rakudo-moar 8a72a4: OUTPUT«NaN␤»
15:31 iBakeCake m: say log Inf
15:31 camelia rakudo-moar 8a72a4: OUTPUT«Inf␤»
15:31 iBakeCake Probably would make more sense to have a separate table of all kinds of special cases for all of such routines
15:49 awwaiid joined #perl6
15:57 itaipu joined #perl6
16:19 zacts joined #perl6
16:22 awwaiid joined #perl6
16:30 girafe joined #perl6
16:38 * [Coke] stares at a export/import failure in about 6 lines of code over two files that is confusing him.
16:39 wamba joined #perl6
16:40 dha joined #perl6
17:00 cdg joined #perl6
17:02 awwaiid joined #perl6
17:07 firstdayonthejob joined #perl6
17:15 awwaiid joined #perl6
17:32 cognominal joined #perl6
17:35 Derperperd joined #perl6
17:50 domidumont joined #perl6
17:52 iBakeCake m: use MONKEY-TYPING; augment class Int {method life-the-universe-and-everything (42:) {1}}; say grep {try .life-the-universe-and-everything}, |^50
17:52 camelia rakudo-moar 906719: OUTPUT«(42)␤»
17:52 iBakeCake neat, eh?
17:53 iBakeCake m: use MONKEY-TYPING; augment class Int {multi method life-the-universe-and-everything (42:) {'ANSWER!'}; multi method life-the-universe-and-everything { 'not the answer' }}; (1, 3, 4, 42, 543)».life-the-universe-and-everything.say
17:53 camelia rakudo-moar 906719: OUTPUT«(not the answer not the answer not the answer ANSWER! not the answer)␤»
17:53 iBakeCake :D
17:56 ilmari[m] joined #perl6
17:57 labster joined #perl6
18:02 M-Illandan joined #perl6
18:02 enick_966 joined #perl6
18:02 Matthew[m] joined #perl6
18:02 tadzik joined #perl6
18:02 Matias[m] joined #perl6
18:03 fumlead Hi guys, what is it?
18:03 fumlead m: my @x = <1, 2, 3, 4, 5>; +@x;
18:04 camelia rakudo-moar 906719: OUTPUT«WARNINGS for <tmp>:␤Useless use of "+" in expression "+@x" in sink context (line 1)␤»
18:04 fumlead m: my @x = <1,2,3>; say +@x;
18:04 camelia rakudo-moar 906719: OUTPUT«1␤»
18:05 iBakeCake fumlead: the < ... > use whitespace to separate items
18:05 iBakeCake not commas
18:05 iBakeCake m: my @x = <this is   awesome!>; dd @x
18:05 camelia rakudo-moar 906719: OUTPUT«Array @x = ["this", "is", "awesome!"]␤»
18:05 fumlead Oh
18:05 iBakeCake m: my @x = 1, 2, 3; dd @x
18:05 camelia rakudo-moar 906719: OUTPUT«Array @x = [1, 2, 3]␤»
18:05 iBakeCake m: my @x = ^3; dd @x
18:05 camelia rakudo-moar 906719: OUTPUT«Array @x = [0, 1, 2]␤»
18:06 fumlead thanks, I thought i'm became mad)
18:06 iBakeCake :)
18:11 perlpilot Didn't we used to have a warning on using commas inside <> or did I imagine that?
18:12 perlpilot or mabye I'm conflating P5 and P6
18:14 iBakeCake please no warnings >_< one things I hated in P5 is constant annoyance about # in qw//
18:14 iBakeCake (and yeah, it does warn about commas too)
18:15 lucasb_ $ perl -wE 'qw/1,2,3/'
18:15 lucasb_ Possible attempt to separate words with commas at -e line 1.
18:15 lucasb_ I always have to do this: my @notes = do { no warnings 'qw'; qw(C C# D D# ...) }
18:16 perlpilot yeah, I was conflating the two perls
18:18 iBakeCake ETOOMANYPERLS
18:28 rurban joined #perl6
18:35 Cabanossi joined #perl6
18:44 harmil_wk EMORETHANONEWAY
18:44 harmil_wk Which, oddly, in Perl is considered a successful status ;-)
18:45 iBakeCake ... and in any natural language :)
18:49 moritz I just watched The Martian, and holy shit, why did I wait this long?
18:49 iBakeCake You... liked it?
18:50 arnsholt Pretty neat, isn't it?
18:50 moritz yes
18:50 arnsholt The book is pretty funny too
18:50 * iBakeCake hated it (the movie)
18:50 moritz like, the best film I've seen in quite a while
18:50 moritz though I don't watch movies very often these days
18:50 moritz iBakeCake: i'm curious, why?
18:51 iBakeCake moritz: just found it completely absurd. Not only that a ship would have enough fuel and supplies to go back for that guy, but that the gov would spend ridiculous amounts of money to save him at all.
18:52 Derperperd joined #perl6
18:52 iBakeCake We're prepping a real life mission to Mars with humans and one consistent requirement: are you ready to die?
18:54 iBakeCake And I guess the movie went the most ridiculous closer to the end... like when they pick him up.. It's just ridiculous, nonsensical, CGI vomit that entire scene is
18:55 moritz iBakeCake: there's the whole emotional side to it. Leaving somebody to die when there is even a slim chance to save him would have *very* negative press, possibly enough to cancle future missions
18:55 arnsholt Well, it's competence porn, isn't it?
18:55 moritz agreed with the last part though
18:56 arnsholt iBakeCake: Well, the last part is a pretty faithful rendition of the ending in the book though =)
19:00 iBakeCake moritz: I imagine in real life there'd be a significant portion of mouth-foaming people yelling about taxpayers money. Sure future programs would be in jeopardy, but I doubt gov would approve spending an uptilion dollars on a risky mission to save one human who undertook a risky mission
19:02 iBakeCake There have been cases of submarines sinking with crews on board and rescue efforts... well, they were hardly spectacular, successfull, or had any crowds cheering on the street.
19:02 iBakeCake I recall this one: https://en.wikipedia.org/wiki/Kursk_submarine_disaster
19:02 moritz iBakeCake: in Germany we had a huge rescue action for a single cave explorer just the other year
19:02 iBakeCake The news occasionally shows the story but no one gave a shit. After a couple of weeks it was clear the crew is dead and that was the end of it.
19:03 moritz ok, probably just a few million EUR, but for somebody the public had barely heard of before
19:04 geekosaur subs don't get the coverage space stuff does
19:04 iBakeCake subs are also much easier to rescue from than Mars :P
19:04 geekosaur um. no
19:04 moritz anyway, I've learned not to apply too high standards to the realism of movies
19:04 geekosaur in some ways the deeps of the Pacific are *worse* than space
19:04 moritz it helps me be less frustrated when watching :-9
19:05 iBakeCake geekosaur: no? We have rescued from subs but we haven't even set foot onto Mars :)
19:05 seatek the moral of the story: better quality control on parts sent to mars, and send more gardeners!
19:05 geekosaur it will depend on where the sub was, and how deep. there really are situations where any rescue mission will only get near its goal after everyone is dead anyway
19:07 cdg joined #perl6
19:09 arnsholt Indeed. I remember when the Kursk sank
19:09 _slade_ joined #perl6
19:13 AlexDaniel A bit closer to the end they were switching between anorexic double and actual actor every 5 seconds, without any attempt to cover it. The most disturbing part of the movie I think. Like, are you kidding me? I'm not fucking blind.
19:14 AlexDaniel that's when that movie went over the nonsense limit in my head…
19:14 AlexDaniel but if you only watch the first half it is pretty good
19:15 seatek Matt Damon didn't sacrifice himself to the art?
19:15 seatek Or was it Mark Walberg? I get them confused.
19:15 iBakeCake damon
19:16 AlexDaniel like “OK, here we look at some person who is trying to survive. His days are counted. Oops, he is running out of supplies. The end”
19:17 AlexDaniel that would've been perfect. No need for a happy end in this story, really.
19:17 iBakeCake Yeah
19:17 seatek He should have gotten abducted and taken to the dyson sphere
19:18 iBakeCake Show a shot of "100 years in the future" where there's a colony and a statue of him
19:19 seatek potatoes blossoming around his feet
19:21 yqt joined #perl6
19:21 fumlead I agreed, Martian is one of the best films I ever watched. It's not perfect, but it's better than others
19:22 moritz much more realistic than, say, Inception
19:22 seatek I liked the book, haven't seen the movie. I liked how he had to try to figure out how to survive from minute to minute with only what he had on-hand
19:23 seatek very detailed and interesting to me
19:24 seatek plus it might help the nasa people figure out things they hadn't already for a trip. if they ever do. i hope so.
19:26 AlexDaniel what?
19:26 iBakeCake where? WHYY?
19:26 iBakeCake :}
19:27 seatek maybe perl6 will stop memory leaking by then so they can use it on mars and have it not explode the habitat ;)
19:27 * awwaiid buys more tape for his turing machine
19:28 iBakeCake Well, we do have a `NASA` module in the ecosystem to entice them... Fingers crossed!
19:28 seatek :)
19:34 crucialrhyme joined #perl6
19:36 crucialrhyme what's the best way to convert big ints to bytes (probably Blob)?
19:38 harmil_wk m: use Test; is set("a", "b", "c", "1", "2", "3"), set(<a b c 1 2 3>.pick(*))
19:38 camelia rakudo-moar 906719: OUTPUT«not ok 1 - ␤␤# Failed test at <tmp> line 1␤# expected: 'a c b 1 2 3'␤#      got: 'a c b 1 3 2'␤»
19:39 harmil_wk This bothers me... it seems to be because the 1 2 3 don't get turned into simple strings
19:39 iBakeCake hm?
19:39 iBakeCake harmil_wk: they're IntStr. Those two sets are not equivalent and `is` is a wrong function to test them anyway.
19:40 canopus joined #perl6
19:40 harmil_wk Yes, that's my concern that IntStr is not an obvious result of what looks like a list of equivalent things.
19:40 iBakeCake Learn to live with it :)
19:41 iBakeCake Or use Quantum::Superposition
19:41 iBakeCake Oh, it's Quantum::Colapse
19:41 iBakeCake https://github.com/zoffixznet/perl6-Quantum-Collapse
19:42 iBakeCake crucialrhyme: maybe keep pushing to a Buf while there's stuff to push and then .Blob it?
19:45 iBakeCake m: say my Int $x = 2**100; my $b = Buf.new; while $x > 255 { $b.push: 255; $x div= 255 }; $b.push: $x if $x; dd Blob.new: $b
19:45 camelia rakudo-moar 906719: OUTPUT«1267650600228229401496703205376␤Blob.new(255,255,255,255,255,255,255,255,255,255,255,255,16)␤»
19:46 * iBakeCake has no idea if that's accurate and is certain it's not the most efficient way :)
19:46 harmil_wk iBakeCake: is seems to do the right thing with equivalent sets. Why do you think it's the wrong operator?
19:46 iBakeCake There's bit tweedling way, ain't there?
19:46 moritz iBakeCake: doesn't that need a .reverse
19:46 * iBakeCake shrugs
19:47 arnsholt iBakeCake: I'm pretty sure always pushing 255 is wrong, but the general gist of it looks right I think
19:47 arnsholt moritz: Depends on if you want big-endian or little-endian, I guess
19:47 arnsholt (And I can never for the life of me remember which is which)
19:48 iBakeCake m: use Test; is set("3 1 a b c 2"), set("a b c", 1, 2, 3)
19:48 camelia rakudo-moar 906719: OUTPUT«ok 1 - ␤»
19:48 moritz big endian is most-significant bit first
19:48 iBakeCake harmil_wk: ^ because it gives false positives
19:48 iBakeCake m: use Test; is "3 1 a b c 2", set("a b c", 1, 2, 3)
19:48 camelia rakudo-moar 906719: OUTPUT«ok 1 - ␤»
19:49 iBakeCake ^ even worse one, since the received result ain't even a set
19:49 iBakeCake arnsholt: why always pushing 255 is wrong?
19:49 harmil_wk Hmm... looking at is-deeply it also makes what I consider to be a mistake
19:50 harmil_wk but I think it's easily fixed.
19:50 iBakeCake harmil_wk: what's the mistake?
19:50 arnsholt iBakeCake: You want to push the remainder of the division at each entry
19:50 arnsholt Otherwise all the bytes will be 0xFF
19:50 iBakeCake ah
19:51 moritz m: my $x = 0x7FF00FFEEAA20; say Blob.new( reverse do gather while $x { take $x % 256; $x div= 256 } );
19:51 camelia rakudo-moar 906719: OUTPUT«Blob:0x<07 ff 00 ff ee aa 20>␤»
19:52 arnsholt Oh, nice one!
19:52 jferrero moritz++
19:52 fumlead iBakeCake: why your example working? (pre-last one about sets) I don't catch the idea
19:52 arnsholt reverse do gather while is an especially impressive syntactic construct
19:52 crucialrhyme that is great
19:52 moritz I keep wondering if a there is a way to express this in a series operator
19:52 iBakeCake fumlead: because `is` stringifies its arguments and compares the resultant strings. It's not suitable for testing anything where you don't expect such a behaviour
19:53 crucialrhyme maybe there is a way to use +> and avoid the mod
19:53 * iBakeCake & relocating
19:53 iBakeCake harmil_wk: still curious in the mistake in is-deeply
19:56 moritz m: my $x = 4023493243433333300000000000000222292;
19:56 camelia rakudo-moar 906719: ( no output )
19:56 moritz m: my $x = 4023493243433333300000000000000222292; say Blob.new( reverse (($x, 0), { .[0] div 256, .[0] % 256 } ... *[0] == 0).map( *[1])[1..*]);
19:56 camelia rakudo-moar 906719: OUTPUT«Blob:0x<03 06 e5 88 5a ca 27 19 8c 1b 52 eb 88 53 64 54>␤»
19:57 moritz m: my $x = 0XFA4023493243433333300000000000000222292; say Blob.new( reverse (($x, 0), { .[0] div 256, .[0] % 256 } ... *[0] == 0).map( *[1])[1..*]);
19:57 camelia rakudo-moar 906719: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3my $x = 07⏏5XFA4023493243433333300000000000000222292␤»
19:57 moritz m: my $x = 0xFA4023493243433333300000000000000222292; say Blob.new( reverse (($x, 0), { .[0] div 256, .[0] % 256 } ... *[0] == 0).map( *[1])[1..*]);
19:57 camelia rakudo-moar 906719: OUTPUT«Blob:0x<0f a4 02 34 93 24 34 33 33 33 00 00 00 00 00 00 00 22 22 92>␤»
19:57 moritz ok, this is rather forced
19:58 fumlead moritz: this solution isn't so clear as previous one
19:58 crucialrhyme m: my $mask = 0xFF; my $x = 0x7FF00FFEEAA20; say Blob.new( reverse do gather while $x { take $x +& $mask; $x +>= 8 } );
19:58 camelia rakudo-moar 906719: OUTPUT«Blob:0x<07 ff 00 ff ee aa 20>␤»
19:59 crucialrhyme thank you for this solution. i really need to get fluent with gather and while
19:59 crucialrhyme gather and take, rather
19:59 moritz I guess keeping a state var would be clearer
20:01 vendethiel- joined #perl6
20:02 Ven_ joined #perl6
20:04 harmil_wk iBakeCake: no, it's not as simple a fix as I thought. The real problem is that, naively one might expect an OO-aware language to defined "deep equivalence" in terms of polymorphism, but eqv (which is what is-deeply uses) explicitly used .WHAT =:= .WHAT for testing, rather than a polymorphic comparison.
20:09 ZoffixMobile joined #perl6
20:09 ZoffixMobile harmil_wk, what's polymorphic comparison? That 42 would is-deeply '42'?
20:12 fumlead m: use Test; is-deeply '42', 42;
20:12 camelia rakudo-moar 906719: OUTPUT«not ok 1 - ␤␤# Failed test at <tmp> line 1␤# expected: 42␤#      got: "42"␤»
20:12 fumlead No)
20:13 harmil_wk fumlead: ZoffixMobile and I are aware of what the current behavior is :)
20:14 harmil_wk ZoffixMobile: I'd say that that depends on what is-deeply says it does. In this case it says it uses "eqv" to establish equivalence, and as I say, in a naively polymorphic sense, Int.new(42) and Str.new("42") are equivalent in P6 because they have a common base role (Cool)
20:14 fumlead harmil_wk, my mistake, my english is rather weak
20:15 harmil_wk fumlead: no worries, thanks for making the test case explicit, though.
20:15 harmil_wk Basically that is-deeply is exactly equivalent to "42 eqv '42'"
20:15 setty1 joined #perl6
20:16 ZoffixMobile harmil_wk, by that logic, so is IO::Path.new('42')... but unlike an Int, I can do file operatons on it and if I test my API to return IO::Path and it gives me an Int, that's a broken API
20:16 harmil_wk I don't think the eqv operator is at fault (though I think it's squatting on some valuable namespace). I think the problem is that is-deeply is set up in the User's eyes to be "is" but for structures, and it's not.
20:16 Ven_ joined #perl6
20:17 harmil_wk ZoffixMobile: Yep, I agree, which is why (other than the name) I think eqv as it is has great value. I could even live with the name, but is-deeply shouldn't be using it.
20:17 ZoffixMobile harmil_wk, I think the only issue here is poor naming of routines.... and that's largely for historical reasons
20:17 setty1 joined #perl6
20:18 harmil_wk ZoffixMobile: I agree that that's probably not worth going back and addressing, but if we have is and is-deeply, we should probably make is-deeply do what is does, but deeply. :-)
20:18 harmil_wk Wow, that's a horrible sentence!
20:20 setty1 joined #perl6
20:33 Ven__ joined #perl6
20:33 setty1 joined #perl6
20:41 fumlead left #perl6
20:42 lostinfog joined #perl6
20:44 girafe2 joined #perl6
20:47 geekosaur joined #perl6
20:59 setty1 joined #perl6
21:02 Ven_ joined #perl6
21:02 setty1 joined #perl6
21:03 setty1 joined #perl6
21:04 harmil_wk Okay, $work came up, I'm back. So, perhaps the right thing to do is to add an is-polymorphically-deeply (but with a better name)
21:04 setty2 joined #perl6
21:06 TEttinger joined #perl6
21:11 iBakeCake .oO( is-similar )
21:11 setty2 joined #perl6
21:13 iBakeCake m: say "Foo".IO eq "Foo"
21:13 camelia rakudo-moar 906719: OUTPUT«True␤»
21:13 iBakeCake m: class RandomStuff does Cool { method Str { "Foo" }; method Int { 42 } }; say RandomStuff eq "Foo"; say RandomStuff == 42
21:13 camelia rakudo-moar 906719: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cool is not composable, so RandomStuff cannot compose it␤at <tmp>:1␤»
21:14 iBakeCake Your mother!
21:14 iBakeCake m: class RandomStuff is Cool { method Str { "Foo" }; method Int { 42 } }; say RandomStuff eq "Foo"; say RandomStuff == 42
21:14 camelia rakudo-moar 906719: OUTPUT«True␤Use of uninitialized value of type RandomStuff in numeric context␤  in block <unit> at <tmp> line 1␤False␤»
21:14 iBakeCake m: class RandomStuff is Cool { method Str { "Foo" }; method Numeric { 42 } }; say RandomStuff eq "Foo"; say RandomStuff == 42
21:14 camelia rakudo-moar 906719: OUTPUT«True␤True␤»
21:17 setty2 joined #perl6
21:18 setty2 joined #perl6
21:23 setty2 joined #perl6
21:26 setty2 joined #perl6
21:31 bjz joined #perl6
21:46 nicq20 joined #perl6
21:48 nicq20 Hello! o/
21:48 yoleaux 16 Oct 2016 18:36Z <AlexDaniel> nicq20: fwiw, until your PR is merged you can do all kinds of scary stuff in your branch (e.g. rewrite history). This is useful if you don't want some “oops” commits to go into the main repo
21:48 yoleaux 16 Oct 2016 18:37Z <AlexDaniel> nicq20: I am mentioning this because I have just squished your last PR (and previous one as well). I am not sure if we have any consensus on squishing, but it is probably a good idea to keep your PRs clean
21:48 yoleaux 16 Oct 2016 18:39Z <AlexDaniel> nicq20: this way it is easier to review a PR, there's no desire to squish it, and the history in the main repo is so clean you can eat off it
21:48 iBakeCake \o
21:48 AlexDaniel \o
21:59 bjz_ joined #perl6
22:00 pecastro joined #perl6
22:11 kurahaupo__ joined #perl6
22:17 amalia_ joined #perl6
22:18 skids joined #perl6
22:21 kjs_ joined #perl6
22:28 Derperperd joined #perl6
23:14 kjs_ joined #perl6
23:19 killbill joined #perl6
23:20 rurban joined #perl6
23:24 sammers_ joined #perl6
23:29 pierre_ joined #perl6
23:30 Jesmaybe joined #perl6
23:31 lizmat and another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2016/10/17/2016-42-release-time/
23:39 b2gills joined #perl6
23:54 Jesmaybe joined #perl6

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

Perl 6 | Reference Documentation | Rakudo