»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:04 wbill joined 00:22 BenGoldberg left 00:25 wbill left 00:26 grondilu left 00:27 yqt left 00:30 BenGoldberg joined
Xliff_ Can you specify the type of array elements in a signature? 00:31
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:32 colomon left, huggable left
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)␤»
gfldex Xliff_: ^^^
00:33 skink joined
Xliff_ gfldex: Ah! Thank you! 00:34
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␤␤»
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
Xliff_ gfldex, yeah, but I'm writing API bindings. 00:36
00:37 colomon joined
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:41 itaipu left 00:46 BenGoldberg left 00:49 BenGoldberg joined 00:54 kurahaupo left 00:55 sufrostico left
skink Hey Xliff_ 00:56
Xliff_ \o 00:58
01:01 colomon left, sufrostico joined, colomon joined, aries_liuxueyang joined 01:07 BenGoldberg left 01:14 buharin_ left 01:16 BenGoldberg joined
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:22
s/module M/method M/ 01:23
01:24 BenGoldberg left 01:28 colomon left 01:31 buharin_ joined
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␤»
gfldex Xliff_: ^^^
01:32 BenGoldberg joined 01:34 molaf left 01:41 espadrine left 01:46 BenGoldberg left, molaf joined 01:48 BenGoldberg joined, sufrostico left 01:52 Ben_Goldberg joined, BenGoldberg left, Ben_Goldberg is now known as BenGoldberg 02:06 labster left 02:11 pierre joined
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
dalek c: b27c0d1 | titsuki++ | doc/Type/Rational.pod:
Fix a typo DenomT to DeT
02:24
c: 595d4ec | titsuki++ | doc/Type/Rational.pod:
Merge pull request #558 from titsuki/fix-typo

