Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-12-05

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 grumble joined #perl6
00:07 j joined #perl6
00:11 zilti joined #perl6
00:25 cognominal joined #perl6
00:27 samcv u: ⍣
00:27 unicodable6 samcv, U+2363 APL FUNCTIONAL SYMBOL STAR DIAERESIS [So] (⍣)
00:27 kurahaupo joined #perl6
00:27 samcv AlexDaniel, should add that to the list of stars
00:27 samcv you said you were looking for two stars that could go together one to signify a hyper star, that doesn't look too bad
00:28 AlexDaniel yea
00:28 pierre_ joined #perl6
00:29 AlexDaniel samcv: well, I think we should not use APL characters… :)
00:29 AlexDaniel u: ⁑
00:29 unicodable6 AlexDaniel, U+2051 TWO ASTERISKS ALIGNED VERTICALLY [Po] (⁑)
00:29 AlexDaniel u: STAR
00:29 unicodable6 AlexDaniel, U+0001 START OF HEADING [Cc] (␁)
00:29 unicodable6 AlexDaniel, U+0002 START OF TEXT [Cc] (␂)
00:29 unicodable6 AlexDaniel, U+0086 START OF SELECTED AREA [Cc] (†)
00:29 unicodable6 AlexDaniel, https://gist.github.com/
00:29 AlexDaniel u: ASTERISK
00:29 unicodable6 AlexDaniel, U+002A ASTERISK [Po] (*)
00:29 unicodable6 AlexDaniel, U+0359 COMBINING ASTERISK BELOW [Mn] (◌͙)
00:29 unicodable6 AlexDaniel, U+204E LOW ASTERISK [Po] (⁎)
00:30 unicodable6 AlexDaniel, https://gist.github.com/6720​753c96919e3f309e48d95221ef46
00:30 AlexDaniel yea, unicodable, thank you very much
00:30 AlexDaniel u: STAR
00:30 unicodable6 AlexDaniel, U+0001 START OF HEADING [Cc] (␁)
00:30 unicodable6 AlexDaniel, U+0002 START OF TEXT [Cc] (␂)
00:30 unicodable6 AlexDaniel, U+0086 START OF SELECTED AREA [Cc] (†)
00:30 unicodable6 AlexDaniel, https://gist.github.com/
00:30 AlexDaniel that's because of control characters, I guess
00:39 canopus joined #perl6
00:47 AlexDaniel m: say ‘a␤b␤c␤d’ ~~ /.*/
00:47 camelia rakudo-moar fa82a1: OUTPUT«「a␤b␤c␤d」␤»
00:48 AlexDaniel I wonder if .gist of a match should always replace newlines with ␤
00:48 AlexDaniel it is a bit unreadable otherwise
00:49 samcv m: print ‘test␤’
00:49 camelia rakudo-moar fa82a1: OUTPUT«test␤»
00:50 samcv ah. nice. so ␤ will literally put a newline in there?
00:50 samcv or
00:50 AlexDaniel well it's hard to show with camelia
00:50 samcv does it not put a newline in there
00:50 AlexDaniel camelia replaces all ␤ on input and produces ␤ instead of newlines in the output
00:50 babydrop And what will you put for ␤?
00:50 samcv m: "␤".ord.say
00:50 camelia rakudo-moar fa82a1: OUTPUT«10␤»
00:51 babydrop -1 from me
00:51 AlexDaniel babydrop: well, have you seen a gist of anything parsed with a grammar? :)
00:52 AlexDaniel m: say ‘「’ ~~ /.*/
00:52 camelia rakudo-moar fa82a1: OUTPUT«「「」␤»
00:52 AlexDaniel nothing is done with 「」, by the way
00:52 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
00:53 AlexDaniel how do you read it then?
00:54 samcv say "「」" ~~ /.*/
00:54 samcv m: say "「」" ~~ /.*/
00:54 camelia rakudo-moar fa82a1: OUTPUT«「「」」␤»
00:54 * geekosaur undoes that conversion with an irc script (inserting gray ␤ characters as evidence)
00:54 babydrop Like text
00:55 AlexDaniel from top to bottom? :)
00:56 babydrop AlexDaniel: yes: http://i.imgur.com/edHnq2e.png
00:56 AlexDaniel babydrop: that's not a grammar
00:57 _28_ria joined #perl6
00:57 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
00:58 AlexDaniel I think I can .subst(/<!after ‘」’>\n/, ‘␤’) and shut up
00:58 AlexDaniel or something like that
00:58 wisti joined #perl6
00:59 AlexDaniel any way to turn off the display of failed matches for Grammar::Debugger?
01:03 aborazmeh joined #perl6
01:03 aborazmeh joined #perl6
01:17 cibs joined #perl6
01:25 kurahaupo__ joined #perl6
01:26 seatek joined #perl6
01:32 pierre_ joined #perl6
01:32 pierre_ joined #perl6
01:41 aborazmeh joined #perl6
01:41 aborazmeh joined #perl6
02:00 pierre_ joined #perl6
02:14 kalkin-_ joined #perl6
02:21 ilmari[m] joined #perl6
02:25 tadzik joined #perl6
02:25 M-Illandan joined #perl6
02:25 Matthew[m] joined #perl6
02:25 dp[m] joined #perl6
02:25 Matias[m] joined #perl6
02:31 pierre_ joined #perl6
02:37 pierre_ joined #perl6
02:47 ilbot3 joined #perl6
02:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:58 dalek ecosystem: b6e96e6 | (David Warring)++ | META.list:
02:58 dalek ecosystem: Add CSS::Declarations
02:58 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/b6e96e6080
02:59 cdg joined #perl6
03:09 mspo is there a reason to not just copy perl5 pack/unpack directly?
03:10 mspo I honestly don't know if there are issues with that or not
03:11 geekosaur it has its weirdnesses, and perl 6 has a richer type ecosystem to feed from/to it
03:12 geekosaur in particular, anything involving strings is going to be difficult to replicate between p5 and p6
03:13 mspo I'm looking to do network protocol stuff; am I looking in the wrong place?
03:13 mspo I need to write a bunch of 16bit messages
03:13 geekosaur you might want to skip pack/unpack and use buf16
03:14 mspo erlang might be good to copy here
03:14 mspo fwiw
03:15 mspo yeah suppose so
03:18 baest joined #perl6
03:20 noganex joined #perl6
03:21 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:22 mspo udp was added to io::socket::async
03:22 mspo but no icmp or raw or even a way to access/use the lower-level socket stuff
03:23 BenGoldberg Well, unless you're writing your own traceroute, you're probably not likely to need icmp, hmm?
03:26 mspo that's not much of a claim for a "general purpose" language ;)
03:26 mspo I find arbitrary restrictions very upsetting
03:27 BenGoldberg Not implemented yet isn't an arbitrary restriction.
03:27 BenGoldberg Well, it is, sorta, but only because some things are higher priority than others.
03:30 solarbunny joined #perl6
03:30 SourceBaby joined #perl6
03:30 Undercover joined #perl6
03:30 dalek joined #perl6
03:30 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:41 cibs joined #perl6
03:43 xtreak joined #perl6
03:49 cognominal joined #perl6
04:11 pierre_ joined #perl6
04:17 cognominal joined #perl6
04:37 Actualeyes joined #perl6
04:41 pyrimidine joined #perl6
04:48 xtreak joined #perl6
05:08 pierre_ joined #perl6
05:19 Actualeyes joined #perl6
05:27 xinming_ joined #perl6
05:42 pyrimidine joined #perl6
05:45 pierre_ joined #perl6
05:56 pyrimidine joined #perl6
05:58 Cabanossi joined #perl6
06:18 xtreak joined #perl6
06:19 pyrimidine joined #perl6
06:20 flaviusb joined #perl6
06:27 bjz joined #perl6
06:33 _28_ria joined #perl6
06:34 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]]␤»
06:34 Hotkeys m: my @foo = [0, 0]; my @bar; for 1..4 { @foo Z+= [0, 1]; @bar.push(@foo.Array); }; say @bar
06:34 camelia rakudo-moar 40d80c: OUTPUT«[[0 1] [0 2] [0 3] [0 4]]␤»
06:34 Hotkeys what exactly is going on here ^
06:35 Hotkeys why shouldn't the first one work like the second
06:35 Hotkeys (and why does the second work?)
06:36 darutoko joined #perl6
06:38 ZzZombo joined #perl6
06:39 CIAvash joined #perl6
06:39 cibs joined #perl6
06:45 Cabanossi joined #perl6
06:46 darutoko- joined #perl6
06:47 sjn__ joined #perl6
06:47 jargan joined #perl6
06:47 bhm_ joined #perl6
06:48 [Coke]_ joined #perl6
06:48 seatek my @foo = [0, 0]; my @bar; for 1..4 { @foo Z+= [0, 1]; @bar.push(|@foo); }; say @bar;
06:48 seatek m: my @foo = [0, 0]; my @bar; for 1..4 { @foo Z+= [0, 1]; @bar.push(|@foo); }; say @bar;
06:48 camelia rakudo-moar 40d80c: OUTPUT«[0 1 0 2 0 3 0 4]␤»
06:51 felher_ joined #perl6
06:51 domidumont joined #perl6
06:51 spidermario joined #perl6
06:54 RabidGravy joined #perl6
06:55 cgfbee joined #perl6
06:56 domidumont joined #perl6
06:58 krakan joined #perl6
06:58 dontbe^2 joined #perl6
07:00 bjz joined #perl6
07:01 pyrimidine joined #perl6
07:05 pyrimidine joined #perl6
07:08 wamba joined #perl6
07:10 _28_ria joined #perl6
07:13 girafe joined #perl6
07:27 CIAvash joined #perl6
07:31 domidumont joined #perl6
07:40 xtreak joined #perl6
08:00 moritz gfldex: I've edited https://perl6advent.wordpress.com​/2016/12/05/how-to-use-the-docs/ it showed sub trait_mod:(....), I guess the HTML editor swalled an <is> there
08:01 moritz gfldex: please check for correctness
08:06 lizmat moritz: also: first line: s/everyting/everything/
08:06 lizmat &
08:08 moritz lizmat: fixed, thanks
08:12 ufobat joined #perl6
08:15 dp[m] joined #perl6
08:15 ilmari[m] joined #perl6
08:15 M-Illandan joined #perl6
08:23 ufobat good morning :)
08:29 cgfbee joined #perl6
08:31 ilogger2 joined #perl6
08:32 abraxxa joined #perl6
08:33 Technaton joined #perl6
08:34 nebuchadnezzar joined #perl6
08:37 dontbe^2 joined #perl6
08:42 abraxxa joined #perl6
08:43 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:49 moritz Technaton: ok, a few points
08:49 moritz Technaton: first, you're assigning a default value, you're not making a type constraint
08:49 moritz Technaton: second, attributes aren't type-check at compile time
08:50 moritz 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␤␤»
08:51 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␤␤»
08:51 moritz m: sub f(&x:($, $)) { x(1, 2) }; say f(-> $a, $b { $a + $b })
08:51 camelia rakudo-moar 6fafbf: OUTPUT«3␤»
08:51 moritz m: sub f(&x:($, $)) { x(1, 2) }; say f(-> $a { $a + $a })
08:51 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␤␤»
08:52 moritz Technaton: ^^ maybe try to apply this for attribute types as well?
08:52 g4 joined #perl6
08:53 [ptc] moritz: also:  s/over the all the pages/over all the pages/  in the second line
08:53 [ptc] moritz: also s/be come/become/
08:54 Technaton moritz: I.e., supplying a setter that enforces the constraint, is that what you're suggesting?
08:55 moritz Technaton: no
08:55 Technaton :(
08:55 moritz Technaton: I'd suggest you try the same syntax as I did in my example above
08:55 moritz [ptc]: I didn't write it! :-)
08:56 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 }␤»
08:56 moritz :(
08:57 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␤»
08:57 psch m: class A { has &.foo where *.signature ~~ :($,$ --> Num) };
08:57 camelia rakudo-moar 6fafbf: ( no output )
08:57 Technaton Sorry, I don't get it. Is "&x:($, $)" a vild type?
08:57 psch it parses if you put a signature there
08:57 psch m: class A { has &.foo where *.signature ~~ :($,$ --> Num) };  # but it doesn't match nominally
08:57 camelia rakudo-moar 6fafbf: ( no output )
08:57 moritz psch: thanks
08:57 psch m: class A { has &.foo where *.signature ~~ :($,$ --> Num) }; A.new: foo => sub ($, $ --> Num) { } #
08:57 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␤␤»
08:57 Technaton psch: But that's a run-time check, right?
08:57 psch ^^^ that doesn't match nominally
08:57 moritz psch: even in the subroutine case it's not a normal type check
08:57 moritz Technaton: it always is
08:58 d4l3k_ joined #perl6
08:58 * Technaton is confused.
08:58 moritz Technaton: as I said earlier, attribute type checks are runtime
08:58 moritz and constraint time checks also
08:58 moritz Perl 6 isn't Haskell :-)
08:59 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?
08:59 psch +type
08:59 moritz Technaton: that's correct
09:00 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:01 rindolf joined #perl6
09:01 amalia_ joined #perl6
09:01 arnsholt The compiler tries to evaluate as many type checks as possible at compile-time, but it's specced to be run-time
09:02 [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"?
09:02 arnsholt So only cases where the run-time types can be inferred at compile-time can actually be evaluated at compile-time
09:02 [ptc] moritz: I'm pedantic; you should know that by now :-P
09:02 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
09:03 arnsholt Meaning that all the code manipulating foo can treat the fact that it's an Int as an invariant
09:03 solarbunny joined #perl6
09:03 masak Technaton: what arnsholt said -- I've actually added such type annotations during debugging, and got an earlier/better exception.
09:03 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.
09:03 Technaton Okay.
09:03 Technaton I see.
09:03 arnsholt Yeah, what masak said
09:04 jonas2 joined #perl6
09:04 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.
09:04 Technaton s/was/is/
09:04 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
09:04 masak which means you now know (thanks, stack trace) which "call site"/consumer disrespects the type restriction
09:05 shadowpaste0 joined #perl6
09:06 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.
09:06 arnsholt If it's a fatal error, you actually *want* it to percolate up to the top-level and cause an explosion
09:06 masak arnsholt: almost as if exceptions should only be used in... exceptional circumstances
09:06 masak :P
09:07 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
09:07 masak arnsholt: when (occasionally) I deliver a Java course, I let the participants know very clearly that this is not acceptable
09:09 Technaton Thanks, masak, arnsholt, psch! :)
09:10 arnsholt masak: Yeah, my first trauma from that was Java code that basically did "try { code() } catch (Exception e) { /* Nope! */ }"
09:10 arnsholt Complicated debugging tremendously
09:10 bjz joined #perl6
09:10 psch m: class A { has $.foo where { .signature ~~ :($,$) }; }; A.new: foo => sub ($, $) { } # hm
09:10 camelia rakudo-moar 6fafbf: ( no output )
09:10 psch not sure why the &-sigil messes that up
09:10 psch m: class A { has &.foo where { .signature ~~ :($,$) }; }; A.new: foo => sub ($, $) { } #
09:10 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␤␤»
09:10 [ptc] m: { class A::B::A {}; }; role A::B::C {}; class A::B { has A::B::C $!foo; };
09:10 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; };␤␤»
09:11 [ptc] m: class A::B::A {}; role A::B::C {}; class A::B { has A::B::C $!foo; };
09:11 camelia rakudo-moar 6fafbf: ( no output )
09:11 arnsholt psch: Do you get the same error if you have the & sigil but not the where clause?
09:11 psch m: class A { has &.foo; }; A.new: foo => sub ($, $) { } #
09:11 camelia rakudo-moar 6fafbf: ( no output )
09:12 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..?
09:13 psch m: my &x where { .arity > 2 }; say &x.VAR.^name
09:13 camelia rakudo-moar 6fafbf: OUTPUT«Scalar␤»
09:13 psch m: my &x where { .arity > 2 }; say &x.VAR.of
09:13 camelia rakudo-moar 6fafbf: OUTPUT«(Callable[<anon>])␤»
09:13 arnsholt Oh, yeah that's probably it
09:13 arnsholt It gets annotated with a subtype of Callable, but Sub is a subtype of Callable in a different branch of the type graph
09:14 arnsholt Maybe?
09:14 arnsholt I'm not overly familiar with the workings of the parametric stuff
09:15 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"; ␤»
09:15 Technaton m: my $a = "foo"; my @b = ( \($a) ); $a = "bar"; say $(@b[0]);
09:15 camelia rakudo-moar 6fafbf: OUTPUT«\("bar")␤»
09:15 Technaton m: my $a = "foo"; my @b = ( \$a ); $a = "bar"; say $(@b[0]);
09:15 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…»
09:15 Technaton hm
09:16 Technaton How can I store references to objects in an array?
09:16 psch Technaton: infix:<=>
09:17 psch oh wait
09:17 psch that's the other way around
09:17 psch you want to point @b[0] at $a
09:17 psch m: my $a = "foo"; my @b; @b[0] := $a; $a = "bar"; say $(@b[0]);
09:17 camelia rakudo-moar 6fafbf: OUTPUT«bar␤»
09:17 psch m: my $a = "foo"; my @b; @b[0] := $a; $a = "bar"; say @b
09:17 camelia rakudo-moar 6fafbf: OUTPUT«[bar]␤»
09:18 psch ...i think? :)  not sure i understand the intention.  we've kind of tabood "reference" in Perl 6 docs and language
09:18 psch +e
09:22 dakkar joined #perl6
09:22 masak but not for the usual reasons
09:22 masak "length" is taboo'd because we consider it not informative enough
09:23 masak "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
09:24 arnsholt In Perl 6 everything's an object and can be used as such
09:28 solarbunny joined #perl6
09:30 pierre_ joined #perl6
09:30 Technaton arnsholt: So…
09:30 Technaton m: my $a = "foo"; my @b = ($a); $a = "bar"; say @b;
09:30 camelia rakudo-moar 6fafbf: OUTPUT«[foo]␤»
09:30 Technaton Hm
09:30 Technaton That seems to create a copy?
09:30 masak it does. assigning to an array copies.
09:31 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;
09:31 camelia rakudo-moar 6fafbf: OUTPUT«Str|foo␤Str|foo␤[foo]␤»
09:31 Technaton Str is just an object like every other, right? Its not depending on *what* I store in the array, is it?
09:31 arnsholt I think binding should do the trick in that case
09:31 masak but also, Str values are not considered references in the sense that Array or Hash values are.
09:31 psch m: my $a = "foo"; my @b = ($a); say @b[0].WHERE; say $a.WHERE; $a = "bar"; say @b;
09:31 camelia rakudo-moar 6fafbf: OUTPUT«139946012341080␤139946012341080␤[foo]␤»
09:31 masak hm, scratch that. while true, it's not why we're seeing the effect above. :)
09:32 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?
09:32 camelia rakudo-moar 6fafbf: OUTPUT«[bar]␤»
09:32 psch arnsholt: yeah, that what the Capture example by Technaton further above does under the hood
09:32 psch cause Captures are always binding
09:33 psch well, unless they're thrown into an is-copy Signature or somesuch vOv
09:34 arnsholt Oh, you even did the exact same snippet above =D
09:34 arnsholt Skim-reading fails again =)
09:34 Technaton :)
09:34 psch m: class A { has $.foo; method inc { $!foo += 1 } }; my $x = A.new: :1foo; my $y = $x; $x.inc; say $y.perl
09:34 camelia rakudo-moar 6fafbf: OUTPUT«A.new(foo => 2)␤»
09:34 Technaton So, what's the p6 equivalent of an array of references?
09:35 psch Technaton: for understanding i'd recommend https://docs.perl6.org/language/containers
09:35 psch Technaton: if you have a specific use-case that you're trying to figure out, ask about that
09:36 psch 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).
09:36 Technaton So, in p5, I'd start with "my @open = ( \$start_node );"
09:37 Technaton 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 giraffe joined #perl6
09:39 espadrine joined #perl6
09:39 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
09:40 Technaton No, A* doesn't change the node. I merely need an answer to the question "is node $foo part of @open"?
09:40 telex joined #perl6
09:40 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:41 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 =)
09:41 Technaton Okay, scratch @array, think Set. :)
09:41 ilmari[m] joined #perl6
09:42 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
09:42 camelia rakudo-moar 6fafbf: OUTPUT«Cannot modify an immutable Bool␤  in block <unit> at <tmp> line 1␤␤»
09:42 Technaton arnsholt: Okay, but that assumes I'd like to impose a certain API on the caller, right?
09:42 arnsholt Durr?
09:43 arnsholt 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.
09:43 arnsholt I'd probably make it a role client code can implement or something
09:44 Technaton Again, I'd like to avoid that.
09:44 Technaton As it is not necessary and imposes an API on the caller.
09:44 Technaton When the only thing I need is a predicate to return the neighbors of any $node.
09:44 arnsholt m: class Node { has $.visited is rw = False; }; my $n = Node.new; my @open = ($n); $n.visited = True; say @open[0].visited
09:44 camelia rakudo-moar 6fafbf: OUTPUT«True␤»
09:44 arnsholt There you go
09:45 Technaton So "@open = ($n)" does *not* copy...?
09:45 arnsholt It copies there reference stored in $n
09:45 arnsholt (Sort of)
09:45 tadzik joined #perl6
09:45 M-Illandan joined #perl6
09:45 Matthew[m] joined #perl6
09:46 masak those parens don't do anything in p6, by the way
09:46 dp[m] joined #perl6
09:46 Matias[m] joined #perl6
09:46 masak `@open = $n` and `@open = ($n)` mean the same thing
09:46 arnsholt True, true
09:46 Technaton m: class Node {}; my $n = Node.new; my @open = $n; say $n.WHERE; say @b[0].WHERE;
09:46 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;␤»
09:46 Technaton m: class Node {}; my $n = Node.new; my @open = $n; say $n.WHERE; say @open[0].WHERE;
09:46 camelia rakudo-moar 6fafbf: OUTPUT«140617112791128␤140617112791128␤»
09:47 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 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 arnsholt Next you store that reference in @b
09:48 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
09:48 psch binding is for making variables point at the same container
09:48 arnsholt Yeah. Just ignore binding entirely, for the time being
09:49 arnsholt 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?
09:49 arnsholt Yup
09:49 Technaton What would I do if I wanted to (deep-) copy $n?
09:49 arnsholt So changes to the *object* will propagate as you'd expect
09:49 Technaton (Just to get to know the difference.)
09:50 arnsholt For a shallow there's $n.clone
09:51 yyy joined #perl6
09:51 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:52 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 jnthn m: class A { }; my $o = A.new; say $o.WHERE; say $o.WHERE; for ^10000 { A.new }; say $o.WHERE
09:52 camelia rakudo-moar 6fafbf: OUTPUT«140471516726200␤14047​1516726200␤140471487973976␤»
09:53 arnsholt Yay garbage collection =D
09:54 Technaton arnsholt: Thanks a bunch!
09:54 rindolf joined #perl6
09:55 Technaton jnthn: Oh. So... Mu.WHICH?
09:55 Technaton : class A { }; my $o = A.new; say $o.WHICH; say $o.WHICH; for ^10000 { A.new }; say $o.WHICH
09:55 jnthn Yes, that'd be wider
09:55 jnthn *wiser
09:55 Technaton m: class A { }; my $o = A.new; say $o.WHICH; say $o.WHICH; for ^10000 { A.new }; say $o.WHICH
09:55 camelia rakudo-moar 6fafbf: OUTPUT«A|59187392␤A|59187392␤A|59187392␤»
09:55 Technaton Cool.
09:55 jnthn That gets an ID that stays the same over an object's lifetime
09:55 Technaton Thanks a bunch! :)
09:56 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 #perl6
09:56 arnsholt If your code starts calling stuff like WHICH, consider whether you're approaching the problem in the optimal way
09:57 brillenfux joined #perl6
09:57 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 :)
09:57 jnthn *read
09:57 jnthn Gah, what's with my typing today...
09:57 arnsholt And even then I suspect you'd be better served by something like $a ~~ AType, since checking .WHAT directly ignores subtypes and such
09:58 jnthn Yup
09:58 CIAvash joined #perl6
09:59 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 arnsholt Is that expected parametric stuff, or a bug?
10:00 jnthn Well, Callable[Foo] would expect the sub to also do Callable[Foo] (implying the sub returns a Foo)
10:00 jnthn Well, is constrained to
10:00 zilti joined #perl6
10:01 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␤␤»
10:01 psch ^^^ is the actual example btw
10:01 jnthn Uh...that Callable[anon] looks...dubious
10:02 jnthn 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
10:02 jnthn m: my &f where { .signature ~~ :($, $) }; say &f.VAR.of
10:02 camelia rakudo-moar 6fafbf: OUTPUT«(Callable[<anon>])␤»
10:02 jnthn m: my &f where { .signature ~~ :($, $) }; say &f.VAR.of.HOW.^name
10:02 camelia rakudo-moar 6fafbf: OUTPUT«Perl6::Metamodel::CurriedRoleHOW␤»
10:02 jnthn wat
10:03 jnthn 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␤␤»
10:03 jnthn m: my $f where { .signature ~~ :($, $) }; say $f.VAR.of
10:03 camelia rakudo-moar 6fafbf: OUTPUT«(<anon>)␤»
10:03 jnthn m: my $f where { .signature ~~ :($, $) }; say $f.VAR.of.HOW.^name
10:03 camelia rakudo-moar 6fafbf: OUTPUT«Perl6::Metamodel::SubsetHOW␤»
10:03 jnthn That's what I'd expect in the first case too
10:03 arnsholt 's odd
10:03 jnthn e.g. it constructs a subset type based off Callable, refined with the sig constraint
10:03 jnthn Not somehow parameterizes it o.O
10:03 arnsholt So somehow there's special logic handling & sigil with where clause?
10:04 jnthn So yeah, that goes down as compiler buglet.
10:04 jnthn arnsholt: Either that or there isn't and should be :P
10:04 arnsholt =D
10:05 zilti joined #perl6
10:09 kurahaupo__ joined #perl6
10:16 zilti joined #perl6
10:18 kurahaupo__ joined #perl6
10:24 ssm joined #perl6
10:28 wamba joined #perl6
10:36 andrewalker joined #perl6
10:37 zilti joined #perl6
10:38 mscha joined #perl6
10:39 cpage joined #perl6
10:41 kurahaupo` left #perl6
10:42 kurahaupo joined #perl6
10:42 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 #perl6
10:57 zilti joined #perl6
11:00 zilti joined #perl6
11:05 zilti joined #perl6
11:09 zilti joined #perl6
11:09 babydrop Perl 6 2016 Advent – Day 5 – "How to use the docs": https://perl6advent.wordpress.com​/2016/12/05/how-to-use-the-docs/
11:10 jnthn multi sub trait_mod: (Sub $s, :$foo!) is foo {
11:10 jnthn Looks like the HTML monster got hungry again...
11:11 zilti joined #perl6
11:18 zilti joined #perl6
11:24 moritz eeks
11:25 timotimo jesus holy christ, this is the worst damn thing in the history of things
11:27 dogbert17 o/
11:27 babydrop :)
11:28 dogbert17 hi babydrop
11:28 babydrop I guess one thing we found out is Perl 6 folks aren't web devs :)
11:29 dogbert17 the IO::Notification.watch-path example on https://docs.perl6.org/type​/IO$COLON$COLONNotification doesn't really check for events in the current directory does it?
11:29 dogbert17 if find the use of $?FILE suspicious to say the least
11:30 babydrop PSA: We need more writers. 8 spots still available. Add yourself to schedule: https://github.com/perl6/mu/blob/ma​ster/misc/perl6advent-2016/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:31 ggoebel joined #perl6
11:32 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 yyy joined #perl6
11:32 babydrop tadzik: where did you hear that anyway?
11:33 tadzik babydrop: I'm pretty sure it was this channel, about 5 years ago :)
11:33 babydrop heh
11:36 Xliff joined #perl6
11:37 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␤»
11:37 Xliff m: my $a; do { $a = 1 unless $a.defined; say $a; $a++ } unless $a.defined && $a == 4;
11:37 camelia rakudo-moar b96bf5: OUTPUT«1␤»
11:37 Xliff m: my $a; do { $a = 4 unless $a.defined; say $a; $a++ } unless $a.defined && $a == 4;
11:37 camelia rakudo-moar b96bf5: OUTPUT«4␤»
11:38 Xliff m: my $a; do while $a.defined && $a == 4 { $a = 1 unless $a.defined; say $a; $a++ }
11:38 camelia rakudo-moar b96bf5: ( no output )
11:38 babydrop m: my $a; $a //= 4; say $a
11:38 Xliff m: my $a; do while ($a.defined && $a < 4) { $a = 1 unless $a.defined; say $a; $a++ }
11:38 camelia rakudo-moar b96bf5: OUTPUT«4␤»
11:38 camelia rakudo-moar b96bf5: ( no output )
11:39 dalek doc: 1cc464c | (Jan-Olof Hendig)++ | doc/Type/IO/Notification.pod6:
11:39 synopsebot6 Link: http://doc.perl6.org/type/IO/Notification
11:39 dalek doc: Changed use of 0FILE to CWD
11:39 dalek doc: review: https://github.com/perl6/doc/commit/1cc464cece
11:39 jnthn Xliff: What are you trying to figure out?
11:39 Xliff m: my $a; do while ($a.defined && $a < 4) { say $a; $a = ($a // 1)++ }
11:39 camelia rakudo-moar b96bf5: ( no output )
11:39 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`
11:39 Xliff m: my $a = 1; do while ($a.defined && $a < 4) { say $a++; }
11:39 camelia rakudo-moar b96bf5: OUTPUT«1␤2␤3␤»
11:39 Xliff That's what I was trying to remember.
11:40 jnthn ah :)
11:40 Xliff Too tired to look at docs. It was easier to play with camelia.
11:40 jnthn `do` never means anything more than "pretend that this statement is an expression"
11:40 Xliff I mean that in the most innocent sense. :P
11:40 Xliff Oh. Thanks for that mneumonic.
11:40 babydrop Xliff: well, she supports /msg and there is also #zofbot
11:41 Xliff I don't want to play with anything that starts with <z o f>
11:41 Xliff Bad things happen.
11:41 babydrop you will be assimilated
11:41 babydrop resistance is futile
11:41 Xliff Dammit I was going there.
11:41 Xliff patience is unnecessary
11:42 Xliff Now I go back to lurking.
11:42 Xliff BTW - Any luck with my RT'd bugs?
11:42 babydrop your RT bugs?
11:42 babydrop which
11:44 babydrop "Re: Purchase Order 20161204DF" that one? :)
11:44 Xliff Hard to find. RT is a pain in the ass!
11:44 jfuller_ joined #perl6
11:44 jfuller joined #perl6
11:44 babydrop Xliff: find on http://perl6.fail/
11:44 Xliff https://rt.perl.org/Ticket/Display.html?id=129109
11:44 Xliff https://rt.perl.org/Public/​Bug/Display.html?id=130095
11:46 Xliff Ooh! A useful, but butt-ugly work around for the first.
11:46 Xliff I may circle back to that.
11:48 babydrop Well, I can tell why few would want to fix the second one...
11:49 babydrop You offer them an unknown codebase to download and run in hopes of finding some bug.
11:49 babydrop 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.
11:50 babydrop 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.
11:50 Xliff I've tried.
11:50 babydrop Xliff: but you can comment out XML::LibXML, right?
11:50 Xliff So rather than waste time on that, I posted what I could.
11:50 Xliff Yes.
11:51 Xliff Figured it's a bug, so incomplete but informative is better than none at all.
11:51 Xliff I hope I wasn't mistaken in that assumption.
11:51 babydrop Xliff: sure. It is.
11:52 babydrop But the fastness with which it will be fixed is reduced :)
11:52 Xliff Fair enough.
11:53 Xliff Now.... to nap.
12:00 pierre_ joined #perl6
12:09 wamba joined #perl6
12:10 yoleaux joined #perl6
12:11 CIAvash joined #perl6
12:20 user9 joined #perl6
12:20 _28_ria joined #perl6
12:27 iH2O joined #perl6
12:31 ZzZombo_ joined #perl6
12:36 iH2O left #perl6
12:38 sufrostico joined #perl6
12:42 yoleaux joined #perl6
12:44 canopus joined #perl6
12:49 pierre_ joined #perl6
13:15 noviceBob joined #perl6
13:17 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␤␤»
13:18 noviceBob what's wrong?
13:20 babydrop The <-Q>+ bit, though I'm unsure what's the right way to write it
13:22 ufobat is there a way to call foo, without creating a my Str @variable first?
13:22 ufobat 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)
13:22 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␤␤»
13:22 masak m: q["cat","dog"] ~~ m:g/'"' ~ '"' <-["]>+/; say $/
13:22 camelia rakudo-moar b96bf5: OUTPUT«(「"cat"」 「"dog"」)␤»
13:22 masak noviceBob: ^
13:23 babydrop masak: but how to do that with tokens?
13:23 masak well, you can place anything there in the place of '"' and <-["]>+
13:24 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 => 「"」)␤»
13:24 babydrop masak: the original code showed that's not the case. <-Q>+ doesn't work
13:24 babydrop and seems making the tokens non-capturing (/<.Q><A><.Q>/) also fails
13:25 DrForr m: my regex Q { <["]> }; my regex Foo { <!Q>+ };
13:25 camelia rakudo-moar b96bf5: ( no output )
13:25 babydrop That hangs in the original code
13:27 yoleaux joined #perl6
13:28 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
13:28 jnthn The lexical fallback is also something I sometimes question whether we should have done...but <foo=&foo> would probably have gotten old fast.
13:30 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 #perl6
13:30 jnthn ufobat: Array[Str].new(<a b c>)
13:31 ufobat ah!
13:34 CIAvash joined #perl6
13:34 pierre_ joined #perl6
13:45 AlexDaniel joined #perl6
13:45 wamba joined #perl6
13:53 abraxxa joined #perl6
13:57 moritz m: my token foo { . }; say 'a' ~~ /<foo>/
13:57 camelia rakudo-moar b96bf5: OUTPUT«「a」␤ foo => 「a」␤»
13:58 moritz huh, somehow the lexical fallback didn't work last I tried it
13:59 abraxxa joined #perl6
14:06 cdg joined #perl6
14:11 cdg joined #perl6
14:20 dalek doc: 62acb6f | coke++ | doc/Type/Hash.pod6:
14:20 synopsebot6 Link: http://doc.perl6.org/type/Hash
14:20 dalek doc: Fix spelling error
14:20 dalek doc: review: https://github.com/perl6/doc/commit/62acb6f934
14:20 dalek doc: 68c736b | coke++ | doc/Type/Hash.pod6:
14:20 dalek doc: remove trailing whitespace
14:20 synopsebot6 Link: http://doc.perl6.org/type/Hash
14:20 dalek doc: review: https://github.com/perl6/doc/commit/68c736be36
14:32 espadrine joined #perl6
14:37 cdg_ joined #perl6
14:37 [Coke] (two CREDITS) AHAHAHAHAHAAHAHAHAHAHAHAHA
14:38 [Coke] As the guy who compiled most of the Christmas thank you list, there were a lot more than two lists. :)
14:42 [Coke] 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:45 cibs joined #perl6
14:48 prammer joined #perl6
14:49 jjatria joined #perl6
14:51 [Coke] bdf repots:
14:51 [Coke] *reports;
14:51 [Coke] I just noticed in another editor that the Perl 6 Advent wordpress
14:51 [Coke] setup replaces HTML escapes when it populates the edit window. Things
14:51 [Coke] that were &lt; become literal < again. Odd.
14:52 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:53 babydrop And if I type it into HTML first, same story, but they disappear in different order.
14:54 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?
14:54 timotimo the one for the advent calendar is hosted by wordpress itself
14:54 timotimo i don't think we have a say in updating vs not updating
14:55 babydrop Right
14:55 babydrop wow, object hashes post was viewed 1,500 times
14:55 * babydrop didn't realize so many people read this stuff
14:55 ufobat joined #perl6
14:56 timotimo we have a surprisingly big readership, that's true
14:56 timotimo it's been surprisingly big for a couple of years already :)
15:04 skids joined #perl6
15:04 xinming joined #perl6
15:04 [Coke] how much of tht 1500 is us going to the main page each day to check stats? ;)
15:04 [Coke] gfldex: You have the same <> problem that befell me and bdf.
15:05 [Coke] 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
15:05 masak but it's years ago and I forgot where I put it
15:05 babydrop [Coke]: surely the minority
15:06 babydrop It's the first time I did it this year, for example.
15:07 [Coke] where do you see object hashes was viewed 1500 times? I see an eye icon with a 273 next to it..
15:08 khw joined #perl6
15:08 [Coke] day 2 is the biggest so far with 1,036 by that stat.
15:09 [Coke] christmas announcement topped out at 10,790
15:09 [Coke] we currently have NO scheduled posts ready to go.
15:09 [Coke] crap, it keeps switching to "ME" instead of "EVERYONE". day 6 is queued up...
15:09 babydrop We do
15:10 babydrop .oO( how many of those 1500 is [Coke] struggling with the UI :P )
15:10 babydrop [Coke]: it's inm the WP Admin page: http://i.imgur.com/mY8apIX.png
15:11 [Coke] so why would they give two completely different stats?
15:11 * masak gives it another hit: https://perl6advent.wordpress.com​/2016/12/03/day-3-object-hashes/
15:12 [Coke] babydrop: I think those are the stats for the DAY not the post on that day.
15:12 [Coke] the stats per post are below.
15:12 [Coke] (day 2, day1, day 3)
15:12 [Coke] so if someone looked at day 2 on december 3, that'd go into your graph you're mousing over.
15:16 alimon1 joined #perl6
15:20 * [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:22 mst finding advent authors is always a PITA
15:22 mst (I've spent november running around trying to volunteer people for other projects before now)
15:22 AlexDaniel huggable: advent
15:22 huggable AlexDaniel, https://github.com/perl6/mu/blob/ma​ster/misc/perl6advent-2016/schedule
15:23 AlexDaniel MasterDuke: write something!
15:23 AlexDaniel :)
15:23 babydrop mst: did you see the harassment from AlexDaniel?
15:23 [Coke] mst: care to write an article detailing your adventures trying to build rakudo for cpan? :)
15:23 AlexDaniel mst: hey!
15:24 AlexDaniel mst: you did not reply the last time, so I thought I'll wait until I see you here… :)
15:24 AlexDaniel babydrop: thanks for reminding!
15:24 AlexDaniel mst: so how is it going?
15:24 AlexDaniel mst: any news?
15:24 mst AlexDaniel: I was at LPW over the weekend
15:24 mst will try and poke people later today
15:25 AlexDaniel mst: good to hear!
15:25 AlexDaniel thanks for your effort :)
15:29 AlexDaniel .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 #perl6
15:30 [Coke] or samcv++
15:38 zakharyas joined #perl6
15:38 babydrop AlexDaniel: do you live in North America?
15:39 AlexDaniel babydrop: no, why?
15:39 babydrop Nothing... just writing code examples in the blog :)
15:39 babydrop s/blog/advent/;
15:39 AlexDaniel babydrop: I live in Estonia (Europe!)
15:40 [Coke] "if coffee then coffee do coffee more coffee else coffee" -wilw
15:41 AlexDaniel u: COFFEE
15:41 unicodable6 AlexDaniel, Found nothing!
15:41 AlexDaniel
15:41 AlexDaniel u: hot beverage
15:41 unicodable6 AlexDaniel, U+2615 HOT BEVERAGE [So] (☕)
15:43 AlexDaniel u: TEA
15:43 unicodable6 AlexDaniel, U+2722 FOUR TEARDROP-SPOKED ASTERISK [So] (✢)
15:43 unicodable6 AlexDaniel, U+273B TEARDROP-SPOKED ASTERISK [So] (✻)
15:43 unicodable6 AlexDaniel, U+273C OPEN CENTRE TEARDROP-SPOKED ASTERISK [So] (✼)
15:43 unicodable6 AlexDaniel, https://gist.github.com/28a3​5c1b6ee14e1bb011e8834f305bc3
15:43 AlexDaniel u: BEER
15:43 unicodable6 AlexDaniel, U+1F37A BEER MUG [So] (🍺)
15:43 unicodable6 AlexDaniel, U+1F37B CLINKING BEER MUGS [So] (🍻)
15:44 AlexDaniel I'll never understand the logic behind this
15:45 babydrop Drunk people are more persistent at bugging Unicode Consortium? :)
15:46 jnthn The Unicode consortium drink more beer than tea/coffee? :)
15:46 diakopter joined #perl6
15:47 AlexDaniel u: drink
15:47 unicodable6 AlexDaniel, U+1F379 TROPICAL DRINK [So] (🍹)
15:48 AlexDaniel u: sake
15:48 unicodable6 AlexDaniel, U+16877 BAMUM LETTER PHASE-B SAKEUAE [Lo] (𖡷)
15:48 unicodable6 AlexDaniel, U+1F376 SAKE BOTTLE AND CUP [So] (🍶)
15:49 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 babydrop mkaythen
15:49 timotimo that's unfortunate
15:49 AlexDaniel immutable SetHash? xD
15:49 jnthn I suspect it's just that nobody implemented STORE on [Set|Bag|Mix]Hash yet...
15:50 timotimo that sounds like the cause
15:50 jnthn Though note that given it's a % thingy, it wants to treat its RHS pairy
15:50 jnthn (Which is more obvious for Bag/Mix)
15:50 kurahaupo__ so not intentionally "value types"?
15:51 timotimo right, *Hash is what you use for mutable stuff
15:51 jnthn SetHash is already mutable, it doesn't doesn't implement STORE
15:51 jnthn But you can assign to individual elements
15:51 ab6tract joined #perl6
15:53 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 ab6tract in that it is completely unexpected and led me down all sorts of wrong assumptions that my code was broken
15:53 ab6tract i don't know if you have time, but there are details here:
15:53 ab6tract https://github.com/rakudo/rakudo/pull/934
15:54 ab6tract 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:55 ab6tract 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?
15:55 ab6tract note that i do not even use this new initialized mix
15:56 ab6tract 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)
15:56 ab6tract is what reminded me of the previous bug
15:56 ab6tract jnthn: i'm talking about the seg fault from creating a hash inside of a thread
15:57 [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␤␤»
15:57 ab6tract which was solved by pre-declaring the has keys prior to using them in the thread
15:57 jnthn Oh...maybe it was the rope string key thing, but that one got fixed a while ago.
15:57 [Coke] m: IO::Path.^methods.say
15:57 camelia rakudo-moar 6e7f97: OUTPUT«(FALLBACK gist new)␤»
15:57 ab6tract jnthn: i understand that
15:57 babydrop ab6tract: but the error talks about getting a Rat instead of an Int not about anything uninitialized
15:57 ab6tract i am trying to get feedback on a different bug which is solved in the same fashion
15:57 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
15:58 ab6tract babydrop: and yet.. creating the mix beforehand (even if that mix is not used, the code does not need to change)
15:58 ab6tract ok, well. i give up
15:58 babydrop That was fast :)
15:58 ab6tract yesterday i had two different heisenbugs
15:58 eliasr joined #perl6
15:58 babydrop Quitter! :)
15:58 ab6tract well
15:58 ab6tract i don't feel much like sticking around
15:59 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?
15:59 ab6tract babydrop: because i encounter heisenbugs like this almost every day
15:59 [Coke] non doc issue: why is it SPEC and not Spec?
15:59 timotimo ab6tract: :( :(
15:59 timotimo sorry to hear that
16:00 ab6tract https://github.com/rakudo/rakudo/pull/934/co​mmits/a578e7b690f6970d545ec252bc45901050dfee​9f#diff-ec15a255a5bd0a668ea531ad7708b327R303
16:00 ab6tract here is one of them
16:00 ab6tract @p.first(Mixy) and @p.grep({ nqp::istype($_, Mixy) }) are not true for the same inputs in boolean context
16:01 babydrop That one reminds me of the bug about smartmatching against a role
16:01 sufrostico joined #perl6
16:01 timotimo i didn't know we had that
16:01 timotimo but yeah, one of those is a smart-match, the other is custom code
16:01 ab6tract and this other one which is blocking my PR, which is literally
16:01 babydrop timotimo: https://rt.perl.org/Ticket/Displ​ay.html?id=129957#ticket-history
16:02 ab6tract timotimo: that does not imply to me that they should ever be different
16:02 ab6tract in boolean context
16:02 timotimo oh yikes
16:02 prammer joined #perl6
16:02 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:03 ab6tract 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
16:03 ab6tract if it is true that i can break the Mix coercer by editing set_operators.pm
16:03 ab6tract please
16:03 timotimo one thing about your first and grep thing
16:03 ab6tract just check that PR
16:03 timotimo when you .first, you get the value
16:04 timotimo 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 timotimo when you use grep, you'll get your booleanness from whether there are results or not
16:04 ab6tract timotimo: very good point
16:04 timotimo that might just be your problem for that one
16:04 timotimo so you'll want "if defined first(...)"
16:05 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?
16:05 babydrop It fails here: https://github.com/rakudo/rakudo​/blob/nom/src/core/Baggy.pm#L20
16:05 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
16:06 ab6tract that failure is literally resolved in the same way i describe in that tickety
16:06 ab6tract by initializing that mix into a variable beforehand
16:06 ab6tract i do not reuse the variable
16:06 babydrop To me that sounds more like covering up a bug than resolving anything TBH
16:06 ab6tract but it stops that failture
16:06 ab6tract i'm not trying to say that this resolves anything
16:07 ab6tract i'm trying to highlight that there is a breakage there
16:07 babydrop OK. So let's find it.
16:07 ab6tract i don
16:08 ab6tract i don't have the tuits
16:08 ab6tract and i am way too frustrated by other factors today
16:08 user9 joined #perl6
16:10 ab6tract what is the else form of with? elswith?
16:10 babydrop orelse
16:11 babydrop 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␤»
16:11 babydrop m: say (42 orelse 5)
16:11 camelia rakudo-moar 6e7f97: OUTPUT«42␤»
16:11 babydrop m: say (0 orelse 5)
16:11 camelia rakudo-moar 6e7f97: OUTPUT«0␤»
16:11 babydrop m: say (Any orelse 5)
16:11 camelia rakudo-moar 6e7f97: OUTPUT«5␤»
16:11 babydrop nevermind. It's more of a looser //
16:11 jnthn orwith
16:13 * babydrop didn't even know we had that
16:13 babydrop ab6tract: so you don't have tuits, but you're upset the reviewer is not interested in chasing that bug? :)
16:14 TimToady the final one is just plain 'else'
16:14 TimToady but you can intermix 'elsif' with 'orwith'
16:14 [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.
16:15 TimToady we need both kinds of people :)
16:15 TimToady just one of 'em is in short supply at the moment
16:15 ab6tract babydrop: the reviewer's never acknowledged the chance of a bug that was not directly caused by my code
16:16 ab6tract 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.
16:16 ab6tract so actually, that decreases my desire
16:16 babydrop ab6tract: what example?
16:17 ab6tract initialize
16:17 ab6tract the mix first
16:17 babydrop The + my $tm = %(blood => 2.1, love => 2.2, rhetoric => 1).Mix; ?
16:17 ab6tract yes
16:17 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.
16:17 japhb I've personally hit this a number of times.
16:17 ab6tract japhb: most certainly
16:17 ab6tract and i am at that wall myself
16:17 ab6tract i spent my whole day chasing this around
16:18 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)
16:18 ab6tract as i said, i have other frustrations today
16:19 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"
16:19 ab6tract anyway, thank you babydrop for looking at it
16:19 ab6tract and sorry for being frustrated today
16:19 ab6tract i will see you all later on
16:20 TimToady ciao
16:21 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 perlpilot s/had/has/
16:21 babydrop I thought gfldex fixed that
16:21 moritz I fixed it once this morning, but it seems to be broken again
16:22 moritz maybe others are lucker than I am
16:22 gfldex wordpress really wants us to go someplace else
16:22 TimToady wp is notorious for letting you fix one thing and breaking something else when you do...
16:22 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.
16:23 TimToady I think he wandered off for a breather
16:25 itcharlie1 joined #perl6
16:28 ab6tract joined #perl6
16:28 ab6tract i did wander off for a breather
16:29 ab6tract but i can't help myself with backlogging sometimes ;)
16:29 ab6tract babydrop: so that is very interesting behavior..
16:30 ab6tract this version passes for me https://github.com/perl6/roast/pull/187/file​s#diff-ad4b1045eb13d7754166b8ce731671e5R193
16:31 TimToady "interesting behavior" is a common failure mode of certain president elects as well
16:31 TEttinger joined #perl6
16:31 ab6tract in the Chinese curse sense of the word
16:31 ilmari 'presidents elect', no? like 'attorneys general'?
16:31 TimToady well, certainly the Chinese are feeling cursed about now :)
16:32 babydrop ab6tract: and for me it fails on a different test than what the comment in that diff says
16:32 babydrop This one crashes: is ([(+)] bag(), $m), $m, "Mix sum reduce with an empty bag should be the value of the mix (Texas)";
16:32 ab6tract yeah that comment is out of date
16:32 babydrop But if I run it in isolation it passes
16:33 ab6tract yeah, i was seeing that too.
16:33 CIAvash joined #perl6
16:34 ab6tract (that it works in isolation)
16:35 ab6tract bizarre
16:35 ab6tract babydrop: don't worry about it unless it interests you. maybe we can pick it up again some other time?
16:35 ab6tract for now it is about time i get that breather
16:36 zakharyas joined #perl6
16:36 ab6tract thanks again #perl6, sorry for venting and a big <3 for your patience
16:36 lucasb_ joined #perl6
16:37 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 babydrop and not why or how.
16:38 babydrop 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:40 m0ltar joined #perl6
16:42 * babydrop can't wait for the robot uprising
16:44 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:45 dwarring joined #perl6
16:47 SoylentGreenSqui left #perl6
16:50 giraffe joined #perl6
16:55 babydrop hmm
16:56 babydrop now another operator fails
16:56 babydrop Do we have a name for this one? (.)
16:56 * babydrop snickers
16:58 babydrop it's a SPESH bug
17:02 babydrop Where does spesh stuff reside? It's moarvm level?
17:02 lucasb_ babydrop: yes, moaar
17:02 babydrop oh, duh... it's moarvm env var so of course :)P
17:03 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 lucasb_ but...
17:04 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'?␤␤»
17:04 babydrop m: sub($,$,$,$,$,$,$){}.signature.say; # this is fixed btw
17:04 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
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'?␤␤»
17:04 babydrop bah
17:04 cibs joined #perl6
17:04 babydrop well, you know what I mean :0
17:04 moritz lucasb_: so don't write that?
17:05 moritz lucasb_: it's easy to write constraints you can't satisfy
17:05 moritz m: sub f(Int where False) { }; f 42
17:05 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␤»
17:05 lucasb_ babydrop: yes, I say yesterday. thanks for fixing!
17:05 moritz m: sub f(Int where {False}) { }; f 42
17:05 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␤»
17:05 lucasb_ *I saw yesterday...
17:05 moritz m: sub f(Int $ where {False}) { }; f 42
17:05 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␤␤»
17:06 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
17:06 jnthn m: sub f(:($a, $b)) { }.perl.say
17:06 camelia rakudo-moar 6e7f97: OUTPUT«sub f ($ (Any $a, Any $b)) { #`(Sub|48236960) ... }␤»
17:06 jnthn m: sub f(:($a, $b)) { }([1, 2])
17:06 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␤␤»
17:07 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 #perl6
17:26 pyrimidine joined #perl6
17:28 jdv79 hello #perl6
17:28 girafe joined #perl6
17:29 nicq20 jdv79: Hello o/
17:30 babydrop \o
17:30 eiro joined #perl6
17:33 zilti joined #perl6
17:39 [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:40 pmurias joined #perl6
17:41 babydrop I rather leave it alone.
17:42 babydrop 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: http://paste.scsys.co.uk/540048
17:43 itcharlie1 left #perl6
17:44 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:46 babydrop neat.. found a parsing bug while writing an Advent
17:46 babydrop m: for <a b> (-) <b c> { .say }
17:46 camelia rakudo-moar 6e7f97: OUTPUT«a => True␤»
17:47 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>␤␤»
17:47 babydrop I guess I have an extra motivation to fix it :)
17:52 babydrop m: for () ∖ () {}
17:52 camelia rakudo-moar 6e7f97: ( no output )
17:53 pmurias babydrop: should the advent posts you code that only works in Rakudo HEAD? ;)
17:53 babydrop u: \
17:53 unicodable6 babydrop, U+005C REVERSE SOLIDUS [Po] (\)
17:53 babydrop gawd dammit
17:53 babydrop I confused myself... after writing about how ∖ looks a lot like \
17:54 babydrop pmurias: that beats not working at all ;)
18:02 [Coke] babydrop: our tests of bugs and features should be deliberate, not accidental.
18:03 [Coke] but I also am fine with not changing the test in 6.c-errata, and only changing it in master.
18:04 cibs joined #perl6
18:04 nicq20 left #perl6
18:04 pyrimidine joined #perl6
18:16 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 #perl6
18:22 firstdayonthejob joined #perl6
18:33 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:34 timotimo i think rather than delegating, that actually compiles down to the other thing
18:35 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 babydrop m: :16<Z>
18:35 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 #perl6
18:38 [Coke] TIL (from mark fowler) that perl 5 has gather/take (in module space)
18:39 [Coke] also perl5++ for making their advent calendar actually christmas-themed. :)
18:39 masak https://metacpan.org/pod/Perl6::Gather ?
18:39 babydrop heh
18:41 masak wow, and it's not a lot of code
18:41 ggoebel joined #perl6
18:43 [Coke] List::Gather, I think.
18:44 babydrop It's also not like ours
18:44 babydrop 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 {} }
18:44 camelia rakudo-moar 6e7f97: OUTPUT«it's a number!␤it's a string!␤it's a number!␤wat␤»
18:44 babydrop Look ma'! take is in a different sub so the caller(-1) hack ain't gonna work \o/
18:46 lucasb_ m: my $n = 10; say ($n, ++$n)
18:46 camelia rakudo-moar 6e7f97: OUTPUT«(11 11)␤»
18:46 lucasb_ m: my $n = 10; say (my $x = $n, ++$n)
18:46 camelia rakudo-moar 6e7f97: OUTPUT«(10 11)␤»
18:46 babydrop no idea about ether's version, but I don't see cross-sub examples in pod
18:47 lucasb_ ^^ this looks strange, but is the correct behaviour, right?
18:47 lucasb_ I get the same results with perl5
18:48 * babydrop would prefer to chuck code like that into "undefined" category :)
18:49 babydrop 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 #perl6
18:50 lucasb_ ok, so it's confirmed
18:50 FROGGS joined #perl6
18:50 lucasb_ I have to "cache" the first value with 'my $x = $n' otherwise I will get a reference to the updated value
18:52 babydrop you stick a value into a different container instead of passing a container whose value gets updated later on
18:52 babydrop s/passing/using/;
18:52 lucasb_ yes, makes sense
18:54 lucasb_ 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"
18:55 babydrop Writing wrong code is what makes programmers stronger!
18:56 AlexDaniel babydrop: so what should we call a “trap” then?
18:56 perlpilot .oO( ... and who plays Admiral Ackbar in this scenario? )
18:58 babydrop AlexDaniel: I dunno, I was just complaining randomly
18:59 babydrop But a language with lots of traps makes me think it's designed badly.
19:00 babydrop Like this isn't a "trap": https://docs.perl6.org/language​/traps#Assigning_to_attributes
19:00 * lucasb_ imagined the "It's a trap" meme image with the subtitle "It's a Perl 6 feature"
19:00 babydrop That's just what someone who has little understanding of attributes might do.
19:01 babydrop m: say Bag.new-from-pairs: :42foo, :45bar
19:01 camelia rakudo-moar 6e7f97: OUTPUT«bag()␤»
19:01 babydrop now that's ^ a trap. It's something any programmer can absentmindedly write and expect to work
19:01 timotimo that's true
19:02 babydrop And this is not a trap: https://docs.perl6.org/language/traps#Whit​espace_in_Regexes_does_not_match_literally
19:02 babydrop m: say 'a b' ~~ /a b/
19:02 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␤»
19:02 babydrop you get a helpful error
19:02 babydrop Anyway, as I've said, I was randomly complaining....
19:02 babydrop Don't quote me on this or anything :P
19:02 lukaramu joined #perl6
19:03 AlexDaniel babydrop: you are right, especially given that it prints a warning, yes
19:03 AlexDaniel though I guess there are times we don't warn
19:03 babydrop yeah
19:03 babydrop m: say 'a b' ~~ /a ./
19:03 camelia rakudo-moar 6e7f97: OUTPUT«「a 」␤»
19:04 AlexDaniel the example should be changed then, I guess
19:04 lucasb_ what "»" inside regexes mean?
19:04 synopsebot6 joined #perl6
19:04 babydrop lucasb_: right word boundary
19:05 lucasb_ babydrop: ah right, I didn't know. thanks
19:05 babydrop m: say "foo bar ber" ~~ m:g/ . » /
19:05 camelia rakudo-moar 6e7f97: OUTPUT«(「o」 「r」 「r」)␤»
19:05 babydrop m: say "foo bar ber" ~~ m:g/ . >> / # same thing in Texas
19:05 camelia rakudo-moar 6e7f97: OUTPUT«(「o」 「r」 「r」)␤»
19:05 babydrop with « and << being left boundaries
19:05 babydrop and <|w> or <wb> being just boundary (no directional distinction)
19:05 firstdayonthejob joined #perl6
19:07 lucasb_ babydrop: thanks. I just wanted to understand the fix from yesterday... you know, the $str.subst(/» ' $'$/,'')
19:07 synopsebot6 joined #perl6
19:07 [Coke] we should also move any traps that are "in perl 5..." to the appropriate 5-to-6 page.
19:07 babydrop lucasb_: https://cdn.meme.am/cache/instan​ces/folder197/500x/73676197.jpg
19:08 [Coke] (there's at leats 2 of those>)
19:08 lucasb_ lol
19:09 [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
19:10 timotimo we used to have at least one extra lang-to-6, but i think it was rejected?
19:10 timotimo was it ruby-to-perl6?
19:10 AlexDaniel timotimo: https://docs.perl6.org/language/rb-nutshell
19:10 babydrop rb-nutshell.html and it's still there; it's just in the middle of the list
19:10 timotimo cool, it's still there
19:15 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 #perl6
19:15 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␤»
19:16 hahainternet heh AOC5 is quite fun in perl6
19:16 hahainternet that one's 4 i guess
19:16 hahainternet but damn Digest::MD5 aint' quick :D
19:19 Upasaka_ joined #perl6
19:19 babydrop Man who designed set Unicode chars... ⊎ is indistinguishable from ⊍ in my font
19:19 hahainternet there are literal homoglyphs in unicode
19:19 hahainternet so best of luck :)
19:19 babydrop Oh.. wait... I think the left one has one more pixes than the other
19:19 [Coke] m: dd(Mu)
19:19 camelia rakudo-moar 6e7f97: OUTPUT«Mu␤»
19:20 babydrop Same with ∖ looking like backslash
19:20 hahainternet that's very different here
19:20 baest_ joined #perl6
19:20 babydrop \∖\∖\∖\∖\∖
19:20 amalia__ joined #perl6
19:20 parisba_ joined #perl6
19:21 babydrop Slightly less slanted in my font: http://i.imgur.com/k10Few5.png
19:21 hahainternet babydrop: your colourscheme is nauseating
19:22 hahainternet here's yours here: https://i.imgur.com/grHfsjY.png
19:22 babydrop Nonsense! :)
19:22 nebuchadnezzar joined #perl6
19:22 babydrop oh wow, yeah, much different
19:22 hahainternet calculating the first hash of aoc5: been going 15 minutes already i think
19:22 hahainternet and this is on a 3770k
19:22 masak baest_: hi! saw you enter in babydrop's screenshot! :D
19:22 hahainternet i'm assuming Digest::MD5 is pure perl6
19:23 mitchum_ joined #perl6
19:23 hahainternet https://github.com/cosimo/perl6-dige​st-md5/blob/master/lib/Digest/MD5.pm
19:23 hahainternet v nice
19:23 Juerd_ joined #perl6
19:23 hahainternet might have to nativecall one though to complete this task today
19:23 lucasb__ joined #perl6
19:23 ponbiki_ joined #perl6
19:23 telex joined #perl6
19:23 AlexDaniel babydrop: my main font does not have ∖ in it, so it looks like this: https://files.progarm.org/2016​-12-05-212322_171x37_scrot.png
19:24 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:25 jonadab Indeed.
19:27 canopus_ joined #perl6
19:28 zilti1 joined #perl6
19:29 babydrop weeee
19:29 dudz hi babydrop
19:29 lucasb__ are we all on the same side?
19:29 dudz hi lucasb__
19:30 babydrop dudz: hi
19:31 lucasb__ m: sub f($a ($b,$c)) { say $a }; f([10,20])  # ok
19:31 camelia rakudo-moar 6e7f97: OUTPUT«[10 20]␤»
19:31 lucasb__ m: sub f($a:($b,$c)) { say ::('$a:') }; f([10,20])  # ???
19:31 camelia rakudo-moar 6e7f97: OUTPUT«[10 20]␤»
19:31 lucasb__ if I type '$a:($b,$c)' then the argument gets captured into a variable named "$a:"
19:32 lucasb__ the variable named just "$a" is inaccessible in the second eval snippet
19:33 lucasb__ in both snippets, $b and $c gets unpacked correctly
19:34 AlexDaniel sooo… are you saying that this should not happen?
19:34 hahainternet isn't $a: the invocant syntax?
19:34 lucasb__ idk :)
19:34 timotimo isn't that our "fancy variable name" syntax?
19:34 lucasb__ I'm just saying that it's strange
19:34 timotimo nah, that'd require word characters after the :
19:34 ilmari[m] joined #perl6
19:34 go|dfish joined #perl6
19:35 geekosaur joined #perl6
19:35 Lucas_One joined #perl6
19:35 jonas2 joined #perl6
19:36 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])␤»
19:36 AlexDaniel “Cannot do non-typename cases of type_constraint” ?
19:37 lucasb__ "yet"
19:37 [Coke] hahainternet: yes, trailing : is the invocant syntax.
19:37 khw joined #perl6
19:37 [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␤»
19:37 [Coke] m: sub f($a:($b,$c)) {} ; dd &f
19:37 camelia rakudo-moar 6e7f97: OUTPUT«Sub f = sub f ($a: (Any $b, Any $c)) { #`(Sub|61889976) ... }␤»
19:38 andrewalker joined #perl6
19:39 AlexDaniel lucasb__: a lot of things actually accept : in their name
19:39 AlexDaniel there was a long discussion on that topic somewhere
19:40 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␤␤»
19:40 babydrop m: { say $:meows }(:42meows)
19:40 camelia rakudo-moar 6e7f97: OUTPUT«42␤»
19:41 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.
19:41 * timotimo doesn't have that kind of money laying around
19:41 RabidGravy looking good
19:41 * timotimo also doesn't have a credit card
19:41 hahainternet [Coke]: how many days left?
19:42 RabidGravy 11 I think
19:42 hahainternet oh easy
19:42 hahainternet if it doesn't reach the target in a week i'll fund whatever's remaining
19:42 hahainternet assuming the general consensus in this channel is that it's a positive thing to do
19:42 babydrop Sure
19:43 babydrop hahainternet++
19:44 hahainternet switched to OpenSSL::Digest
19:44 hahainternet still taking some time!
19:44 RabidGravy I think most of the (very few,) nay sayers I have encountered are bitter old hackers who refuse to get with the programme
19:44 hahainternet i'm bitter and old
19:45 RabidGravy Oh I'm old
19:46 firstdayonthejob joined #perl6
19:46 mspo https://news.ycombinator.com/item?id=13108683
19:47 bhm_ hahainternet++
19:47 bjz joined #perl6
19:48 hahainternet so, given this is so slow
19:48 hahainternet i guess i better learn some async
19:48 babydrop m: https://gist.github.com/zoffixznet​/85fb4f181011b34c347f11e367a6afde
19:48 hahainternet iirc you can take a seq and batch it out to threads
19:48 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␤␤»
19:48 babydrop What is it crying about? What's expecting an Int? :S
19:48 hahainternet if anyone has a relevant link to hand that'd be nice
19:48 timotimo mspo: let's all prepare for a whole bunch of negativity :)
19:48 lizmat joined #perl6
19:48 hahainternet babydrop: the combinations func?
19:48 mspo timotimo: HN tends to like perl6
19:49 mspo from what I've seen
19:49 hahainternet babydrop: (just a guess)
19:49 dalek joined #perl6
19:49 mspo other than the usual perl stuff
19:49 babydrop hahainternet: what'd you mean?
19:49 prammer joined #perl6
19:49 hahainternet babydrop: you asked what expected an int
19:50 hahainternet doesn't combinations take an int which is the number of returned elements?
19:50 babydrop hahainternet: it doesn't tho
19:50 hahainternet just a guess, i'm still new at p6
19:50 babydrop But I did have a hyper on it that wasn't needed....
19:50 babydrop Still get a bug tho
19:50 babydrop m: https://gist.github.com/zoffixznet​/0601b566a589d9921cffc3eee33f0dca
19:50 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)))␤(…»
19:50 babydrop Combinations alone work
19:50 timotimo mspo: it's clear to me that you have enough positivity to counter HN :)
19:51 mspo anyway traffic = money and HN = traffic
19:52 timotimo *shrug*, no PR is bad PR :)
19:52 hahainternet not sure HN is good traffic, but as timotimo said
19:52 masak "traffic = money" is the kind of thinking that got us Trump :(
19:52 babydrop dammit
19:52 hahainternet anyway i'm happy to throw in $1500 so the KS is going to succeed
19:52 mspo money = winning is the american way
19:52 babydrop My beautiful code is breaking at its seams
19:52 hahainternet so we'll see how much i need to put in
19:52 hahainternet babydrop: still waiting for my code to return lol
19:52 babydrop heh
19:52 hahainternet 100%ing one CPU
19:52 hahainternet 7 sat there idle
19:53 babydrop m: https://gist.github.com/zoffixznet​/ff9097cff1152fc1e08606db747f7493
19:53 camelia rakudo-moar 6e7f97: OUTPUT«I can build...␤This type (Scalar) does not support elems␤  in block <unit> at <tmp> line 9␤␤»
19:53 babydrop wat?
19:54 bjz joined #perl6
19:55 [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
19:56 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␤␤»
19:57 [Coke] does wordpress track edit history?
19:57 babydrop Hm, doesn't crash with ∪ op
19:59 babydrop m: Pair.new(1, 42).values.say
19:59 camelia rakudo-moar 6e7f97: OUTPUT«(42)␤»
19:59 babydrop m: Pair.new(1, 42).value.say
19:59 camelia rakudo-moar 6e7f97: OUTPUT«42␤»
19:59 [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 #perl6
20:01 [Coke] probably had too many windows open pointing at my article.
20:02 masak [Coke]: more and more I realize why I didn't write my advent posts inside of the Wordpress UI.
20:03 pmurias what is prefered 'use nqp' or 'use MONKEY-GUTS'?
20:03 babydrop yes
20:03 babydrop I mean, the guts
20:03 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 #perl6
20:04 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)
20:04 camelia rakudo-moar 6e7f97: OUTPUT«(Int)␤»
20:05 pmurias what does 'working on nqp' mean?
20:05 lucasb__ m: sub (::T) { say (T.gist,) }.(10)
20:05 camelia rakudo-moar 6e7f97: OUTPUT«((Int))␤»
20:05 pmurias writing nqp code?
20:05 lucasb__ m: sub (::T) { say (T,) }.(10)
20:05 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␤␤»
20:05 geekosaur specifically working on the nqp components under perl 6
20:06 babydrop Interestiong... in this code: $_».key.say for @wanted.combinations.grep: { $materials ≽ [⊎] ».value };
20:06 babydrop The » on .value doesn't need the $_, but it's needed on ».key at the start :/
20:07 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 geekosaur (or "intended to become part of...")
20:08 geekosaur 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 ribasushi joined #perl6
20:09 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 #perl6
20:09 geekosaur yes, and?
20:09 geekosaur are you saying they should be treated as 100% equivalent, then?
20:10 geekosaur then could you explain why both exist?
20:10 pmurias aren't they?
20:10 geekosaur *technically* yes
20:10 babydrop m: https://gist.github.com/zoffixznet​/bb284c614f1eee2a80bacb062fe3d76b
20:10 camelia rakudo-moar 6e7f97: OUTPUT«I can build...␤␤Cannot unbox a type object (Any) to a str.␤  in block <unit> at <tmp> line 9␤␤»
20:10 AlexDaniel I am not sure where does the guarantee that GUTS is actually nqp comes from, but whatever…
20:10 * babydrop sighs at the bugs
20:10 pmurias geekosaur: I would guess the reasons both exists is backwards compatibility
20:10 geekosaur it's not about the technical part, it's about organization
20:10 babydrop caused by using $^stuff instead of $_
20:11 geekosaur right. ok, I yield. tech solves social problems
20:12 inokenty joined #perl6
20:13 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
20:14 geekosaur er, with rakudo. "perl 6" isn't really relevant, if you want to play pedant
20:14 babydrop not really.
20:14 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
20:14 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
20:14 hahainternet is that known?
20:14 hahainternet i'll build a fresh rakudo shortly
20:14 geekosaur there is never any technical reason for anything to be MONKEY-*
20:14 hahainternet but reading the docs it doesn't seem like it should behave this way
20:14 timotimo hahainternet: hyper and race are known to not work 100% right
20:14 babydrop hahainternet: those methods are kinda buggy
20:14 hahainternet fair 'nuff
20:15 hahainternet race 100%s all cores incl hyperthreaded cores here
20:15 hahainternet quite happily
20:15 hahainternet showing 780% or so in top
20:15 hahainternet haven't actually measured performance improvement
20:15 timotimo probably not drastically much
20:15 hahainternet i'll give that a go in a bit when i've finished playing with aoc5
20:15 timotimo we still have a nasty bottleneck
20:16 hahainternet parallelism is hard
20:16 hahainternet it's nice to see it this far along though
20:16 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'
20:16 babydrop hahainternet: there's literally a ticket with " .race makes code run 5 times slower" in its title
20:16 hahainternet babydrop: lmao
20:16 pmurias * reason
20:16 hahainternet still the fact i can add .race. and see all 8 cores saturated is a good sign
20:16 babydrop m: nqp::blah;
20:16 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␤»
20:16 hahainternet babydrop: do the same caveats apply to supplies/tapping/etc?
20:16 pmurias if 'use MONKEY-GUTS' is the prefered form maybe the exception message should be updated?
20:17 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?
20:17 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
20:18 babydrop to the point that I sometimes use that instead of use nqp; in #perl6
20:18 babydrop hahainternet: I think Supply has a from-seq or somesuch method
20:18 babydrop huggable: Supply
20:18 huggable babydrop, Asynchronous data stream with multiple subscribers: https://docs.perl6.org/type/Supply
20:19 pyrimidine joined #perl6
20:19 babydrop m: dd Supply.from-list: 1..10
20:19 camelia rakudo-moar 6e7f97: OUTPUT«Supply.new␤»
20:20 babydrop m: https://gist.github.com/zoffixznet​/6b73e7f0e039db3d00facadc1f5c1db4
20:20 camelia rakudo-moar 6e7f97: OUTPUT«I can build...␤␤house␤shed␤dog-house␤house shed␤house dog-house␤shed dog-house␤»
20:20 hahainternet a supply might not be what i want, probably a channel and a bunch of start/awaits
20:20 babydrop My 1-liner awesome-code works \o/
20:20 hahainternet reading the docs anyhow, cheers
20:21 hahainternet babydrop: that's superb
20:21 babydrop tho I'm annoyed by that slip just to work around a bug :(
20:22 pmurias AlexDaniel: if you are using either 'use nqp' or 'use MONKEY-GUTS' I don't think you get any guarantess whatsoever
20:23 AlexDaniel well, that's true, I guess
20:24 * lizmat waves from home
20:24 timotimo greetings lizmat!
20:24 lizmat starting work on the P6W now
20:25 babydrop \o\/
20:26 timotimo that looks kind of painful
20:26 babydrop heh
20:26 babydrop Feel free to send a patch for my keyboard driver :)
20:30 RabidGravy dunno, do I want to do another advent article?
20:30 babydrop RabidGravy: yes
20:31 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
20:32 dalek mu: c925011 | RabidGravy++ | misc/perl6advent-2016/schedule:
20:32 dalek mu: Add an article for the 12th
20:32 dalek mu: review: https://github.com/perl6/mu/commit/c92501148f
20:32 babydrop \o/
20:34 firstdayonthejob joined #perl6
20:35 ufobat joined #perl6
20:37 babydrop <hahainternet> doesn't combinations take an int which is the number of returned elements?
20:37 babydrop <babydrop> hahainternet: it doesn't tho
20:37 babydrop I was wrong. It can take it. Or a Range. And defaults to 0..* Range
20:38 babydrop And it's the number of stuff to combine
20:38 babydrop m: say <a b c d e>.combinations: 3
20:38 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))␤»
20:38 babydrop m: say <a b c d e>.combinations: 5
20:38 camelia rakudo-moar 6e7f97: OUTPUT«((a b c d e))␤»
20:38 babydrop * number of stuff in the resultant combination
20:45 lucasb__ m: class a::b::c {}; say ::('a::b::c')
20:45 camelia rakudo-moar 6e7f97: OUTPUT«(c)␤»
20:46 prammer joined #perl6
20:46 babydrop m: class a::b::c {}; say ::('a::b::c').^name
20:46 camelia rakudo-moar 6e7f97: OUTPUT«a::b::c␤»
20:46 lucasb__ m: class a::b::c {}; say ::('::x::a::b::c')
20:46 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␤␤»
20:46 lucasb__ No such symbol 'a::b::c' ??
20:46 babydrop m: class a::b::c {}; say ::('::z::a::b::c')
20:46 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␤␤»
20:46 lucasb__ interesting how the "::x::" prefix was dropped. I wonder why
20:47 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␤␤»
20:48 lucasb__ the error is correct, only the symbol shown in the error message is not (it got its prefix stripped)
20:49 hahainternet are pointy blocks weird inside start blocks?
20:50 hahainternet oh wait i might just be being dumb :)
20:51 psch m: say ::Int; say ::('::Int')
20:51 camelia rakudo-moar 6e7f97: OUTPUT«(Int)␤(Int)␤»
20:51 psch m: say ::Int; say ::('::Rakudo::Internals')
20:51 camelia rakudo-moar 6e7f97: OUTPUT«(Int)␤(Internals)␤»
20:52 lucasb__ just a data point: I think code handling the ::('...') syntax was touched recently
20:52 psch m: try ::('::x::A'); say $!.perl
20:52 camelia rakudo-moar 6e7f97: OUTPUT«X::NoSuchSymbol.new(symbol => "A")␤»
20:52 lucasb__ see the difference in errors:
20:52 lucasb__ m: ::('::')
20:52 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␤␤»
20:52 lucasb__ star-m: ::('::')
20:52 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␤␤»
20:53 psch yeah, i think the Exception message gets misconstructed
20:53 lucasb__ this affects any ::('::a::b::c') name resolution as well
20:53 psch bisectable6: ::('::')
20:53 bisectable6 psch, Bisecting by output (old=2015.12 new=6e7f97f) because on both starting points the exit code is 1
20:53 psch oh, shoulda gone with star-m as old :/
20:53 bisectable6 psch, bisect log: https://gist.github.com/83e2​72837dd0cc44f4d90d5faf54681b
20:53 bisectable6 psch, (2016-04-30) https://github.com/rakudo/rakudo/commit/​d7698f3de2eb3c326aa3af8b9e9827fe506cdabf
20:54 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
20:54 psch ah fudge, it's 2016.10 here
20:54 bisectable6 psch, bisect log: https://gist.github.com/4ebe​88ea63cc97bc5eba7e1fc934b3ec
20:54 bisectable6 psch, (2016-11-20) https://github.com/rakudo/rakudo/commit/​939d27370861ee383d874104453f04b333b2f66e
20:54 psch sheesh
20:54 hahainternet oh, actually i wonder if that 'class C is Array of Int' thing is bisectable
20:54 psch ah, lucasb__++
20:55 psch 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␤␤»
20:55 psch m: ::('$a::X')
20:55 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␤␤»
20:55 psch it's actually too late for me to look into that, g'night o7
20:58 * [Coke] finally remembers to put DYLD_FALLBACK_LIBRARY_PATH in his .profile to help with nativecall installations on OS X
21:02 kurahaupo__ joined #perl6
21:03 ab6tract joined #perl6
21:07 ab6tract babydrop: nice find with the spesh bug. that was driving me absolutely nuts yesterday
21:08 ab6tract 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"?
21:08 ab6tract i'm wondering whether i should just fold those into my current PR
21:09 ab6tract timotimo: indeed
21:09 timotimo should be easy-ish to systematically go through now that we've realized it
21:09 timotimo and build a bunch of test cases to highlight this
21:09 ab6tract i wasn't thinking about .first returning a value there
21:09 timotimo it's a good point
21:10 timotimo easy to miss, i expect
21:10 timotimo especially when you mostly get not only defined but also truthy things in your thing
21:10 ab6tract and i have a suspicion i either cargo culted it or it was changed from a less optimal form
21:10 timotimo like, who uses union with an empty set? :P
21:11 ab6tract yeah it was a weird one. i specifically would get a failure on `[(+)] bag(), $m`
21:12 timotimo mhm
21:13 timotimo your work has done a big service to the perl6 effort, i'd say
21:13 timotimo good find
21:13 ab6tract i added a few tests in this PR https://github.com/perl6/roast/pull/187
21:14 ab6tract timotimo: i also noticed that (+) was not actually symmetric :O
21:14 timotimo could that have been due to your bug?
21:14 timotimo are the intermediate values sane?
21:14 timotimo oh, wait
21:14 ab6tract yup, that's how i got to the grep solution
21:14 timotimo you mean with regards to different types?
21:15 ab6tract $bag (+) $mix should be the same as $mix (+) $bag
21:16 ab6tract it is as when i patch the defined-dummo
21:16 ab6tract it is *fixed
21:18 timotimo aha!
21:18 ab6tract and the specific asymmetry was due to defined-nes
21:19 timotimo fantastic
21:19 ab6tract so it was one of those hair puller bugs
21:19 ab6tract glad we can clear em all out
21:19 timotimo <3
21:21 cdg joined #perl6
21:29 mulk[m] joined #perl6
21:32 _ramix_ joined #perl6
21:33 noviceBob joined #perl6
21:34 _ramix_ Hi. I need to change the module name: https://modules.perl6.org/dist/F​ileSystem::Capacity::VolumesInfo by https://modules.perl6.org/​dist/FileSystem::Capacity, is it possible?
21:34 bjz joined #perl6
21:35 ab6tract alright, fixes are pushed
21:35 ab6tract big hugs to you all, #perl6 <3 !
21:37 kurahaupo joined #perl6
21:41 kurahaupo joined #perl6
21:44 babydrop ...
21:45 babydrop I guess I'll create an Issue on ramix's module
21:51 bjz joined #perl6
21:52 babydrop https://github.com/ramiroencinas/p​erl6-FileSystem-Capacity/issues/3
21:54 labster joined #perl6
22:09 M-Illandan joined #perl6
22:09 ilmari[m] joined #perl6
22:09 Matthew[m] joined #perl6
22:09 tadzik joined #perl6
22:09 Matias[m] joined #perl6
22:09 dp[m] joined #perl6
22:19 lizmat .u U+2212
22:19 bjz joined #perl6
22:21 AlexDaniel m: say 2212.chr
22:21 camelia rakudo-moar 7ad4a8: OUTPUT«ࢤ␤»
22:21 babydrop .u −
22:21 babydrop u: −
22:21 unicodable6 babydrop, U+2212 MINUS SIGN [Sm] (−)
22:21 bjz joined #perl6
22:22 babydrop m: say '2212'.parse-base(16).chr
22:22 camelia rakudo-moar 7ad4a8: OUTPUT«−␤»
22:22 AlexDaniel m: say 0x2212.chr
22:22 camelia rakudo-moar 7ad4a8: OUTPUT«−␤»
22:22 AlexDaniel right
22:23 babydrop golfed my earlier bag issue:
22:23 babydrop m: [bag() but "house"].combinations.grep: { [⊎] $^stuff-we-want }
22:23 camelia rakudo-moar 7ad4a8: OUTPUT«Cannot unbox a type object (Any) to a str.␤  in block <unit> at <tmp> line 1␤␤»
22:25 hahainternet so it seems that the supply .batch method doesn't seem to work if the supply is fed by a seq
22:26 babydrop :(
22:26 hahainternet it'd be very nice to have that method on ranges/seqs too
22:26 hahainternet both of which are concepts amenable to batching
22:27 babydrop hahainternet: we do. It's called .rotor
22:27 hahainternet ah ok thank you :)
22:27 babydrop hahainternet: http://perl6.party/post/Perl-6-.ro​tor-The-King-of-List-Manipulation
22:28 hahainternet the question is now, am i doing something wrong with supplies?
22:28 hahainternet it's a little frustrating there seems to be no way to block on a channel send either
22:29 hahainternet as i want to produce an infinite list of values and feed them to many consumers, each consumer receiving only one
22:29 hahainternet so i'd like to have it rate limited by the consumer consumption, not sure how to architect it the 'perl6 way' yet :D
22:29 hahainternet will take a break now and have a play around more later
22:30 labster joined #perl6
22:30 hahainternet oh, it looks like rotor only works on lists, so probably doesn't work on an infinite sequence either
22:31 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))␤»
22:31 hahainternet hmmm
22:32 hahainternet oh that's cause that's a range
22:32 babydrop :/
22:32 hahainternet i might be wrong anyway
22:32 babydrop You are. … is a sequence operator. .. is a range operator
22:33 hahainternet oh bad rendering, it overlaps with your infinity symbol
22:33 hahainternet i see it now
22:33 babydrop m: (1..∞).rotor(5)[^3].say
22:33 camelia rakudo-moar 7ad4a8: OUTPUT«((1 2 3 4 5) (6 7 8 9 10) (11 12 13 14 15))␤»
22:33 babydrop It works on Ranges too, tho
22:33 hahainternet yeah i see my error now, it does only iterate up to the element i request
22:33 babydrop \o/
22:33 hahainternet however, trying to create a channel from any sort of supply based on this seems to just block indefinitely
22:34 hahainternet so if you know why that is then i'll celebrate :p
22:34 babydrop nope
22:34 babydrop Gonna go play Warframe \o/
22:34 babydrop (but I don't know off top of my head...)
22:34 AlexDaniel hahainternet: what exactly are you trying?
22:35 kurahaupo_ joined #perl6
22:35 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 setty1 joined #perl6
22:38 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 …»
22:38 AlexDaniel m: say (0..*).race.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 …»
22:38 hahainternet without using hyper or race
22:38 AlexDaniel ok
22:38 hahainternet sorry, you weren't here for that i guess
22:38 hahainternet hyper actually returns part way through, and race is apparently known to be slow and buggy
22:38 hahainternet so i thought i'd learn about promises/supplies/channels :)
22:38 AlexDaniel that's right
22:39 AlexDaniel hahainternet: are you sure you need 0..* ?
22:40 AlexDaniel 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
22:40 hahainternet the actual challenge is trivial
22:41 hahainternet i'm interested in learning perl6 :D
22:41 hahainternet http://adventofcode.com/2016/day/5
22:43 AlexDaniel so you need a concurrent Seq, huh?
22:43 hahainternet in decent sized batches ideally
22:47 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 AlexDaniel so some sort of a thread-safe generator is needed
22:47 hahainternet AlexDaniel: yeah i was hoping the .Channel method would do it magically for me so it wasn't racing to push
22:47 babydrop hahainternet: I've not read the challenge, but perhaps this would be of help: https://irclog.perlgeek.de/​perl6/2016-05-28#i_12561518
22:47 AlexDaniel well, you can always do it with a Lock
22:47 babydrop IIRC it's batching of some sort of another with Promises
22:48 hahainternet AlexDaniel: nah it's fine if it's something that is still a bit uncertain
22:49 hahainternet race and hyper are the 'right' way to do this anyway
22:49 hahainternet so i'll just complete it single threaded
22:49 hahainternet food first though, cheers for your help, if you have any ideas please lmk
22:50 stmuk_ joined #perl6
22:51 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
22:51 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»
22:51 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…
22:53 lizmat and another issue of Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2016/12/05/​2016-49-its-looking-a-lot-like-blog-posts/
22:54 babydrop wooooo
22:54 bjz joined #perl6
22:55 firstdayonthejob joined #perl6
22:56 babydrop lizmat++ good weekly.
22:56 babydrop Wow, a ton of blog posts!
22:59 labster1 joined #perl6
23:02 BooK lizmat: the link to the learning perl 6 kickstart points back to the post
23:03 BooK I guess because it's empty
23:04 babydrop oops :o
23:05 babydrop timotimo: are you around? Or anyone else with weekly's perms
23:05 babydrop This is the link https://www.kickstarter.com/proj​ects/1422827986/learning-perl-6
23:05 * babydrop wouldn't mind getting perms to fix typos 0:)
23:09 lizmat BooK babydrop: fixed, thanks!
23:12 lizmat and good night, #perl6!
23:12 bjz joined #perl6
23:12 lizmat babydrop: wrt to edit access, it really is still timotimo's blog, so I'll leave that decision up to him
23:12 lizmat sleep&
23:26 Juerd Does anyone know of any impressive Perl 6 asciicasts? (asciinema.org)
23:26 sufrostico joined #perl6
23:27 sufrosti1o joined #perl6
23:33 firstdayonthejob joined #perl6
23:37 babydrop Is Wendy Liz's spouse?
23:42 labster joined #perl6
23:44 cognominal joined #perl6
23:57 babydrop Writing this post... the &mix/Mix.new-from-pairs really suck.
23:59 babydrop &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.

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

Perl 6 | Reference Documentation | Rakudo