»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
dalek ateverable: fcc0eb0 | MasterDuke17++ | Whateverable.pm6:
.get-commits should return to the CWD it came from
00:00
seatek Oh gosh, ok, roles have lots of bells and whistles. almost like subroutiness even sometimes. ok roles are crazy. 00:01
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:06
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:07
skids seatek: The flat composition and interface definition are the simple use case, and the paramterization is the advanced use case. 00:46
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;
camelia rakudo-moar 2dd0dd: OUTPUT«1␤2␤True␤True␤»
dalek osystem: 319454a | gfldex++ | META.list:
add Concurrent::Channelify
01:36
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]␤»
Herby__ how do I have camelia return output to me privately?
ugexe use /msg 01:56
Herby__ thanks
iBakeCake Herby__: we have an operator for % ... == 0, it's %% 02:01
m: my @evens-squared = ($_ ** 2 if ($_ %% 20) for 0..20); say @evens-squared;
camelia rakudo-moar 2dd0dd: OUTPUT«[0 400]␤»
iBakeCake :o 02:02
oh, typo :)
Herby__ typo? 02:03
iBakeCake m: my @evens-squared = ^20 .grep(* %% 2).map: *²; say @evens-squared;
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␤␤»
iBakeCake Herby__: I typoed 20 for 2, so that's why result was wrong
m: my @evens-squared = ^20 .grep(* %% 2).map: ***2; say @evens-squared;
camelia rakudo-moar 2dd0dd: OUTPUT«[(0) (4) (8) (12) (16) (20) (24) (28) (32) (36)]␤»
Herby__ ahh ok. its been a long day :) 02:03
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␤␤»
Herby__ my @odds-squared = ($_ ** 2 unless ($_ %% 2) for 0..20)
m: my @odds-squared = ($_ ** 2 unless ($_ %% 2) for 0..20)
camelia ( no output )
Herby__ m: my @odds-squared = ($_ ** 2 unless ($_ %% 2) for 0..20); say @odds-squared;
camelia rakudo-moar 2dd0dd: OUTPUT«[1 9 25 49 81 121 169 225 289 361]␤»
Herby__ iBakeCake: what madness is that?
iBakeCake Herby__: lol. Ironically, I was thinking the same about your code :P 02:05
Herby__ grep(* %% 2).map: ***2 02:06
how does that work?
ShimmerFairy Herby__: that ***2 would be more intelligible as * ** 2 :) 02:06
iBakeCake Herby__: * is a whatever star
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? :)
iBakeCake Herby__: pretty much
Herby__: wanna see a neat trick? 02:08
Do ya? :) 02:10
lucs iBakeCake: I do :) 02:11
Herby__ yes I do!
iBakeCake Hm.. wait
Ah. 1 sec 02:12
iBakeCake fumbles with the magic box and the rabbit
lucs Nothing up your sleeve...
iBakeCake damn... didn't work 02:13
iBakeCake tries the alternative
Eh
never mind
m: my @evens-squared = 4, 16, 36, 64 … 400; say @evens-squared
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␤␤»
iBakeCake But you can do doubles: 02:14
m: say 4, 8, 12 … 400;
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…»
iBakeCake Ah, here we go 02:15
m: my @evens-squared = 4, {(sqrt($_)+1)**2} … 400; say @evens-squared
camelia rakudo-moar 2dd0dd: OUTPUT«[4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400]␤»
iBakeCake ta-da!
:}
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]␤»
Herby__ pretty slick! 02:17
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)␤»
iBakeCake m: say (4, (*.sqrt+2)**2 … ∞)[^20];
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)␤»
iBakeCake :)
I'm slightly bummed ² doesn't work with Whatevers :(
m: say (4, (*.sqrt+2)² … ∞)[^20];
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␤␤»
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␤␤»
iBakeCake interesting error :/
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))␤»
iBakeCake huh
Herby__ uh
iBakeCake oh, it's interpreting it as HyperWhatevers? 02:24
yup 02:25
m: say (4, (* **½+2)**2 … 400)[^10]
camelia rakudo-moar 2dd0dd: OUTPUT«(4 16 36 64 100 144 196 256 324 400)␤»
iBakeCake ehehe :P 02:26
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:31
iBakeCake m: 42 does role { method square { self² } }; 42.square.say 02:34
camelia rakudo-moar 2dd0dd: OUTPUT«1764␤»
iBakeCake m: say WHY 'Life, the Universe and Everything': 02:36
camelia rakudo-moar 2dd0dd: OUTPUT«42␤»
iBakeCake :} 02:36
Herby__ nice :) 02:41
seatek iBakeCake: just realized what you did there. :) that is bizarre. that self because numeric especially 03:02
edgar hi 03:47
Herby__ o/ 04:02
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␤»
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
camelia rakudo-moar 2dd0dd: OUTPUT«0.005421␤»
andrzejku hey :) 07:20
moritz ho 07:41
andrzejku I configured my perl enviroment according Derek Cline presentation and so happy right now ;P 07:52
RabidGravy Morning 07:52
llfourn is there a way to check if something matches a regex without setting $/? 08:03
I'm in grammar actions and doing a match clobbers it
I guess I could create a temp lexical scope...
moritz llfourn: or you could just not use $/ in the signature of your action method 08:06
call it $m instead
llfourn that's probably the way to go
unfortunetly I do some magic like CALLER::<$/> in the .new of all AST nodes so they know from what they were created 08:07
which I know is fairly evil but it does save a lot of time
except that it causes this problem :P 08:08
Ven_ Good *, #perl6. 08:47
FROGGS hi Ven_ 08:47
Ven_ I'm wondering if someone could help me with `run`. It seems the exitcode is discarded if use `:out`. 08:48
m: say run(<foo>, :out).exitcode;
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␤␤»
FROGGS you have to rean von out and the close it
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
FROGGS: oh, slurp-rest will make it all appear?
FROGGS github.com/perl6/roast/blob/d1baf2...-io/pipe.t 08:50
Ven_: yes
Ven_ FROGGS: thanks. 08:51
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
d
tbrowder hi #perl6! 09:36
is iBakeCake around, or anyone else who can help me understand current implementation of the replication operator infix<x>? 09:38
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
arguments.
timotimo o/
tbrowder: what does "with another signature" mean? 09:45
tbrowder hi, timotimo
i mean (int, str) so one can say "3 x ' 0' 09:46
3 x '0' => '000' 09:47
timotimo but we already have "0" x 3 for that?
tbrowder it seems more natural to say 3 eggs the eggs x 3
timotimo in that case
m: say 3 Rx '0'
camelia rakudo-moar 2dd0dd: OUTPUT«000␤»
jnthn Performance/development time are hardly the issue with that. It's that it's a really bad idea.
timotimo done.
tbrowder s/the/than/
why? 09:48
jnthn For the same reason == and + in JavaScript are problematic.
timotimo though thunking might get disappeared with Rx
m: say 3 rX rand
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␤ …»
tbrowder hi jnthn, I appreciate you! 09:49
timotimo m: say 3 Rx rand
camelia rakudo-moar 2dd0dd: OUTPUT«0.1233976090031390.1233976090031390.123397609003139␤»
timotimo right, it makes thunking disappear
jnthn Operators should be predictable in their behavior
So, == always coerces both sides to numeric, while eq always coerces both sides to strings
my $str = prompt 'String? '; my $rep = prompt 'Repetitions? '; say $str x $rep 09:50
tbrowder now that makes more sense
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 :)
(Was plotting text bar graphs) 09:53
tbrowder okay, i'm satisfied, thanks!
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
jnthn (So that you can give a new semantic a new syntax, rather than overloading existing syntax with a confusing meaning)
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:57
m: say 4 Rx 'c' 09:59
camelia rakudo-moar 2dd0dd: OUTPUT«cccc␤»
tbrowder slick!!
timotimo handle with care, though 10:05
as i said, it will not thunk the RHS for you any more
though that makes it possible to obtain a version of x that doesn't thunk if that's what you want: RRx 10:06
jnthn m: say rand x 4 10:07
camelia rakudo-moar 2dd0dd: OUTPUT«0.9604191013640550.9604191013640550.9604191013640550.960419101364055␤»
jnthn x doesn't anyway; you're thinking of xx
timotimo oh!
silly me! of course i am
i should really have some tea
timotimo wow. i just made it and already spilled a big slosh of it on my table 10:11
this day is ... going to need some getting used to
arnsholt A caffeination-bootstrapping related incident? 10:12
Hard to produce caffeine correctly without first consuming the caffeine
timotimo yeah
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:16
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:18
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:19
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
m: <good stuff>[' '].say
camelia rakudo-moar 2dd0dd: OUTPUT«good␤»
iBakeCake ends the soliloquy
timotimo it's amusing that i only see whitespace in there 10:35
iBakeCake There *is* only whitespace in there.
timotimo oh
i should have probably read the line before that line
iBakeCake :) 10:36
timotimo wonders if there's actually caffeine in that tea
iBakeCake You never listen to me! :P
timotimo FROGGS: ask me if you need help working the coverity website 10:51
hmpf. the coverity summary page is only updated about 50% :\ 10:52
FROGGS timotimo: will do once I have access 10:59
timotimo i gave you access (i think) 11:00
FROGGS ahh, I see
timotimo hm. i gave you contributor/member access, that might not be enough for some things?
nah, only thing you can't do is submit new builds or manage users
the overview is still showing the version from last time, not the new one :| 11:01
FROGGS timotimo: I can see the defects fine 11:03
timotimo good! 11:04
there's a few false-positives i can see
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:05
timotimo hooray, it's showing the newest version name, now! 11:08
tbrowder iBakeCake: thanks 11:17
dalek c: fd7d6ba | coke++ | doc/Language/operators.pod6:
remove trailing ws
12:39
c/spellcheck: 7bd27cb | Nic++ | doc/Language/traps.pod6:
Add 'once' Block to Traps (#968)

Added a section to traps about using once blocks within other blocks of code.
Resolves issue #959
c/spellcheck: 2bc0df8 | (Tom Browder)++ | doc/Language/operators.pod6:
give fair notice of a possible silent error
c/spellcheck: f6314f6 | (Tom Browder)++ | doc/Language/operators.pod6:
give examples of incorrect args
c/spellcheck: 9677f76 | (Zoffix Znet)++ | doc/Language/operators.pod6:
Improve infix:<x>
c/spellcheck: fd7d6ba | coke++ | doc/Language/operators.pod6:
remove trailing ws
c/spellcheck: 8fb6e69 | coke++ | doc/Language/ (2 files):
Merge branch 'master' into spellcheck
iBakeCake weeeee
ug :( missed the ride. 12:40
timotimo :( 12:41
iBakeCake When is Murican election gonna be over.... Every time I open Twitter, I see trump this trump that. 13:02
Even TimToady is pitching in heh 13:03
timotimo TrumpToady?
iBakeCake :}
timotimo that's a scary thought 13:06
perlpilot Perl has words. Good words. Lots of words. Perl has the best words.
timotimo you can grab your program by the operators 13:10
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:13
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? :)
dalek c/spellcheck: 4989cea | coke++ | xt/.aspell.pws:
more words
perlpilot iBakeCake: yep!
dalek c: 8ad2322 | coke++ | doc/Type/Lock.pod6:
fix typo
13:15
perlpilot though, hopefully the next presidential election will have learned from the mistakes of this one. 13:15
dalek c/spellcheck: 8ad2322 | coke++ | doc/Type/Lock.pod6:
fix typo
c/spellcheck: 2985d2f | coke++ | doc/Type/Lock.pod6:
Merge branch 'master' into spellcheck
perlpilot The one good thing I can think of from this election is the increased use of real time fact checking. 13:16
iBakeCake
.oO( but who's factchecking the fact checkers... )
13:17
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:18
[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␤␤»
[Coke] m: say Int.new.multiness
camelia rakudo-moar 2dd0dd: OUTPUT«No such method 'multiness' for invocant of type 'Int'␤ in block <unit> at <tmp> line 1␤␤»
[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␤␤»
iBakeCake
.oO( multiness ?? )
13:25
[Coke] oh, it's a method on a very particular exception type, not on all methods. ah
iBakeCake m: 'multi {}'.EVAL; CATCH { default { dd [ .^name, .multiness ] } } 13:27
camelia rakudo-moar 2dd0dd: OUTPUT«["X::Anon::Multi", "multi"]␤»
iBakeCake wonders what other multinesses are there
m: 'proto {}'.EVAL; CATCH { default { dd [ .^name, .multiness ] } } 13:28
camelia rakudo-moar 2dd0dd: OUTPUT«["X::Anon::Multi", "proto"]␤»
iBakeCake \o/
[Coke] any suggestions for dealing with spellchecking things like variable names and literal constants in the code? 13:34
down to 99 pod6 files with spelling issues. 13:35
dalek c/spellcheck: 0e74bc2 | coke++ | xt/.aspell.pws:
more words
13:36
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:51
[Coke] pmurias: yes, one of those two things. :) 13:57
dalek c: f2e063e | coke++ | doc/Type/Str.pod6:
fix typo
14:03
[Coke] pmurias: code like this: substr("Long string", 6); # tring
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:04
[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:28
iBakeCake [Coke]: maybe try changing the \new to new here: github.com/perl6/doc/blob/master/d....pod6#L139 14:29
and see if it still tells you about ew? /me shrugs
dalek c: 2caf533 | coke++ | doc/Type/Str.pod6:
fix typo
14:31
c: 8ed3d19 | coke++ | doc/Language/traps.pod6:
fix typo
c/spellcheck: f2e063e | coke++ | doc/Type/Str.pod6:
fix typo
14:32
c/spellcheck: 2caf533 | coke++ | doc/Type/Str.pod6:
fix typo
c/spellcheck: 8ed3d19 | coke++ | doc/Language/traps.pod6:
fix typo
c/spellcheck: 7577b75 | coke++ | xt/.aspell.pws:
more words
c/spellcheck: 19affec | coke++ | doc/ (2 files):
Merge branch 'master' into spellcheck
[Coke] ah, that's probably it, thanks.
dalek c: 9398f28 | coke++ | doc/Language/traps.pod6:
fix typos
14:39
pmurias [Coke]: if it's a single example (or a couple of those) I would just change it instead of doing something complex 14:43
[Coke] no, it's more like 100s of instances. 14:46
hurm. anyone know what aspell means when it says: 14:47
--extra-dicts=<list>
(What is a list, in this context?)
[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:49
[Coke] puts this down and works on something else for a while. whoops 14:50
iBakeCake [Coke]: maybe it's --extra-dicts=one --extra-dicts=two ... ? 14:57
[Coke] that results in using just two, as I read it 15:05
dalek c: d2574de | (Zoffix Znet)++ | doc/Type/Numeric.pod6:
Clarify special cases in Numeric.log
15:23
iBakeCake kinda LTA that Cool.pod6 duplicates a ton of routines from Numeric.pod6 15:24
dalek c: db56afa | (Zoffix Znet)++ | doc/Type/Cool.pod6:
Replicate Numeric.log changes in Cool.log

  (why is all of this stuff duplicated like this? Cool really just does a
coersion to Numeric for all of these mathematical methods and maintaining docs for them in 2 places is LTA)
15:28
c: d2f47ac | (Zoffix Znet)++ | doc/Type/Cool.pod6:
Clarify special cases in Numeric.log10
15:29
c: 59efbe2 | (Zoffix Znet)++ | doc/Type/Numeric.pod6:
Clarify special cases in Numeric.log10
15:30
iBakeCake m: say log NaN 15:31
camelia rakudo-moar 8a72a4: OUTPUT«NaN␤»
iBakeCake m: say log Inf
camelia rakudo-moar 8a72a4: OUTPUT«Inf␤»
iBakeCake Probably would make more sense to have a separate table of all kinds of special cases for all of such routines
[Coke] stares at a export/import failure in about 6 lines of code over two files that is confusing him. 16:38
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)␤»
iBakeCake neat, eh?
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)␤»
iBakeCake :D
fumlead Hi guys, what is it? 18:03
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)␤»
fumlead m: my @x = <1,2,3>; say +@x;
camelia rakudo-moar 906719: OUTPUT«1␤»
iBakeCake fumlead: the < ... > use whitespace to separate items 18:05
not commas
m: my @x = <this is awesome!>; dd @x
camelia rakudo-moar 906719: OUTPUT«Array @x = ["this", "is", "awesome!"]␤»
fumlead Oh
iBakeCake m: my @x = 1, 2, 3; dd @x
camelia rakudo-moar 906719: OUTPUT«Array @x = [1, 2, 3]␤»
iBakeCake m: my @x = ^3; dd @x
camelia rakudo-moar 906719: OUTPUT«Array @x = [0, 1, 2]␤»
fumlead thanks, I thought i'm became mad) 18:06
iBakeCake :)
perlpilot Didn't we used to have a warning on using commas inside <> or did I imagine that? 18:11
or mabye I'm conflating P5 and P6 18:12
iBakeCake please no warnings >_< one things I hated in P5 is constant annoyance about # in qw// 18:14
(and yeah, it does warn about commas too)
lucasb_ $ perl -wE 'qw/1,2,3/' 18:15
Possible attempt to separate words with commas at -e line 1.
I always have to do this: my @notes = do { no warnings 'qw'; qw(C C# D D# ...) }
perlpilot yeah, I was conflating the two perls 18:16
iBakeCake ETOOMANYPERLS 18:18
harmil_wk EMORETHANONEWAY 18:44
Which, oddly, in Perl is considered a successful status ;-)
iBakeCake ... and in any natural language :) 18:45
moritz I just watched The Martian, and holy shit, why did I wait this long? 18:49
iBakeCake You... liked it?
arnsholt Pretty neat, isn't it? 18:50
moritz yes
arnsholt The book is pretty funny too
iBakeCake hated it (the movie)
moritz like, the best film I've seen in quite a while
though I don't watch movies very often these days
iBakeCake: i'm curious, why?
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:51
iBakeCake We're prepping a real life mission to Mars with humans and one consistent requirement: are you ready to die? 18:52
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:54
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?
moritz agreed with the last part though
arnsholt iBakeCake: Well, the last part is a pretty faithful rendition of the ending in the book though =) 18:56
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:00
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
I recall this one: en.wikipedia.org/wiki/Kursk_submarine_disaster
moritz iBakeCake: in Germany we had a huge rescue action for a single cave explorer just the other year
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.
moritz ok, probably just a few million EUR, but for somebody the public had barely heard of before 19:03
geekosaur subs don't get the coverage space stuff does 19:04
iBakeCake subs are also much easier to rescue from than Mars :P
geekosaur um. no
moritz anyway, I've learned not to apply too high standards to the realism of movies
geekosaur in some ways the deeps of the Pacific are *worse* than space
moritz it helps me be less frustrated when watching :-9
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!
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
arnsholt Indeed. I remember when the Kursk sank 19:09
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:13
that's when that movie went over the nonsense limit in my head… 19:14
but if you only watch the first half it is pretty good
seatek Matt Damon didn't sacrifice himself to the art? 19:15
Or was it Mark Walberg? I get them confused.
iBakeCake damon
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:16
that would've been perfect. No need for a happy end in this story, really. 19:17
iBakeCake Yeah
seatek He should have gotten abducted and taken to the dyson sphere
iBakeCake Show a shot of "100 years in the future" where there's a colony and a statue of him 19:18
seatek potatoes blossoming around his feet 19:19
fumlead I agreed, Martian is one of the best films I ever watched. It's not perfect, but it's better than others 19:21
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
very detailed and interesting to me 19:23
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:24
AlexDaniel what? 19:26
iBakeCake where? WHYY?
:}
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:27
iBakeCake Well, we do have a `NASA` module in the ecosystem to entice them... Fingers crossed! 19:28
seatek :)
crucialrhyme what's the best way to convert big ints to bytes (probably Blob)? 19:36
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'␤»
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?
harmil_wk: they're IntStr. Those two sets are not equivalent and `is` is a wrong function to test them anyway.
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 :)
Or use Quantum::Superposition 19:41
Oh, it's Quantum::Colapse
github.com/zoffixznet/perl6-Quantum-Collapse
crucialrhyme: maybe keep pushing to a Buf while there's stuff to push and then .Blob it? 19:42
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)␤»
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?
iBakeCake There's bit tweedling way, ain't there?
moritz iBakeCake: doesn't that need a .reverse
iBakeCake shrugs
arnsholt iBakeCake: I'm pretty sure always pushing 255 is wrong, but the general gist of it looks right I think 19:47
moritz: Depends on if you want big-endian or little-endian, I guess
(And I can never for the life of me remember which is which)
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 - ␤»
moritz big endian is most-significant bit first
iBakeCake harmil_wk: ^ because it gives false positives
m: use Test; is "3 1 a b c 2", set("a b c", 1, 2, 3)
camelia rakudo-moar 906719: OUTPUT«ok 1 - ␤»
iBakeCake ^ even worse one, since the received result ain't even a set 19:49
arnsholt: why always pushing 255 is wrong?
harmil_wk Hmm... looking at is-deeply it also makes what I consider to be a mistake
but I think it's easily fixed. 19:50
iBakeCake harmil_wk: what's the mistake?
arnsholt iBakeCake: You want to push the remainder of the division at each entry
Otherwise all the bytes will be 0xFF
iBakeCake ah
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>␤»
arnsholt Oh, nice one! 19:52
jferrero moritz++
fumlead iBakeCake: why your example working? (pre-last one about sets) I don't catch the idea
arnsholt reverse do gather while is an especially impressive syntactic construct
crucialrhyme that is great
moritz I keep wondering if a there is a way to express this in a series operator
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
crucialrhyme maybe there is a way to use +> and avoid the mod 19:53
iBakeCake & relocating
harmil_wk: still curious in the mistake in is-deeply
moritz m: my $x = 4023493243433333300000000000000222292; 19:56
camelia ( no output )
moritz m: my $x = 4023493243433333300000000000000222292; say Blob.new( reverse (($x, 0), { .[0] div 256, .[0] % 256 } ... *[0] == 0).map( *[1])[1..*]);
camelia rakudo-moar 906719: OUTPUT«Blob:0x<03 06 e5 88 5a ca 27 19 8c 1b 52 eb 88 53 64 54>␤»
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␤»
moritz m: my $x = 0xFA4023493243433333300000000000000222292; say Blob.new( reverse (($x, 0), { .[0] div 256, .[0] % 256 } ... *[0] == 0).map( *[1])[1..*]);
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>␤»
moritz ok, this is rather forced
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 } );
camelia rakudo-moar 906719: OUTPUT«Blob:0x<07 ff 00 ff ee aa 20>␤»
crucialrhyme thank you for this solution. i really need to get fluent with gather and while 19:59
gather and take, rather
moritz I guess keeping a state var would be clearer
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:04
ZoffixMobile harmil_wk, what's polymorphic comparison? That 42 would is-deeply '42'? 20:09
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"␤»
fumlead No)
harmil_wk fumlead: ZoffixMobile and I are aware of what the current behavior is :) 20:13
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
harmil_wk fumlead: no worries, thanks for making the test case explicit, though. 20:15
Basically that is-deeply is exactly equivalent to "42 eqv '42'"
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
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
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
Wow, that's a horrible sentence!
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
iBakeCake
.oO( is-similar )
21:11
iBakeCake m: say "Foo".IO eq "Foo" 21:13
camelia rakudo-moar 906719: OUTPUT«True␤»
iBakeCake m: class RandomStuff does Cool { method Str { "Foo" }; method Int { 42 } }; say RandomStuff eq "Foo"; say RandomStuff == 42
camelia rakudo-moar 906719: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cool is not composable, so RandomStuff cannot compose it␤at <tmp>:1␤»
iBakeCake Your mother! 21:14
m: class RandomStuff is Cool { method Str { "Foo" }; method Int { 42 } }; say RandomStuff eq "Foo"; say RandomStuff == 42
camelia rakudo-moar 906719: OUTPUT«True␤Use of uninitialized value of type RandomStuff in numeric context␤ in block <unit> at <tmp> line 1␤False␤»
iBakeCake m: class RandomStuff is Cool { method Str { "Foo" }; method Numeric { 42 } }; say RandomStuff eq "Foo"; say RandomStuff == 42
camelia rakudo-moar 906719: OUTPUT«True␤True␤»
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
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
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
iBakeCake \o
AlexDaniel \o
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2016/10/17/...ease-time/ 23:31