Fix a typo DenomT to DeT
02:26 pierre left 02:30 labster joined, BenGoldberg left 02:31 pierre joined 02:32 BenGoldberg joined 02:36 pierre left 02:46 noganex_ joined 02:49 noganex left
Xliff_ gfldex++ && b2gills++: Thanks! 02:54
03:00 colomon joined 03:02 TakinOver joined 03:05 TakinOver left 03:08 TakinOver joined 03:15 TakinOver left 03:16 TakinOver joined, kid51 left 03:20 TakinOver left 03:26 skids left 03:27 TakinOver joined 03:28 willthechill left 03:33 TakinOver left
Xliff_ Opening a 8M P6 --profile HTML file in Chrome takes a bit. 03:38
Well, this file has become quite the problem. 03:45
I can't open it in Chrome, and it looks like FireFox will fail as well.
Profile data looks to be too large for their JS engines. 03:46
Oh! Firefox finally opened!
03:48 skink left 04:04 ssotka joined 04:08 BenGoldberg left 04:10 skids joined 04:31 Cabanossi left 04:34 Cabanossi joined
tadzik Xliff; have you tried the qt profiler frontend? 04:38
Xliff_: github.com/tadzik/p6profiler-qt 04:39
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:40
04:44 kurahaupo joined 04:45 finanalyst left
Xliff_ tadzik, thanks for the suggestion! 04:50
Now I just need to know how to interpret the data. For some reason my code is running exceptionally slow.
I want to see why. 04:51
04:51 Sgeo left 04:52 khw left 04:53 Sgeo joined, kurahaupo_ joined 04:57 kurahaupo left, kurahaupo_ left 05:14 jjido joined 05:21 bjz joined, bjz_ left 05:34 wbill joined 05:37 anomie__ joined
anomie__ Is it a bug that it's so easy to pass malformed UTF-8 as an argument with linenoise? 05:37
05:38 Actualeyes joined
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
05:40 adu joined 05:41 adu left
anomie__ linenoise really doesn't seem to work well with multi-byte characters 05:43
I'll upload a video in a minute to show what I mean. 05:44
This is a known bug, right? comfy.moe/eadsqp.ogv 05:46
05:54 jjido left, bjz_ joined
anomie__ I think what happens, is that pressing backspace on the linenoise REPL removes one byte, rather than one character. 05:54
05:55 bjz left
tadzik from what I remember from the linenoise source, that may be exactly the case 05:56
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:58
I guess that's really not high on the priority list though, it's pretty petty. 05:59
But then again, with my limited knowledge it seems like low-hanging fruit to me.
05:59 pierre joined 06:00 Actualeyes left, bjz joined 06:02 jack_rabbit joined 06:03 bjz_ left 06:15 domidumont joined 06:16 Actualeyes joined 06:19 domidumont left, domidumont joined 06:20 jack_rabbit left
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:28
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:29
tadzik Xliff_: I'm not sure profiler will show you the parsing/module loading times 06:31
but this is known to be quite a slow process
try 'time perl6 -MYour::Module -e1'?
Xliff_ k
real 0m3.828s 06:33
user 0m3.756s
sys 0m0.068s
So parse time of around 4 seconds and another 2-3 for deserialization using Perl5's XML::Hash::XS 06:35
That includes retrieval via HTTP::UserAgent
06:36 rindolf joined 06:41 mohae__ left, cpage_ joined 06:43 patrickz joined 06:53 rurban joined, rurban left 06:55 RabidGravy joined, ssotka left 07:03 rurban1 joined 07:10 wamba joined, jjido joined 07:18 darutoko joined 07:20 jjido left 07:21 wamba left 07:22 wamba joined 07:23 CIAvash joined 07:28 setty1 joined 07:33 Tonik joined, Tonik left 07:50 rurban joined 07:53 espadrine joined 07:54 wamba left, rurban1 left
RabidGravy right, all the modules working again 07:56
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
:-\
08:13 wbill left 08:29 finanalyst joined 08:30 patrickz left 08:32 AlexDaniel joined 08:34 firstdayonthejob joined 08:36 cpage_ left, sno left, [Sno] joined 08:37 rurban1 joined 08:38 rurban2 joined, rurban3 joined 08:40 rurban left 08:41 rurban1 left 08:42 rurban2 left 08:45 spider-mario joined 08:46 anomie__ left 08:48 rurban joined 08:50 rurban3 left 08:53 domidumont left 08:54 labster left 08:57 xinming left 08:58 xinming joined 08:59 labster joined
RabidGravy I think I am going to go back to once a week 08:59
08:59 anomie__ joined
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:00
09:05 CIAvash left 09:09 rurban left 09:10 rurban joined 09:11 jjido joined
rindolf Hi all! "rakudobrew build moar" here (after a previous older build) fails with this error - paste.debian.net/712176/ - I'm on Mageia v6 x86-64. 09:11
RabidGravy .tell jnthn, if you want to look at the weird channel/react/promise interaction I was on about yesterday you will need github.com/jonathanstowe/Audio-Lib...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,"?!
RabidGravy .tell jnthn if you want to look at the weird channel/react/promise interaction I was on about yesterday you will need github.com/jonathanstowe/Audio-Lib...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
yoleaux RabidGravy: I'll pass your message to jnthn.
09:15 Actualeyes left
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/perl/p6/rakudobrew/moar-nom/install" and trying again 09:15
anyway I'm off out to a garden show
rindolf RabidGravy: bye
RabidGravy toodles 09:16
09:18 CIAvash joined 09:20 RabidGravy left 09:22 xinming_ joined 09:25 pierre left, xinming left 09:27 Actualeyes joined
dalek c: 97cbb75 | (Jan-Olof Hendig)++ | doc/Type/Array.pod:
Added docs for method of in class Array
09:31
09:39 Emeric joined
dalek pan style="color: #395be5">perl6-examples: 48133d0 | (Shlomi Fish)++ | categories/euler/prob286-shlomif.p6:
add a solution to Euler #286.
09:50
09:51 wamba joined 09:56 TEttinger left 09:57 pmurias joined 10:02 xinming_ is now known as xinming, labster left 10:05 jjido left 10:06 Emeric1 joined 10:07 Emeric left, Emeric1 is now known as Emeric 10:09 Emeric left 10:11 patrickz joined 10:14 iH2O joined 10:25 iH2O left 10:27 pierre joined 10:29 setty1 left 10:34 patrickz left 10:37 pierre left 10:40 grondilu joined
grondilu Hello #perl6 10:41
10:41 pierre joined 10:44 finanalyst left
pmurias hi 10:45
10:46 Actualeyes left
tadzik hello from Mal-moo o/ 10:51
10:51 pierre left 10:53 Emeric joined 10:56 pierre joined 10:58 iH2O joined 10:59 iH2O left, Actualeyes joined
pmurias tadzik: where is that? 11:04
tadzik southern Sweden, it's actually Malmo
11:05 kurahaupo joined, kurahaupo left, iH2O joined
pmurias tadzik: any perl events bringing you there? 11:08
tadzik nah, just work stuff 11:09
rindolf grondilu: hi, how are you?
tadzik it's a lot warmer than last time though
11:11 Emeric left 11:19 iH2O left 11:23 rindolf left 11:25 pierre left 11:30 kid51 joined 11:32 patrickz joined
dogbert17 o/ #perl6 11:45
if anyone wants to review my attempt to document Array.default the gist is here: gist.github.com/dogbert17/aee462bd...15e449c3b3 11:48
11:50 wamba left
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:54 pmurias left
AlexDaniel eh, LTA 11:55
dogbert17 AlexDaniel: ah my secon example is bogus, thx 11:56
s/secon/second/
AlexDaniel dogbert17: huh? my snippet is not related to your gist 11:57
dogbert17: in fact, there's nothing wrong with your gist
dogbert17 AlexDaniel: true, you scared me :) and my code actually works, pheew 11:58
AlexDaniel: thx for taking a look 11:59
12:00 tokomer joined
AlexDaniel dogbert17++ 12:00
12:02 ggoebel114 joined
dogbert17 AlexDaniel: thx, btw have you tried running the first code example here doc.perl6.org/type/Lock 12:02
it's broken but I don't have a clue what it should look like 12:03
12:03 pierre joined
AlexDaniel dogbert17: it's broken. Let's see 12:04
dalek c: 5a14b51 | (Jan-Olof Hendig)++ | doc/Type/Array.pod:
Added docs for Array.default. AlexDaniel++
12:06 tokomer left 12:07 pmurias joined
AlexDaniel dogbert17: ok 12:09
dogbert17 AlexDaniel: noticed it yesterday but am unable to fix it due to lack of knowledge 12:10
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
12:11 kurahaupo joined
dogbert17 afk time for a walk in the sun 12:12
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
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␤»
AlexDaniel oh come on
m: my $x = 0; await (^10).map: { start { sleep 0.1; $x++ }; }; say $x;
camelia rakudo-moar beb3c9: OUTPUT«10␤»
AlexDaniel m: my $x = 0; await (^10).map: { start { sleep 0.1; $x++ }; }; say $x;
camelia rakudo-moar beb3c9: OUTPUT«10␤»
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
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␤»
AlexDaniel dogbert17: and I believe that this is the right example ↑
dogbert17: get rid of that sleep though
dogbert17: gist.github.com/AlexDaniel/93949b1...f248fe0286 12:20
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:22
12:26 |meta joined 12:30 PotatoGim joined 12:32 Emeric left, Emeric joined, huggable joined, firstdayonthejob left 12:38 Actualeyes left 12:47 mspo left 12:52 Actualeyes joined 12:54 aries_liuxueyang left, aries_liuxueyang joined 12:59 jferrero joined, rurban left 13:00 brrt joined 13:06 jjido left
tailgate Let's say I import a module with use 13:26
does use execute statements in the module? Could I include setup code for that module at the the end?
Like for example, when that module is loaded, I'd like to load a csv file into a static class member 13:27
psch tailgate: the module mainline runs during import, the module BEGIN time runs during module compilation 13:28
13:29 ecocode joined
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
(because we do have largely working precompilation :) )
tailgate can BEGIN blocks be in just a file, or do they have to be in a module? 13:31
psch what do you mean "a file"? 13:32
they can be in any perl6 program, yes
tailgate that
psch if that program is a module or a, well, script only matters for the mentioned semantics
m: say "bye"; say BEGIN "hi" 13:33
camelia rakudo-moar beb3c9: OUTPUT«bye␤hi␤»
psch m: say "bye"; BEGIN say "hi" # duh
camelia rakudo-moar beb3c9: OUTPUT«hi␤bye␤»
pochi m: sub foo() { return [1,2,3], [<foo bar baz>] }; my (@a, @b) = foo(); say @b; 13:34
camelia rakudo-moar beb3c9: OUTPUT«[]␤»
psch m: sub foo() { return [1,2,3], [<foo bar baz>] }; my (@a, @b) := foo(); say @b;
camelia rakudo-moar beb3c9: OUTPUT«[foo bar baz]␤»
pochi o.O 13:35
something about binding?
psch pochi: you're returning one container from &foo
pochi: that container contains two arrays
pochi right
psch pochi: and gets assigned to the first array in your declaration
pochi: binding lowers that by one container level 13:36
well, lowers the RHS
pochi is that the same ':' that goes infront of signatures? 13:37
psch it works as a mnemonic i suppose
which is probably the intend between the language design :)
pochi :-)
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:38
pochi I see. thank you 13:39
13:42 grondilu left 13:44 pmurias left 13:53 kaare_ joined
dogbert17 AlexDaniel: many thanks for the code, do you want to commit the changes or should I? 13:54
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
dogbert17: also, thanks for working on the docs. I love your contributions
dogbert17 AlexDaniel: will commit and thx for the kind words
dalek c: 56f9f93 | (Jan-Olof Hendig)++ | doc/Type/Lock.pod:
Corrected broken example. AlexDaniel++ for providing a working example
14:01
AlexDaniel dogbert17: uh, oh! 14:02
dogbert17: there's no need for ‘for’
dogbert17 AlexDaniel: oops, will fix before anyone notices :) 14:03
AlexDaniel dogbert17: does it compile with for? 14:04
nope 14:05
timotimo you'd need to have "await do for" i suppose
oh, actually
there's a map there, too
AlexDaniel await $_ perhaps
but it's redundant
timotimo await (^10).map: { ... } should do fine 14:06
AlexDaniel yea
dogbert17: by the way, what editor do you use?
dalek c: 552ae16 | (Jan-Olof Hendig)++ | doc/Type/Lock.pod:
Had forgotten to remove a 'for' statement that should not be there
14:07
dogbert17 AlexDaniel: emacs
AlexDaniel dogbert17: perhaps you want to take a look at something like this: www.emacswiki.org/emacs/WhiteSpace 14:09
dogbert17: I don't care about it too much, but there are people who are pissed off when they see trailing whitespace :) 14:10
dogbert17: but generally it is a good idea to make your editor show more stuff
dogbert17 AlexDaniel: thx, will take a look
14:11 spider-mario left, spider-mario joined 14:15 RabidGravy joined 14:26 mohae joined, rurban joined 14:30 colomon left
RabidGravy boom 14:31
dogbert17 and he survived the garden show :) 14:34
dalek c: b7a4665 | titsuki++ | doc/Language/contributors.pod:
Add a contributor
14:35
c: c5fbf85 | titsuki++ | doc/Language/contributors.pod:
Merge pull request #560 from titsuki/add-contributor

