Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-05-29

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:04 wbill joined #perl6
00:30 BenGoldberg joined #perl6
00:31 Xliff_ Can you specify the type of array elements in a signature?
00:32 gfldex m: sub f(Array[Int] $a){ dd $a }; f(Array[Int](1,2,3));
00:32 camelia rakudo-moar 7500ea: OUTPUT«Array[Int] $a = Array[Int].new(1, 2, 3)␤»
00:33 gfldex m: sub f(Int @a){ dd @a }; f(Array[Int](1,2,3));
00:33 camelia rakudo-moar 7500ea: OUTPUT«Array[Int].new(1, 2, 3)␤»
00:33 gfldex Xliff_: ^^^
00:33 skink joined #perl6
00:34 Xliff_ gfldex: Ah! Thank you!
00:35 Xliff_ m: sub f(Int @a) { dd @a }; f([1, 2, 3]);
00:35 camelia rakudo-moar 7500ea: OUTPUT«Type check failed in binding @a; expected Positional[Int] but got Array ($[1, 2, 3])␤  in sub f at /tmp/pQCMo69Coq line 1␤  in block <unit> at /tmp/pQCMo69Coq line 1␤␤»
00:36 gfldex you are feeding it Array[Any]
00:36 Xliff_ Hmmm... Don't know if I want to force the caller to have to specifcally write "Array[Int]"
00:36 kurahaupo joined #perl6
00:36 Xliff_ gfldex, yeah, but I'm writing API bindings.
00:37 colomon joined #perl6
00:37 Xliff_ If this were my own code, I wouldn't care. However I'm shooting for ease of use. I will just manually type check in the routine.
00:37 gfldex you could provide a multi
00:49 BenGoldberg joined #perl6
00:56 skink Hey Xliff_
00:58 Xliff_ \o
01:01 sufrostico joined #perl6
01:01 colomon joined #perl6
01:01 aries_liuxueyang joined #perl6
01:16 BenGoldberg joined #perl6
01:22 Xliff_ OK, here's a question. I have a class B that inherits from a class A. Both classes implement module M. If I want a method to refer to the M from class A, how would I do that?
01:23 Xliff_ s/module M/method M/
01:31 buharin_ joined #perl6
01:32 gfldex m: class A { method m() { say 'I haz a A' } }; class B is A { method m(){ say 'I haz a B'; self.A::m(); } }; B.new.m;
01:32 camelia rakudo-moar 7500ea: OUTPUT«I haz a B␤I haz a A␤»
01:32 gfldex Xliff_: ^^^
01:32 BenGoldberg joined #perl6
01:46 molaf joined #perl6
01:48 BenGoldberg joined #perl6
01:52 Ben_Goldberg joined #perl6
02:11 pierre joined #perl6
02:13 b2gills m: class A { method m() { say 'I haz a A' } }; class B is A { method m(){ say 'I haz a B'; self.A::m(); } }; B.new.A::m;
02:13 camelia rakudo-moar 7500ea: OUTPUT«I haz a A␤»
02:14 teatime joined #perl6
02:24 dalek doc: b27c0d1 | titsuki++ | doc/Type/Rational.pod:
02:24 dalek doc: Fix a typo DenomT to DeT
02:24 dalek doc: review: https://github.com/perl6/doc/commit/b27c0d1f53
02:24 dalek doc: 595d4ec | titsuki++ | doc/Type/Rational.pod:
02:24 dalek doc: Merge pull request #558 from titsuki/fix-typo
02:24 dalek doc:
02:24 dalek doc: Fix a typo DenomT to DeT
02:24 dalek doc: review: https://github.com/perl6/doc/commit/595d4ecc76
02:30 labster joined #perl6
02:31 pierre joined #perl6
02:32 BenGoldberg joined #perl6
02:46 noganex_ joined #perl6
02:54 Xliff_ gfldex++ && b2gills++: Thanks!
03:00 colomon joined #perl6
03:02 TakinOver joined #perl6
03:08 TakinOver joined #perl6
03:16 TakinOver joined #perl6
03:27 TakinOver joined #perl6
03:38 Xliff_ Opening a 8M P6 --profile HTML file in Chrome takes a bit.
03:45 Xliff_ Well, this file has become quite the problem.
03:45 Xliff_ I can't open it in Chrome, and it looks like FireFox will fail as well.
03:46 Xliff_ Profile data looks to be too large for their JS engines.
03:46 Xliff_ Oh! Firefox finally opened!
04:04 ssotka joined #perl6
04:10 skids joined #perl6
04:34 Cabanossi joined #perl6
04:38 tadzik Xliff; have you tried the qt profiler frontend?
04:39 tadzik Xliff_: https://github.com/tadzik/p6profiler-qt
04:40 tadzik it doesn't have all the features of the angular version, but it will show you the profiling data with which the browser shits itself :)
04:44 kurahaupo joined #perl6
04:50 Xliff_ tadzik, thanks for the suggestion!
04:50 Xliff_ Now I just need to know how to interpret the data. For some reason my code is running exceptionally slow.
04:51 Xliff_ I want to see why.
04:53 Sgeo joined #perl6
04:53 kurahaupo_ joined #perl6
05:14 jjido joined #perl6
05:21 bjz joined #perl6
05:34 wbill joined #perl6
05:37 anomie__ joined #perl6
05:37 anomie__ Is it a bug that it's so easy to pass malformed UTF-8 as an argument with linenoise?
05:38 Actualeyes joined #perl6
05:40 tadzik Xliff_: you're welcome :) Let me know if anything breaks in it, or if there's some feature that you really miss in it
05:40 adu joined #perl6
05:43 anomie__ linenoise really doesn't seem to work well with multi-byte characters
05:44 anomie__ I'll upload a video in a minute to show what I mean.
05:46 anomie__ This is a known bug, right? http://comfy.moe/eadsqp.ogv
05:54 bjz_ joined #perl6
05:54 anomie__ I think what happens, is that pressing backspace on the linenoise REPL removes one byte, rather than one character.
05:56 tadzik from what I remember from the linenoise source, that may be exactly the case
05:58 anomie__ All right. My internet is slow and annoying af so I won't do it right now, but we should see if there's an issue for that, cuz some like me (and perhaps some mac users), like to use an elipsis (…) instead of three dots (...), and other things.
05:59 anomie__ I guess that's really not high on the priority list though, it's pretty petty.
05:59 anomie__ But then again, with my limited knowledge it seems like low-hanging fruit to me.
05:59 pierre joined #perl6
06:00 bjz joined #perl6
06:02 jack_rabbit joined #perl6
06:15 domidumont joined #perl6
06:16 Actualeyes joined #perl6
06:19 domidumont joined #perl6
06:28 Xliff_ tadzik: I'm seeing serious delays before INIT in the one-liner I'm running. It's using a module that I'm developing, and I can't see why it is so slow.
06:29 Xliff_ Given the code, it looks like the slowdown is in the parsing. However, I can't really tell because I'm not well-versed in the profile output.
06:31 tadzik Xliff_: I'm not sure profiler will show you the parsing/module loading times
06:31 tadzik but this is known to be quite a slow process
06:31 tadzik try 'time perl6 -MYour::Module -e1'?
06:31 Xliff_ k
06:33 Xliff_ real    0m3.828s
06:33 Xliff_ user    0m3.756s
06:33 Xliff_ sys     0m0.068s
06:35 Xliff_ So parse time of around 4 seconds and another 2-3 for deserialization using Perl5's XML::Hash::XS
06:35 Xliff_ That includes retrieval via HTTP::UserAgent
06:36 rindolf joined #perl6
06:41 cpage_ joined #perl6
06:43 patrickz joined #perl6
06:53 rurban joined #perl6
06:53 rurban left #perl6
06:55 RabidGravy joined #perl6
07:03 rurban1 joined #perl6
07:10 wamba joined #perl6
07:10 jjido joined #perl6
07:18 darutoko joined #perl6
07:22 wamba joined #perl6
07:23 CIAvash joined #perl6
07:28 setty1 joined #perl6
07:33 Tonik joined #perl6
07:50 rurban joined #perl6
07:53 espadrine joined #perl6
07:56 RabidGravy right, all the modules working again
07:59 RabidGravy which came down to four instances of the builtin JSON parser being deprecated and used accidentally, one external dependency getting messed up, one "something odd going on with versioned dependencies" and two "WTF! why do I even bother" which required some re-writing
07:59 RabidGravy :-\
08:29 finanalyst joined #perl6
08:32 AlexDaniel joined #perl6
08:34 firstdayonthejob joined #perl6
08:36 [Sno] joined #perl6
08:37 rurban1 joined #perl6
08:38 rurban2 joined #perl6
08:38 rurban3 joined #perl6
08:45 spider-mario joined #perl6
08:48 rurban joined #perl6
08:57 xinming joined #perl6
08:59 labster joined #perl6
08:59 RabidGravy I think I am going to go back to once a week
08:59 anomie__ joined #perl6
09:00 RabidGravy I settled on once a month, shortly *after* a release, but that's too easy to let slide and doesn't catch regressions quickly enough
09:10 rurban joined #perl6
09:11 jjido joined #perl6
09:11 rindolf Hi all! "rakudobrew build moar" here (after a previous older build) fails with this error - http://paste.debian.net/712176/ - I'm on Mageia v6 x86-64.
09:12 RabidGravy .tell jnthn, if you want to look at the weird channel/react/promise interaction I was on about yesterday you will need https://github.com/jonathanstowe/A​udio-Libshout/releases/tag/v0.0.8 - libshout and icecast are available as packages on nearly all Linux and BSDs, you may need to adjust the icecast.xml
09:12 yoleaux RabidGravy: What kind of a name is "jnthn,"?!
09:12 RabidGravy .tell jnthn if you want to look at the weird channel/react/promise interaction I was on about yesterday you will need https://github.com/jonathanstowe/A​udio-Libshout/releases/tag/v0.0.8 - libshout and icecast are available as packages on nearly all Linux and BSDs, you may need to adjust the icecast.xml
09:12 yoleaux RabidGravy: I'll pass your message to jnthn.
09:15 RabidGravy rindolf, it is possible that they layout of some of the precompiled artefacts have changed, I'd suggest removing the whole "/home/shlomif/Download/unpack/per​l/p6/rakudobrew/moar-nom/install" and trying again
09:15 RabidGravy anyway I'm off out to a garden show
09:15 rindolf RabidGravy: bye
09:16 RabidGravy toodles
09:18 CIAvash joined #perl6
09:22 xinming_ joined #perl6
09:27 Actualeyes joined #perl6
09:31 dalek doc: 97cbb75 | (Jan-Olof Hendig)++ | doc/Type/Array.pod:
09:31 dalek doc: Added docs for method of in class Array
09:31 dalek doc: review: https://github.com/perl6/doc/commit/97cbb751fe
09:39 Emeric joined #perl6
09:50 dalek perl6-examples: 48133d0 | (Shlomi Fish)++ | categories/euler/prob286-shlomif.p6:
09:50 dalek perl6-examples: add a solution to Euler #286.
09:50 dalek perl6-examples: review: https://github.com/perl6/perl​6-examples/commit/48133d0b6c
09:51 wamba joined #perl6
09:57 pmurias joined #perl6
10:06 Emeric1 joined #perl6
10:11 patrickz joined #perl6
10:14 iH2O joined #perl6
10:25 iH2O left #perl6
10:27 pierre joined #perl6
10:40 grondilu joined #perl6
10:41 grondilu Hello #perl6
10:41 pierre joined #perl6
10:45 pmurias hi
10:51 tadzik hello from Mal-moo o/
10:53 Emeric joined #perl6
10:56 pierre joined #perl6
10:58 iH2O joined #perl6
10:59 Actualeyes joined #perl6
11:04 pmurias tadzik: where is that?
11:04 tadzik southern Sweden, it's actually Malmo
11:05 kurahaupo joined #perl6
11:05 iH2O joined #perl6
11:08 pmurias tadzik: any perl events bringing you there?
11:09 tadzik nah, just work stuff
11:09 rindolf grondilu: hi, how are you?
11:09 tadzik it's a lot warmer than last time though
11:19 iH2O left #perl6
11:30 kid51 joined #perl6
11:32 patrickz joined #perl6
11:45 dogbert17 o/ #perl6
11:48 dogbert17 if anyone wants to review my attempt to document Array.default the gist is here: https://gist.github.com/dogbert17​/aee462bdb51ef1d71caf3915e449c3b3
11:54 AlexDaniel m: my @a1 of Str is default(42)
11:54 camelia rakudo-moar beb3c9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/up9kK8EjjG␤Default value '42' will never bind to a parameter of type Array[Str]␤at /tmp/up9kK8EjjG:1␤------> 3my @a1 of Str is default(42)7⏏5<EOL>␤    expecting any of:␤        constraint␤»
11:55 AlexDaniel eh, LTA
11:56 dogbert17 AlexDaniel: ah my secon example is bogus, thx
11:56 dogbert17 s/secon/second/
11:57 AlexDaniel dogbert17: huh? my snippet is not related to your gist
11:57 AlexDaniel dogbert17: in fact, there's nothing wrong with your gist
11:58 dogbert17 AlexDaniel: true, you scared me :) and my code actually works, pheew
11:59 dogbert17 AlexDaniel: thx for taking a look
12:00 tokomer joined #perl6
12:00 AlexDaniel dogbert17++
12:02 ggoebel114 joined #perl6
12:02 dogbert17 AlexDaniel: thx, btw have you tried running the first code example here http://doc.perl6.org/type/Lock
12:03 dogbert17 it's broken but I don't have a clue what it should look like
12:03 pierre joined #perl6
12:04 AlexDaniel dogbert17: it's broken. Let's see
12:04 dalek doc: 5a14b51 | (Jan-Olof Hendig)++ | doc/Type/Array.pod:
12:04 dalek doc: Added docs for Array.default. AlexDaniel++
12:04 dalek doc: review: https://github.com/perl6/doc/commit/5a14b51884
12:07 pmurias joined #perl6
12:09 AlexDaniel dogbert17: ok
12:10 dogbert17 AlexDaniel: noticed it yesterday but am unable to fix it due to lack of knowledge
12:11 AlexDaniel dogbert17: it should be using ‘start’ and there has to be no ‘for’, but I'm trying to come up with an example that demonstrates the problem
12:11 kurahaupo joined #perl6
12:12 * dogbert17 afk time for a walk in the sun
12:13 AlexDaniel m: my $x = 0; await (^1000).map: { start { sleep 0.1; $x++ }; }; say $x;
12:13 camelia rakudo-moar beb3c9: OUTPUT«Memory allocation failed; could not allocate 14960 bytes␤»
12:13 jjido joined #perl6
12:13 AlexDaniel m: my $x = 0; await (^100).map: { start { sleep 0.1; $x++ }; }; say $x;
12:13 camelia rakudo-moar beb3c9: OUTPUT«Memory allocation failed; could not allocate 14960 bytes␤»
12:13 AlexDaniel oh come on
12:13 AlexDaniel m: my $x = 0; await (^10).map: { start { sleep 0.1; $x++ }; }; say $x;
12:13 camelia rakudo-moar beb3c9: OUTPUT«10␤»
12:13 AlexDaniel m: my $x = 0; await (^10).map: { start { sleep 0.1; $x++ }; }; say $x;
12:13 camelia rakudo-moar beb3c9: OUTPUT«10␤»
12:13 AlexDaniel dogbert17: ok, if you run that kind of thing on your own computer, you will see that the result is sometimes different
12:14 Emeric joined #perl6
12:16 AlexDaniel m: my $x = 0; my $l = Lock.new; await (^10).map: { start { $l.protect({ sleep 0.001; $x++ }); } }; say $x;
12:16 camelia rakudo-moar beb3c9: OUTPUT«10␤»
12:16 AlexDaniel dogbert17: and I believe that this is the right example ↑
12:16 AlexDaniel dogbert17: get rid of that sleep though
12:20 AlexDaniel dogbert17: https://gist.github.com/AlexDaniel​/93949b15cfea51b9c9193ff248fe0286
12:22 AlexDaniel dogbert17: I'm not sure if that's the best example to show there, but I hope that you will be able to figure it out
12:26 |meta joined #perl6
12:30 PotatoGim joined #perl6
12:32 Emeric joined #perl6
12:32 huggable joined #perl6
12:47 mspo left #perl6
12:52 Actualeyes joined #perl6
12:54 aries_liuxueyang joined #perl6
12:59 jferrero joined #perl6
13:00 brrt joined #perl6
13:26 tailgate Let's say I import a module with use
13:26 tailgate does use execute statements in the module? Could I include setup code for that module at the the end?
13:27 tailgate Like for example, when that module is loaded, I'd like to load a csv file into a static class member
13:28 psch tailgate: the module mainline runs during import, the module BEGIN time runs during module compilation
13:29 ecocode joined #perl6
13:29 psch so e.g. a < module Foo { BEGIN say "hi"; say "bye" } > would print "hi\nbye\n" on first 'use' after creation, and only "bye\n" on subsequent uses without changing the module
13:30 psch (because we do have largely working precompilation :) )
13:31 tailgate can BEGIN blocks be in just a file, or do they have to be in a module?
13:32 psch what do you mean "a file"?
13:32 psch they can be in any perl6 program, yes
13:32 tailgate that
13:32 psch if that program is a module or a, well, script only matters for the mentioned semantics
13:33 psch m: say "bye"; say BEGIN "hi"
13:33 camelia rakudo-moar beb3c9: OUTPUT«bye␤hi␤»
13:33 psch m: say "bye"; BEGIN say "hi" # duh
13:33 camelia rakudo-moar beb3c9: OUTPUT«hi␤bye␤»
13:34 pochi m: sub foo() { return [1,2,3], [<foo bar baz>] }; my (@a, @b) = foo(); say @b;
13:34 camelia rakudo-moar beb3c9: OUTPUT«[]␤»
13:34 psch m: sub foo() { return [1,2,3], [<foo bar baz>] }; my (@a, @b) := foo(); say @b;
13:34 camelia rakudo-moar beb3c9: OUTPUT«[foo bar baz]␤»
13:35 pochi o.O
13:35 pochi something about binding?
13:35 psch pochi: you're returning one container from &foo
13:35 psch pochi: that container contains two arrays
13:35 pochi right
13:35 psch pochi: and gets assigned to the first array in your declaration
13:36 psch pochi: binding lowers that by one container level
13:36 psch well, lowers the RHS
13:37 pochi is that the same ':' that goes infront of signatures?
13:37 psch it works as a mnemonic i suppose
13:37 psch which is probably the intend between the language design :)
13:37 pochi :-)
13:38 psch it's not the 'the same' in so far as that it doesn't work along the same code path or anything, but the semantics are very alike, yeah
13:39 pochi I see. thank you
13:53 kaare_ joined #perl6
13:54 dogbert17 AlexDaniel: many thanks for the code, do you want to commit the changes or should I?
13:56 AlexDaniel dogbert17: well, the point of my gist was to show you the intent of that code example :) So please do it yourself
13:56 AlexDaniel dogbert17: also, thanks for working on the docs. I love your contributions
13:56 dogbert17 AlexDaniel: will commit and thx for the kind words
14:01 dalek doc: 56f9f93 | (Jan-Olof Hendig)++ | doc/Type/Lock.pod:
14:01 dalek doc: Corrected broken example. AlexDaniel++ for providing a working example
14:01 dalek doc: review: https://github.com/perl6/doc/commit/56f9f93ad1
14:02 AlexDaniel dogbert17: uh, oh!
14:02 AlexDaniel dogbert17: there's no need for ‘for’
14:03 dogbert17 AlexDaniel: oops, will fix before anyone notices :)
14:04 AlexDaniel dogbert17: does it compile with for?
14:05 AlexDaniel nope
14:05 timotimo you'd need to have "await do for" i suppose
14:05 timotimo oh, actually
14:05 timotimo there's a map there, too
14:05 AlexDaniel await $_ perhaps
14:05 AlexDaniel but it's redundant
14:06 timotimo await (^10).map: { ... } should do fine
14:06 AlexDaniel yea
14:06 AlexDaniel dogbert17: by the way, what editor do you use?
14:07 dalek doc: 552ae16 | (Jan-Olof Hendig)++ | doc/Type/Lock.pod:
14:07 dalek doc: Had forgotten to remove a 'for' statement that should not be there
14:07 dalek doc: review: https://github.com/perl6/doc/commit/552ae16939
14:07 dogbert17 AlexDaniel: emacs
14:09 AlexDaniel dogbert17: perhaps you want to take a look at something like this: https://www.emacswiki.org/emacs/WhiteSpace
14:10 AlexDaniel dogbert17: I don't care about it too much, but there are people who are pissed off when they see trailing whitespace :)
14:10 AlexDaniel dogbert17: but generally it is a good idea to make your editor show more stuff
14:10 dogbert17 AlexDaniel: thx, will take a look
14:11 spider-mario joined #perl6
14:15 RabidGravy joined #perl6
14:26 mohae joined #perl6
14:26 rurban joined #perl6
14:31 RabidGravy boom
14:34 dogbert17 and he survived the garden show :)
14:35 dalek doc: b7a4665 | titsuki++ | doc/Language/contributors.pod:
14:35 dalek doc: Add a contributor
14:35 dalek doc: review: https://github.com/perl6/doc/commit/b7a466515c
14:35 dalek doc: c5fbf85 | titsuki++ | doc/Language/contributors.pod:
14:35 dalek doc: Merge pull request #560 from titsuki/add-contributor
14:35 dalek doc:
14:35 dalek doc: Add a contributor
14:35 dalek doc: review: https://github.com/perl6/doc/commit/c5fbf85f0c
14:40 domidumont joined #perl6
14:41 itaipu joined #perl6
14:41 AlexDaniel perhaps someone should also extract other missing names from git history ¯\_(ツ)_/¯
14:42 AlexDaniel ah, that's not just the contributors to docs
14:42 AlexDaniel nvm then
14:42 tony-o does nativecall not play well with passing anonymous subs?
14:42 Zoffix joined #perl6
14:42 Zoffix m: use Test; cmp-ok 2, '==', 5, 'seems sane';
14:42 camelia rakudo-moar beb3c9: OUTPUT«not ok 1 - seems sane␤␤# Failed test 'seems sane'␤# at /tmp/d2nEW6X5dj line 1␤# expected: '5'␤Sub+{<anon|52917568>}+{Precedence} object coerced to string (please use .gist or .perl to do that)  in block  at /home/camelia/rakudo-m-inst-1/share/per…»
14:42 Zoffix m: use Test; cmp-ok 2, '<', 5, 'seems sane';
14:42 camelia rakudo-moar beb3c9: OUTPUT«not ok 1 - seems sane␤␤# Failed test 'seems sane'␤# at /tmp/kqui3siS7u line 1␤# Could not use '<' as a comparator␤»
14:43 Zoffix Are docs wrong or test is broken? http://docs.perl6.org/language/​testing#By_arbitrary_comparison
14:43 Zoffix or am I doing something wrong
14:43 psch m: use Test; cmp-ok 2, &[<], 5, 'seems sane';
14:43 camelia rakudo-moar beb3c9: OUTPUT«ok 1 - seems sane␤»
14:43 Zoffix Right, but docs claim you can use strings
14:43 psch m: cmp-ok 'my spelling is apperling', '~~', /perl/, "bad speller";
14:43 camelia rakudo-moar beb3c9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/MRHnuRA5ME␤Undeclared routine:␤    cmp-ok used at line 1␤␤»
14:43 psch m: use Test; cmp-ok 'my spelling is apperling', '~~', /perl/, "bad speller";
14:43 camelia rakudo-moar beb3c9: OUTPUT«ok 1 - bad speller␤»
14:43 Zoffix :S
14:44 AlexDaniel m: use Test; cmp-ok 2, ‘<’, 5, ‘seems sane’;
14:44 camelia rakudo-moar beb3c9: OUTPUT«not ok 1 - seems sane␤␤# Failed test 'seems sane'␤# at /tmp/FjSPldGCl2 line 1␤# Could not use '<' as a comparator␤»
14:44 psch m: say EVAL '&infix:<<>'
14:44 camelia rakudo-moar beb3c9: OUTPUT«5===SORRY!5=== Error while compiling /home/camelia/EVAL_0␤Unable to parse expression in shell-quote words; couldn't find final '>>' ␤at /home/camelia/EVAL_0:1␤------> 3&infix:<<>7⏏5<EOL>␤    expecting any of:␤        colon pair␤      …»
14:44 Zoffix m: use Test; cmp-ok 2, '<', /5/, 'seems sane';
14:44 camelia rakudo-moar beb3c9: OUTPUT«not ok 1 - seems sane␤␤# Failed test 'seems sane'␤# at /tmp/djFBXzEOCs line 1␤# Could not use '<' as a comparator␤»
14:44 psch m: say EVAL '&infix:<==>'
14:44 camelia rakudo-moar beb3c9: OUTPUT«sub infix:<==> (Mu $?, Mu $?) { #`(Sub+{<anon|52917568>}+{Precedence}|37044272) ... }␤»
14:44 Zoffix Ahhh
14:44 psch if $op ~~ Callable ?? $op !! try EVAL "&infix:<$op>" -> $matcher {
14:44 psch is the offending line in Test.pm
14:45 psch changing it to < "&infix:('$op')" probably largely fixes it
14:45 psch well, unless we got a comparator that uses ', of course :)
14:45 psch the cleanest solution might actually be changing the Signature to expect a Callable for $op and ditching the EVAL bit
14:46 psch and of course adjusting the docs
14:46 Zoffix m: say &infix:("meow")
14:46 camelia rakudo-moar beb3c9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/CbNZ8GjfG2␤You can't adverb ␤at /tmp/CbNZ8GjfG2:1␤------> 3say &infix:("meow")7⏏5<EOL>␤»
14:46 psch m: say &infix:('<')
14:46 camelia rakudo-moar beb3c9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/VRJRa9C2Gf␤You can't adverb ␤at /tmp/VRJRa9C2Gf:1␤------> 3say &infix:('<')7⏏5<EOL>␤»
14:46 psch huh, that form doesn't work?
14:46 psch oh, right, brackets, not parens
14:46 psch m: say &infix:['<']
14:46 camelia rakudo-moar beb3c9: OUTPUT«sub infix:«<» (Mu $?, Mu $?) { #`(Sub+{<anon|52917568>}|70515680) ... }␤»
14:46 Zoffix m: my $op = '<'; say &infix:[$op]
14:46 psch m: say &infix:['meow']
14:46 camelia rakudo-moar beb3c9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ns1RvCJvoy␤Undeclared routine:␤    infix:<meow> used at line 1. Did you mean 'infix:<∖>', 'infix:<lt>', 'infix:<eq>', 'infix:<o>', 'infix:<~|>'?␤␤»
14:46 camelia rakudo-moar beb3c9: OUTPUT«Use of uninitialized value <element> of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed.  in any canonicalize_pair at src/Perl6/World.nqp line 4331␤Use of uninitialized value <element> of type A…»
14:46 AlexDaniel m: say Q「「「「「「hello」」」」」」
14:46 camelia rakudo-moar beb3c9: OUTPUT«hello␤»
14:47 Zoffix AlexDaniel++
14:47 aries_liuxueyang joined #perl6
14:48 psch m: BEGIN my $op = "<"; say &infix:<<$op>>
14:48 camelia rakudo-moar beb3c9: OUTPUT«sub infix:«<» (Mu $?, Mu $?) { #`(Sub+{<anon|52917568>}|45354096) ... }␤»
14:48 psch m: constant $op = "<"; say &infix:<<$op>>
14:48 camelia rakudo-moar beb3c9: OUTPUT«sub infix:«<» (Mu $?, Mu $?) { #`(Sub+{<anon|52917568>}|54107248) ... }␤»
14:48 psch Zoffix: the look up is compile time
14:48 Zoffix But yeah, +1 on ditching the eval. &[] vs '' is just one char away
14:53 Zoffix m: run "ls"
14:53 camelia rakudo-moar beb3c9: OUTPUT«run is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub run at src/RESTRICTED.setting line 14␤  in block <unit> at /tmp/wWcCMBi30n line 1␤␤»
14:53 Zoffix m: use Test; cmp-ok '', '~~>;warn run "ls"; my $x =<z', '', '';
14:53 camelia rakudo-moar beb3c9: OUTPUT«Perlito␤dalek-queue␤evalbot␤evalbot.lo​g␤foo␤lib␤log␤mbox␤nqp-js␤p1␤p2␤p6eval-token␤​perl5␤rakudo-j-1␤rakudo-j-2␤rakudo-j-inst␤rak​udo-j-inst-1␤rakudo-j-inst-2␤rakudo-m-1␤rakud​o-m-2␤rakudo-m-inst␤rakudo-m-inst-1␤rak…»
14:53 * Zoffix snickers
14:55 AlexDaniel Zoffix: yeah. Awesome. Good job.
14:56 Zoffix 👏👏👏
15:01 pochi Type check failed for return value; expected Array[Numeric] but got Array[Numeric].new()
15:02 Zoffix pochi, we can't fix a code we can't see :)
15:02 dalek doc: 7c4d9d2 | (Jan-Olof Hendig)++ | doc/Type/Bag.pod:
15:02 dalek doc: Fixed two broken links
15:02 dalek doc: review: https://github.com/perl6/doc/commit/7c4d9d24fc
15:02 pochi I just don't understand the error
15:03 pochi aren't those the same?
15:03 Zoffix You're returning a wrong type, though how you got Array[Numeric].new() to be a type is beyond me
15:03 psch m: say Array[Numeric] eqv Array[Numeric].new
15:03 camelia rakudo-moar beb3c9: OUTPUT«False␤»
15:04 Zoffix m: say Array[Numeric].new
15:04 camelia rakudo-moar beb3c9: OUTPUT«[]␤»
15:04 Zoffix m: say Array[Numeric].new.WHAT
15:04 camelia rakudo-moar beb3c9: OUTPUT«(Array[Numeric])␤»
15:04 * Zoffix shrugs
15:04 rindolf joined #perl6
15:04 psch m: sub f(--> Array[Numeric].new) { Array[Numeric] }
15:04 camelia rakudo-moar beb3c9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/gKMBGKWejc␤Type 'Array' is not declared. Did you mean 'array'?␤at /tmp/gKMBGKWejc:1␤------> 3sub f(--> Array[Numeric]7⏏5.new) { Array[Numeric] }␤»
15:04 AlexDaniel m: my @a of Numeric; @a[0] = Array[Numeric].new
15:04 camelia rakudo-moar beb3c9: OUTPUT«Type check failed in assignment to @a; expected Numeric but got Array[Numeric] (Array[Numeric].new())␤  in block <unit> at /tmp/pBjySgI1TG line 1␤␤»
15:04 psch m: sub f() return Array[Numeric].new { Array[Numeric] }
15:04 camelia rakudo-moar beb3c9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/wNDPYf43v4␤Missing block␤at /tmp/wNDPYf43v4:1␤------> 3sub f()7⏏5 return Array[Numeric].new { Array[Numer␤    expecting any of:␤        new name to be defined␤»
15:04 psch m: sub f() returns Array[Numeric].new { Array[Numeric] }
15:04 camelia rakudo-moar beb3c9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/m0p1IMyvz9␤Missing block␤at /tmp/m0p1IMyvz9:1␤------> 3sub f() returns Array[Numeric]7⏏5.new { Array[Numeric] }␤    expecting any of:␤        new name to be defined␤»
15:04 psch m: sub f() returns (Array[Numeric].new) { Array[Numeric] }
15:04 camelia rakudo-moar beb3c9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/QUVB391BGq␤Malformed trait␤at /tmp/QUVB391BGq:1␤------> 3sub f() returns7⏏5 (Array[Numeric].new) { Array[Numeric] }␤»
15:04 Zoffix Or pochi can actually show their code so we wouldn't need to spam trying to guess it? :)
15:05 psch hah!
15:05 AlexDaniel m: my @a of Numeric; @a[0] = Array[Numeric].new
15:05 camelia rakudo-moar beb3c9: OUTPUT«Type check failed in assignment to @a; expected Numeric but got Array[Numeric] (Array[Numeric].new())␤  in block <unit> at /tmp/dp_mmfAONE line 1␤␤»
15:05 psch that would be easy :P
15:05 AlexDaniel well that's close enough
15:05 AlexDaniel ah no, not even close
15:05 psch m: sub f() returns Array[Numeric] { Array[Numeric].new }; f()
15:05 camelia rakudo-moar beb3c9: ( no output )
15:05 psch well, that just works
15:06 psch m: sub f(--> Array[Numeric]) { Array[Numeric].new }; f() # so does this
15:06 camelia rakudo-moar beb3c9: ( no output )
15:06 psch so, whatever is going on there definitely needs a code example :)
15:06 pochi I'll try to find a small non-working sample
15:06 psch pochi: why not just put your whole code on a pastebin?
15:06 AlexDaniel psch: or we can introduce a new game here
15:07 AlexDaniel psch: come up with a code snippet that produces the same output
15:07 pochi psch: it's quite a lof of code already :-)
15:07 pochi spanning multiple files
15:07 AlexDaniel psch: there are some interesting ones, like “Segmentation fault” xD
15:08 wamba joined #perl6
15:08 AlexDaniel nowadays I'm not sure if there's something that makes rakudo segfault. I think that all my code in segfaulty tickets now produce some kind of an error instead
15:09 psch m: use NativeCall; sub free is native {*}; free(0)
15:09 camelia rakudo-moar beb3c9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/8uyATnGRHa␤Calling free(Int) will never work with declared signature ()␤at /tmp/8uyATnGRHa:1␤------> 3use NativeCall; sub free is native {*}; 7⏏5free(0)␤»
15:09 psch m: use NativeCall; sub free(int $) is native {*}; free(0)
15:10 camelia rakudo-moar beb3c9: OUTPUT«Potential difficulties:␤    In 'free' routine declaration - Not an accepted NativeCall type for parameter [1]  : int␤     --> For Numerical type, use the appropriate int32/int64/num64...␤    at /tmp/MW2h9AxSQx:1␤    ------> 3ativeCall; sub free(in…»
15:10 psch m: use NativeCall; sub free(int32 $) is native {*}; free(0)
15:10 camelia rakudo-moar beb3c9: ( no output )
15:10 * psch wonders *what* that actually does
15:10 psch pochi: maybe --ll-exception can help you to figure out what's going on
15:11 Zoffix RFC to disallow string comparators in cmp-ok: https://rt.perl.org/Ticket/Display.html?id=128283
15:11 psch m: use NativeCall; sub malloc(int32 $a, int32 $b) is native {*}; malloc(0, 8)
15:11 camelia rakudo-moar beb3c9: ( no output )
15:11 * psch stops messing with libc :P
15:11 AlexDaniel and that's not fair anyway
15:17 Zoffix m: kill 11, $*PID
15:17 camelia rakudo-moar beb3c9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zqB18EzhkS␤Undeclared routine:␤    kill used at line 1␤␤»
15:17 Zoffix :(
15:18 dalek doc: 35dd2bc | (Zoffix Znet)++ | doc/Language/5to6-perlfunc.pod:
15:18 dalek doc: Fix typo
15:18 dalek doc: review: https://github.com/perl6/doc/commit/35dd2bc7a4
15:18 AlexDaniel Zoffix: well, why don't you use your eval trick
15:19 Zoffix AlexDaniel, ???
15:19 zakharyas joined #perl6
15:19 AlexDaniel Zoffix: run(‘kill’, 11, $*PID)
15:19 Zoffix Ah
15:19 Zoffix meh
15:20 Zoffix Not sure how good "Now part of the Proc::Async class, but looks to work as in Perl 5." is in 5to6 docs for kill. Considering the Proc's kill method is just for that proc.
15:20 Zoffix m: use Test; cmp-ok '', '~~>;warn run(‘kill’, 11, $*PID); <z', '', '';
15:20 camelia rakudo-moar beb3c9: OUTPUT«(signal TERM)kill: sending signal to 11 failed: Operation not permitted␤»
15:20 Zoffix tsk tsk
15:21 Zoffix m: use Test; cmp-ok '', '~~>;warn run(‘kill’, $*PID, 11); <z', '', '';
15:21 camelia rakudo-moar beb3c9: OUTPUT«(signal TERM)kill: sending signal to 11 failed: Operation not permitted␤»
15:26 geekosaur "-11"
15:26 geekosaur otherwise you're sending SIGTERM to pid 11 as well as whatever pid you intended
15:26 Zoffix Ah, right
15:26 Zoffix m: use Test; cmp-ok '', '~~>;warn run(‘kill’, "-11", $*PID); <z', '', '';
15:26 camelia rakudo-moar beb3c9: OUTPUT«(signal SEGV)»
15:28 pochi I got it down to a few lines of code: https://pastee.org/pxjsh
15:28 pochi but I can't get it down under 3 files :-(
15:29 psch that's a bit weird
15:30 pochi thank you :-)
15:30 pochi almost whatever I do to change any ocde in the 3 files, the error goes away
15:33 pochi Hm, seems XXX doesn't have to be a class with Numeric, just a 'my Numeric @a;' also triggers it.
15:35 psch well, it doesn't happen on rakudo-jvm, fwiw :)
15:35 psch ...not that that'd help
15:36 pochi :-)
15:36 psch cause rakudo-jvm is unfortunately still pretty broken :/
15:36 psch anyway, i'd guess it might be something about reuse of parametrized roles..?
15:37 psch well, across SC boundary
15:37 finanalyst joined #perl6
15:37 Zoffix I somehow managed to make it not throw that error by changing has to my and so on and then changing back to original it work... and when I nuked .precomp the error reappeared :/
15:37 psch pochi: can you RT your example?
15:37 pochi aye
15:38 psch 'cause i can really only guess that it might be somewhere in that direction, and have no real clue how to follow up on my guess... :)
15:55 RabidGravy Zoffix this sounds  a similar problem to what I had the other day with Lumberjack
15:58 Zoffix I think psch's hunch is more relevant. I may have just stumbled onto another bug with precomp not being invalidated
15:59 Zoffix s/relevant/closer to the cause of poch's bug/;
16:03 CIAvash I think this is the same bug: https://rt.perl.org/Public/​Bug/Display.html?id=127309
16:04 telex joined #perl6
16:04 geekosaur wow, that's a "fun" looking bug
16:05 pochi that looks exactly the same
16:07 vike joined #perl6
16:16 camelia joined #perl6
16:18 dalek doc: 8507fd5 | (Zoffix Znet)++ | html/ (2 files):
16:18 dalek doc: Add to easily get a link to a section a user is reading
16:18 dalek doc: review: https://github.com/perl6/doc/commit/8507fd513b
16:29 wooy joined #perl6
16:32 huggable joined #perl6
16:34 titsuki Hi. Does anyone know how to implement Visitor Pattern in Perl 6 ? (SEE ALSO: https://rt.perl.org/Ticket/Display.html?id=128275 )
16:36 vendethiel joined #perl6
16:36 hankache joined #perl6
16:37 timotimo titsuki: to be honest, i'd just put both into the same file and maybe give it two different export flags to get around the problem?
16:37 timotimo even if you don't do the export flag thing, you can continue experimenting with visitor patterns and such
16:37 timotimo BBIAB
16:41 hankache afternoon #perl6
16:43 Zoffix \o
16:43 Nicq joined #perl6
16:43 titsuki timotimo: hmm, honestly to say "put both into the same file" doesn't seem the best solution...
16:44 geekosaur it's not. but we're still working bugs out of this stuff.
16:45 geekosaur might see if it works with "no precompilation;" at the top?
16:45 psch actually, circular referencing of modules is never gonna work
16:45 llfourn ^^
16:45 Zoffix psch, how come?
16:45 llfourn because you can't depend on a module that depends on you
16:45 psch Zoffix: because of one pass parsing
16:45 Zoffix psch, I see
16:45 psch Zoffix: we have to know what A means when we parse B, and we have to know what B means when we parse A
16:46 psch Zoffix: which is clearly an infinite loop :)
16:46 llfourn titsuki: you could declare roles in the same file and have the classes in different files.
16:47 geekosaur I think some answer is going to be needed here, or this is going to become a problem
16:47 Zoffix It does seem as an obvious flaw however. You can't set specific types to, say, attributes any time you want
16:48 llfourn I think that's what roles are for. ie declare roles upfront in one file and then just depend on that file. Sorta like a .h file.
16:49 * Zoffix isn't sure what that means
16:49 ugexe this usually means you want some form of dependency inversion
16:50 ugexe with a shared interface
16:50 Zoffix If I have Foo that takes .bar of type Bar and Bar that takes .foo of type Foo I have to shove them in one file for the sole reason that Perl 6 can't handle circular references.
16:50 llfourn instead of A.pm depending on B.pm and B.pm depending on A.pm you have R.pm which both depend on and the classes in A.pm and B.pm implement the roles.
16:50 llfourn the roles in R.pm are declared in the same file
16:51 llfourn so basically rather than declaring huge classes in the same file you have small roles in the same file.
16:51 Zoffix :/
16:51 llfourn and the classes in different files.
16:51 Zoffix I don't get how that solves anything.
16:52 Zoffix But maybe we're talking about different things...
16:52 mst it gets rid of the need for the circular dependency, I think
16:52 llfourn hmm ok I'll write a gist to show how it can solve what I percieve as titsuki problem.
16:53 titsuki llfourn: thanks !
16:59 llfourn ok take a look at: https://gist.github.com/LLFourn/​df95c23e884b7c1a9dd0e52580431c15
17:00 llfourn the idea being is that you can still typecheck everything without the circular dependency
17:01 llfourn I totally get the desire to modules that refer to eachother though. I have even brought this up myself in this channel.
17:02 titsuki llfourn: thanks a lot ! It looks good to me.
17:02 llfourn I do have some large .pm files with may too many interdependent classes in them because I cbf creating a central role file.
17:02 llfourn titsuki: no worries let me know if you think of anything better :)
17:05 Zoffix llfourn++
17:07 jjido joined #perl6
17:13 smls joined #perl6
17:17 gfldex is there a way to get hold of the return value of a wrapee inside the wrapper?
17:18 llfourn gfldex: do you mean with .wrap?
17:18 gfldex yes
17:19 llfourn m: sub foo { "inside" }; &foo.wrap: { my $res = callsame; $res.uc }; say foo();
17:19 camelia rakudo-moar beb3c9: OUTPUT«inside␤»
17:19 llfourn hmm..
17:19 gfldex callsame and friends never return
17:20 llfourn err really :S
17:20 llfourn m: sub foo { "inside" }; &foo.wrap: { my $res = nextsame; $res.uc }; say foo();
17:20 gfldex whould i lie to you?
17:20 camelia rakudo-moar beb3c9: OUTPUT«inside␤»
17:20 llfourn what's the one that returns then?
17:21 llfourn I could have sworn callsame returns
17:21 llfourn m: sub foo { "inside" }; &foo.wrap: { my $res = callwith(); $res.uc }; say foo();
17:21 camelia rakudo-moar beb3c9: OUTPUT«inside␤»
17:21 gfldex i don't know the answer, hence my question.
17:21 llfourn callsame is meant to return
17:22 llfourn http://docs.perl6.org/language/functions # according to docs at least
17:22 jnthn m: use soft; sub foo { "inside" }; &foo.wrap: { my $res = callwith(); $res.uc }; say foo();
17:22 camelia rakudo-moar beb3c9: OUTPUT«INSIDE␤»
17:22 yoleaux 09:12Z <RabidGravy> jnthn: if you want to look at the weird channel/react/promise interaction I was on about yesterday you will need https://github.com/jonathanstowe/A​udio-Libshout/releases/tag/v0.0.8 - libshout and icecast are available as packages on nearly all Linux and BSDs, you may need to adjust the icecast.xml
17:23 jnthn Note the `use soft` which is needed if you're going to wrap at runtime
17:23 llfourn m: sub foo { "inside" }; BEGIN &foo.wrap: { my $res = callwith(); $res.uc }; say foo();
17:23 camelia rakudo-moar beb3c9: OUTPUT«INSIDE␤»
17:23 llfourn jnthn++ thanks
17:24 dalek doc: 04948f2 | (Zoffix Znet)++ | html/js/main.js:
17:24 dalek doc: Fix type error
17:24 dalek doc: review: https://github.com/perl6/doc/commit/04948f2819
17:30 buharin_ joined #perl6
17:35 firstdayonthejob joined #perl6
17:36 gfldex where do we doc pragmas like `use soft;`?
17:36 smls Could this bug be related to precomp? https://rt.perl.org/Ticket/Disp​lay.html?id=128287#txn-1403174
17:36 smls ^^ nine
17:36 smls Something seems to be going wrong when loading compunits that use parameterized types.
17:43 Zoffix Oh christ... in my Perl 6 Workshop posts, in the design I forgot to include how the function will know what API key to use! I wonder if I can spin it like the omission was deliberate all part of my plan....
17:44 llfourn smls: you can tell if it's related to precomp by just doing "no precompilation;" at the top of the .pm files
17:44 llfourn and see if it still goofs
17:45 ugexe fwiw it works if you declare your modules `unit module A`, `unit module B`
17:46 ugexe so its printing once during precomp, and once during runtime
17:46 smls llfourn: Adding `no precompilation;` to B.pm indeed fixes it!
17:47 llfourn ;)
18:03 dalek doc: 60e2099 | (Zoffix Znet)++ | html/css/style.css:
18:03 dalek doc: Fix CSS bug with title anchors
18:03 dalek doc: review: https://github.com/perl6/doc/commit/60e2099fd6
18:10 FROGGS joined #perl6
18:11 FROGGS o/
18:13 hankache_ joined #perl6
18:13 psch o/ FROGGS
18:14 bartolin \o FROGGS
18:16 tadzik FROGGS! \o/
18:16 FROGGS :o)
18:18 Zoffix New post: Perl 6 Hands-On Workshop: Weatherapp (Part 3): http://perl6.party/post/Perl-6-Han​ds-On-Workshop--Weatherapp--Part-3
18:20 daxim joined #perl6
18:23 llfourn Zoffix++
18:25 xfix joined #perl6
18:28 hankache joined #perl6
18:28 Zoffix WANT! (camelia plush) https://scontent-yyz1-1.xx.fbcdn.net/v/t1.0-9/1332​7397_1121217634612752_8667348857516811931_n.jpg?oh​=38534709c57821cfa7e1efde4d4b75fe&amp;oe=57CC298B
18:29 psch that is adorable
18:29 DrForr They're terribly cute.
18:29 llfourn haha that's awesome
18:29 yqt joined #perl6
18:30 Emeric Camelia -->  <3
18:30 tadzik aww :}
18:35 mr-foobar joined #perl6
18:54 grondilu joined #perl6
19:00 ssotka joined #perl6
19:01 labster joined #perl6
19:06 TakinOver joined #perl6
19:08 rindolf joined #perl6
19:51 TEttinger joined #perl6
19:57 masak tfw you start writing a blog post about something interesting, and finishing up the blog post gets further and further away because you keep finding more interesting things
19:57 xtreak joined #perl6
19:58 Zoffix What does 'tfw' mean?
19:58 grondilu that feel when
19:58 Zoffix ah
19:58 grondilu I did not know, had to look it up
19:58 Zoffix I tried to look it up but couldn't find anything useful :/
19:59 grondilu google found me the relevant entry as top choice.
19:59 masak I thought it meant "that feeling when"... but I'm getting old, so maybe it means "feel" :P
19:59 masak it's pretty common on Twitter
19:59 grondilu www.urbandictionary.com/define.php?term=TFW
19:59 masak would anyone here mind getting it as a minichallenge while I struggle to write it up? :)
20:00 Zoffix ehehe http://www.urbandictionary.​com/define.php?term=Zoffix
20:01 tadzik lol
20:02 masak clicking urbandictionary links always fills me with trepidation
20:02 tadzik I'm still a bit sad and a bit amused at what I got when looking up "AFAB" there
20:03 mst masak: I know it as 'that feeling when', but shortening feeling to feel seems to be a thing in general
20:03 tadzik . o O ( right in the feels )
20:03 huf i've seen fee-fees too
20:04 tadzik I read that as "feces"
20:04 huf eventually it'll be gnileef
20:04 masak mst: so far, I took "teh feelz" to be a l33t way to say "strong emotions"
20:04 tadzik it opens so many possibities too!
20:04 tadzik "I want to be hardcore but I'm sensitive inside" :]
20:05 masak maybe it's a soft core within a bigger hard core
20:05 tadzik ooh
20:06 masak like Toffifees
20:06 * tadzik giggles
20:06 tadzik oh, sorry: "teh giggz"
20:06 mst masak: ARMADILLO
20:06 mst CRUNCHY ON THE OUTSIDE, CHEWY ON THE INSIDE
20:07 masak heh
20:08 tadzik hm, so soft core within a bigger hard-core.. that makes it dual-core?
20:11 jjido joined #perl6
20:32 huggable joined #perl6
20:41 _28_ria joined #perl6
20:42 Zoffix Does my code look really "clever" on http://perl6.party/post/Perl-6-Han​ds-On-Workshop--Weatherapp--Part-3 ?
20:42 jjido joined #perl6
20:42 Zoffix Wondering if I should bother responding to this comment or to chuck it into the troll bin: https://www.reddit.com/r/programming/​comments/4llkov/perl_6_handson_worksh​op_weatherapp_part_3_writing/d3ocbmn
20:43 dalek doc: c72d7ba | (Jan-Olof Hendig)++ | doc/Type/IO/Socket/Async.pod:
20:43 dalek doc: Fixed typo and a broken link
20:43 dalek doc: review: https://github.com/perl6/doc/commit/c72d7ba1f3
20:43 mst Zoffix: no, it looks exactly the right level of stupid for test code to me
20:43 Zoffix stupid? :/
20:44 gnull m: my $a = dir '/'; say $a;
20:44 camelia rakudo-moar 4a7eaa: OUTPUT«("/boot".IO "/home".IO "/opt".IO "/srv".IO "/tmp".IO "/usr".IO "/var".IO "/etc".IO "/dev".IO "/proc".IO "/sys".IO "/run".IO "/lib".IO "/sbin".IO "/bin".IO "/lib64".IO "/mnt".IO "/root".IO "/selinux".IO)␤»
20:44 gnull m: my @a = dir '/'; say @a;
20:44 camelia rakudo-moar 4a7eaa: OUTPUT«["/boot".IO "/home".IO "/opt".IO "/srv".IO "/tmp".IO "/usr".IO "/var".IO "/etc".IO "/dev".IO "/proc".IO "/sys".IO "/run".IO "/lib".IO "/sbin".IO "/bin".IO "/lib64".IO "/mnt".IO "/root".IO "/selinux".IO]␤»
20:44 gnull what the hack?
20:44 Zoffix gnull, ?
20:45 gnull why can i store array into scalar?
20:45 smls because this is not Perl 5 :P
20:45 moritz because an array is an object
20:45 Zoffix gnull, because this isn't Perl 5 :P
20:45 gnull I didn't expect the first example to work)
20:45 mst Zoffix: replied.
20:46 mst Zoffix: because I could say the last sentence.
20:46 AlexDaniel well, you can store arrayref in a scalar in perl 5
20:46 Zoffix mst++ thanks :D
20:46 AlexDaniel my $x = [4, 8, 15, 16]
20:46 smls gnull: In Perl 6, a $ variable is a container that can hold any object.
20:46 smls which includes Array objects.
20:47 Zoffix gnull, the @ and % sigils are more about getting Positional and Associative roles for free, rather than storing specifically Arrays or Hashes
20:47 Zoffix At least that's my feel for them. Not that I'm an expert
20:47 gnull does containig array in `$` somehow differ from `@` ?
20:47 AlexDaniel you have to access elements like $x->[1] though (in perl 5)
20:48 smls gnull: A @ variable is always a *defined* Array object. And assigning to it, replaces the elements of the array instead of creating a new one.
20:48 gnull m: sub f(@x){say @x}; my $a = [1,2,3]; f $a;
20:48 camelia rakudo-moar 4a7eaa: OUTPUT«[1 2 3]␤»
20:48 smls Whereas a $ variable starts out undefined,m and can hold any defined or undefined value/object.
20:49 Zoffix m: my @a; say @a.WHAT; my Array $a; say $a.WHAT
20:49 camelia rakudo-moar 4a7eaa: OUTPUT«(Array)␤(Array)␤»
20:50 Zoffix smls, I don't get what you mean.
20:50 Zoffix I guess my question would be: why the hell would I want to ever use @a or %a?
20:50 smls m: my @a; say @a;  my Array $a; say $a
20:50 camelia rakudo-moar 4a7eaa: OUTPUT«[]␤(Array)␤»
20:50 RabidGravy m: my @a; say @a.defined; my Array $a; say $a.defined
20:50 camelia rakudo-moar 4a7eaa: OUTPUT«True␤False␤»
20:51 gnull YEs, what is the fundamental difference?
20:51 AlexDaniel the difference is in syntax, basically
20:51 AlexDaniel m: my $x = 4, 8, 15; # can't do that
20:51 camelia rakudo-moar 4a7eaa: OUTPUT«WARNINGS for /tmp/Uh4kxUUQMT:␤Useless use of constant integer 15 in sink context (lines 1, 1)␤Useless use of constant integer 8 in sink context (lines 1, 1)␤»
20:51 AlexDaniel m: my Sx = 4, 8, 15; # can do that
20:51 camelia rakudo-moar 4a7eaa: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zKRJG4kSUw␤Malformed my (did you mean to declare a sigilless \Sx or $Sx?)␤at /tmp/zKRJG4kSUw:1␤------> 3my Sx7⏏5 = 4, 8, 15; # can do that␤»
20:51 AlexDaniel oops
20:51 AlexDaniel m: my @x = 4, 8, 15; # can do that
20:51 camelia rakudo-moar 4a7eaa: ( no output )
20:52 mohae_ joined #perl6
20:52 AlexDaniel m: my $x = (4, 8, 15, 16); say ‘hi’ for $x # does not DWIM
20:52 camelia rakudo-moar 4a7eaa: OUTPUT«hi␤»
20:52 AlexDaniel m: my @x = (4, 8, 15, 16); say ‘hi’ for @x # DWIMs
20:52 camelia rakudo-moar 4a7eaa: OUTPUT«hi␤hi␤hi␤hi␤»
20:52 gnull assigning to $a happens in scalar context, but to @a is in list context. Right?
20:52 AlexDaniel m: my $x = (4, 8, 15, 16); say ‘hi’ for @$x
20:52 camelia rakudo-moar 4a7eaa: OUTPUT«hi␤hi␤hi␤hi␤»
20:52 smls gnull: Yes.
20:52 smls Well, there is no context in the PErl 5 sense
20:53 smls but assigning to @a accepts a list on the right-hand side
20:54 smls Zoffix: You could get away without ever using @ variables. At the end of the day, what they offer over $ variables is convenience for working with arrays.
20:54 Zoffix I see. So they'
20:54 Zoffix I see. So they're far less "important" than in Perl 5...
20:54 Zoffix or "fundamental" I guess
20:55 smls Well, I do still use them all the time... :P
20:55 gnull m: my $a = [1,2,3]; say @$a;
20:55 camelia rakudo-moar 4a7eaa: OUTPUT«[1 2 3]␤»
20:55 gnull m: my $a = [1,2,3]; &$a;
20:55 camelia rakudo-moar 4a7eaa: ( no output )
20:56 gnull feels like storing an array in $var is like references in perl5
20:57 smls gnull: You can think of every $ variable in Perl 6 as an implicit reference, if that helps.
20:57 gnull In the last example I'm trying to derefer a reference to an array as function
20:58 gnull m: my $a = [1,2,3]; say &$a;
20:58 camelia rakudo-moar 4a7eaa: OUTPUT«[1 2 3]␤»
20:58 smls gnull: There is Perl 5-like referencing/dereferencing in Perl 6.
20:58 AlexDaniel Zoffix: you can get away without @ in perl 5 as well
20:58 Zoffix AlexDaniel, true
20:59 Zoffix gnull, there is no references in Perl 6.
20:59 gnull Looks like &$a evaluates to an array. But I'm trying to derefer it as a function
20:59 mst in perl5 you effectively only need @foo as sugar barring maaaybe performance bits too
21:00 smls gnull: Oops, I meant "there is *no* ..."
21:00 smls The @() contectualizer in @$a is simply short for $a.list
21:01 smls No idea what &() even does
21:01 Zoffix What does &$a do? I don't see & as a prefix op on http://docs.perl6.org/language/operators
21:01 Zoffix m: my $x = 5; say &$x()
21:02 camelia rakudo-moar 4a7eaa: OUTPUT«No such method 'CALL-ME' for invocant of type 'Int'␤  in block <unit> at /tmp/n61yoUs0cn line 1␤␤»
21:02 Zoffix m: my $x = 5; say &$x
21:02 camelia rakudo-moar 4a7eaa: OUTPUT«5␤»
21:02 gnull m: my $x = 5; say $x()
21:02 camelia rakudo-moar 4a7eaa: OUTPUT«No such method 'CALL-ME' for invocant of type 'Int'␤  in block <unit> at /tmp/m0ldQ8G7RO line 1␤␤»
21:03 smls Zoffix: http://design.perl6.org/S03.html#line_222
21:03 gnull I tried to derefer like in perl5, now I see that it doesn't work. Looks like & before $variable does nothing.
21:03 smls Zoffix: They are contextualizers (i.e. special syntax), not prefix operators.
21:04 smls $() calls .item,  @() calls .list,  %() calls .hash.
21:04 Zoffix & calls... ?
21:04 smls No idea.
21:04 Zoffix :P
21:04 gnull m: my $a = [1,2,3]; say a.list;
21:04 camelia rakudo-moar 4a7eaa: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Uls0EwDttb␤Undeclared routine:␤    a used at line 1␤␤»
21:05 gnull m: my $a = [1,2,3]; say $a.list;
21:05 camelia rakudo-moar 4a7eaa: OUTPUT«[1 2 3]␤»
21:05 gnull m: my $a = [1,2,3]; say $a.list.list;
21:05 camelia rakudo-moar 4a7eaa: OUTPUT«[1 2 3]␤»
21:05 Zoffix gnull, personally, I found forgetting all of my Perl 5 helpful when learning Perl 6. It's just too different a language to try to just map the concepts and end up with decent code.
21:06 smls Well, no need to forget all of Perl 5. Just everything about references... :P
21:06 Zoffix and the subroutine arguments/parameters
21:06 gnull Fortunately I haven't dived deep into perl5, so will not take much time to forget it
21:07 Zoffix :)
21:09 gnull Is there a way to get all of class instance methods in perl6? I mean everything that can go after `$a.`
21:09 gnull Something like `dir` in python?
21:09 smls $a.^methods
21:11 smls m: say "Hello world".^methods
21:11 camelia rakudo-moar 4a7eaa: OUTPUT«(BUILD Int Num chomp chop pred succ simplematch match ords samecase samemark samespace word-by-word trim-leading trim-trailing trim encode NFC NFD NFKC NFKD wordcase trans indent codes chars uc lc tc fc tclc flip ord WHY WHICH Bool Str Stringy DUMP ACCEPTS…»
21:11 gnull my $a = [1,2]; my @b = [1, 2]; say $a.^methods eqv @b.^methods
21:12 gnull m: my $a = [1,2]; my @b = [1, 2]; say $a.^methods eqv @b.^methods
21:12 camelia rakudo-moar 4a7eaa: OUTPUT«True␤»
21:17 smls Zoffix: Do you know if there's a way to add diagrams/images to the content p6doc pages?
21:17 Zoffix No idea.
21:17 Zoffix Well, we have type charts, so I guess there *is* a way :)
21:18 Zoffix Like this one: http://docs.perl6.org/type/BagHash#See_Also
21:18 geekosaur gnull, that probably won't help because there's this thing where an item acts like an array-like thing with one item in it
21:18 smls I don't think those are included from the POD content though
21:18 smls but rather, added procedurally to type pages by htmlify
21:19 gnull Thank you. It became much more clear for me.
21:21 geekosaur m: my $x; my @x; say $x.HOW; say @x.HOW
21:21 camelia rakudo-moar 4a7eaa: OUTPUT«Perl6::Metamodel::ClassHOW.new␤Method 'gist' not found for invocant of class 'Perl6::Metamodel::ClassHOW+{<anon>}'␤  in block <unit> at /tmp/RAegQ2wWx8 line 1␤␤»
21:21 geekosaur neither of those very helpful, sigh
21:23 arnsholt m: my $x; say $x.HOW.^name # maybe?
21:23 camelia rakudo-moar 4a7eaa: OUTPUT«Perl6::Metamodel::ClassHOW␤»
21:23 rurban joined #perl6
21:23 arnsholt Right. Not terribly helpful either, I suppose
21:28 smls What kind of help did you expect from it?
21:29 geraud joined #perl6
21:37 geekosaur was hoping there'd be more differing between them. I think the first one was as close as I got; the ClassHOW with Positional role mixed in didn't have a .gist
21:43 nowan joined #perl6
21:53 BenGoldberg joined #perl6
22:03 gnull Hmm, is there a way to make a regexp from string at runtime?
22:04 gnull For example, I want the user to supply the regex in config.
22:06 geekosaur $foo interpolates literally in a regex, <$foo> interpolates as a regex
22:06 brabo joined #perl6
22:15 gnull Cool, thanks.
22:17 anomie__ How could I print an Int as a unicode code point?
22:17 smls m: say 123.chr
22:17 camelia rakudo-moar 4a7eaa: OUTPUT«{␤»
22:18 anomie__ Ah, all right. Thanks.
22:19 BenGoldberg m: say chr 123
22:19 camelia rakudo-moar 4a7eaa: OUTPUT«{␤»
22:21 tailgate I'm trying to figure out why this code requires an instance: I'd like it to be a static variable.
22:21 tailgate https://gist.github.com/ahalbert/​e10146b45c021ea4ccb7da9610e9e2e0
22:22 Zoffix tailgate, because @.elements is an instance attribute. You may want to use my @.elements
22:23 tailgate thanks
22:23 Zoffix It may also need `is rw` to make it writable, though I don't remember if class attributes are writable by default
22:24 Zoffix m: class Foo { my @.meow }; Foo.meow = ^10; say Foo.meow
22:24 camelia rakudo-moar 4a7eaa: OUTPUT«[0 1 2 3 4 5 6 7 8 9]␤»
22:24 Zoffix they are
22:30 rvchangue joined #perl6
22:34 BenGoldberg joined #perl6
22:41 BenGoldberg joined #perl6
22:42 titsuki joined #perl6
22:46 bjz joined #perl6
22:49 anomie__ Heh, my perl script is gonna be a script to generate every possible emoji character (including the combinatorial ones).
22:50 BenGoldberg joined #perl6
22:52 diakopter joined #perl6
22:56 chee joined #perl6
22:57 chee joined #perl6
23:06 BenGoldberg joined #perl6
23:13 anomie__ joined #perl6
23:13 anomie__ So, how do I define a range/array of Ints as a subroutine's signature?
23:14 Zoffix m: sub foo (@foo where { .all ~~ Int }) { say @foo }; say foo [1, 2, 3]
23:14 camelia rakudo-moar 4a7eaa: OUTPUT«[1 2 3]␤True␤»
23:16 anomie__ Thanks.
23:17 Zoffix m: my @rray of Int = 1, 2, 3, 'a'
23:17 camelia rakudo-moar 4a7eaa: OUTPUT«Type check failed in assignment to @rray; expected Int but got Str ("a")␤  in block <unit> at /tmp/0NnRxToN9n line 1␤␤»
23:17 Zoffix m: sub foo (@foo of Int) { say @foo }; say foo [1, 2, 3]
23:17 camelia rakudo-moar 4a7eaa: OUTPUT«5===SORRY!5=== Error while compiling /tmp/kapVti1LxH␤Cannot call trait_mod:<of>(Parameter, Int); none of these signatures match:␤    (Mu:U $target, Mu:U $type)␤    (Routine:D $target, Mu:U $type)␤at /tmp/kapVti1LxH:1␤»
23:18 Zoffix I wonder, is the latter failing just a matter of defining a new multi for the trait_mod:<of>?
23:18 Zoffix Seems a useful and oft-requested functionality.
23:20 anomie__ Yeah.
23:26 arnsholt m: sub foo(int @foo) { ... } # <- not what you want?
23:26 camelia rakudo-moar 4a7eaa: ( no output )
23:27 Zoffix Nope
23:28 Zoffix m: sub foo(int @foo) { ... }; foo [1, 2, 3]
23:28 camelia rakudo-moar 4a7eaa: OUTPUT«Type check failed in binding @foo; expected Positional[int] but got Array ($[1, 2, 3])␤  in sub foo at /tmp/6JQeHZzegD line 1␤  in block <unit> at /tmp/6JQeHZzegD line 1␤␤»
23:28 Zoffix I think the term for your version is "parameterized", while the original regards the contents of the array
23:31 adu joined #perl6
23:39 arnsholt Zoffix: I think that's because [1,2,3] is Array[Any]
23:39 arnsholt m: sub foo(int @foo) { say @foo }; my int @foo = 1,2,3; foo(@foo) # Should work, I think?
23:39 camelia rakudo-moar 4a7eaa: OUTPUT«1 2 3␤»
23:40 chee joined #perl6
23:45 jack_rabbit joined #perl6
23:50 tardisx joined #perl6
23:52 Zoffix Ah, I see now.
23:52 Zoffix Still, it
23:52 Zoffix Still, it'd require coercing to Array[Int] every time you want to use that sub which is LTA
23:58 arnsholt IIRC, making  [...] intuit types has been discussed, but ultimately rejected

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

Perl 6 | Reference Documentation | Rakudo