»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
vcv Was able to reproduce my issue in glot.io as soon as I separated my code out into separate files instead of one, which is how I have it locally. glot.io/snippets/eydmv3hf0r 00:02
If i remove the custom trait on my method it works
AlexDaniel is glot.io using rakudobrew? 00:03
because they might want to… switch to the master branch 00:04
maybe they're not using blead, but 2017.10 is a bit suspicious
“FROM rakudo-star:latest” 00:05
vcv I don't think it's the version. I think I can produce a smaller test case as well...
AlexDaniel ah, it's star release also, ok then 00:06
00:12 jimav joined
jimav Is there a ticket system for Rakudo bugs? The only thing I found was a mailing list [email@hidden.address] 00:13
And, where would be a good place to ask questions about language design decisions (I know...) 00:14
Specifically, why P6 permits sigilless "variables" to be created with = as well as := (rather than := only)
AlexDaniel jimav: github.com/rakudo/rakudo/issues/ and fail.rakudo.party/
*language* design decisions should be discussed elsewhere, but this does not happen that often nowadays… 00:15
jimav I assumed that was the case...
AlexDaniel there's github.com/perl6/6.d-prep/ for v6.d release 00:16
jimav Thanks, that is helpful. 00:17
vcv I got a smaller test case reproducable on my local perl6 (Rakudo Star 2018.01) and glot.io: glot.io/snippets/eydnap6xrl
AlexDaniel jimav: if I were you I'd probably submit a ticket with RFC label to the main rakudo tracker ( github.com/rakudo/rakudo/issues/ )
vcv If I combine the code into a single file the issue goes away
AlexDaniel once someone can point out a better place it can be moved
00:19 jimav left
AlexDaniel jimav: or, if you're feeling serious about it, 6.d-prep repo is indeed the right place (similarly to github.com/perl6/6.d-prep/issues/4 ) 00:19
00:23 skids joined
Zoffix jimav, well, (1) less typing; (2) don't have to remember which one works and which one would throw on you; (3) no questions about why it's `.=` and not `.:=` :) 00:27
They're equivalent otherwise.
As for the "variables", they can variate: 00:28
m: my \foo = $ = "meows"; foo = 42; say foo
camelia 42
Zoffix m: my \foo = $ = "meows"; foo = 42; foo = 100; say foo
camelia 100
Zoffix m: my \foo = $ = "meows"; foo := 42; foo = 100; say foo 00:29
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use bind operator with this left-hand side
at <tmp>:1
------> 3my \foo = $ = "meows"; foo := 427⏏5; foo = 100; say foo
Zoffix bah :)
vcv Opened my first bug for rakudo (github.com/rakudo/rakudo/issues/1536) woohoo 00:30
Zoffix Sweet :) 00:31
00:31 dct_ left
Zoffix Related: RT#121991 00:32
Oops
synopsebot RT#121991 [open]: rt.perl.org/Ticket/Display.html?id=121991 [@LARRY] Unless 'use soft' is in play, .wrap should die in Rakudo
Zoffix Damn you copy-pasteable \n's!
Related: RT#121991 RT#129096 RT#128476 RT#127860 RT#125634 00:33
synopsebot RT#129096 [open]: rt.perl.org/Ticket/Display.html?id=129096 [BUG] sub wrapped with mod_trait:<is> when exported yield cryptic error message, works fine in same unit
RT#128476 [new]: rt.perl.org/Ticket/Display.html?id=128476 [SEGV] .wrap causes segfault when wrapping core sub and using that sub in a module that uses the module that wraps
RT#127860 [open]: rt.perl.org/Ticket/Display.html?id=127860 [BUG][PRECOMP] Wrapped method fails when precompiled
RT#125634 [open]: rt.perl.org/Ticket/Display.html?id=125634 [BUG] Using a compiled (mbc) wrapping trait: Cannot invoke this object (REPR: Null, cs = 0)
vcv ahh, 129096 looks like the same bug for sure 00:35
and yep, adding no precompilation; to the top of the file with my custom trait "fixes" it. That's a good enough workaround for now, thanks Zoffix++ 00:37
Zoffix vcv: your ticket is still good to have, as GitHub is a better Issue tracker.
00:40 sharksoft joined
vcv Are there other ways to annotate a sub/method beside for #| ? I'm using the custom trait but the trait doesn't actually *do* anything in my way, plus checking that the method has the specific trait seems difficult 00:42
in my case*
sharksoft Is there a more efficient way to compute this? I'm calculating the entropy of N probability distributions across C classes stored in an (N, C) array and returning a (N, ) array: (@probs[].map: *.map: { $_ * $_.log }).map: { -1 * $_.sum } 00:43
Zoffix this reminds me 00:44
huggable: log
huggable Zoffix, Comes out 2.41x faster than core .log10 and can handle Ints larger than 1.8e308: gist.github.com/zoffixznet/2539e8b...43e173fe8f
Zoffix Ah, it was .log10; nevermind
sharksoft maybe on a related note, anybody know about PDL coming to Perl 6? 00:45
Zoffix sharksoft: nothing particularly jumps out to me in that code
(in a sense that there'd be some much faster way to do a thing)
sharksoft well thanks, I appreciate it. can I write that any more cleanly or is that about as concise as that gets? 00:46
Zoffix You can omit the `[]` and the `$_` on the method calls 00:47
m: .sum.say with ^10
camelia 45
sharksoft ah, right
thanks!
Zoffix And I guess `.map: { -1 * $_.sum }` can be written as just `.map: -*.sum` 00:48
(in the latter, the `*` is the Whatever and makes a WhateverCode closure
)
sharksoft do you have a link handy for explaning when the Whatever works and when you need $_? 00:49
Zoffix sharksoft: there's docs: docs.perl6.org/type/WhateverCode and also there's this blog post (I've not read it; dunno how good it is): perl6advent.wordpress.com/2017/12/11/ 00:50
sharksoft thanks!
Zoffix sharksoft: $_ can be omited on method calls... I think that's the only place where it can be omitted. The Whatever star makes a closure pretty much everywhere, as long as it's not used as a thing on its own (basically say(*) is a call of &say with just Whatever instance, whereas say(*.so) makes a WhateverCode closure) 00:51
00:53 konsolebox left
sharksoft that's helpful 00:53
i just need to put my functional hat back on
Zoffix vcv: dunno. In core, there's a trait that mixes in a role that adds a method and then the thing that checks the annotation just checks if routine .can that method
m: multi trait_mod:<is> (Routine:D \r, :$meow!) { r.^mixin: role Meower { method meow {} } }; sub foo is meow {}; sub bar {}; say .can("meow") ?? "Tis a meow sub" !! "some other sub" for &foo, &bar 00:54
camelia Tis a meow sub
some other sub
Zoffix vcv: something like that
m: multi trait_mod:<is> (Routine:D \r, :$meow!) { r.^mixin: role Meower { } }; sub foo is meow {}; sub bar {}; say $_ ~~ Meower ?? "Tis a meow sub" !! "some other sub" for &foo, &bar 00:55
camelia Tis a meow sub
some other sub
Zoffix I guess that works too
(just mixin a role and typecheck on whether the sub is of that type)
vcv Ahh good trick. thanks :) 00:56
01:08 vcv left 01:13 markong left 01:18 aborazmeh joined, aborazmeh left, aborazmeh joined 01:28 Khisanth left 01:41 Khisanth joined 01:44 xi- left 01:48 pharv left, xi- joined 01:49 pharv joined 01:53 pharv left 01:59 sharksoft left 02:12 pharv joined 02:16 pharv left 02:25 wamba left 02:27 releasable6 left, releasable6 joined 02:46 char_var[buffer] joined 02:47 xenotrope left 02:48 ilbot3 left 02:49 xenotrope joined 02:55 ilbot3 joined, ChanServ sets mode: +v ilbot3 02:57 greppable6 left, greppable6 joined, ChanServ sets mode: +v greppable6 02:58 greppable6 left, greppable6 joined, ChanServ sets mode: +v greppable6 02:59 greppable6 left, greppable6 joined, ChanServ sets mode: +v greppable6 03:00 aborazmeh left 03:14 skids left 03:32 sacomo left 03:53 MasterDuke_ joined 03:54 MasterDuke left 03:56 MasterDuke_ is now known as MasterDuke 04:05 Cabanossi left 04:06 Cabanossi joined 04:50 pharv joined 04:54 imcsk8 left 04:55 imcsk8 joined, pharv left 05:01 Cabanossi left 05:03 Cabanossi joined 05:33 khw left 06:01 konsolebox joined 06:10 AlexDani` joined 06:11 AlexDaniel left
Geth doc: 0d3973ee64 | (JJ Merelo)++ | doc/Language/containers.pod6
Eliminates "also"

Closes #1784
06:18
synopsebot Link: doc.perl6.org/language/containers
06:21 AlexDani` left
Geth doc: 7ec4382595 | (JJ Merelo)++ | doc/Language/containers.pod6
Fixes example

It does compile now. Closes #1785.
06:33
synopsebot Link: doc.perl6.org/language/containers
06:39 aindilis` left 06:40 stmuk_ joined, aindilis joined 06:42 stmuk left 06:44 troys left 06:50 pharv joined 06:55 pharv left 06:58 Exodist left 06:59 Exodist joined 07:45 setty1 joined 08:16 darutoko joined 08:35 Alikzus left 08:38 rindolf joined, epony left 08:56 pierre joined, sena_kun joined 09:00 wamba joined 09:05 pierre left 09:06 pierre joined 09:10 pierre left 09:31 rindolf left 09:35 rindolf joined 09:37 TEttinger left 09:54 bwisti left, bwisti joined 10:18 pmurias joined 10:22 eliasr joined 10:24 lowbro joined, lowbro left, lowbro joined 10:32 Exodist left 10:34 Exodist joined 10:52 pharv joined 10:56 pharv left 11:21 greppable6 left, greppable6 joined, ChanServ sets mode: +v greppable6 11:39 gabiruh_ joined 11:41 espadrine_ joined, gabiruh left, espadrine left 11:43 raydiak__ left 11:44 releasable6 left, releasable6 joined 11:54 jeromelanteri joined 11:55 a3r0_ joined, jferrero_ joined, mst_ joined, erdic_ joined, atta_ joined, tinita_ joined, teatime_ joined 11:56 Alchemy joined 11:57 Alchemy is now known as Guest78273 12:00 ambs left, teatime left, a3r0 left, erdic left, tinita left, TreyHarris left, mst left, atta left, ilbelkyr left, jferrero left, daemon left, erdic_ is now known as erdic 12:02 ambs joined 12:03 releasable6 left 12:04 releasable6 joined
Xliff \o 12:04
Is there a way to define a rule {} within anothe rule{} ? 12:05
12:07 markong joined, TreyHarris joined, jeromelanteri left 12:09 setty1 left 12:17 tinita_ is now known as tinita
moritz well, you can have a code block, and inside my rule foo { ... } 12:19
but, what's the use case?
Xliff Succinctness.
Readability.
moritz I doubt you'll gain that 12:20
Xliff rule _used_only_in_rule_a { ... }; rule a { ...Lotsa complex stuff using _used_only_in_rule_a ... } 12:21
12:21 ilbelkyr joined
Xliff Rather than have that rule messing around, I'd like to put it all in rule a {}, so its easier to find. 12:21
If you really need a use-case, I will write a gist. 12:24
Mixing grammars with code looks like really powerful tool. I've been looking here for ideas: 12:25
github.com/perl6/std/blob/master/STD.pm6
But I don't know how relevant that is.
12:26 Rawriful joined 12:36 konsolebox left 12:37 konsolebox joined 12:40 ExtraCrispy joined 12:48 cygx joined
cygx m: my rule foo { :my rule bar { 42 }; <bar> }; say 42 ~~ /<foo>/ 12:48
yoleaux 28 Jan 2018 09:09Z <nine> cygx: github.com/rakudo/rakudo/commit/b6a7d7f64d should take care of it
camelia 「42」
foo => 「42」
bar => 「42」
cygx Xliff: ^^
Xliff cygx++ 12:49
But if the rule is multilined, will the prefix-by-colon still work? 12:50
Let me gist
Or better yet, paste.
12:53 konsolebox left
Xliff gist.github.com/Xliff/4bfbfb6b348b...2896c15416 12:55
12:56 sharksoft joined
Xliff Hmm... "perl6 -c" doesn't seem to think so... at least with a space in front of "my" 12:56
Maybe code block in that case. 12:57
13:00 konsolebox joined, sharksoft left 13:05 robertle joined 13:12 wamba left
cygx Xliff: I left a comment on that gist 13:22
13:26 espadrine_ is now known as espadrine 13:30 xi- left, xi- joined 13:35 Guest78273 left, Guest78273 joined 13:36 Guest78273 is now known as daemon 13:40 raydiak__ joined 13:50 pharv joined 13:54 pharv left 14:00 cygx left 14:01 comborico1611 joined 14:14 lizmat left 14:29 lizmat joined 14:32 skids joined 14:53 wamba joined 15:23 comborico1611_ joined, mst_ is now known as mst 15:31 AlexDani` joined, comborico1611_ left, konsolebox left 15:32 AlexDani` is now known as AlexDaniel, Ulti left, konsolebox joined 15:34 comborico1611_ joined 15:38 Ulti joined
Xliff Thanks, cygx++ 15:46
15:58 natrys joined 16:11 Xliff left 16:16 pmurias__ joined, pmurias__ left, khw joined 16:32 skids left 16:36 Exodist left 16:37 Exodist joined 16:41 comborico1611_ left 16:44 comborico1611 left, greppable6 left, comborico1611 joined, greppable6 joined 16:46 Exodist left 16:48 Exodist joined 16:53 comborico1611 left 17:03 Xliff joined 17:12 |oLa| joined, |oLa| left 17:14 ufobat joined 17:21 zakharyas joined 17:25 rindolf left 17:35 zakharyas left
Geth doc: 07ebe8ad3f | (JJ Merelo)++ | doc/Language/quoting.pod6
Fixes results of examples

Closes #1786
17:37
synopsebot Link: doc.perl6.org/language/quoting
17:41 zakharyas joined 17:44 kybr left 17:45 sharksoft joined 17:47 kybr joined 18:11 zakharyas left 18:17 comborico1611 joined 18:18 sharksoft left 18:23 dct_ joined
Geth doc: fcd9e8e213 | (Zoffix Znet)++ | 2 files
Clarify IO::[Cat]Handle.eof on zero-size files

Impl: github.com/MoarVM/MoarVM/commit/8d94732aad
   github.com/perl6/nqp/commit/43d4336974
   github.com/rakudo/rakudo/commit/af4dfe827c
Spec: github.com/perl6/roast/commit/3ac8e0b8ae
   github.com/perl6/roast/commit/ed59a994cc
Issues: github.com/rakudo/rakudo/issues/1533 R#1533
   github.com/rakudo/rakudo/issues/1541 R#1541
18:29
synopsebot R#1533 [closed]: github.com/rakudo/rakudo/issues/1533 [RFC][regression][⚠ blocker ⚠] /proc/…/status can no longer be read line by line
synopsebot R#1541 [open]: github.com/rakudo/rakudo/issues/1541 [IO][JVM] [JVM] IO::Handle.eof always reports true for zero-size and /proc files
18:29 Zoffix left 18:34 pmurias left 18:44 darutoko left
Geth doc: 43cab13cf0 | (JJ Merelo)++ | doc/Language/faq.pod6
Changes link to GitHub closes #1789
18:50
synopsebot Link: doc.perl6.org/language/faq
18:52 pmurias joined 18:57 setty1 joined 19:01 expectocode joined
expectocode hello! I'm trying to get into perl6 after spending a lot of time with python3, and i'm having trouble finding the equivalent to python's `enumerate`. Any tips? 19:02
19:03 espadrine left 19:04 wamba left
expectocode found it! what i was looking for was .kv 19:07
19:09 wamba joined 19:10 zakharyas joined
comborico1611 expectocode: Sorry I missed ya. I'm a super newb myself. But in case you aren't familier, the best place to search for Perl6 operators and such is doc.perl6.org 19:14
yoleaux 10 Feb 2018 12:34Z <DrForr> comborico1611: I have a copy, but it's in storage, I believe.
comborico1611 Sorry again, that's docs.perl6.org 19:15
19:15 kolikov joined
moritz doc is a redirect to docs, so no harm done :-) 19:17
comborico1611 Clever girl! (Jurassic Park reference) 19:18
19:20 Exodist left 19:21 Exodist joined 19:22 rindolf joined 19:23 kolikov left 19:29 ExtraCrispy left 19:30 TEttinger joined, zakharyas left 19:31 zakharyas joined 19:36 comborico1611 left 19:37 census joined 19:38 Exodist left 19:39 pmurias left 19:40 Exodist joined 19:47 wamba left
Xliff Jurassic Park reference? Where? 19:47
Xliff disbelieves.
19:48 avalenn left
census does anybody happen to be very good with gmail here? 19:48
19:49 cdg joined
kurahaupo census: that's an odd question, but shoot 19:52
census kurahaupo i can private message you so as to not clog the channel if you prefer 19:53
kurahaupo Ok
19:53 releasable6 left, releasable6 joined, ChanServ sets mode: +v releasable6
expectocode found it! what i was looking for was .kv 19:54
kurahaupo Xliff: "clever girl" was admiring the intelligence of the Velociraptor, while being hunted by her
gfldex m: my @a = <apple banana grapes pear>; say $++, ': ',.Str for @a; 19:56
camelia 0: apple
1: banana
2: grapes
3: pear
gfldex expectocode: ^^^ we don't need enumerate, we got magic :-> 19:57
expectocode gfldex, ??
gfldex expectocode: also, .kv may produce surprising results if the Array got holes 19:58
19:59 comborico1611 joined
gfldex expectocode: if you need a one-shot counter us an anonymous state variable 19:59
expectocode: see docs.perl6.org/language/variables#...$_Variable 20:00
20:01 lowbro left
Xliff kurahaupo: Yes. I got that. But does that mean you are calling moritz++ a Velociraptor?/ 20:04
timotimo expectocode: there's a document in the "language" section of docs.perl6.org that eases going from python to perl6
Xliff If so, that would explain a lot. :D 20:05
That's assuming that for this conversation $Velociraptor ~~ WhateverCode (where ~~ === consumes) 20:06
timotimo docs.perl6.org/language/py-nutshell
sadly, enumerate isn't listed
Xliff census: If you still haven't gotten an answer, feel free to ping me. 20:07
El_Che what's enumeration? iterators?
expectocode El_Che, it's when you loop through something and get a (index, value) pair instead of just value
gfldex, the thing i wanted to loop through was a string.comb but i appreciate the note
20:08 Exodist left
gfldex Str.comb should not produce holes :) 20:08
20:08 Exodist joined
El_Che yes, .kv is the perl 6 equivalent of each, range, |k,v| and friends :) 20:08
20:12 cdg left, cdg joined 20:17 Exodist left, cdg left, Exodist joined 20:19 comborico1611 left 20:23 TuukkaX42 joined 20:36 Exodist left 20:37 Exodist joined, expectocode left 20:49 census left 20:51 dct_ left 21:02 dj_goku left 21:03 Exodist left 21:05 dj_goku joined, dj_goku left, dj_goku joined 21:06 Exodist joined 21:07 dct_ joined 21:10 wamba joined 21:13 comborico1611 joined 21:27 natrys left 21:33 census joined 21:52 AlexDaniel left, AlexDaniel joined 21:58 eliasr left 22:06 rindolf left 22:09 census left
buggable New CPAN upload: PDF-Class-0.0.8.tar.gz by WARRINGD cpan.metacpan.org/authors/id/W/WA/...0.8.tar.gz 22:11
22:17 robertle left 22:27 setty1 left, Kaiepi left
kurahaupo Xliff: sorry was afk on phone to a bereaved friend 22:58
Xliff: I can't claim credit for calling moritz a velociraptor, but if you want to, go right ahead. 😁 22:59
23:02 zakharyas left, mniip left 23:04 espadrine joined 23:07 tt joined 23:14 espadrine left 23:30 sno left 23:47 Rawriful left, gabiruh_ is now known as gabiruh