Add a contributor
14:35 brrt left 14:40 domidumont joined 14:41 itaipu joined
AlexDaniel perhaps someone should also extract other missing names from git history ¯\_(ツ)_/¯ 14:41
ah, that's not just the contributors to docs 14:42
nvm then
tony-o does nativecall not play well with passing anonymous subs?
14:42 Zoffix joined
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…»
Zoffix m: use Test; cmp-ok 2, '<', 5, 'seems sane';
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␤»
Zoffix Are docs wrong or test is broken? docs.perl6.org/language/testing#By_...comparison 14:43
14:43 pierre left
Zoffix or am I doing something wrong 14:43
psch m: use Test; cmp-ok 2, &[<], 5, 'seems sane';
camelia rakudo-moar beb3c9: OUTPUT«ok 1 - seems sane␤»
Zoffix Right, but docs claim you can use strings
psch m: cmp-ok 'my spelling is apperling', '~~', /perl/, "bad speller";
camelia rakudo-moar beb3c9: OUTPUT«5===SORRY!5=== Error while compiling /tmp/MRHnuRA5ME␤Undeclared routine:␤ cmp-ok used at line 1␤␤»
psch m: use Test; cmp-ok 'my spelling is apperling', '~~', /perl/, "bad speller";
camelia rakudo-moar beb3c9: OUTPUT«ok 1 - bad speller␤»
Zoffix :S
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␤»
psch m: say EVAL '&infix:<<>'
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␤ …»
Zoffix m: use Test; cmp-ok 2, '<', /5/, 'seems sane';
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␤»
psch m: say EVAL '&infix:<==>'
camelia rakudo-moar beb3c9: OUTPUT«sub infix:<==> (Mu $?, Mu $?) { #`(Sub+{<anon|52917568>}+{Precedence}|37044272) ... }␤»
Zoffix Ahhh
psch if $op ~~ Callable ?? $op !! try EVAL "&infix:<$op>" -> $matcher {
is the offending line in Test.pm
changing it to < "&infix:('$op')" probably largely fixes it 14:45
well, unless we got a comparator that uses ', of course :)
the cleanest solution might actually be changing the Signature to expect a Callable for $op and ditching the EVAL bit
and of course adjusting the docs 14:46
Zoffix m: say &infix:("meow")
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>␤»
psch m: say &infix:('<')
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>␤»
psch huh, that form doesn't work?
14:46 aries_liuxueyang left
psch oh, right, brackets, not parens 14:46
m: say &infix:['<']
camelia rakudo-moar beb3c9: OUTPUT«sub infix:«<» (Mu $?, Mu $?) { #`(Sub+{<anon|52917568>}|70515680) ... }␤»
Zoffix m: my $op = '<'; say &infix:[$op]
psch m: say &infix:['meow']
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:<~|>'?␤␤»
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…»
AlexDaniel m: say Q「「「「「「hello」」」」」」
camelia rakudo-moar beb3c9: OUTPUT«hello␤»
Zoffix AlexDaniel++ 14:47
14:47 aries_liuxueyang joined
psch m: BEGIN my $op = "<"; say &infix:<<$op>> 14:48
camelia rakudo-moar beb3c9: OUTPUT«sub infix:«<» (Mu $?, Mu $?) { #`(Sub+{<anon|52917568>}|45354096) ... }␤»
psch m: constant $op = "<"; say &infix:<<$op>>
camelia rakudo-moar beb3c9: OUTPUT«sub infix:«<» (Mu $?, Mu $?) { #`(Sub+{<anon|52917568>}|54107248) ... }␤»
psch Zoffix: the look up is compile time
Zoffix But yeah, +1 on ditching the eval. &[] vs '' is just one char away
14:50 patrickz left
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␤␤»
Zoffix m: use Test; cmp-ok '', '~~>;warn run "ls"; my $x =<z', '', '';
camelia rakudo-moar beb3c9: OUTPUT«Perlito␤dalek-queue␤evalbot␤evalbot.log␤foo␤lib␤log␤mbox␤nqp-js␤p1␤p2␤p6eval-token␤perl5␤rakudo-j-1␤rakudo-j-2␤rakudo-j-inst␤rakudo-j-inst-1␤rakudo-j-inst-2␤rakudo-m-1␤rakudo-m-2␤rakudo-m-inst␤rakudo-m-inst-1␤rak…»
Zoffix snickers
AlexDaniel Zoffix: yeah. Awesome. Good job. 14:55
Zoffix 👏👏👏 14:56
15:00 espadrine left
pochi Type check failed for return value; expected Array[Numeric] but got Array[Numeric].new() 15:01
Zoffix pochi, we can't fix a code we can't see :) 15:02
dalek c: 7c4d9d2 | (Jan-Olof Hendig)++ | doc/Type/Bag.pod:
Fixed two broken links
pochi I just don't understand the error
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
psch m: say Array[Numeric] eqv Array[Numeric].new
camelia rakudo-moar beb3c9: OUTPUT«False␤»
Zoffix m: say Array[Numeric].new 15:04
camelia rakudo-moar beb3c9: OUTPUT«[]␤»
Zoffix m: say Array[Numeric].new.WHAT
camelia rakudo-moar beb3c9: OUTPUT«(Array[Numeric])␤»
Zoffix shrugs
15:04 rindolf joined
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] }␤»
AlexDaniel m: my @a of Numeric; @a[0] = Array[Numeric].new
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␤␤»
psch m: sub f() return Array[Numeric].new { Array[Numeric] }
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␤»
psch m: sub f() returns Array[Numeric].new { Array[Numeric] }
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␤»
psch m: sub f() returns (Array[Numeric].new) { Array[Numeric] }
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] }␤»
Zoffix Or pochi can actually show their code so we wouldn't need to spam trying to guess it? :)
psch hah! 15:05
AlexDaniel m: my @a of Numeric; @a[0] = Array[Numeric].new
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␤␤»
psch that would be easy :P
AlexDaniel well that's close enough
ah no, not even close
psch m: sub f() returns Array[Numeric] { Array[Numeric].new }; f()
camelia ( no output )
psch well, that just works
m: sub f(--> Array[Numeric]) { Array[Numeric].new }; f() # so does this 15:06
camelia ( no output )
psch so, whatever is going on there definitely needs a code example :)
pochi I'll try to find a small non-working sample
psch pochi: why not just put your whole code on a pastebin?
AlexDaniel psch: or we can introduce a new game here
psch: come up with a code snippet that produces the same output 15:07
pochi psch: it's quite a lof of code already :-)
spanning multiple files
AlexDaniel psch: there are some interesting ones, like “Segmentation fault” xD
15:08 wamba joined
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:08
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)␤»
psch m: use NativeCall; sub free(int $) is native {*}; free(0)
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)
camelia ( no output )
psch wonders *what* that actually does
pochi: maybe --ll-exception can help you to figure out what's going on
Zoffix RFC to disallow string comparators in cmp-ok: 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)
camelia ( no output )
psch stops messing with libc :P
AlexDaniel and that's not fair anyway
15:12 rurban left
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␤␤»
Zoffix :(
dalek c: 35dd2bc | (Zoffix Znet)++ | doc/Language/5to6-perlfunc.pod:
Fix typo
15:18
AlexDaniel Zoffix: well, why don't you use your eval trick
Zoffix AlexDaniel, ??? 15:19
15:19 zakharyas joined
AlexDaniel Zoffix: run(‘kill’, 11, $*PID) 15:19
Zoffix Ah
meh
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
m: use Test; cmp-ok '', '~~>;warn run(‘kill’, 11, $*PID); <z', '', '';
camelia rakudo-moar beb3c9: OUTPUT«(signal TERM)kill: sending signal to 11 failed: Operation not permitted␤»
Zoffix tsk tsk
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␤»
geekosaur "-11" 15:26
otherwise you're sending SIGTERM to pid 11 as well as whatever pid you intended
Zoffix Ah, right
m: use Test; cmp-ok '', '~~>;warn run(‘kill’, "-11", $*PID); <z', '', '';
camelia rakudo-moar beb3c9: OUTPUT«(signal SEGV)»
pochi I got it down to a few lines of code: pastee.org/pxjsh 15:28
but I can't get it down under 3 files :-(
psch that's a bit weird 15:29
pochi thank you :-) 15:30
almost whatever I do to change any ocde in the 3 files, the error goes away
Hm, seems XXX doesn't have to be a class with Numeric, just a 'my Numeric @a;' also triggers it. 15:33
psch well, it doesn't happen on rakudo-jvm, fwiw :) 15:35
...not that that'd help
pochi :-) 15:36
psch cause rakudo-jvm is unfortunately still pretty broken :/
anyway, i'd guess it might be something about reuse of parametrized roles..?
well, across SC boundary 15:37
15:37 finanalyst joined
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?
pochi aye
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:38
RabidGravy Zoffix this sounds a similar problem to what I had the other day with Lumberjack 15:55
Zoffix I think psch's hunch is more relevant. I may have just stumbled onto another bug with precomp not being invalidated 15:58
s/relevant/closer to the cause of poch's bug/; 15:59
CIAvash I think this is the same bug: rt.perl.org/Public/Bug/Display.html?id=127309 16:03
16:03 telex left 16:04 telex joined
geekosaur wow, that's a "fun" looking bug 16:04
16:05 vike left
pochi that looks exactly the same 16:05
16:07 vike joined 16:16 camelia joined
dalek c: 8507fd5 | (Zoffix Znet)++ | html/ (2 files):
Add to easily get a link to a section a user is reading
16:18
16:18 ChanServ sets mode: +v camelia 16:22 finanalyst left 16:29 wooy joined 16:32 huggable left, huggable joined
titsuki Hi. Does anyone know how to implement Visitor Pattern in Perl 6 ? (SEE ALSO: rt.perl.org/Ticket/Display.html?id=128275 ) 16:34
16:36 vendethiel joined, hankache joined
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
even if you don't do the export flag thing, you can continue experimenting with visitor patterns and such
BBIAB 16:38
hankache afternoon #perl6 16:41
16:41 buharin_ left
Zoffix \o 16:43
16:43 Nicq joined
titsuki timotimo: hmm, honestly to say "put both into the same file" doesn't seem the best solution... 16:43
geekosaur it's not. but we're still working bugs out of this stuff. 16:44
might see if it works with "no precompilation;" at the top? 16:45
psch actually, circular referencing of modules is never gonna work
llfourn ^^
Zoffix psch, how come?
llfourn because you can't depend on a module that depends on you
psch Zoffix: because of one pass parsing
Zoffix psch, I see
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
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 Nicq left
geekosaur I think some answer is going to be neede