»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:00 grumble joined 00:04 cognominal left 00:06 espadrine left 00:07 j joined, j is now known as Guest76412 00:08 Guest76412 left 00:11 zilti joined 00:13 wamba left 00:25 cognominal joined
samcv u: ⍣ 00:27
unicodable6 samcv, U+2363 APL FUNCTIONAL SYMBOL STAR DIAERESIS [So] (⍣)
00:27 kurahaupo joined
samcv AlexDaniel, should add that to the list of stars 00:27
you said you were looking for two stars that could go together one to signify a hyper star, that doesn't look too bad
AlexDaniel yea 00:28
00:28 pierre_ joined
AlexDaniel samcv: well, I think we should not use APL characters… :) 00:29
u: ⁑
unicodable6 AlexDaniel, U+2051 TWO ASTERISKS ALIGNED VERTICALLY [Po] (⁑)
AlexDaniel u: STAR
unicodable6 AlexDaniel, U+0001 START OF HEADING [Cc] (␁)
AlexDaniel, U+0002 START OF TEXT [Cc] (␂)
AlexDaniel, U+0086 START OF SELECTED AREA [Cc] ()
AlexDaniel, gist.github.com/
AlexDaniel u: ASTERISK
unicodable6 AlexDaniel, U+002A ASTERISK [Po] (*)
AlexDaniel, U+0359 COMBINING ASTERISK BELOW [Mn] (◌͙)
AlexDaniel, U+204E LOW ASTERISK [Po] (⁎)
AlexDaniel, gist.github.com/6720753c96919e3f30...d95221ef46 00:30
AlexDaniel yea, unicodable, thank you very much
u: STAR
unicodable6 AlexDaniel, U+0001 START OF HEADING [Cc] (␁)
AlexDaniel, U+0002 START OF TEXT [Cc] (␂)
AlexDaniel, U+0086 START OF SELECTED AREA [Cc] ()
AlexDaniel, gist.github.com/
AlexDaniel that's because of control characters, I guess
00:32 canopus left 00:39 canopus joined
AlexDaniel m: say ‘a␤b␤c␤d’ ~~ /.*/ 00:47
camelia rakudo-moar fa82a1: OUTPUT«「a␤b␤c␤d」␤»
AlexDaniel I wonder if .gist of a match should always replace newlines with ␤ 00:48
it is a bit unreadable otherwise
samcv m: print ‘test␤’ 00:49
camelia rakudo-moar fa82a1: OUTPUT«test␤»
samcv ah. nice. so ␤ will literally put a newline in there? 00:50
or
AlexDaniel well it's hard to show with camelia
samcv does it not put a newline in there
AlexDaniel camelia replaces all ␤ on input and produces ␤ instead of newlines in the output
babydrop And what will you put for ␤?
samcv m: "␤".ord.say
camelia rakudo-moar fa82a1: OUTPUT«10␤»
babydrop -1 from me 00:51
AlexDaniel babydrop: well, have you seen a gist of anything parsed with a grammar? :)
m: say ‘「’ ~~ /.*/ 00:52
camelia rakudo-moar fa82a1: OUTPUT«「「」␤»
AlexDaniel nothing is done with 「」, by the way
babydrop Yes, and I don't want my multi-line text to be showed into a single line, separated with characters that don't exist in my match
AlexDaniel how do you read it then? 00:53
samcv say "「」" ~~ /.*/ 00:54
m: say "「」" ~~ /.*/
camelia rakudo-moar fa82a1: OUTPUT«「「」」␤»
geekosaur undoes that conversion with an irc script (inserting gray ␤ characters as evidence)
babydrop Like text
AlexDaniel from top to bottom? :) 00:55
babydrop AlexDaniel: yes: i.imgur.com/edHnq2e.png 00:56
AlexDaniel babydrop: that's not a grammar
00:57 _28_ria joined
AlexDaniel if you write just a couple of rules to parse the text you'll see that it becomes unreadable very quickly 00:57
babydrop That's why we invented tools like Grammar::Debugger
AlexDaniel I think I can .subst(/<!after ‘」’>\n/, ‘␤’) and shut up 00:58
or something like that
00:58 wisti joined
AlexDaniel any way to turn off the display of failed matches for Grammar::Debugger? 00:59
01:03 aborazmeh joined, aborazmeh left, aborazmeh joined 01:13 ZzZombo left 01:15 cibs left 01:17 cibs joined 01:22 hipek8 left 01:24 kurahaupo_ left 01:25 kurahaupo__ joined 01:26 seatek joined, pierre_ left 01:32 pierre_ joined, pierre_ left, pierre_ joined 01:37 aborazmeh left 01:41 aborazmeh joined, aborazmeh left, aborazmeh joined 01:52 ilmari[m] left, M-Illandan left, Matias[m] left, tadzik left, Matthew[m] left, dp[m] left 01:58 pierre_ left 02:00 pierre_ joined 02:08 Herby_ left 02:10 kurahaupo is now known as kurahaupo`, kurahaupo__ is now known as kurahaupo_ 02:14 kalkin- left, kalkin-_ joined 02:21 ilmari[m] joined 02:23 pierre_ left 02:25 tadzik joined, M-Illandan joined, Matthew[m] joined, dp[m] joined, Matias[m] joined 02:31 pierre_ joined 02:36 pierre_ left 02:37 pierre_ joined 02:45 ilbot3 left 02:47 ilbot3 joined
dalek osystem: b6e96e6 | (David Warring)++ | META.list:
Add CSS::Declarations
02:58
02:59 cdg joined
mspo is there a reason to not just copy perl5 pack/unpack directly? 03:09
I honestly don't know if there are issues with that or not 03:10
geekosaur it has its weirdnesses, and perl 6 has a richer type ecosystem to feed from/to it 03:11
in particular, anything involving strings is going to be difficult to replicate between p5 and p6 03:12
03:13 cdg left
mspo I'm looking to do network protocol stuff; am I looking in the wrong place? 03:13
I need to write a bunch of 16bit messages
geekosaur you might want to skip pack/unpack and use buf16
mspo erlang might be good to copy here 03:14
fwiw
yeah suppose so 03:15
03:17 baest left 03:18 baest joined 03:20 noganex joined
BenGoldberg mspo, As long as your network protocol stuff is based on tcp, you should be good. Perl6 does not yet support either udp or icmp, afaik. 03:21
mspo udp was added to io::socket::async 03:22
but no icmp or raw or even a way to access/use the lower-level socket stuff
03:23 noganex_ left
BenGoldberg Well, unless you're writing your own traceroute, you're probably not likely to need icmp, hmm? 03:23
03:24 solarbunny left, SourceBaby left, Undercover left, dalek left
mspo that's not much of a claim for a "general purpose" language ;) 03:26
I find arbitrary restrictions very upsetting
BenGoldberg Not implemented yet isn't an arbitrary restriction. 03:27
Well, it is, sorta, but only because some things are higher priority than others.
03:30 solarbunny joined, SourceBaby joined, Undercover joined, dalek joined, weber.freenode.net sets mode: +vv Undercover dalek
BenGoldberg Also, nothing whatsoever prevents you from using NativeCall, and various C functions from libsocket. The only downside of that is that you'll be limited to synchronous function calls, whereas IO::Socket::Async is more perlish. 03:30
03:36 AlexDaniel left 03:39 cibs left 03:40 pyrimidine left 03:41 cibs joined 03:44 xtreak joined 03:46 aborazmeh left 03:49 cognominal left, cognominal joined 04:03 pierre_ left 04:04 cognominal left 04:11 pierre_ joined 04:15 pierre_ left 04:17 cognominal joined 04:35 Actualeyes left 04:37 Actualeyes joined 04:41 pyrimidine joined 04:46 pyrimidine left 04:47 xtreak left 04:48 xtreak joined 04:50 rburkholder left 05:07 Timbus left 05:08 pierre_ joined 05:12 skids left 05:16 Actualeyes left 05:19 Actualeyes joined 05:22 BenGoldberg left 05:27 xinming_ joined 05:30 xinming left 05:41 pierre_ left 05:42 pyrimidine joined 05:45 pierre_ joined 05:46 khw left, pyrimidine left 05:55 Cabanossi left 05:56 pyrimidine joined 05:58 Cabanossi joined 06:00 pyrimidine left 06:16 xtreak left 06:17 wisti left 06:18 xtreak joined 06:19 pyrimidine joined 06:20 flaviusb joined 06:23 _28_ria left 06:24 pyrimidine left, tadzik left, Matias[m] left, ilmari[m] left, Matthew[m] left, dp[m] left 06:25 M-Illandan left 06:27 bjz joined 06:33 _28_ria joined
Hotkeys m: my @foo = [0, 0]; my @bar; for 1..4 { @foo Z+= [0, 1]; @bar.push(@foo); }; say @bar 06:34
camelia rakudo-moar 40d80c: OUTPUT«[[0 4] [0 4] [0 4] [0 4]]␤»
Hotkeys m: my @foo = [0, 0]; my @bar; for 1..4 { @foo Z+= [0, 1]; @bar.push(@foo.Array); }; say @bar
camelia rakudo-moar 40d80c: OUTPUT«[[0 1] [0 2] [0 3] [0 4]]␤»
Hotkeys what exactly is going on here ^
why shouldn't the first one work like the second 06:35
(and why does the second work?)
06:36 darutoko joined 06:37 cibs left 06:38 ZzZombo joined 06:39 CIAvash joined, cibs joined 06:47 dontbe^2 left 06:48 darutoko left 06:52 Cabanossi left, Cabanossi joined, darutoko- joined, sjn__ joined, jargan joined, bhm_ joined, [Coke]_ joined
seatek my @foo = [0, 0]; my @bar; for 1..4 { @foo Z+= [0, 1]; @bar.push(|@foo); }; say @bar; 06:52
m: my @foo = [0, 0]; my @bar; for 1..4 { @foo Z+= [0, 1]; @bar.push(|@foo); }; say @bar;
camelia rakudo-moar 40d80c: OUTPUT«[0 1 0 2 0 3 0 4]␤»
06:52 felher_ joined, domidumont joined, spidermario joined 06:53 bjz left, sjn left, bhm left, jast left, spider-mario left, felher left, [Coke] left, cgfbee left 06:54 RabidGravy joined 06:55 domidumont left 06:58 cgfbee joined, domidumont joined, dwarring left, krakan left, krakan joined, dontbe^2 joined 07:00 bjz joined 07:01 pyrimidine joined 07:05 pyrimidine left, domidumont left, pyrimidine joined 07:07 _28_ria left 07:08 wamba joined 07:10 _28_ria joined 07:13 girafe joined 07:18 CIAvash left 07:27 CIAvash joined 07:28 xtreak left 07:31 domidumont joined 07:40 xtreak joined
moritz gfldex: I've edited perl6advent.wordpress.com/2016/12/...-the-docs/ it showed sub trait_mod:(....), I guess the HTML editor swalled an <is> there 08:03
gfldex: please check for correctness
lizmat moritz: also: first line: s/everyting/everything/ 08:06
&
moritz lizmat: fixed, thanks 08:08
08:11 CIAvash left 08:12 ufobat joined 08:15 dp[m] joined, ilmari[m] joined, M-Illandan joined 08:20 M-Illandan left, ilmari[m] left, dp[m] left
ufobat good morning :) 08:23
08:31 ilogger2 joined, ChanServ sets mode: +v ilogger2 08:32 abraxxa joined 08:33 Technaton joined 08:34 nebuchadnezzar joined 08:37 dontbe^2 joined 08:41 abraxxa left 08:42 abraxxa joined
Technaton Hello, p6'ers! I'm playing a bit with Perl6's syntax. Currently, I am trying to define a class' attribute that is a Sub taking 2 parameters, returning a floating point number, being RW and having a default… `has Sub &.heuristic is rw = sub { 0.0 };` seems to pass the syntax check, but there's no compile-time check wrt to the sub's structure. Can somebody help me, please? 08:43
moritz Technaton: ok, a few points 08:49
Technaton: first, you're assigning a default value, you're not making a type constraint
Technaton: second, attributes aren't type-check at compile time
m: sub f(&x:($, $)) { f(1, 2) }; say f -> $a, $b { $a + $b } 08:50
camelia rakudo-moar 6fafbf: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤ in sub f at <tmp> line 1␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
moritz m: sub f(&x:($, $)) { f(1, 2) }; say f(-> $a, $b { $a + $b }) 08:51
camelia rakudo-moar 6fafbf: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤ in sub f at <tmp> line 1␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
moritz m: sub f(&x:($, $)) { x(1, 2) }; say f(-> $a, $b { $a + $b })
camelia rakudo-moar 6fafbf: OUTPUT«3␤»
moritz m: sub f(&x:($, $)) { x(1, 2) }; say f(-> $a { $a + $a })
camelia rakudo-moar 6fafbf: OUTPUT«Constraint type check failed for parameter '&x'␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
moritz Technaton: ^^ maybe try to apply this for attribute types as well? 08:52
08:52 g4 joined
[ptc] moritz: also: s/over the all the pages/over all the pages/ in the second line 08:53
moritz: also s/be come/become/
Technaton moritz: I.e., supplying a setter that enforces the constraint, is that what you're suggesting? 08:54
moritz Technaton: no 08:55
Technaton :(
moritz Technaton: I'd suggest you try the same syntax as I did in my example above
[ptc]: I didn't write it! :-)
psch m: class A { has &.foo:($,$ --> Num) } 08:56
camelia rakudo-moar 6fafbf: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤You can't adverb has &.foo␤at <tmp>:1␤------> 3class A { has &.foo:($,$ --> Num)7⏏5 }␤»
moritz :(
m: class A { has &.foo where { .signature ~~ ($, $ --> Num) } } 08:57
camelia rakudo-moar 6fafbf: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3 { has &.foo where { .signature ~~ ($, $7⏏5 --> Num) } }␤ expecting any of:␤ statement end␤ statement modifier␤ statement modifier loop␤»
psch m: class A { has &.foo where *.signature ~~ :($,$ --> Num) };
camelia ( no output )
Technaton Sorry, I don't get it. Is "&x:($, $)" a vild type?
psch it parses if you put a signature there
m: class A { has &.foo where *.signature ~~ :($,$ --> Num) }; # but it doesn't match nominally
camelia ( no output )
moritz psch: thanks
psch m: class A { has &.foo where *.signature ~~ :($,$ --> Num) }; A.new: foo => sub ($, $ --> Num) { } #
camelia rakudo-moar 6fafbf: OUTPUT«Type check failed in assignment to &!foo; expected Callable[<anon>] but got Sub+{Callable[Num]} (sub ($, $ --> Num) { ...)␤ in block <unit> at <tmp> line 1␤␤»
Technaton psch: But that's a run-time check, right?
psch ^^^ that doesn't match nominally
moritz psch: even in the subroutine case it's not a normal type check
Technaton: it always is
08:58 d4l3k_ joined
Technaton is confused. 08:58
moritz Technaton: as I said earlier, attribute type checks are runtime
and constraint time checks also
Perl 6 isn't Haskell :-)
Technaton So any "has Foo &.bar is rw;" cannot be subject to a static code check, is that right? 08:59
psch all method checks are runtime, aren't they?
+type
moritz Technaton: that's correct
Technaton Oh, okay. Are there any compile-time signature/type checks in p6? I though I had read something along the lines of it, but now I am not so sure anymore. I guess I erred…? 09:00
09:01 rindolf joined, amalia_ joined
arnsholt The compiler tries to evaluate as many type checks as possible at compile-time, but it's specced to be run-time 09:01
[ptc] moritz: I know! :-) Saw you asking for corrections and thought I'd mention a couple more I'd spotted. 09:02
Technaton Or, to rephrase the question: What's the advantage of "has Int $.foo is rw" in contrast to "has $.foo is rw"?
arnsholt So only cases where the run-time types can be inferred at compile-time can actually be evaluated at compile-time
[ptc] moritz: I'm pedantic; you should know that by now :-P
arnsholt Technaton: The advnatage is that you'll get an exception if some piece of code tries to assign something other than an int to your foo attribute
Meaning that all the code manipulating foo can treat the fact that it's an Int as an invariant 09:03
09:03 solarbunny joined
masak Technaton: what arnsholt said -- I've actually added such type annotations during debugging, and got an earlier/better exception. 09:03
09:03 d4l3k_ is now known as dalek, ChanServ sets mode: +v dalek
Technaton arnsholt: Okay, but wouldn't I get the same exception somewhere else at a pice of code like "foo() * 2"? 09:03
masak things blow up closer to the source of the problem, as it were.
Technaton Okay.
I see.
arnsholt Yeah, what masak said 09:04
09:04 jonas2 joined
masak usually things start to blow up at object construction 09:04
Technaton Very much in the same way as it was with p5 and Moose/Moo/Mouse.
s/was/is/
arnsholt When a variable has an unexpected value, what you really want to know is how it came to get that value, so throwing the exception at assignment is way more useful
masak which means you now know (thanks, stack trace) which "call site"/consumer disrespects the type restriction
09:05 shadowpaste0 joined
arnsholt Yup. I've come to the realization that exception handling constructs should be used extremely sparingly, and pretty much only in the cases where you can recover from the exception and continue normal operation 09:06
Technaton Which helps quite a bit. Yes, I see that now.
arnsholt If it's a fatal error, you actually *want* it to percolate up to the top-level and cause an explosion
masak arnsholt: almost as if exceptions should only be used in... exceptional circumstances
:P
arnsholt It's far harder to debug code which chugs merrily onwards after a failure, since the root cause is obscured 09:07
masak arnsholt: "chugs merrily onwards after a failure" is one of my pet peeves with a lot of inexpertly written Java code
arnsholt: when (occasionally) I deliver a Java course, I let the participants know very clearly that this is not acceptable
Technaton Thanks, masak, arnsholt, psch! :) 09:09
arnsholt masak: Yeah, my first trauma from that was Java code that basically did "try { code() } catch (Exception e) { /* Nope! */ }" 09:10
Complicated debugging tremendously
09:10 bjz joined
psch m: class A { has $.foo where { .signature ~~ :($,$) }; }; A.new: foo => sub ($, $) { } # hm 09:10
camelia ( no output )
psch not sure why the &-sigil messes that up
m: class A { has &.foo where { .signature ~~ :($,$) }; }; A.new: foo => sub ($, $) { } #
camelia rakudo-moar 6fafbf: OUTPUT«Type check failed in assignment to &!foo; expected Callable[<anon>] but got Sub (sub ($, $) { #`(Sub|7...)␤ in block <unit> at <tmp> line 1␤␤»
[ptc] m: { class A::B::A {}; }; role A::B::C {}; class A::B { has A::B::C $!foo; };
camelia rakudo-moar 6fafbf: OUTPUT«5===SORRY!5===␤Type 'A::B::C' is not declared␤at <tmp>:1␤------> 3ole A::B::C {}; class A::B { has A::B::C7⏏5 $!foo; };␤Malformed has␤at <tmp>:1␤------> 3role A::B::C {}; class A::B { has A::B::7⏏5C $!foo; };␤␤»
[ptc] m: class A::B::A {}; role A::B::C {}; class A::B { has A::B::C $!foo; }; 09:11
camelia ( no output )
arnsholt psch: Do you get the same error if you have the & sigil but not the where clause?
psch m: class A { has &.foo; }; A.new: foo => sub ($, $) { } #
camelia ( no output )
arnsholt Huh. So looks like adding the where clause does something odd to the type-checking 09:12
psch yeah, seems to pun Callable or something..?
m: my &x where { .arity > 2 }; say &x.VAR.^name 09:13
camelia rakudo-moar 6fafbf: OUTPUT«Scalar␤»
psch m: my &x where { .arity > 2 }; say &x.VAR.of
camelia rakudo-moar 6fafbf: OUTPUT«(Callable[<anon>])␤»
arnsholt Oh, yeah that's probably it
It gets annotated with a subtype of Callable, but Sub is a subtype of Callable in a different branch of the type graph
Maybe? 09:14
I'm not overly familiar with the workings of the parametric stuff
Technaton m: $a = "foo"; @b = ( \($a) ); $a = "bar"; say $(@b[0]); 09:15
camelia rakudo-moar 6fafbf: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$a' is not declared␤at <tmp>:1␤------> 3<BOL>7⏏5$a = "foo"; @b = ( \($a) ); $a = "bar"; ␤»
Technaton m: my $a = "foo"; my @b = ( \($a) ); $a = "bar"; say $(@b[0]);
camelia rakudo-moar 6fafbf: OUTPUT«\("bar")␤»
Technaton m: my $a = "foo"; my @b = ( \$a ); $a = "bar"; say $(@b[0]);
camelia rakudo-moar 6fafbf: OUTPUT«Potential difficulties:␤ To pass an array, hash or sub to a function in Perl 6, just pass it as is.␤ For other uses of Perl 5's ref operator consider binding with ::= instead.␤ Parenthesize as \(...) if you intended a capture of a single var…»
Technaton hm
How can I store references to objects in an array? 09:16
psch Technaton: infix:<=>
oh wait 09:17
that's the other way around
you want to point @b[0] at $a
m: my $a = "foo"; my @b; @b[0] := $a; $a = "bar"; say $(@b[0]);
camelia rakudo-moar 6fafbf: OUTPUT«bar␤»
psch m: my $a = "foo"; my @b; @b[0] := $a; $a = "bar"; say @b
camelia rakudo-moar 6fafbf: OUTPUT«[bar]␤»
psch ...i think? :) not sure i understand the intention. we've kind of tabood "reference" in Perl 6 docs and language 09:18
+e
09:22 dakkar joined
masak but not for the usual reasons 09:22
"length" is taboo'd because we consider it not informative enough
"reference" is taboo's because it permeates the language, and so it's kind of not relevant to mention all the time 09:23
arnsholt Technaton: To first order, forget the concept of reference as you've learned it from Perl 5
In Perl 6 everything's an object and can be used as such 09:24
09:28 solarbunny left, solarbunny joined 09:30 pierre_ joined
Technaton arnsholt: So… 09:30
m: my $a = "foo"; my @b = ($a); $a = "bar"; say @b;
camelia rakudo-moar 6fafbf: OUTPUT«[foo]␤»
Technaton Hm
That seems to create a copy?
masak it does. assigning to an array copies.
arnsholt Oh, you want that behaviour 09:31
psch m: my $a = "foo"; my @b = ($a); say @b[0].WHICH; say $a.WHICH; $a = "bar"; say @b;
camelia rakudo-moar 6fafbf: OUTPUT«Str|foo␤Str|foo␤[foo]␤»
Technaton Str is just an object like every other, right? Its not depending on *what* I store in the array, is it?
arnsholt I think binding should do the trick in that case
masak but also, Str values are not considered references in the sense that Array or Hash values are.
psch m: my $a = "foo"; my @b = ($a); say @b[0].WHERE; say $a.WHERE; $a = "bar"; say @b;
camelia rakudo-moar 6fafbf: OUTPUT«139946012341080␤139946012341080␤[foo]␤»
masak hm, scratch that. while true, it's not why we're seeing the effect above. :)
psch that specific case is two containers pointing at the same value. then you assign a different value to one of the containers... 09:32
arnsholt m: my $a = "foo"; my @b; @b[0] := $a; $a = "bar"; say @b # I think?
camelia rakudo-moar 6fafbf: OUTPUT«[bar]␤»
psch arnsholt: yeah, that what the Capture example by Technaton further above does under the hood
cause Captures are always binding
well, unless they're thrown into an is-copy Signature or somesuch vOv 09:33
arnsholt Oh, you even did the exact same snippet above =D 09:34
Skim-reading fails again =)
Technaton :)
psch m: class A { has $.foo; method inc { $!foo += 1 } }; my $x = A.new: :1foo; my $y = $x; $x.inc; say $y.perl
camelia rakudo-moar 6fafbf: OUTPUT«A.new(foo => 2)␤»
Technaton So, what's the p6 equivalent of an array of references?
psch Technaton: for understanding i'd recommend docs.perl6.org/language/containers 09:35
Technaton: if you have a specific use-case that you're trying to figure out, ask about that
Technaton: maybe even with a Perl 5 example :) 09:36
Technaton Okay, thanks for the link. The specific use case is trying to implement A* has a way to dig into p6. A* features an open and a closed list of nodes (open: nodes to visit, closed: nodes visited).
So, in p5, I'd start with "my @open = ( \$start_node );"
Because I need to check, e.g., whether a node $foo is already part of @closed, i.e., whether I've seen that node before (via another path). 09:37
09:37 giraffe joined 09:39 espadrine joined
psch well, if you want $start_node to change when you change @open[0] you need to bind 09:39
arnsholt I'd probably change the implementation a bit
Technaton No, A* doesn't change the node. I merely need an answer to the question "is node $foo part of @open"? 09:40
09:40 telex joined
arnsholt Just pop nodes of @open as long as there's stuff there, and skip the iteration if the popped node is in the closed set 09:40
Technaton Huh? I thought adding an object to an @array makes a copy? 09:41
arnsholt For checking set membership, the Set class may be of some use =)
Technaton Okay, scratch @array, think Set. :)
09:41 ilmari[m] joined
Technaton The open set doesn't come prepopulated. What I get from the caller is $start, $destination, and a predicate (read: sub) that returns the neighbors of a $node. 09:42
arnsholt m: class Node { has $.visited = False; }; my $n = Node.new; my @open = ($n); $n.visited = True; say @open[0].visited
camelia rakudo-moar 6fafbf: OUTPUT«Cannot modify an immutable Bool␤ in block <unit> at <tmp> line 1␤␤»
Technaton arnsholt: Okay, but that assumes I'd like to impose a certain API on the caller, right?
arnsholt Durr?
Well yeah. Assuming you want to make a general purpose A* implementation, you need to impose *some kind* of expectation 09:43
Technaton Fro A*, I only need three predicates, $start, and $destination. I would specifically like to avoid to introduce any roles, etc.
arnsholt I'd probably make it a role client code can implement or something
Technaton Again, I'd like to avoid that. 09:44
As it is not necessary and imposes an API on the caller.
When the only thing I need is a predicate to return the neighbors of any $node.
arnsholt m: class Node { has $.visited is rw = False; }; my $n = Node.new; my @open = ($n); $n.visited = True; say @open[0].visited
camelia rakudo-moar 6fafbf: OUTPUT«True␤»
arnsholt There you go
Technaton So "@open = ($n)" does *not* copy...? 09:45
arnsholt It copies there reference stored in $n
(Sort of)
09:45 tadzik joined, Matthew[m] joined, M-Illandan joined
masak those parens don't do anything in p6, by the way 09:46
09:46 dp[m] joined, Matias[m] joined
masak `@open = $n` and `@open = ($n)` mean the same thing 09:46
arnsholt True, true
Technaton m: class Node {}; my $n = Node.new; my @open = $n; say $n.WHERE; say @b[0].WHERE;
camelia rakudo-moar 6fafbf: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@b' is not declared␤at <tmp>:1␤------> 3e.new; my @open = $n; say $n.WHERE; say 7⏏5@b[0].WHERE;␤»
Technaton m: class Node {}; my $n = Node.new; my @open = $n; say $n.WHERE; say @open[0].WHERE;
camelia rakudo-moar 6fafbf: OUTPUT«140617112791128␤140617112791128␤»
Technaton So its more or less the same memory consumption I would get with the following construct out of C++ land: "std::vector<NodeType *> open"? 09:47
09:47 rindolf left
arnsholt The reason it didn't work with the string example is that "my $a = 'foo'" in Perl 6 is (sort of, kind of) like "my $a = \'foo'" in Perl 5 09:47
Next you store that reference in @b
Technaton arnsholt: Okay, so I need to read up on binding in p6. :) 09:48
arnsholt But when you then do "$a = 'bar'" that doesn't change @b any more than "$a = \'bar'" would in Perl 5
psch binding is for making variables point at the same container
arnsholt Yeah. Just ignore binding entirely, for the time being
It's only for that handful of cases where you want to alias variables, more or less 09:49
Technaton Okay. So, again: my @foo = $n copies the reference to the object $n points to, and not the object itself, right?
arnsholt Yup
Technaton What would I do if I wanted to (deep-) copy $n?
arnsholt So changes to the *object* will propagate as you'd expect
Technaton (Just to get to know the difference.)
arnsholt For a shallow there's $n.clone 09:50
09:51 yyy joined
arnsholt The exact semantics of deep copy are dependant on the exact details of your class, so if you need deep copy you'll have to implement that yourself 09:51
jnthn A note from recent backlog: using .WHERE to check that you have the same object over time will end in great confusion, because objects can move over their lifetime 09:52
m: class A { }; my $o = A.new; say $o.WHERE; say $o.WHERE; for ^10000 { A.new }; say $o.WHERE
camelia rakudo-moar 6fafbf: OUTPUT«140471516726200␤140471516726200␤140471487973976␤»
arnsholt Yay garbage collection =D 09:53
Technaton arnsholt: Thanks a bunch! 09:54
09:54 rindolf joined
Technaton jnthn: Oh. So... Mu.WHICH? 09:55
: class A { }; my $o = A.new; say $o.WHICH; say $o.WHICH; for ^10000 { A.new }; say $o.WHICH
jnthn Yes, that'd be wider
*wiser
Technaton m: class A { }; my $o = A.new; say $o.WHICH; say $o.WHICH; for ^10000 { A.new }; say $o.WHICH
camelia rakudo-moar 6fafbf: OUTPUT«A|59187392␤A|59187392␤A|59187392␤»
Technaton Cool.
jnthn That gets an ID that stays the same over an object's lifetime
Technaton Thanks a bunch! :)
arnsholt I suspect there's a reason didn't mention WHICH though =) 09:56
psch i did use .WHERE explicitly because of Str fwiw
09:56 gregf_ joined
arnsholt If your code starts calling stuff like WHICH, consider whether you're approaching the problem in the optimal way 09:56
09:57 brillenfux joined
arnsholt I think WHERE is the only one I'd expect people to use with any kind of regularity 09:57
jnthn didn't ready the whole conversation :)
*read
Gah, what's with my typing today...
arnsholt And even then I suspect you'd be better served by something like $a ~~ AType, since checking .WHAT directly ignores subtypes and such
jnthn Yup 09:58
09:58 CIAvash joined
arnsholt jnthn: psch++ had an interesting type-check failure a little after 10AM, BTW, where Callable[#`(mixin from where clause)] doesn't accept an instance of Sub 09:59
Is that expected parametric stuff, or a bug?
jnthn Well, Callable[Foo] would expect the sub to also do Callable[Foo] (implying the sub returns a Foo) 10:00
Well, is constrained to
10:00 zilti joined
psch m: my &f where { .signature ~~ :($, $) }; &f = sub ($,$) { } 10:01
camelia rakudo-moar 6fafbf: OUTPUT«Type check failed in assignment to &f; expected Callable[<anon>] but got Sub (sub ($, $) { #`(Sub|5...)␤ in block <unit> at <tmp> line 1␤␤»
psch ^^^ is the actual example btw
jnthn Uh...that Callable[anon] looks...dubious
I've no idea what it's actually managed to do there :P 10:02
psch i guessed "punned Callable in a weird way" vOv
jnthn m: my &f where { .signature ~~ :($, $) }; say &f.VAR.of
camelia rakudo-moar 6fafbf: OUTPUT«(Callable[<anon>])␤»
jnthn m: my &f where { .signature ~~ :($, $) }; say &f.VAR.of.HOW.^name
camelia rakudo-moar 6fafbf: OUTPUT«Perl6::Metamodel::CurriedRoleHOW␤»
jnthn wat
m: my $f where { .signature ~~ :($, $) }; say &f.VAR.of 10:03
camelia rakudo-moar 6fafbf: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤ f used at line 1␤␤»
jnthn m: my $f where { .signature ~~ :($, $) }; say $f.VAR.of
camelia rakudo-moar 6fafbf: OUTPUT«(<anon>)␤»
jnthn m: my $f where { .signature ~~ :($, $) }; say $f.VAR.of.HOW.^name
camelia rakudo-moar 6fafbf: OUTPUT«Perl6::Metamodel::SubsetHOW␤»
jnthn That's what I'd expect in the first case too
arnsholt 's odd
jnthn e.g. it constructs a subset type based off Callable, refined with the sig constraint
Not somehow parameterizes it o.O
arnsholt So somehow there's special logic handling & sigil with where clause?
10:04 zilti left
jnthn So yeah, that goes down as compiler buglet. 10:04
arnsholt: Either that or there isn't and should be :P
arnsholt =D
10:05 zilti joined 10:09 kurahaupo__ joined 10:12 yyy left 10:15 zilti left 10:16 zilti joined 10:18 kurahaupo__ left, kurahaupo__ joined 10:24 ssm joined 10:27 zilti left 10:28 wamba joined 10:36 andrewalker joined 10:37 zilti joined 10:38 mscha joined 10:39 cpage joined 10:40 CIAvash left 10:42 zilti left, kurahaupo joined
mscha m: use NativeCall; my CArray[uint8] $a .= new(200 xx 16); say $a[0].base(16); # That's surprisingly negative for an unsigned int... 10:42
camelia rakudo-moar b96bf5: OUTPUT«-38␤»
10:43 zilti joined 10:47 zilti left 10:55 wamba left 10:57 zilti joined 10:59 zilti left 11:00 zilti joined 11:03 zilti left 11:05 zilti joined 11:08 zilti left 11:09 zilti joined
babydrop Perl 6 2016 Advent – Day 5 – "How to use the docs": perl6advent.wordpress.com/2016/12/...-the-docs/ 11:09
jnthn multi sub trait_mod: (Sub $s, :$foo!) is foo { 11:10
11:10 zilti left
jnthn Looks like the HTML monster got hungry again... 11:10
11:11 pierre_ left, zilti joined 11:16 zilti left 11:18 zilti joined
moritz eeks 11:24
timotimo jesus holy christ, this is the worst damn thing in the history of things 11:25
dogbert17 o/ 11:27
babydrop :)
dogbert17 hi babydrop 11:28
babydrop I guess one thing we found out is Perl 6 folks aren't web devs :)
dogbert17 the IO::Notification.watch-path example on docs.perl6.org/type/IO$COLON$COLONNotification doesn't really check for events in the current directory does it? 11:29
if find the use of $?FILE suspicious to say the least
babydrop PSA: We need more writers. 8 spots still available. Add yourself to schedule: github.com/perl6/mu/blob/master/mi...6/schedule . Advent posts go far and wide, so please write something. 11:30
tadzik oh, I've heard this before: "if perl6 is so good why is rakudo.org using a php framework!?" :P
11:32 ggoebel joined
babydrop You're right! Time to exile the borgouis! Perl 6 for everything! As a matter of fact, time to replace this IRC client with somethign made out of Perl 6. 11:32
11:32 yyy joined
babydrop tadzik: where did you hear that anyway? 11:32
tadzik babydrop: I'm pretty sure it was this channel, about 5 years ago :) 11:33
babydrop heh
11:36 Xliff joined
Xliff m: my $a; do { $a = 1 unless $a.defined; say $a; $a++ } unless $a == 4; 11:37
camelia rakudo-moar b96bf5: OUTPUT«Use of uninitialized value of type Any in numeric context␤ in block <unit> at <tmp> line 1␤1␤»
Xliff m: my $a; do { $a = 1 unless $a.defined; say $a; $a++ } unless $a.defined && $a == 4;
camelia rakudo-moar b96bf5: OUTPUT«1␤»
Xliff m: my $a; do { $a = 4 unless $a.defined; say $a; $a++ } unless $a.defined && $a == 4;
camelia rakudo-moar b96bf5: OUTPUT«4␤»
Xliff m: my $a; do while $a.defined && $a == 4 { $a = 1 unless $a.defined; say $a; $a++ } 11:38
camelia ( no output )
babydrop m: my $a; $a //= 4; say $a
Xliff m: my $a; do while ($a.defined && $a < 4) { $a = 1 unless $a.defined; say $a; $a++ }
camelia rakudo-moar b96bf5: OUTPUT«4␤»
( no output )
dalek c: 1cc464c | (Jan-Olof Hendig)++ | doc/Type/IO/Notification.pod6:
Changed use of 0FILE to CWD
11:39
synopsebot6 Link: doc.perl6.org/type/IO/Notification
jnthn Xliff: What are you trying to figure out?
Xliff m: my $a; do while ($a.defined && $a < 4) { say $a; $a = ($a // 1)++ }
camelia ( no output )
jnthn If it's how to write the condtion at the top of the loop but have it checked at the end of the loop, look up `repeat`
Xliff m: my $a = 1; do while ($a.defined && $a < 4) { say $a++; }
camelia rakudo-moar b96bf5: OUTPUT«1␤2␤3␤»
Xliff That's what I was trying to remember.
jnthn ah :) 11:40
Xliff Too tired to look at docs. It was easier to play with camelia.
jnthn `do` never means anything more than "pretend that this statement is an expression"
Xliff I mean that in the most innocent sense. :P
Oh. Thanks for that mneumonic.
babydrop Xliff: well, she supports /msg and there is also #zofbot
Xliff I don't want to play with anything that starts with <z o f> 11:41
Bad things happen.
babydrop you will be assimilated
resistance is futile
Xliff Dammit I was going there.
patience is unnecessary
Now I go back to lurking. 11:42
BTW - Any luck with my RT'd bugs?
babydrop your RT bugs?
which
"Re: Purchase Order 20161204DF" that one? :) 11:44
Xliff Hard to find. RT is a pain in the ass!
11:44 jfuller_ joined, jfuller joined
babydrop Xliff: find on perl6.fail/ 11:44
Xliff rt.perl.org/Ticket/Display.html?id=129109
rt.perl.org/Public/Bug/Display.html?id=130095
Ooh! A useful, but butt-ugly work around for the first. 11:46
I may circle back to that.
babydrop Well, I can tell why few would want to fix the second one... 11:48
11:48 jfuller_ left, jfuller left
babydrop You offer them an unknown codebase to download and run in hopes of finding some bug. 11:49
I braved it last time, but it failed to run, so your response is I now should "comment out all XML::LibXML" on top of downloading a large unknown codebase.
Doesn't sound like a lot of fun. You should golf that bug to the smallest test case. Preferrable one that can be copy/pasted into the ticket. 11:50
Xliff I can't golf it down.
I've tried.
babydrop Xliff: but you can comment out XML::LibXML, right?
Xliff So rather than waste time on that, I posted what I could.
Yes.
Figured it's a bug, so incomplete but informative is better than none at all. 11:51
I hope I wasn't mistaken in that assumption.
babydrop Xliff: sure. It is.
But the fastness with which it will be fixed is reduced :) 11:52
Xliff Fair enough.
Now.... to nap. 11:53
11:54 Xliff is now known as Xliff_ZZzzZZZzzz 12:00 pierre_ joined 12:04 pierre_ left 12:09 wamba joined 12:10 yoleaux joined, ChanServ sets mode: +v yoleaux 12:11 bjz left, CIAvash joined 12:14 zilti left 12:20 user9 joined, _28_ria joined 12:27 iH2O joined 12:31 ZzZombo_ joined 12:36 iH2O left 12:38 sufrostico joined 12:40 yoleaux left 12:42 yoleaux joined, ChanServ sets mode: +v yoleaux 12:45 canopus joined, _28_ria left 12:47 wamba left, CIAvash left 12:49 pierre_ joined 13:01 pierre_ left 13:15 noviceBob joined
noviceBob p6: my regex Q { <["]> }; my regex A { <-Q>+ }; q/"cat","dog"/ ~~ m:g /<Q><A><Q>/; say $/; 13:17
camelia rakudo-moar b96bf5: OUTPUT«No such method 'Q' for invocant of type 'Cursor'␤ in regex A at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
noviceBob what's wrong? 13:18
babydrop The <-Q>+ bit, though I'm unsure what's the right way to write it 13:20
ufobat is there a way to call foo, without creating a my Str @variable first? 13:22
m: say "a".WHAT; say "a".Array.WHAT; my Str @a = <a b c>; say @a.WHAT; sub foo(Str @a) { dd @a}; foo(<a b c>); foo("a".Array)
camelia rakudo-moar b96bf5: OUTPUT«(Str)␤(Array)␤(Array[Str])␤Type check failed in binding to @a; expected Positional[Str] but got List ($("a", "b", "c"))␤ in sub foo at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
masak m: q["cat","dog"] ~~ m:g/'"' ~ '"' <-["]>+/; say $/
camelia rakudo-moar b96bf5: OUTPUT«(「"cat"」 「"dog"」)␤»
masak noviceBob: ^
babydrop masak: but how to do that with tokens? 13:23
masak well, you can place anything there in the place of '"' and <-["]>+
babydrop p6: my regex Q { <["]> }; my regex A { [<!before <Q>> .]+ }; q/"cat","dog"/ ~~ m:g /<Q><A><Q>/; say $/; 13:24
camelia rakudo-moar b96bf5: OUTPUT«(「"cat"」␤ Q => 「"」␤ A => 「cat」␤ Q => 「"」 「"dog"」␤ Q => 「"」␤ A => 「dog」␤ Q => 「"」)␤»
babydrop masak: the original code showed that's not the case. <-Q>+ doesn't work
and seems making the tokens non-capturing (/<.Q><A><.Q>/) also fails
DrForr m: my regex Q { <["]> }; my regex Foo { <!Q>+ }; 13:25
camelia ( no output )
babydrop That hangs in the original code
13:26 yoleaux left 13:27 yoleaux joined, ChanServ sets mode: +v yoleaux
jnthn The lexical fallback only happens with <foo>; the other forms all require that you be in a grammar so they can be called as methods 13:28
babydrop Ah
jnthn The lexical fallback is also something I sometimes question whether we should have done...but <foo=&foo> would probably have gotten old fast.
babydrop p6: grammar { token TOP { [<.Q><A><.Q>]+ % "," }; regex Q { <["]> }; regex A { <-Q>+ } }.parse(q/"cat","dog"/).caps.say; 13:30
camelia rakudo-moar b96bf5: OUTPUT«(A => 「cat」 A => 「dog」)␤»
13:30 prammer joined
jnthn ufobat: Array[Str].new(<a b c>) 13:30
ufobat ah! 13:31
13:33 abraxxa left 13:34 CIAvash joined, pierre_ joined 13:45 AlexDaniel joined, wamba joined 13:49 noviceBob left 13:53 abraxxa joined
moritz m: my token foo { . }; say 'a' ~~ /<foo>/ 13:57
camelia rakudo-moar b96bf5: OUTPUT«「a」␤ foo => 「a」␤»
moritz huh, somehow the lexical fallback didn't work last I tried it 13:58
13:58 abraxxa left 13:59 abraxxa joined 14:00 espadrine left 14:01 CIAvash left 14:06 cdg joined 14:09 sufrostico left 14:10 cdg left 14:11 cdg joined 14:14 yyy left
dalek c: 62acb6f | coke++ | doc/Type/Hash.pod6:
Fix spelling error
14:20
synopsebot6 Link: doc.perl6.org/type/Hash
c: 68c736b | coke++ | doc/Type/Hash.pod6:
remove trailing whitespace
synopsebot6 Link: doc.perl6.org/type/Hash
14:32 espadrine joined 14:37 cdg_ joined
[Coke] (two CREDITS) AHAHAHAHAHAAHAHAHAHAHAHAHA 14:37
14:38 cdg left
[Coke] As the guy who compiled most of the Christmas thank you list, there were a lot more than two lists. :) 14:38
Three are still 4-8 empty slots on the advent calendar. 2-4 days until the first gap. (uncertainty due to the placeholder entries put in to fill some gaps if needed) 14:42
14:45 cibs joined 14:46 prammer left 14:48 prammer joined 14:49 jjatria joined
[Coke] bdf repots: 14:51
*reports;
I just noticed in another editor that the Perl 6 Advent wordpress
setup replaces HTML escapes when it populates the edit window. Things
that were &lt; become literal < again. Odd.
babydrop I tried right now with typing: <markup>&lt;test&gt; right now and after switching between Visual and HTML a couple of times, it removed everything :/ 14:52
And if I type it into HTML first, same story, but they disappear in different order. 14:53
14:54 ZzZombo_ left
babydrop So I guess, the lesson is: write somewhere else and don't switch Visual/HTML after pasting. 14:54
[Coke] how out of date is our wordpress install?
timotimo the one for the advent calendar is hosted by wordpress itself
i don't think we have a say in updating vs not updating 14:55
babydrop Right
wow, object hashes post was viewed 1,500 times
babydrop didn't realize so many people read this stuff
14:55 ufobat joined
timotimo we have a surprisingly big readership, that's true 14:56
it's been surprisingly big for a couple of years already :)
15:04 skids joined, xinming joined
[Coke] how much of tht 1500 is us going to the main page each day to check stats? ;) 15:04
gfldex: You have the same <> problem that befell me and bdf.
Need to re-edit the article to add them back in by hand, probably. 15:05
masak at some point I had a Markdown-to-perl6advent script that just did all those necessary conversions for me automatically
but it's years ago and I forgot where I put it
babydrop [Coke]: surely the minority
It's the first time I did it this year, for example. 15:06
[Coke] where do you see object hashes was viewed 1500 times? I see an eye icon with a 273 next to it.. 15:07
15:08 khw joined
[Coke] day 2 is the biggest so far with 1,036 by that stat. 15:08
christmas announcement topped out at 10,790 15:09
15:09 brillenfux left
[Coke] we currently have NO scheduled posts ready to go. 15:09
crap, it keeps switching to "ME" instead of "EVERYONE". day 6 is queued up...
babydrop We do
.oO( how many of those 1500 is [Coke] struggling with the UI :P )
15:10
[Coke]: it's inm the WP Admin page: i.imgur.com/mY8apIX.png
[Coke] so why would they give two completely different stats? 15:11
masak gives it another hit: perl6advent.wordpress.com/2016/12/...ct-hashes/
[Coke] babydrop: I think those are the stats for the DAY not the post on that day. 15:12
the stats per post are below.
(day 2, day1, day 3)
so if someone looked at day 2 on december 3, that'd go into your graph you're mousing over.
15:14 g4 left 15:16 alimon1 joined
[Coke] has trouble coming up with a topic for day 8. :| 15:20
[Coke] is sad that we don't have more volunteers to write articles about things they've done with Perl 6. :| 15:21
mst finding advent authors is always a PITA 15:22
(I've spent november running around trying to volunteer people for other projects before now)
AlexDaniel huggable: advent
huggable AlexDaniel, github.com/perl6/mu/blob/master/mi...6/schedule
AlexDaniel MasterDuke: write something! 15:23
:)
babydrop mst: did you see the harassment from AlexDaniel?
[Coke] mst: care to write an article detailing your adventures trying to build rakudo for cpan? :)
AlexDaniel mst: hey!
mst: you did not reply the last time, so I thought I'll wait until I see you here… :) 15:24
babydrop: thanks for reminding!
mst: so how is it going?
mst: any news?
mst AlexDaniel: I was at LPW over the weekend
will try and poke people later today
AlexDaniel mst: good to hear! 15:25
thanks for your effort :)
.tell MadcapJake don't you want to write an advent post about atom perl 6 support? :) Perhaps you know some interesting edge cases (e.g. a bunch of them in the recent PR for unicode quotes), or whatever 15:29
yoleaux AlexDaniel: I'll pass your message to MadcapJake.
15:30 mr-foobar joined
[Coke] or samcv++ 15:30
15:38 zakharyas joined
babydrop AlexDaniel: do you live in North America? 15:38
AlexDaniel babydrop: no, why? 15:39
babydrop Nothing... just writing code examples in the blog :)
s/blog/advent/;
AlexDaniel babydrop: I live in Estonia (Europe!)
[Coke] "if coffee then coffee do coffee more coffee else coffee" -wilw 15:40
AlexDaniel u: COFFEE 15:41
unicodable6 AlexDaniel, Found nothing!
AlexDaniel
u: hot beverage
unicodable6 AlexDaniel, U+2615 HOT BEVERAGE [So] (☕)
AlexDaniel u: TEA 15:43
unicodable6 AlexDaniel, U+2722 FOUR TEARDROP-SPOKED ASTERISK [So] (✢)
AlexDaniel, U+273B TEARDROP-SPOKED ASTERISK [So] (✻)
AlexDaniel, U+273C OPEN CENTRE TEARDROP-SPOKED ASTERISK [So] (✼)
AlexDaniel, gist.github.com/28a35c1b6ee14e1bb0...834f305bc3
AlexDaniel u: BEER
unicodable6 AlexDaniel, U+1F37A BEER MUG [So] (🍺)
AlexDaniel, U+1F37B CLINKING BEER MUGS [So] (🍻)
AlexDaniel I'll never understand the logic behind this 15:44
babydrop Drunk people are more persistent at bugging Unicode Consortium? :) 15:45
jnthn The Unicode consortium drink more beer than tea/coffee? :) 15:46
15:46 diakopter joined 15:47 diakopter left
AlexDaniel u: drink 15:47
unicodable6 AlexDaniel, U+1F379 TROPICAL DRINK [So] (🍹)
AlexDaniel u: sake 15:48
unicodable6 AlexDaniel, U+16877 BAMUM LETTER PHASE-B SAKEUAE [Lo] (𖡷)
AlexDaniel, U+1F376 SAKE BOTTLE AND CUP [So] (🍶)
babydrop m: my %set is SetHash = <a b c d>; 15:49
camelia rakudo-moar 6e7f97: OUTPUT«Cannot modify an immutable SetHash␤ in block <unit> at <tmp> line 1␤␤»
15:49 pierre_ left
babydrop mkaythen 15:49
timotimo that's unfortunate
AlexDaniel immutable SetHash? xD
jnthn I suspect it's just that nobody implemented STORE on [Set|Bag|Mix]Hash yet...
timotimo that sounds like the cause 15:50
jnthn Though note that given it's a % thingy, it wants to treat its RHS pairy
(Which is more obvious for Bag/Mix)
kurahaupo__ so not intentionally "value types"?
timotimo right, *Hash is what you use for mutable stuff 15:51
jnthn SetHash is already mutable, it doesn't doesn't implement STORE
But you can assign to individual elements
15:51 ab6tract joined
ab6tract hi jnthn: i've encountered a bug which reminds me of the previous need to initialize a hash before using a hash key in a separate thread 15:53
in that it is completely unexpected and led me down all sorts of wrong assumptions that my code was broken
i don't know if you have time, but there are details here:
github.com/rakudo/rakudo/pull/934
tl;dr -- i finally patched mix/bag to do the right thing, only to find that a test would fail with an error from coercing a hash to a Mix 15:54
adding a single initialization of the same Mix, using the exact same syntax of a hash coerced to Mix, resolves the error 15:55
jnthn But...the test in question doesn't involve multiple threads?
ab6tract note that i do not even use this new initialized mix
jnthn: no, but the fact that simply initializing the thing before using it fixes things 15:56
jnthn (And indeed, you should not use any hash that's going to mutate beyond the point of sharing it between threads)
ab6tract is what reminded me of the previous bug
jnthn: i'm talking about the seg fault from creating a hash inside of a thread
[Coke] m: IO::PATH.^methods.say 15:57
camelia rakudo-moar 6e7f97: OUTPUT«Could not find symbol '&PATH'␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
ab6tract which was solved by pre-declaring the has keys prior to using them in the thread
jnthn Oh...maybe it was the rope string key thing, but that one got fixed a while ago.
[Coke] m: IO::Path.^methods.say
camelia rakudo-moar 6e7f97: OUTPUT«(FALLBACK gist new)␤»
ab6tract jnthn: i understand that
babydrop ab6tract: but the error talks about getting a Rat instead of an Int not about anything uninitialized
ab6tract i am trying to get feedback on a different bug which is solved in the same fashion
jnthn No idea what's going on in this csae, but it doesn't immediately feel related, knowing what that problem actually boiled down to
ab6tract babydrop: and yet.. creating the mix beforehand (even if that mix is not used, the code does not need to change) 15:58
ok, well. i give up
babydrop That was fast :)
ab6tract yesterday i had two different heisenbugs
15:58 eliasr joined
babydrop Quitter! :) 15:58
ab6tract well
i don't feel much like sticking around
babydrop Why? 15:59
[Coke] doc question: IO::PATH mentions a method SPEC; It's really an attribute - are we documenting public attributes as methods?
ab6tract babydrop: because i encounter heisenbugs like this almost every day
[Coke] non doc issue: why is it SPEC and not Spec?
timotimo ab6tract: :( :(
sorry to hear that
15:59 prammer left
ab6tract github.com/rakudo/rakudo/pull/934/...08b327R303 16:00
here is one of them
@p.first(Mixy) and @p.grep({ nqp::istype($_, Mixy) }) are not true for the same inputs in boolean context
babydrop That one reminds me of the bug about smartmatching against a role 16:01
16:01 sufrostico joined
timotimo i didn't know we had that 16:01
but yeah, one of those is a smart-match, the other is custom code
ab6tract and this other one which is blocking my PR, which is literally
babydrop timotimo: rt.perl.org/Ticket/Display.html?id...et-history
ab6tract timotimo: that does not imply to me that they should ever be different 16:02
in boolean context
timotimo oh yikes
16:02 prammer joined
ab6tract and here i have this other bug which i can't even seem to get the PR reviewer interested in enough to double check 16:02
and yes, i find the idea that my code change would somehow affect the Mix coercer to be preposterous in both true or false forms 16:03
timotimo um
ab6tract if it is true that i can break the Mix coercer by editing set_operators.pm
please
timotimo one thing about your first and grep thing
ab6tract just check that PR
timotimo when you .first, you get the value
if you're looking through Sets and such, you'll end up with the case where the boolean-ness is defined by whether the set has elements or not 16:04
when you use grep, you'll get your booleanness from whether there are results or not
ab6tract timotimo: very good point
timotimo that might just be your problem for that one
so you'll want "if defined first(...)"
TimToady or "with first(...)" 16:05
timotimo but the Bar.new ~~ Foo thing baffles me ... but maybe it's got something to do with the optimizer, does it also fail with --optimize=0 or --optimize=off?
babydrop It fails here: github.com/rakudo/rakudo/blob/nom/...ggy.pm#L20
16:05 user9 left
babydrop And seeing an Int restriction, I'm guessing value is a 1.1 Rat from the Mix 16:05
ab6tract babydrop: which is interesting, considering that I'm calling .Mix
that failure is literally resolved in the same way i describe in that tickety 16:06
by initializing that mix into a variable beforehand
i do not reuse the variable
babydrop To me that sounds more like covering up a bug than resolving anything TBH
ab6tract but it stops that failture
i'm not trying to say that this resolves anything
16:06 espadrine left
ab6tract i'm trying to highlight that there is a breakage there 16:07
babydrop OK. So let's find it.
ab6tract i don
i don't have the tuits 16:08
and i am way too frustrated by other factors today
16:08 user9 joined
ab6tract what is the else form of with? elswith? 16:10
babydrop orelse
m: say 42 orelse 5 16:11
camelia rakudo-moar 6e7f97: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 5 in sink context (line 1)␤42␤»
babydrop m: say (42 orelse 5)
camelia rakudo-moar 6e7f97: OUTPUT«42␤»
babydrop m: say (0 orelse 5)
camelia rakudo-moar 6e7f97: OUTPUT«0␤»
babydrop m: say (Any orelse 5)
camelia rakudo-moar 6e7f97: OUTPUT«5␤»
babydrop nevermind. It's more of a looser //
jnthn orwith 16:12
babydrop didn't even know we had that 16:13
ab6tract: so you don't have tuits, but you're upset the reviewer is not interested in chasing that bug? :)
TimToady the final one is just plain 'else' 16:14
but you can intermix 'elsif' with 'orwith'
[Coke] babydrop: as somene involved in perl6 in one form or another for some time, sometimes when someone reports a problem, they just need it fixed so they can move on. they don't have time to also debug core issue and or provide fixes.
TimToady we need both kinds of people :) 16:15
just one of 'em is in short supply at the moment
ab6tract babydrop: the reviewer's never acknowledged the chance of a bug that was not directly caused by my code
as far as i know, the reviewer (which is you?) never tried the example that i provided 16:16
babydrop ab6tract: you code exposes it, regardless of where it's caused.
ab6tract so actually, that decreases my desire
babydrop ab6tract: what example? 16:17
ab6tract initialize
the mix first
babydrop The + my $tm = %(blood => 2.1, love => 2.2, rhetoric => 1).Mix; ?
ab6tract yes
japhb I think essentially a fair number of us have only so much yak-shaving stack depth. Beyond that point, we throw a mental exception.
I've personally hit this a number of times.
ab6tract japhb: most certainly
and i am at that wall myself
i spent my whole day chasing this around
japhb Boo to that. 16:18
ab6tract and when i brought it up i felt like it was brushed off as something not even worth considering (that this was a bug not introduced by my code change, only exposed by it)
as i said, i have other frustrations today
japhb Time to put down the keyboard and take a walk? 16:19
ab6tract all i was hoping for was a recognition like "hey, that's weird. i can confirm the behavior"
anyway, thank you babydrop for looking at it
and sorry for being frustrated today
i will see you all later on
TimToady ciao 16:20
perlpilot Looks like the latest Advent post had some syntax eaten by Wordpress. (unless that's a clever ploy to get people reading the docs more) 16:21
s/had/has/
babydrop I thought gfldex fixed that
moritz I fixed it once this morning, but it seems to be broken again
maybe others are lucker than I am 16:22
gfldex wordpress really wants us to go someplace else
TimToady wp is notorious for letting you fix one thing and breaking something else when you do...
babydrop ab6tract: where is that line supposed to go? 'cause I'm still getting the same failure when I add it before the carshing test.
TimToady I think he wandered off for a breather 16:23
16:24 ab6tract left 16:25 itcharlie1 joined 16:28 zakharyas left, ab6tract joined
ab6tract i did wander off for a breather 16:28
but i can't help myself with backlogging sometimes ;) 16:29
babydrop: so that is very interesting behavior..
this version passes for me github.com/perl6/roast/pull/187/fi...1671e5R193 16:30
TimToady "interesting behavior" is a common failure mode of certain president elects as well 16:31
16:31 TEttinger joined
ab6tract in the Chinese curse sense of the word 16:31
ilmari 'presidents elect', no? like 'attorneys general'?
TimToady well, certainly the Chinese are feeling cursed about now :)
babydrop ab6tract: and for me it fails on a different test than what the comment in that diff says 16:32
This one crashes: is ([(+)] bag(), $m), $m, "Mix sum reduce with an empty bag should be the value of the mix (Texas)";
ab6tract yeah that comment is out of date
babydrop But if I run it in isolation it passes
16:33 mscha left
ab6tract yeah, i was seeing that too. 16:33
16:33 CIAvash joined
ab6tract (that it works in isolation) 16:34
bizarre 16:35
babydrop: don't worry about it unless it interests you. maybe we can pick it up again some other time?
for now it is about time i get that breather
16:36 zakharyas joined
ab6tract thanks again #perl6, sorry for venting and a big <3 for your patience 16:36
16:36 lucasb_ joined
babydrop ab6tract: well, I can take a look at it later this week. I need to do some things today first, which is why I told you on the PR that all I know is it fails 16:37
and not why or how.
And once I fix the issue, I'll merge the PR. But I don't want to merge something that makes 6.c-errata fail, regardless whether it caues the issue or just uncovers it 16:38
16:40 m0ltar joined 16:41 ab6tract left
babydrop can't wait for the robot uprising 16:42
16:43 giraffe left
babydrop The real issue in those tests is using the same variables all over the file instead of isolating them for each small chunk 16:44
16:45 dwarring joined 16:48 zakharyas left 16:50 giraffe joined
babydrop hmm 16:55
now another operator fails 16:56
Do we have a name for this one? (.)
babydrop snickers
16:58 abraxxa left
babydrop it's a SPESH bug 16:58
17:00 CIAvash left
babydrop Where does spesh stuff reside? It's moarvm level? 17:02
lucasb_ babydrop: yes, moaar
babydrop oh, duh... it's moarvm env var so of course :)P
17:02 cibs left
lucasb_ if you declare a signature like 'sub f($a ($b,$c))'; then the 2-elem array $a gets unpacked into $b and $c 17:03
but...
babydrop m: sub($,$,$,$,$,$,$).signature.say; # this is fixed btw 17:04
camelia rakudo-moar 6e7f97: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤ sub used at line 1. Did you mean 'sum'?␤␤»
babydrop m: sub($,$,$,$,$,$,$){}.signature.say; # this is fixed btw
lucasb_ if you declare a signature like 'sub f(:($b,$c))'; it still expects a 2-argument *sub-signature*, but there's no way to satisfy this constraint
camelia rakudo-moar 6e7f97: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤ sub used at line 1. Did you mean 'sum'?␤␤»
babydrop bah
17:04 cibs joined
babydrop well, you know what I mean :0 17:04
moritz lucasb_: so don't write that?
lucasb_: it's easy to write constraints you can't satisfy 17:05
m: sub f(Int where False) { }; f 42
camelia rakudo-moar 6e7f97: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot do non-typename cases of type_constraint yet␤at <tmp>:1␤------> 3sub f(Int where False7⏏5) { }; f 42␤»
lucasb_ babydrop: yes, I say yesterday. thanks for fixing!
moritz m: sub f(Int where {False}) { }; f 42
camelia rakudo-moar 6e7f97: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot do non-typename cases of type_constraint yet␤at <tmp>:1␤------> 3sub f(Int where {False}7⏏5) { }; f 42␤»
lucasb_ *I saw yesterday...
moritz m: sub f(Int $ where {False}) { }; f 42
camelia rakudo-moar 6e7f97: OUTPUT«Constraint type check failed for parameter '<anon>'␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
moritz ok, not *so* easy, it still took me three tries, but you get the picture 17:06
lucasb_ my point is... writing a signature object like 'sub f(:(...))' inside another signature should not be valid code
jnthn m: sub f(:($a, $b)) { }.perl.say
camelia rakudo-moar 6e7f97: OUTPUT«sub f ($ (Any $a, Any $b)) { #`(Sub|48236960) ... }␤»
jnthn m: sub f(:($a, $b)) { }([1, 2])
camelia rakudo-moar 6e7f97: OUTPUT«Too few positionals passed; expected 2 arguments but got 0 in sub-signature␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
lucasb_ neither f(:(1,2)) match as well 17:07
jnthn I'd have to look at the grammar to see what that actually is parsing as :)
17:17 nicq20 joined 17:26 pyrimidine joined
jdv79 hello #perl6 17:28
17:28 girafe joined
nicq20 jdv79: Hello o/ 17:29
babydrop \o 17:30
17:30 eiro joined 17:33 zilti joined 17:35 prammer left
[Coke] babydrop: I think changing the 6.c test files to avoid unnecessary sharing of variables is a reasonable fix that won't change the intent of the test. 17:39
17:40 pmurias joined
babydrop I rather leave it alone. 17:41
If it weren't sharing, I guess we'd never find that bug :) 17:42
pmurias what should I pass to nqp::shell on windows to test if it returns the error code, here is a linux version: paste.scsys.co.uk/540048
17:43 itcharlie1 left
pmurias it's possible that nqp::shell('exit 47', ...) already works on windows but I don't have a windows dev env to set it up 17:44
17:46 dakkar left
babydrop neat.. found a parsing bug while writing an Advent 17:46
m: for <a b> (-) <b c> { .say }
camelia rakudo-moar 6e7f97: OUTPUT«a => True␤»
babydrop m: for <a b> \ <b c> { .say } 17:47
camelia rakudo-moar 6e7f97: OUTPUT«5===SORRY!5===␤Function 'b' needs parens to avoid gobbling block␤at <tmp>:1␤------> 3for <a b> \ <b c> { .say }7⏏5<EOL>␤Missing block (apparently claimed by 'b')␤at <tmp>:1␤------> 3for <a b> \ <b c> { .say }7⏏5<EOL>␤␤»
babydrop I guess I have an extra motivation to fix it :)
m: for () ∖ () {} 17:52
camelia ( no output )
pmurias babydrop: should the advent posts you code that only works in Rakudo HEAD? ;) 17:53
babydrop u: \
unicodable6 babydrop, U+005C REVERSE SOLIDUS [Po] (\)
babydrop gawd dammit
I confused myself... after writing about how ∖ looks a lot like \
pmurias: that beats not working at all ;) 17:54
17:59 pyrimidine left
[Coke] babydrop: our tests of bugs and features should be deliberate, not accidental. 18:02
but I also am fine with not changing the test in 6.c-errata, and only changing it in master. 18:03
18:03 cibs left 18:04 wamba left, cibs joined, nicq20 left, pyrimidine joined
babydrop m: ∅<x>:delete # somewhat of an LTA message, since I ain't got DELETE-KEY in my code 18:16
camelia rakudo-moar 6e7f97: OUTPUT«Cannot call 'DELETE-KEY' on an immutable 'Set'␤ in block <unit> at <tmp> line 1␤␤»
18:18 domidumont joined 18:20 ggoebel left 18:22 firstdayonthejob joined
masak babydrop: on the other hand, we have a number of delegations like that in Perl 6. %h<key> itself delegates to %h{"key"}, and we don't try to hide that in error messages. (and if we did, then at some point those wanting to override operators would suffer from us hiding it.) 18:33
timotimo i think rather than delegating, that actually compiles down to the other thing 18:34
babydrop Well, I don't know how it works vov. I'm just noticing that error is a lot less awesome, if you compare it to, say, 18:35
m: :16<Z>
camelia rakudo-moar 6e7f97: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Invalid base-16 character 'Z': 7⏏5Z. Please use one of 0..9, A..F␤at <tmp>:1␤------> 3:16<Z>7⏏5<EOL>␤»
18:36 prammer joined, prammer left
[Coke] TIL (from mark fowler) that perl 5 has gather/take (in module space) 18:38
also perl5++ for making their advent calendar actually christmas-themed. :) 18:39
masak metacpan.org/pod/Perl6::Gather ?
babydrop heh
masak wow, and it's not a lot of code 18:41
18:41 ggoebel joined
[Coke] List::Gather, I think. 18:43
babydrop It's also not like ours 18:44
m: multi foo (Numeric) { "it's a number!".take }; multi foo (Stringy) { "it's a string!".take }; multi foo ($) { "wat".take }; .say for gather { foo 42; foo 'meow'; foo 4.5; foo {} }
camelia rakudo-moar 6e7f97: OUTPUT«it's a number!␤it's a string!␤it's a number!␤wat␤»
babydrop Look ma'! take is in a different sub so the caller(-1) hack ain't gonna work \o/
lucasb_ m: my $n = 10; say ($n, ++$n) 18:46
camelia rakudo-moar 6e7f97: OUTPUT«(11 11)␤»
lucasb_ m: my $n = 10; say (my $x = $n, ++$n)
camelia rakudo-moar 6e7f97: OUTPUT«(10 11)␤»
babydrop no idea about ether's version, but I don't see cross-sub examples in pod
lucasb_ ^^ this looks strange, but is the correct behaviour, right? 18:47
I get the same results with perl5
babydrop would prefer to chuck code like that into "undefined" category :) 18:48
But yeah, looks right to me: all the stuff gets evaluated left to right, before it gets all shipped to say() 18:49
jnthn Yup, looks reasonable to me
18:49 prammer joined
lucasb_ ok, so it's confirmed 18:50
18:50 FROGGS joined
lucasb_ I have to "cache" the first value with 'my $x = $n' otherwise I will get a reference to the updated value 18:50
18:51 firstdayonthejob left
babydrop you stick a value into a different container instead of passing a container whose value gets updated later on 18:52
s/passing/using/;
lucasb_ yes, makes sense
anyone feel welcome to document this "caveat" in the docs/traps :) 18:54
babydrop thinks we should stop calling any random tricky behaviour a "trap"
Writing wrong code is what makes programmers stronger! 18:55
AlexDaniel babydrop: so what should we call a “trap” then? 18:56
perlpilot
.oO( ... and who plays Admiral Ackbar in this scenario? )
babydrop AlexDaniel: I dunno, I was just complaining randomly 18:58
But a language with lots of traps makes me think it's designed badly. 18:59
Like this isn't a "trap": docs.perl6.org/language/traps#Assi...attributes 19:00
lucasb_ imagined the "It's a trap" meme image with the subtitle "It's a Perl 6 feature"
babydrop That's just what someone who has little understanding of attributes might do.
m: say Bag.new-from-pairs: :42foo, :45bar 19:01
camelia rakudo-moar 6e7f97: OUTPUT«bag()␤»
babydrop now that's ^ a trap. It's something any programmer can absentmindedly write and expect to work
timotimo that's true
babydrop And this is not a trap: docs.perl6.org/language/traps#Whit..._literally 19:02
m: say 'a b' ~~ /a b/
camelia rakudo-moar 6e7f97: OUTPUT«Potential difficulties:␤ Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)␤ at <tmp>:1␤ ------> 3say 'a b' ~~ /a7⏏5 b/␤Nil␤»
babydrop you get a helpful error
Anyway, as I've said, I was randomly complaining....
Don't quote me on this or anything :P
19:02 lukaramu joined
AlexDaniel babydrop: you are right, especially given that it prints a warning, yes 19:03
though I guess there are times we don't warn
babydrop yeah
m: say 'a b' ~~ /a ./
camelia rakudo-moar 6e7f97: OUTPUT«「a 」␤»
AlexDaniel the example should be changed then, I guess 19:04
lucasb_ what "􏿽xBB" inside regexes mean?
19:04 yoleaux left, synopsebot6 joined, jjatria left
babydrop lucasb_: right word boundary 19:04
lucasb_ babydrop: ah right, I didn't know. thanks 19:05
babydrop m: say "foo bar ber" ~~ m:g/ . » /
camelia rakudo-moar 6e7f97: OUTPUT«(「o」 「r」 「r」)␤»
babydrop m: say "foo bar ber" ~~ m:g/ . >> / # same thing in Texas
camelia rakudo-moar 6e7f97: OUTPUT«(「o」 「r」 「r」)␤»
babydrop with « and << being left boundaries
and <|w> or <wb> being just boundary (no directional distinction)
19:05 firstdayonthejob joined
lucasb_ babydrop: thanks. I just wanted to understand the fix from yesterday... you know, the $str.subst(/􏿽xBB ' $'$/,'') 19:07
19:07 synopsebot6 left, synopsebot6 joined
[Coke] we should also move any traps that are "in perl 5..." to the appropriate 5-to-6 page. 19:07
babydrop lucasb_: cdn.meme.am/cache/instances/folder...676197.jpg 19:08
[Coke] (there's at leats 2 of those>)
lucasb_ lol
[Coke] others look like they belong in a specific lang-to-6 page, like Junctions and ^,|, and & 19:09
lucasb_ perlpilot who gave the visual suggestion
timotimo we used to have at least one extra lang-to-6, but i think it was rejected? 19:10
was it ruby-to-perl6?
AlexDaniel timotimo: docs.perl6.org/language/rb-nutshell
babydrop rb-nutshell.html and it's still there; it's just in the middle of the list
timotimo cool, it's still there
babydrop m: dd bag(<a a b c a d>) (.) bag(<a a b c c>) 19:15
camelia rakudo-moar 6e7f97: OUTPUT«("a"=>6,"c"=>2,"b"=>1).Bag␤»
19:15 ChoHag joined
babydrop m: dd bag(<a a b c a d>) (+) bag(<a a b c c>) 19:15
camelia rakudo-moar 6e7f97: OUTPUT«("a"=>5,"c"=>3,"b"=>2,"d"=>1).Bag␤»
hahainternet heh AOC5 is quite fun in perl6 19:16
that one's 4 i guess
but damn Digest::MD5 aint' quick :D
19:19 Upasaka_ joined
babydrop Man who designed set Unicode chars... ⊎ is indistinguishable from ⊍ in my font 19:19
hahainternet there are literal homoglyphs in unicode
so best of luck :)
babydrop Oh.. wait... I think the left one has one more pixes than the other
[Coke] m: dd(Mu)
camelia rakudo-moar 6e7f97: OUTPUT«Mu␤»
babydrop Same with ∖ looking like backslash 19:20
hahainternet that's very different here
19:20 baest_ joined
babydrop \∖\∖\∖\∖\∖ 19:20
19:20 amalia__ joined, parisba_ joined
babydrop Slightly less slanted in my font: i.imgur.com/k10Few5.png 19:21
hahainternet babydrop: your colourscheme is nauseating
here's yours here: i.imgur.com/grHfsjY.png 19:22
19:22 nebuchadnezzar left
babydrop Nonsense! :) 19:22
19:22 nebuchadnezzar joined
babydrop oh wow, yeah, much different 19:22
hahainternet calculating the first hash of aoc5: been going 15 minutes already i think
and this is on a 3770k
masak baest_: hi! saw you enter in babydrop's screenshot! :D
hahainternet i'm assuming Digest::MD5 is pure perl6
19:23 mitchum_ joined
hahainternet github.com/cosimo/perl6-digest-md5...est/MD5.pm 19:23
v nice
19:23 Juerd_ joined
hahainternet might have to nativecall one though to complete this task today 19:23
19:23 telex left, lucasb__ joined, ponbiki_ joined, telex joined
AlexDaniel babydrop: my main font does not have ∖ in it, so it looks like this: files.progarm.org/2016-12-05-21232..._scrot.png 19:23
19:24 cdg_ left
AlexDaniel more of a bug than a feature, but I really like the fact that I can distinguish between ascii and non-ascii chars… 19:24
jonadab Indeed. 19:25
19:27 canopus_ joined 19:28 zilti1 joined, synopsebot6 left, zilti left, lucasb_ left, khw left, canopus left, andrewalker left, kurahaupo__ left, ilmari[m] left, jonas2 left, amalia_ left, dalek left, Juerd_ is now known as Juerd, amalia__ is now known as amalia_
babydrop weeee 19:29
dudz hi babydrop
lucasb__ are we all on the same side?
dudz hi lucasb__
19:30 parisba_ is now known as parisba
babydrop dudz: hi 19:30
19:30 firstdayonthejob left
lucasb__ m: sub f($a ($b,$c)) { say $a }; f([10,20]) # ok 19:31
camelia rakudo-moar 6e7f97: OUTPUT«[10 20]␤»
lucasb__ m: sub f($a:($b,$c)) { say ::('$a:') }; f([10,20]) # ???
camelia rakudo-moar 6e7f97: OUTPUT«[10 20]␤»
lucasb__ if I type '$a:($b,$c)' then the argument gets captured into a variable named "$a:"
the variable named just "$a" is inaccessible in the second eval snippet 19:32
in both snippets, $b and $c gets unpacked correctly 19:33
AlexDaniel sooo… are you saying that this should not happen? 19:34
hahainternet isn't $a: the invocant syntax?
lucasb__ idk :)
timotimo isn't that our "fancy variable name" syntax?
lucasb__ I'm just saying that it's strange
timotimo nah, that'd require word characters after the :
19:34 ilmari[m] joined, go|dfish joined 19:35 geekosaur joined, Lucas_One joined, jonas2 joined
AlexDaniel m: sub f($a: where { True }) { }; f([10,20]) 19:36
camelia rakudo-moar 6e7f97: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot do non-typename cases of type_constraint yet␤at <tmp>:1␤------> 3sub f($a: where { True }7⏏5) { }; f([10,20])␤»
AlexDaniel “Cannot do non-typename cases of type_constraint” ?
lucasb__ "yet" 19:37
[Coke] hahainternet: yes, trailing : is the invocant syntax.
19:37 khw joined
[Coke] m: sub f($a:($b,$c)) {} ; dd f 19:37
camelia rakudo-moar 6e7f97: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Calling f() will never work with declared signature ($a: (Any $b, Any $c))␤at <tmp>:1␤------> 3sub f($a:($b,$c)) {} ; dd 7⏏5f␤»
[Coke] m: sub f($a:($b,$c)) {} ; dd &f
camelia rakudo-moar 6e7f97: OUTPUT«Sub f = sub f ($a: (Any $b, Any $c)) { #`(Sub|61889976) ... }␤»
19:38 andrewalker joined
AlexDaniel lucasb__: a lot of things actually accept : in their name 19:39
there was a long discussion on that topic somewhere
babydrop m: { say $:meows }(:42moews) 19:40
camelia rakudo-moar 6e7f97: OUTPUT«Required named parameter 'meows' not passed␤ in block <unit> at <tmp> line 1␤␤»
babydrop m: { say $:meows }(:42meows)
camelia rakudo-moar 6e7f97: OUTPUT«42␤»
RabidGravy well that's odd I've just an email from a recruiter about the very job I am doing now :) 19:41
[Coke] only 1528$ left to go to fund the "learning perl 6 book" kickstarter.
timotimo doesn't have that kind of money laying around
RabidGravy looking good
timotimo also doesn't have a credit card
hahainternet [Coke]: how many days left?
RabidGravy 11 I think 19:42
hahainternet oh easy
if it doesn't reach the target in a week i'll fund whatever's remaining
assuming the general consensus in this channel is that it's a positive thing to do
babydrop Sure
hahainternet++ 19:43
19:43 pyrimidine left
hahainternet switched to OpenSSL::Digest 19:44
still taking some time!
RabidGravy I think most of the (very few,) nay sayers I have encountered are bitter old hackers who refuse to get with the programme
hahainternet i'm bitter and old
RabidGravy Oh I'm old 19:45
19:46 firstdayonthejob joined
mspo news.ycombinator.com/item?id=13108683 19:46
bhm_ hahainternet++ 19:47
19:47 prammer left, bjz joined
hahainternet so, given this is so slow 19:48
i guess i better learn some async
babydrop m: gist.github.com/zoffixznet/85fb4f1...e367a6afde
hahainternet iirc you can take a seq and batch it out to threads
camelia rakudo-moar 6e7f97: OUTPUT«I can build...␤Type check failed in assignment; expected Int but got Bag (("wood"=>200,"brick"=...)␤ in block <unit> at <tmp> line 9␤␤»
babydrop What is it crying about? What's expecting an Int? :S
hahainternet if anyone has a relevant link to hand that'd be nice
timotimo mspo: let's all prepare for a whole bunch of negativity :)
19:48 lizmat joined
hahainternet babydrop: the combinations func? 19:48
mspo timotimo: HN tends to like perl6
from what I've seen 19:49
hahainternet babydrop: (just a guess)
19:49 dalek joined, ChanServ sets mode: +v dalek
mspo other than the usual perl stuff 19:49
babydrop hahainternet: what'd you mean?
19:49 prammer joined
hahainternet babydrop: you asked what expected an int 19:49
doesn't combinations take an int which is the number of returned elements? 19:50
babydrop hahainternet: it doesn't tho
hahainternet just a guess, i'm still new at p6
babydrop But I did have a hyper on it that wasn't needed....
Still get a bug tho
m: gist.github.com/zoffixznet/0601b56...eee33f0dca
camelia rakudo-moar 6e7f97: OUTPUT«I can build...␤()␤(house => bag(wood(200), brick(3000), glass(50)))␤(shed => bag(wood(300), brick(3000), glass(50)))␤(dog-house => bag(wood(50)))␤(house => bag(wood(200), brick(3000), glass(50)) shed => bag(wood(300), brick(3000), glass(50)))␤(…»
babydrop Combinations alone work
timotimo mspo: it's clear to me that you have enough positivity to counter HN :)
mspo anyway traffic = money and HN = traffic 19:51
19:51 bjz left
timotimo *shrug*, no PR is bad PR :) 19:52
hahainternet not sure HN is good traffic, but as timotimo said
masak "traffic = money" is the kind of thinking that got us Trump :(
babydrop dammit
hahainternet anyway i'm happy to throw in $1500 so the KS is going to succeed
mspo money = winning is the american way
babydrop My beautiful code is breaking at its seams
hahainternet so we'll see how much i need to put in
babydrop: still waiting for my code to return lol
babydrop heh
hahainternet 100%ing one CPU
7 sat there idle
babydrop m: gist.github.com/zoffixznet/ff9097c...db747f7493 19:53
camelia rakudo-moar 6e7f97: OUTPUT«I can build...␤This type (Scalar) does not support elems␤ in block <unit> at <tmp> line 9␤␤»
babydrop wat?
19:54 bjz joined
[Coke] wtf. the day 1 article reverted to missing <>'s again? 19:55
babydrop I blame abstr6ct. They infected me with random bugs in bags
AlexDaniel m: my @wanted = ‘house’; .say for @wanted.combinations.grep: { dd $^stuff».values }; 19:56
camelia rakudo-moar 6e7f97: OUTPUT«This type (Scalar) does not support elems␤ in block <unit> at <tmp> line 1␤␤»
[Coke] does wordpress track edit history? 19:57
babydrop Hm, doesn't crash with ∪ op
m: Pair.new(1, 42).values.say 19:59
camelia rakudo-moar 6e7f97: OUTPUT«(42)␤»
babydrop m: Pair.new(1, 42).value.say
camelia rakudo-moar 6e7f97: OUTPUT«42␤»
[Coke] ah found it. I fixed it, and then an autosave threw away the nice edits and replaced them with the stupid html destroying edits.
20:00 wamba joined
[Coke] probably had too many windows open pointing at my article. 20:01
masak [Coke]: more and more I realize why I didn't write my advent posts inside of the Wordpress UI. 20:02
pmurias what is prefered 'use nqp' or 'use MONKEY-GUTS'? 20:03
babydrop yes
I mean, the guts
geekosaur guess: use nqp; when you're actually working on nqp, use MONKEY-GUTS; when poking the guts from "normal" code
20:04 Tonik joined
geekosaur MONKEY-GUTS should be a warning, basically. If you're working specifically on/in nqp, it should be fairly obvious already. 20:04
lucasb__ m: sub (::T) { say T }.(10)
camelia rakudo-moar 6e7f97: OUTPUT«(Int)␤»
pmurias what does 'working on nqp' mean? 20:05
lucasb__ m: sub (::T) { say (T.gist,) }.(10)
camelia rakudo-moar 6e7f97: OUTPUT«((Int))␤»
pmurias writing nqp code?
lucasb__ m: sub (::T) { say (T,) }.(10)
camelia rakudo-moar 6e7f97: OUTPUT«No such method 'gist' for invocant of type 'T'␤ in sub at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
geekosaur specifically working on the nqp components under perl 6
babydrop Interestiong... in this code: $_».key.say for @wanted.combinations.grep: { $materials ≽ [⊎] ».value }; 20:06
The » on .value doesn't need the $_, but it's needed on ».key at the start :/
geekosaur an argument could be made for "if it's not part of the rakudo distribution then it should be MONKEY-GUTS", but that might be a little too tight a constraint 20:07
(or "intended to become part of...")
but, summary: if you're specifically doing work on internals, that should already be obvious enough that you don't need the extra warning that you're diving under the perl 6 façade 20:08
20:09 ribasushi joined
geekosaur (warning intended for future readers of the code, of course) 20:09
pmurias geekosaur: rakudo enforces the use of either 'use MONKEY-GUTS' or 'use nqp'
20:09 sufrosti1o joined
geekosaur yes, and? 20:09
are you saying they should be treated as 100% equivalent, then?
then could you explain why both exist? 20:10
pmurias aren't they?
geekosaur *technically* yes
babydrop m: gist.github.com/zoffixznet/bb284c6...062fe3d76b
camelia rakudo-moar 6e7f97: OUTPUT«I can build...␤␤Cannot unbox a type object (Any) to a str.␤ in block <unit> at <tmp> line 9␤␤»
AlexDaniel I am not sure where does the guarantee that GUTS is actually nqp comes from, but whatever…
babydrop sighs at the bugs
pmurias geekosaur: I would guess the reasons both exists is backwards compatibility
geekosaur it's not about the technical part, it's about organization
babydrop caused by using $^stuff instead of $_
geekosaur right. ok, I yield. tech solves social problems 20:11
20:12 ufobat left, inokenty joined
pmurias geekosaur: actual work on nqp is done in NQP not Perl 6 20:13
geekosaur nqp is, for all intents and purposes, packaged with perl 6
er, with rakudo. "perl 6" isn't really relevant, if you want to play pedant 20:14
babydrop not really.
timotimo yeah, though we should be able to drop things like the nqp Grammar and Actions and World from our distribution since it's just a compile-time dependency
hahainternet i've got some weird behaviour where an infinite seq will parallelise fine with .race, but return after a batch or so with .hyper
is that known?
i'll build a fresh rakudo shortly
geekosaur there is never any technical reason for anything to be MONKEY-*
hahainternet but reading the docs it doesn't seem like it should behave this way
timotimo hahainternet: hyper and race are known to not work 100% right
babydrop hahainternet: those methods are kinda buggy
hahainternet fair 'nuff 20:15
race 100%s all cores incl hyperthreaded cores here
quite happily
showing 780% or so in top
haven't actually measured performance improvement
timotimo probably not drastically much
hahainternet i'll give that a go in a bit when i've finished playing with aoc5
timotimo we still have a nasty bottleneck
hahainternet parallelism is hard 20:16
it's nice to see it this far along though
pmurias the reasons I'm bringing up the 'use MONKEY-GUTS' vs 'use nqp' is that when seeing a 'nqp::someoop' rakudo encourages reminds users that they might want to add 'use nqp'
babydrop hahainternet: there's literally a ticket with " .race makes code run 5 times slower" in its title
hahainternet babydrop: lmao
pmurias * reason
hahainternet still the fact i can add .race. and see all 8 cores saturated is a good sign
babydrop m: nqp::blah;
camelia rakudo-moar 6e7f97: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Could not find nqp::blah, did you forget 'use nqp;' ?␤at <tmp>:1␤------> 3nqp::blah7⏏5;␤ expecting any of:␤ argument list␤»
hahainternet babydrop: do the same caveats apply to supplies/tapping/etc?
pmurias if 'use MONKEY-GUTS' is the prefered form maybe the exception message should be updated?
babydrop hahainternet: not to my knowledge, no. That stuff is much more solid 20:17
hahainternet can i convert a seq into a supply and/or is there a method to do the batching ala hyper/race?
babydrop pmurias: yeah. I don't recall who told me that, but I remember this info as MONKEY-GUTS is what our users should see
to the point that I sometimes use that instead of use nqp; in #perl6 20:18
hahainternet: I think Supply has a from-seq or somesuch method
huggable: Supply
huggable babydrop, Asynchronous data stream with multiple subscribers: docs.perl6.org/type/Supply
20:19 pyrimidine joined
babydrop m: dd Supply.from-list: 1..10 20:19
camelia rakudo-moar 6e7f97: OUTPUT«Supply.new␤»
20:20 firstdayonthejob left
babydrop m: gist.github.com/zoffixznet/6b73e7f...dc1f5c1db4 20:20
camelia rakudo-moar 6e7f97: OUTPUT«I can build...␤␤house␤shed␤dog-house␤house shed␤house dog-house␤shed dog-house␤»
hahainternet a supply might not be what i want, probably a channel and a bunch of start/awaits
babydrop My 1-liner awesome-code works \o/
hahainternet reading the docs anyhow, cheers
babydrop: that's superb 20:21
babydrop tho I'm annoyed by that slip just to work around a bug :(
pmurias AlexDaniel: if you are using either 'use nqp' or 'use MONKEY-GUTS' I don't think you get any guarantess whatsoever 20:22
20:22 domidumont left
AlexDaniel well, that's true, I guess 20:23
lizmat waves from home 20:24
timotimo greetings lizmat!
lizmat starting work on the P6W now
babydrop \o\/ 20:25
20:26 Technaton left
timotimo that looks kind of painful 20:26
babydrop heh
Feel free to send a patch for my keyboard driver :)
RabidGravy dunno, do I want to do another advent article? 20:30
babydrop RabidGravy: yes
RabidGravy Hmm, I'll make something about Audio::StreamThing for the 12th 20:31
timotimo i think i ought to do something related to SDL2::Raw, but i'd like to improve things before i write about it
dalek : c925011 | RabidGravy++ | misc/perl6advent-2016/schedule:
Add an article for the 12th
20:32
babydrop \o/
20:34 Tonik left, firstdayonthejob joined 20:35 ufobat joined
babydrop <hahainternet> doesn't combinations take an int which is the number of returned elements? 20:37
<babydrop> hahainternet: it doesn't tho
I was wrong. It can take it. Or a Range. And defaults to 0..* Range
And it's the number of stuff to combine 20:38
m: say <a b c d e>.combinations: 3
camelia rakudo-moar 6e7f97: OUTPUT«((a b c) (a b d) (a b e) (a c d) (a c e) (a d e) (b c d) (b c e) (b d e) (c d e))␤»
babydrop m: say <a b c d e>.combinations: 5
camelia rakudo-moar 6e7f97: OUTPUT«((a b c d e))␤»
babydrop * number of stuff in the resultant combination
20:42 prammer left
lucasb__ m: class a::b::c {}; say ::('a::b::c') 20:46
camelia rakudo-moar 6e7f97: OUTPUT«(c)␤»
20:46 prammer joined
babydrop m: class a::b::c {}; say ::('a::b::c').^name 20:46
camelia rakudo-moar 6e7f97: OUTPUT«a::b::c␤»
lucasb__ m: class a::b::c {}; say ::('::x::a::b::c')
camelia rakudo-moar 6e7f97: OUTPUT«No such symbol 'a::b::c'␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
lucasb__ No such symbol 'a::b::c' ??
babydrop m: class a::b::c {}; say ::('::z::a::b::c')
camelia rakudo-moar 6e7f97: OUTPUT«No such symbol 'a::b::c'␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
lucasb__ interesting how the "::x::" prefix was dropped. I wonder why
babydrop m: class a::b::c {}; say ::('::k::z::a::b::c') 20:47
camelia rakudo-moar 6e7f97: OUTPUT«No such symbol 'z::a::b::c'␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
lucasb__ the error is correct, only the symbol shown in the error message is not (it got its prefix stripped) 20:48
20:49 jonas2 left
hahainternet are pointy blocks weird inside start blocks? 20:49
oh wait i might just be being dumb :) 20:50
psch m: say ::Int; say ::('::Int') 20:51
camelia rakudo-moar 6e7f97: OUTPUT«(Int)␤(Int)␤»
psch m: say ::Int; say ::('::Rakudo::Internals')
camelia rakudo-moar 6e7f97: OUTPUT«(Int)␤(Internals)␤»
lucasb__ just a data point: I think code handling the ::('...') syntax was touched recently 20:52
psch m: try ::('::x::A'); say $!.perl
camelia rakudo-moar 6e7f97: OUTPUT«X::NoSuchSymbol.new(symbol => "A")␤»
lucasb__ see the difference in errors:
m: ::('::')
camelia rakudo-moar 6e7f97: OUTPUT«No such symbol ''␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
lucasb__ star-m: ::('::')
camelia star-m 2016.10: OUTPUT«Start argument to substr out of range. Is: 1, should be in 0..0; use *-1 if you want to index relative to the end␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
psch yeah, i think the Exception message gets misconstructed 20:53
lucasb__ this affects any ::('::a::b::c') name resolution as well
psch bisectable6: ::('::')
bisectable6 psch, Bisecting by output (old=2015.12 new=6e7f97f) because on both starting points the exit code is 1
psch oh, shoulda gone with star-m as old :/
bisectable6 psch, bisect log: gist.github.com/83e272837dd0cc44f4...5faf54681b
psch, (2016-04-30) github.com/rakudo/rakudo/commit/d7...fe506cdabf
psch bisectable6: old=2016.11 ::('::') 20:54
bisectable6 psch, Bisecting by output (old=2016.11 new=6e7f97f) because on both starting points the exit code is 1
psch ah fudge, it's 2016.10 here
bisectable6 psch, bisect log: gist.github.com/4ebe88ea63cc97bc5e...1fc934b3ec
psch, (2016-11-20) github.com/rakudo/rakudo/commit/93...b333b2f66e
psch sheesh
hahainternet oh, actually i wonder if that 'class C is Array of Int' thing is bisectable
psch ah, lucasb__++
m: ::('$::a::X') 20:55
camelia rakudo-moar 6e7f97: OUTPUT«No such symbol '$X'␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
psch m: ::('$a::X')
camelia rakudo-moar 6e7f97: OUTPUT«No such symbol '$a::X'␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
psch it's actually too late for me to look into that, g'night o7
[Coke] finally remembers to put DYLD_FALLBACK_LIBRARY_PATH in his .profile to help with nativecall installations on OS X 20:58
21:02 kurahaupo__ joined 21:03 ab6tract joined
ab6tract babydrop: nice find with the spesh bug. that was driving me absolutely nuts yesterday 21:07
the discussion of .first vs .grep earlier i believe exposes a class of bugs that should exist throughout set_operators.pm right now 21:08
timotimo using first without "with" or "defined"?
ab6tract i'm wondering whether i should just fold those into my current PR 21:09
timotimo: indeed
timotimo should be easy-ish to systematically go through now that we've realized it
and build a bunch of test cases to highlight this
ab6tract i wasn't thinking about .first returning a value there
timotimo it's a good point
easy to miss, i expect 21:10
especially when you mostly get not only defined but also truthy things in your thing
ab6tract and i have a suspicion i either cargo culted it or it was changed from a less optimal form
timotimo like, who uses union with an empty set? :P
21:11 Matias[m] left, ilmari[m] left, dp[m] left, Matthew[m] left, tadzik left
ab6tract yeah it was a weird one. i specifically would get a failure on `[(+)] bag(), $m` 21:11
timotimo mhm 21:12
your work has done a big service to the perl6 effort, i'd say 21:13
good find
ab6tract i added a few tests in this PR github.com/perl6/roast/pull/187
timotimo: i also noticed that (+) was not actually symmetric :O 21:14
timotimo could that have been due to your bug?
are the intermediate values sane?
oh, wait
ab6tract yup, that's how i got to the grep solution
timotimo you mean with regards to different types?
ab6tract $bag (+) $mix should be the same as $mix (+) $bag 21:15
21:15 FROGGS left
ab6tract it is as when i patch the defined-dummo 21:16
it is *fixed
21:16 bjz left
timotimo aha! 21:18
ab6tract and the specific asymmetry was due to defined-nes
timotimo fantastic 21:19
ab6tract so it was one of those hair puller bugs
glad we can clear em all out
timotimo <3
21:21 cdg joined 21:22 M-Illandan left 21:29 mulk[m] joined 21:32 _ramix_ joined 21:33 noviceBob joined
_ramix_ Hi. I need to change the module name: modules.perl6.org/dist/FileSystem:...olumesInfo by modules.perl6.org/dist/FileSystem::Capacity, is it possible? 21:34
21:34 bjz joined
ab6tract alright, fixes are pushed 21:35
21:35 bjz left
ab6tract big hugs to you all, #perl6 <3 ! 21:35
21:35 ab6tract left 21:37 kurahaupo left, kurahaupo joined 21:40 kurahaupo left, _ramix_ left 21:41 kurahaupo joined
babydrop ... 21:44
21:44 ufobat left
babydrop I guess I'll create an Issue on ramix's module 21:45
21:51 bjz joined 21:52 bjz left
babydrop github.com/ramiroencinas/perl6-Fil...y/issues/3 21:52
21:54 labster joined 21:57 skids left 22:00 rindolf left 22:02 noviceBob left 22:09 prammer left, M-Illandan joined, ilmari[m] joined, Matthew[m] joined, tadzik joined, Matias[m] joined, dp[m] joined 22:13 labster left
lizmat .u U+2212 22:19
22:19 bjz joined 22:20 bjz left
AlexDaniel m: say 2212.chr 22:21
camelia rakudo-moar 7ad4a8: OUTPUT«ࢤ␤»
babydrop .u −
u: −
unicodable6 babydrop, U+2212 MINUS SIGN [Sm] (−)
22:21 bjz joined
babydrop m: say '2212'.parse-base(16).chr 22:22
camelia rakudo-moar 7ad4a8: OUTPUT«−␤»
AlexDaniel m: say 0x2212.chr
camelia rakudo-moar 7ad4a8: OUTPUT«−␤»
AlexDaniel right
babydrop golfed my earlier bag issue: 22:23
m: [bag() but "house"].combinations.grep: { [⊎] $^stuff-we-want }
camelia rakudo-moar 7ad4a8: OUTPUT«Cannot unbox a type object (Any) to a str.␤ in block <unit> at <tmp> line 1␤␤»
hahainternet so it seems that the supply .batch method doesn't seem to work if the supply is fed by a seq 22:25
babydrop :( 22:26
hahainternet it'd be very nice to have that method on ranges/seqs too
both of which are concepts amenable to batching
babydrop hahainternet: we do. It's called .rotor 22:27
hahainternet ah ok thank you :)
babydrop hahainternet: perl6.party/post/Perl-6-.rotor-The-...nipulation
hahainternet the question is now, am i doing something wrong with supplies? 22:28
it's a little frustrating there seems to be no way to block on a channel send either
as i want to produce an infinite list of values and feed them to many consumers, each consumer receiving only one 22:29
so i'd like to have it rate limited by the consumer consumption, not sure how to architect it the 'perl6 way' yet :D
will take a break now and have a play around more later
22:30 labster joined
hahainternet oh, it looks like rotor only works on lists, so probably doesn't work on an infinite sequence either 22:30
babydrop m: (1…∞).rotor(5)[^3].say 22:31
camelia rakudo-moar 7ad4a8: OUTPUT«((1 2 3 4 5) (6 7 8 9 10) (11 12 13 14 15))␤»
hahainternet hmmm
oh that's cause that's a range 22:32
babydrop :/
hahainternet i might be wrong anyway
babydrop You are. … is a sequence operator. .. is a range operator
hahainternet oh bad rendering, it overlaps with your infinity symbol 22:33
i see it now
babydrop m: (1..∞).rotor(5)[^3].say
camelia rakudo-moar 7ad4a8: OUTPUT«((1 2 3 4 5) (6 7 8 9 10) (11 12 13 14 15))␤»
babydrop It works on Ranges too, tho
hahainternet yeah i see my error now, it does only iterate up to the element i request
babydrop \o/
hahainternet however, trying to create a channel from any sort of supply based on this seems to just block indefinitely
so if you know why that is then i'll celebrate :p 22:34
babydrop nope
Gonna go play Warframe \o/
(but I don't know off top of my head...)
AlexDaniel hahainternet: what exactly are you trying?
22:35 kurahaupo_ joined
AlexDaniel create an infinite supply? 22:35
hahainternet AlexDaniel: effectively (0..*).map({some transform}), trying to have a bunch of workers read sequential values from it, then kill it when they complete
22:37 kurahaupo__ left, setty1 joined
AlexDaniel m: say (0..*).hyper.map({ $_ +1 }).cache 22:38
camelia rakudo-moar 7ad4a8: OUTPUT«(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 …»
AlexDaniel m: say (0..*).race.map({ $_ +1 }).cache
camelia rakudo-moar 7ad4a8: OUTPUT«(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 …»
hahainternet without using hyper or race
AlexDaniel ok
hahainternet sorry, you weren't here for that i guess
22:38 firstdayonthejob left
hahainternet hyper actually returns part way through, and race is apparently known to be slow and buggy 22:38
so i thought i'd learn about promises/supplies/channels :)
AlexDaniel that's right
hahainternet: are you sure you need 0..* ? 22:39
hahainternet: what kind of infinite sequence do you want to produce? 22:40
hahainternet AlexDaniel: this is for aoc5, it's an infinite list of strings with an incrementing integer at the end, being hashed and checked for leading zeros
the actual challenge is trivial 22:41
i'm interested in learning perl6 :D
adventofcode.com/2016/day/5
AlexDaniel so you need a concurrent Seq, huh? 22:43
hahainternet in decent sized batches ideally
22:45 bjz left
AlexDaniel hahainternet: the problem here is that you can't just push an infinite list of numbers into a supply (because your workers probably cannot consume the data as fast)… I'm pretty sure that it is possible, I just don't know how 22:47
so some sort of a thread-safe generator is needed
hahainternet AlexDaniel: yeah i was hoping the .Channel method would do it magically for me so it wasn't racing to push
babydrop hahainternet: I've not read the challenge, but perhaps this would be of help: irclog.perlgeek.de/perl6/2016-05-28#i_12561518
AlexDaniel well, you can always do it with a Lock
babydrop IIRC it's batching of some sort of another with Promises
hahainternet AlexDaniel: nah it's fine if it's something that is still a bit uncertain 22:49
race and hyper are the 'right' way to do this anyway
so i'll just complete it single threaded
food first though, cheers for your help, if you have any ideas please lmk
22:50 stmuk_ joined
AlexDaniel eval: my $lock = Lock.new; my $curval = 0; sub gen() { $lock.protect({ $curval++ }) }; await (for ^8 { start { for ^10 { say gen(); sleep 0.1 } } }) 22:51
babydrop hahainternet: the stuff I linked to
evalable6 AlexDaniel, rakudo-moar 7ad4a86: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤17␤16␤18␤19␤20␤21␤22␤23␤24␤25␤26␤27␤28␤29␤30␤31␤32␤33␤34␤35␤36␤37␤38␤39␤40␤41␤42␤43␤44␤45␤46␤47␤48␤49␤50␤51␤52␤53␤54␤55␤56␤57␤58␤59␤60␤61␤62␤63␤64␤65␤66␤67␤68␤69␤70␤71␤72␤73␤74␤75␤76␤77␤78␤79»
babydrop hahainternet: I wrote that for jberger because he was trying to use the buggy hyper or race 22:52
AlexDaniel hahainternet: you'd have to modify it though if you want to work on batches…
lizmat and another issue of Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2016/12/05/...log-posts/ 22:53
babydrop wooooo 22:54
22:54 bjz joined 22:55 firstdayonthejob joined 22:56 bjz left
babydrop lizmat++ good weekly. 22:56
Wow, a ton of blog posts!
22:59 labster1 joined 23:00 labster left
BooK lizmat: the link to the learning perl 6 kickstart points back to the post 23:03
I guess because it's empty
babydrop oops :o 23:04
timotimo: are you around? Or anyone else with weekly's perms 23:05
This is the link www.kickstarter.com/projects/14228...ing-perl-6
babydrop wouldn't mind getting perms to fix typos 0:)
23:07 lukaramu left 23:08 sufrosti1o left 23:09 sufrostico left
lizmat BooK babydrop: fixed, thanks! 23:09
and good night, #perl6! 23:12
23:12 bjz joined
lizmat babydrop: wrt to edit access, it really is still timotimo's blog, so I'll leave that decision up to him 23:12
sleep&
Juerd Does anyone know of any impressive Perl 6 asciicasts? (asciinema.org) 23:26
23:26 sufrostico joined, pmurias left 23:27 sufrosti1o joined, firstdayonthejob left 23:32 bjz left 23:33 firstdayonthejob joined
babydrop Is Wendy Liz's spouse? 23:37
23:38 firstdayonthejob left 23:42 labster1 is now known as labster 23:43 labster left, labster joined 23:44 cognominal joined
babydrop Writing this post... the &mix/Mix.new-from-pairs really suck. 23:57
&mix is pointless, since it supports only integer weights—if I only had those, I'd use a Bag. And the Mix is immutable so it's not like I could adjust them. OK, so I explained that in the post, but you have to contort yourself with .new-from-pairs too, since it colonform and unquoted keys get treated as named args and are ignored. 23:59