Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-05-28

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 timotimo worst case i'd create a throw-away scalar and find its .VAR.type or .VAR.of or what it's called
00:00 cpage_ joined #perl6
00:05 Juerd joined #perl6
00:07 timotimo hmm
00:09 timotimo m: my Mu $foo := Metamodel::CoercionHOW.new_type(Str, Any); say $foo
00:09 camelia rakudo-moar be4e43: OUTPUT«(Str(Any))␤»
00:10 timotimo well, that looks good enough. may want to have that stashed away somewhere for re-use, though
00:13 KotH joined #perl6
00:16 BenGoldberg joined #perl6
00:24 BenGoldberg joined #perl6
00:27 Skarsnik_ joined #perl6
00:50 colomon joined #perl6
00:52 BenGoldberg joined #perl6
00:58 colomon joined #perl6
01:14 BenGoldberg joined #perl6
01:15 erdic joined #perl6
01:15 esh joined #perl6
01:17 KotH joined #perl6
01:24 raydiak .u ▶
01:24 yoleaux U+25B6 BLACK RIGHT-POINTING TRIANGLE [So] (▶)
01:24 BenGoldberg joined #perl6
01:32 kalkin- joined #perl6
01:34 cpage_ joined #perl6
01:45 BenGoldberg joined #perl6
01:48 molaf joined #perl6
01:52 pierre joined #perl6
01:53 Zoffix joined #perl6
01:54 jberger joined #perl6
01:54 jberger Zoffix: o/
01:54 BenGoldberg joined #perl6
01:55 Zoffix Hey all. jberger is trying to calculate pi using monte carlo method. I tried to write it with .race, but it was slower than single-thread way. Now, I rewrote it with Promises, but it *still* doesn't offer any speed improvement on my 4-core box. Any idea why? Is my code wrong: https://gist.github.com/zoffixznet/ae7bcf0efc99eba8eaadbd917238ff1a
01:55 Zoffix m: https://gist.github.com/zoffixznet/ae7bcf0efc99eba8eaadbd917238ff1a
01:55 camelia rakudo-moar be4e43: OUTPUT«3.13798␤»
01:56 jberger for anyone interested in the actual math (not that its really that hard if you think about it) here is a link I found http://mathfaculty.fullerton.edu/mathews/n2003/montecarlopimod.html
01:58 Zoffix Oh, HAHAHA.
01:58 Zoffix jberger, try it out. I set my VM I'm running this on to use just one core :P
01:58 jberger hahahaha
01:59 Zoffix To that point, .race probably works too :P
02:00 BenGoldberg joined #perl6
02:02 jberger yeah
02:02 jberger it does
02:02 jberger or at least I see the cores all spinning
02:03 cpage_ joined #perl6
02:03 Zoffix I think it's still buggy though.
02:03 Zoffix m: sleep 1 for ^4 .race: :1batch; say now - INIT now;
02:03 jberger well we are going to hit the amount of good randomness in the computer at some point
02:03 camelia rakudo-moar be4e43: OUTPUT«1.008283␤»
02:04 Zoffix What about my code? Does it offer speed increase when you set CORES to 4 vs 1? I'm not seeing any difference when I run it on Windows 10
02:06 jberger yeah
02:06 Zoffix m: await ^4 .map: { start sleep 1}; say now - INIT now
02:06 camelia rakudo-moar be4e43: OUTPUT«1.0044573␤»
02:06 jberger I get 11.5s with my original
02:06 jberger 6.5 for yours (race)
02:06 jberger just the one liners
02:07 Zoffix I meant this one: https://gist.github.com/zoffixznet/ae7bcf0efc99eba8eaadbd917238ff1a
02:07 jberger on TIMES=800_000
02:07 jberger argh, you actually want me to download it .... :p
02:08 Zoffix Well, I can use camelia, I guess
02:09 Zoffix m: https://gist.github.com/zoffixznet/ae7bcf0efc99eba8eaadbd917238ff1a
02:09 camelia rakudo-moar be4e43: OUTPUT«3.139072␤15.3952821␤»
02:09 Zoffix m: https://gist.github.com/zoffixznet/4e0b776a61239888cc0a1a019736dbf7
02:10 camelia rakudo-moar be4e43: OUTPUT«3.1397␤17.11032489␤»
02:10 jberger no I'm running it now
02:10 mspo camelia needs , stats=true to give timings :)
02:10 jberger when I set CORES=1 I still see my cores jump up
02:10 Zoffix oh
02:11 jberger I think to be a real test CORES=1 shouldn't try to thread it
02:12 jberger Zoffix: that one doesn't nearly scale though
02:12 jberger an it doesn't actually utilize the cores well either
02:12 jberger the race one does much better at showing up in htop
02:18 Zoffix I found the problem.
02:18 Zoffix m: https://gist.github.com/zoffixznet/cd814dfdf89ff199cb4779935e71ad52
02:18 camelia rakudo-moar be4e43: OUTPUT«3.14372␤2.19685761␤»
02:18 Zoffix m: https://gist.github.com/zoffixznet/be7b404f52aa4b6977fee17e17b82910
02:18 camelia rakudo-moar be4e43: OUTPUT«3.14252␤1.6769645␤»
02:18 Zoffix The promises were returning a lazy list and it's only when I attempted to get at the results did all the calculations were happening.
02:19 Zoffix Doesn't explain why all 4 cores were spinning up though, before I made it eager
02:19 Zoffix ¯\_(ツ)_/¯ a puzzle for another day
02:20 BenGoldberg joined #perl6
02:21 jberger ah
02:21 jberger well thanks anyway
02:22 jberger and if you like the example you are welcome to post about it, it was why I asked you in the first place
02:22 jberger or don't, either way
02:28 BenGoldberg joined #perl6
02:31 vendethiel joined #perl6
02:37 BenGoldberg joined #perl6
02:45 BenGoldberg joined #perl6
02:47 Zoffix left #perl6
02:48 noganex joined #perl6
02:53 zacts joined #perl6
02:56 colomon joined #perl6
03:01 jberger left #perl6
03:06 BenGoldberg joined #perl6
03:20 BenGoldberg joined #perl6
03:24 labster joined #perl6
03:26 BenGoldberg joined #perl6
03:33 Zoffix joined #perl6
03:34 Zoffix ugexe, ah, I was using unspace wrong. I was doing .foo \␤.bar and that extra space before the backslash was giving trouble (RE: http://stackoverflow.com/questions/37423541/define-a-subroutine-that-can-be-called-via-method-syntax/37425772 )
03:46 bjz joined #perl6
04:00 dalek ecosystem: 0b6c611 | (Richard Hainsworth)++ | META.list:
04:00 dalek ecosystem: Adding Algorithm::Tarjan to ecosystem
04:00 dalek ecosystem:
04:00 dalek ecosystem: Provides a method for finding cycles in a directed graph.
04:00 dalek ecosystem: See hhtps://github.com/finanalyst/p6-Algorithm-Tarjan
04:00 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/0b6c611375
04:01 finanalyst joined #perl6
04:01 finanalyst just tried adding a module to ecosystem 'Algorithm::Tarjan'. Not sure if I have done this correctly.
04:03 finanalyst I may have added directly to the Meta list without going through the pull request process.
04:03 finanalyst I'm still trying to figure out the git process
04:11 Zoffix Looks fine to me.
04:13 kaare_ joined #perl6
04:22 diakopter .u :smile_cat:
04:22 yoleaux U+003A COLON [Po] (:)
04:22 yoleaux U+005F LOW LINE [Pc] (_)
04:22 yoleaux U+0061 LATIN SMALL LETTER A [Ll] (a)
04:22 Zoffix .u ????
04:22 yoleaux U+1F63F CRYING CAT FACE [So] (????)
04:22 Zoffix .u cat face
04:22 yoleaux U+1F431 CAT FACE [So] (????)
04:22 diakopter heh
04:26 cpage_ joined #perl6
04:35 Cabanossi joined #perl6
04:43 CIAvash joined #perl6
04:56 jack_rabbit joined #perl6
05:01 wamba joined #perl6
05:35 bjz_ joined #perl6
05:35 cpage_ joined #perl6
05:37 xfix joined #perl6
05:39 ssotka joined #perl6
05:55 bjz joined #perl6
05:56 wamba joined #perl6
06:02 buharin joined #perl6
06:26 ssotka joined #perl6
06:46 Ven joined #perl6
06:48 RabidGravy joined #perl6
07:00 pierre joined #perl6
07:02 bjz_ joined #perl6
07:06 jjido joined #perl6
07:21 RabidGravy boom
07:22 domidumont joined #perl6
07:23 rindolf joined #perl6
07:25 buharin joined #perl6
07:27 domidumont joined #perl6
07:37 wbill joined #perl6
07:56 cpage_ joined #perl6
07:56 firstdayonthejob joined #perl6
08:01 domidumont joined #perl6
08:01 domidumont joined #perl6
08:03 Emeric joined #perl6
08:06 Emeric1 joined #perl6
08:06 pierre joined #perl6
08:12 darutoko joined #perl6
08:16 RabidGravy why *does* github call the generated LICENSE file that?  I'd never thought about it before, but in english that is the verb rather than the noun
08:19 BenGoldberg joined #perl6
08:20 huf no, license is also the noun
08:23 Juerd RabidGravy: US English uses the spelling 'license', sometimes 'licence', for both the noun and the verb, unlike advice/advise which is noun/verb in both UK and US English.
08:23 RabidGravy huf, only in certain dictionaries
08:24 Juerd But, why would having a verb in a file name be an issue? README is neither, but does have a verb.
08:25 huf RabidGravy: so? presumably whoever named the file was using one of those dictionaries
08:25 huf everyone gets to pick and choose :)
08:25 Juerd And sometimes it's called COPYING instead of LICENSE
08:25 dalek ecosystem: 1c0a6fb | palapitta++ | META.list:
08:25 dalek ecosystem: Movieinfo
08:25 dalek ecosystem:
08:25 dalek ecosystem: to get movie info from omdb
08:25 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/1c0a6fb30f
08:25 dalek ecosystem: 041e4df | RabidGravy++ | META.list:
08:25 dalek ecosystem: Merge pull request #211 from palapitta/patch-3
08:25 dalek ecosystem:
08:25 dalek ecosystem: Movieinfo
08:25 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/041e4dfb4c
08:25 huf Juerd: but COP isnt a verb!
08:26 huf (it is...)
08:26 Juerd huf: Makes me wonder what ying is.
08:26 huf yin + yang finally combined
08:27 Juerd That sounds slightly apocalyptical...
08:27 huf yep
08:28 huf the world *is* ending, it's just taking its sweet time about it
08:28 Juerd END { fork }
08:28 Juerd Oh, hm, the fork will end just as well
08:29 Juerd Does Perl 6 has a way to restart your program? The ultimate 'goto 10'?
08:29 BenGoldberg joined #perl6
08:29 Juerd In Perl 5 I'd probably cheat with "exec $0" and hope both parts dwim.
08:29 RabidGravy I think Zoffix was playing with something like that
08:31 RabidGravy https://github.com/zoffixznet/perl6-Bailador-Dev-AutoRestarter
08:32 hjst joined #perl6
08:33 Juerd That's managed externally with kill
08:36 vendethiel joined #perl6
08:47 spider-mario joined #perl6
08:52 zero-one left #perl6
08:53 wbill joined #perl6
08:58 bjz joined #perl6
09:08 pierre_ joined #perl6
09:13 finanalyst joined #perl6
09:24 BenGoldberg joined #perl6
09:27 finanalyst module question: I put a 32x32 png in library logotype, but the logo did not show up in the module directory. Is meta info needed?
09:27 cibs joined #perl6
09:28 finanalyst s/library/directory/
09:28 RabidGravy don't think so
09:29 pierre_ joined #perl6
09:29 RabidGravy ah logo_32x32.png apparently
09:29 RabidGravy (having just examined one where it does show)
09:31 ab6tract joined #perl6
09:32 ab6tract o/ #perl6
09:32 ab6tract i'm happy to report some great progress has been made on the Sereal port!
09:34 ab6tract i'd like to make it available both with a C backend and a PP one
09:36 iH2O joined #perl6
09:36 lizmat timotimo: thanks for the tip, but for some reason I get locally:
09:36 lizmat $ 6 'my Mu $foo := Metamodel::CoercionHOW.new_type(Str, Any); say $foo'
09:36 lizmat Method 'shortname' not found for invocant of class 'Perl6::Metamodel::CoercionHOW'
09:36 lizmat in block <unit> at -e line 1
09:37 iH2O left #perl6
09:37 lizmat The same I get with:
09:37 lizmat $ 6 'my Mu $a = Str(Any); say $a'
09:37 lizmat Method 'shortname' not found for invocant of class 'Perl6::Metamodel::CoercionHOW'
09:37 lizmat in block <unit> at -e line 1
09:38 lizmat it was that error that made me revert the patch
09:43 ab6tract but I'm running into some confusion around how to reference subroutines in one role that will later get defined in a different role
09:44 ab6tract i thought stubbing them in role A and defining them in role B and mixing them in 'does A does B' order would resolve it, but at run-time the stubs still get run
09:44 Ven joined #perl6
09:50 BenGoldberg joined #perl6
09:52 llfourn joined #perl6
09:52 cibs joined #perl6
09:58 BenGoldberg joined #perl6
10:00 llfourn .tell nine hoelzro++ has been able to trigger the precomp bug on the first run through with the right dependency tree (in case you missed it) RT #128268
10:00 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=128268
10:00 yoleaux llfourn: I'll pass your message to nine.
10:04 ab6tract there is always the EVAL option, but i was hoping for something less dirty
10:14 lizmat timotimo: ah, missed a commit :-)
10:26 masak good afternoon, #perl6
10:26 Ven o/ masak
10:29 lizmat masak o/
10:30 cibs joined #perl6
10:34 buharin joined #perl6
10:43 grondilu joined #perl6
10:44 timotimo Zoffix: currently, invocation requires two mallocs; one for the lexical environment, one for the space where all the register contents go. malloc will serialize access with locking. if you have an invocation-heavy thing inside your race (things not very well inlined, calls that are in there to make race work, ...) it'll spend most of its time spinning trying to acquire that lock
10:45 ab6tract ive decided to make the backend distinction an environment setting, so i can punt it all to compile time and use needs/import :D
10:47 edehont joined #perl6
11:03 BenGoldberg joined #perl6
11:11 Zoffix timotimo, invocation is what? method calls?
11:13 lizmat anything with () or a method call (which is () under the hood)
11:14 timotimo Zoffix: anything that creates a call frame, really
11:14 timotimo if things go bad, even a pair of curlies inside a code body can cause an invocation to happen
11:14 timotimo it's something jnthn is very much looking into making faster right now
11:14 Zoffix :S that makes .race kinda not very racy, considering most of the things would have () in them :/
11:14 Zoffix At least it explains why I had 2x speed increase when I was using 4x the cores.
11:15 timotimo of course. that resource contention is going to go away
11:15 kid51 joined #perl6
11:17 iH2O joined #perl6
11:27 Zoffix Ah, palapitta reminds me of a young me. Ill-designed, untested code released for fun rather than utility.
11:28 Zoffix Considering their first module was an implementation of the weather API I'm discussing in my workshop, I guess I'm at least partially responsible ????
11:30 iH2O left #perl6
11:31 cibs joined #perl6
11:36 Emeric joined #perl6
11:36 buharin joined #perl6
11:37 |meta joined #perl6
11:39 BenGoldberg joined #perl6
11:40 masak remind me -- does Perl 6 have something like Python's math.hypot ?
11:40 masak math.hypot(x, y) gives back math.sqrt(x * x + y * y)
11:41 Zoffix use NativeCall ...  :P
11:42 BenGoldberg I don't think there is one.
11:43 jjido joined #perl6
11:43 Zoffix m: use NativeCall; sub hypot(num64, num64 --> num64) is native {}; say hypot 3e0, 4e0
11:43 camelia rakudo-moar c5dfd7: OUTPUT«5␤»
11:45 Zoffix m: sub hypot {sqrt $^a²+$^b²}(3, 4).say
11:45 camelia rakudo-moar c5dfd7: OUTPUT«5␤»
11:49 dogbert17 (x+yi).abs # perhaps
11:50 dogbert17 m: say (3+4i).abs
11:50 camelia rakudo-moar c5dfd7: OUTPUT«5␤»
11:50 masak heh :)
11:50 anonymous :o what sorcery is that
11:50 masak the magic of complex arithmetic
11:51 Zoffix m: say (25+666i).abs
11:51 camelia rakudo-moar c5dfd7: OUTPUT«666.469054045272␤»
11:51 masak "abs($real)" can be seen as "the distance from 0 to the number $real"
11:51 Zoffix m: sub hypot {sqrt $^a²+$^b²}(25, 666).say
11:51 camelia rakudo-moar c5dfd7: OUTPUT«666.469054045272␤»
11:51 Zoffix m: say 3+4i
11:51 camelia rakudo-moar c5dfd7: OUTPUT«3+4i␤»
11:51 masak this notion can be extended to the complex numbers, which pulls in the Pythagorean Theroem as a side effect
11:52 masak Zoffix: you're familiar with complex numbers?
11:52 Zoffix only that i is sqrt(-1)
11:52 masak heh :)
11:52 masak it is, yes
11:52 masak m: sqrt(-1 + 0i)
11:52 camelia rakudo-moar c5dfd7: OUTPUT«WARNINGS for /tmp/oHWXGCvXH4:␤Useless use of "sqrt(-1 + 0i)" in expression "sqrt(-1 + 0i)" in sink context (line 1)␤»
11:52 masak m: say sqrt(-1 + 0i)
11:52 camelia rakudo-moar c5dfd7: OUTPUT«0+1i␤»
11:53 dogbert17 a recent addition to the docs: http://doc.perl6.org/type/Complex#method_abs
11:54 masak Zoffix: I think the best way to think about the complex numbers is that they "fix" the fundamental theorem of algebra
11:54 kurahaupo joined #perl6
11:54 masak Zoffix: with only the real numbers, a degree-2 polynomial can have *up to* 2 roots, a degree-5 polynomial can have *up to* 5 roots, etc
11:55 masak Zoffix: with the complex numbers, a degree-N polynomial has *exactly* N roots
11:55 BenGoldberg joined #perl6
11:55 masak which, needless to say, is very neat and pretty
11:55 Zoffix Oh, coolk
11:56 masak and when you put it like that, it's a minor miracle that setting `i := sqrt(-1)` fixes all that
11:56 masak it fixes it for *all* the polynomials. all the possible ones.
11:56 Zoffix Ohhh, k, now I get why (3+4i).abs works :D
11:57 masak what made it click? :)
11:57 Zoffix hehe, neat :D dogbert17++
11:57 dogbert17 glad to be able to help
11:57 Zoffix I was thinking of it as "3" plus some other number. What made it click is realizing it's 3 with 4 on the imaginary plane and then you can see the distance to it would by a hypotenuse of a right triangle
11:58 masak I'm not a huge fan of abusing complex numbers as mere Cartesian coordinates
11:58 Zoffix That's what made it click :)
11:59 kid51 joined #perl6
12:00 dogbert17 .seen lizamt
12:00 yoleaux I haven't seen lizamt around.
12:00 dogbert17 .seen lizmat
12:00 yoleaux I saw lizmat 11:13Z in #perl6: <lizmat> anything with () or a method call (which is () under the hood)
12:01 * lizmat is still here
12:01 lizmat but about to get some fresh air
12:01 dogbert17 lizmat: I have some draft documentation for Hash.keyof. is it in touch with reality? https://gist.github.com/dogbert17/447575b42b268b3d562a020bb754fadd
12:02 masak lizmat: go go go! fresh air is important! :)
12:02 lizmat say %h1.keyof;                           # (Any)   # Str(Any)  ??
12:02 jnthn m: say Str(Any)
12:02 camelia rakudo-moar c5dfd7: OUTPUT«(Str(Any))␤»
12:02 jnthn lizmat: I fixed ^^ last night... :)
12:02 lizmat yeah, noticed this moarn
12:03 jnthn :)
12:03 pochi m: sub foo() returns Str, Int { return "hello", 42 }
12:03 camelia rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/hn3Banv5ec␤Missing block␤at /tmp/hn3Banv5ec:1␤------> 3sub foo() returns Str7⏏5, Int { return "hello", 42 }␤    expecting any of:␤        new name to be defined␤»
12:04 pochi is there a way to specify a mixed return type?
12:04 jnthn pochi: One way is to declare a `subset StrOrInt where Str | Int;` and then use it as the return type
12:05 psch m: sub f { return "hello", 42 }; f().WHAT.say
12:05 camelia rakudo-moar c5dfd7: OUTPUT«(List)␤»
12:05 psch pochi: you don't seem to be returning something mixed?
12:05 lizmat pochi: in p6 you only ever return one thing
12:05 lizmat and if it has comma's in it, it's a List
12:05 lizmat afk&
12:05 pochi hm, ok, but can I put constraints on the contents of List then?
12:06 lizmat I think that's specced, but not implemented yet
12:06 lizmat jnthn?
12:06 llfourn a junction?
12:06 lizmat really afk&
12:06 AlexDaniel joined #perl6
12:06 llfourn m: sub foo() returns Str|Int { return "hello", 42 }; foo();
12:06 camelia rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/V63DQbH1yr␤Missing block␤at /tmp/V63DQbH1yr:1␤------> 3sub foo() returns Str7⏏5|Int { return "hello", 42 }; foo();␤    expecting any of:␤        new name to be defined␤»
12:06 jnthn Oh, you want to pattern match what's in a list...
12:06 pochi yes
12:07 llfourn m: sub foo() returns :(Str,Int) { return "hello", 42 }; foo();
12:07 camelia rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/cdu_zP1NBF␤Malformed trait␤at /tmp/cdu_zP1NBF:1␤------> 3sub foo() returns7⏏5 :(Str,Int) { return "hello", 42 }; foo(␤»
12:07 llfourn m: sub foo() returns List where { $_ ~~ :(Str,Int) } { return "hello", 42 }; foo();
12:07 dogbert17 lizmat++ thx for the feedback
12:07 jnthn m: subset IS where :(Int, Str); sub foo() returns IS { (4.2, 'hi') }; say foo
12:07 camelia rakudo-moar c5dfd7: OUTPUT«Type check failed for return value; expected IS but got List ($(4.2, "hi"))␤  in sub foo at /tmp/MTaWmxTvNo line 1␤  in block <unit> at /tmp/MTaWmxTvNo line 1␤␤»
12:07 jnthn m: subset IS where :(Int, Str); sub foo() returns IS { (4, 'hi') }; say foo
12:07 camelia rakudo-moar c5dfd7: OUTPUT«(4 hi)␤»
12:08 llfourn is my last message flashing for anyone else?
12:08 pochi it's flashing :-)
12:08 Zoffix No, but I see a null char
12:08 jnthn llfourn: No, white text on grey background for me :)
12:08 llfourn o.o
12:09 pochi what the 'where :()' syntax?
12:09 pochi *what's
12:09 jnthn :(...) is a signature literal
12:09 pochi ah
12:09 pochi thank you :-)
12:09 jnthn And subest Foo where <conditon here>; is a refinement type
12:09 Zoffix FWIW, I opened a ticket a few days about vis-a-vis returning Int|Str and ther like: https://rt.perl.org/Ticket/Display.html?id=128262
12:09 jnthn Zoffix: Yeah, confusing error... :)
12:10 jnthn Compiler's trying to be helpful and ends up being the opposite. :)
12:10 jnthn m: sub foo() returns Itn { }
12:10 camelia rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/DbnqYz0xve␤Invalid typename 'Itn'. Did you mean 'Int'?␤at /tmp/DbnqYz0xve:1␤------> 3sub foo() returns Itn7⏏5 { }␤»
12:10 jnthn m: sub foo() returns Int|Str { }
12:10 camelia rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/nZq9Zg2VRW␤Missing block␤at /tmp/nZq9Zg2VRW:1␤------> 3sub foo() returns Int7⏏5|Str { }␤    expecting any of:␤        new name to be defined␤»
12:10 jnthn Oh, it wasn't that one?
12:11 Zoffix m: sub foo(--> Int|Str)  { }
12:11 camelia rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/hicSjxwiOM␤Type 'Int' is not declared. Did you mean 'int'?␤at /tmp/hicSjxwiOM:1␤------> 3sub foo(--> Int7⏏5|Str)  { }␤»
12:11 jnthn Oh, with -->
12:11 jnthn Yeah, agree that wants some atention
12:11 jnthn *attention
12:11 llfourn m: sub (Int|Str $var) { }; # I also try and do this sometimes
12:11 camelia rakudo-moar c5dfd7: OUTPUT«===SORRY!===␤No compile-time value for Str␤»
12:12 jnthn o.O
12:12 llfourn also I even try regex literals :P
12:12 bjz_ joined #perl6
12:12 jnthn Trouble with that one is that |foo is capture syntax inside a signature :)
12:13 llfourn m: multi regex-dispatch(/fo+/) { }; multi regex-dispatch(/ba+/)  {}; regex-dispatch("foo"); #something like
12:13 camelia rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/go3EVCCVwd␤Calling regex-dispatch(Str) will never work with any of these multi signatures:␤    (Int $ where { ... }) ␤    (Int $ where { ... })␤at /tmp/go3EVCCVwd:1␤------> 3) { }; multi regex-dispat…»
12:13 jnthn oh hah, I bet I can guess... It sees "(Int |Str" and declares a symbol Str that the capture will be bound in to. This in turn clobbers the Str symbol needed to produce the parse error that follows :P
12:14 llfourn ahh
12:14 psch m: sub f($a, ::($a) $b) { }; f(Int|Str, "foo") # /o\
12:14 camelia rakudo-moar c5dfd7: ( no output )
12:14 jnthn That's pretty amusing. But yeah, if it's not already RT'd please do; the current error helps nobody..
12:14 llfourn okie doke
12:15 llfourn my last RT (5 mins ago) didn't go so well. Lets see if I can get it done in one email this time.
12:18 jnthn :)
12:18 jnthn lunch &
12:19 dogbert17 m: sub foo() returns IntStr { return IntStr.new(42, "hello") }; say foo().perl
12:19 camelia rakudo-moar c5dfd7: OUTPUT«IntStr.new(42, "hello")␤»
12:25 pierre joined #perl6
12:27 jjido joined #perl6
12:32 huggable joined #perl6
12:35 dalek doc: 32541e4 | (Jan-Olof Hendig)++ | doc/Type/Hash.pod:
12:35 dalek doc: Added docs for method keyof in class Hash. lizmat++, jnthn++
12:35 dalek doc: review: https://github.com/perl6/doc/commit/32541e40d1
12:36 iH2O joined #perl6
12:39 BenGoldberg joined #perl6
12:41 pierre joined #perl6
12:43 iH2O left #perl6
12:47 jjido joined #perl6
12:49 setty1 joined #perl6
12:58 dalek doc: 49f7f34 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Signature.pod:
12:58 dalek doc: get `where` into the index
12:58 dalek doc: review: https://github.com/perl6/doc/commit/49f7f34bd0
12:58 dalek doc: 3948b65 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Signature.pod:
12:58 dalek doc: get `where` into the index
12:58 dalek doc: review: https://github.com/perl6/doc/commit/3948b656da
13:00 BenGoldberg joined #perl6
13:07 pierre joined #perl6
13:16 grondilu m: say (my $).VAR.name;
13:16 camelia rakudo-moar c5dfd7: OUTPUT«$␤»
13:16 grondilu m: say class { has $.x }.VAR.name
13:16 camelia rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class '<anon|57888480>'␤  in block <unit> at /tmp/IRkz3SpHWR line 1␤␤»
13:16 pierre joined #perl6
13:16 grondilu m: say class { has $.x }.x.VAR.name
13:16 camelia rakudo-moar c5dfd7: OUTPUT«Cannot look up attributes in a type object␤  in block <unit> at /tmp/aqDkPFY7Nf line 1␤␤»
13:19 pochi $.x is a method that operates on $!x
13:19 psch m: say class { has $.x }.new(:2x)x.VAR.name
13:19 camelia rakudo-moar c5dfd7: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5\$_' (indicated by ⏏)␤  in block <unit> at /tmp/9lF534opPv line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/9lF534opPv line 1␤␤»
13:19 psch m: say class { has $.x }.new(:2x).x.VAR.name
13:19 camelia rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class 'Int'␤  in block <unit> at /tmp/egiKpG4qqE line 1␤␤»
13:20 Zoffix m: say class { has $.x }.new(:2x).x.VAR.^name
13:20 camelia rakudo-moar c5dfd7: OUTPUT«Int␤»
13:20 psch m: say class { has $.x }.new(:2x).x.name
13:20 camelia rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class 'Int'␤  in block <unit> at /tmp/jR7xM3jJzE line 1␤␤»
13:20 psch m: say class { has $.x }.new(:2x).x.VAR.VAR.name
13:20 camelia rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class 'Int'␤  in block <unit> at /tmp/XmYzWLUUwC line 1␤␤»
13:20 psch vOv
13:20 psch not even sure what's being looked for :)
13:20 jnthn m: say class { has $.x is rw }.new(:2x).x.name
13:20 camelia rakudo-moar c5dfd7: OUTPUT«Method 'name' not found for invocant of class 'Int'␤  in block <unit> at /tmp/gjscsjLZXL line 1␤␤»
13:21 jnthn m: say class { has $.x is rw }.new(:2x).x.VAR.name
13:21 camelia rakudo-moar c5dfd7: OUTPUT«$!x␤»
13:21 jnthn Maybe that? :)
13:21 Zoffix :o
13:21 psch oh, right, no rw means no container there i suppose
13:21 jnthn Yeah, we take the thing out of its container
13:21 jnthn When no "is rw"
13:23 grondilu what's :2x?
13:23 grondilu m: say :2x
13:23 camelia rakudo-moar c5dfd7: OUTPUT«Unexpected named parameter 'x' passed␤  in block <unit> at /tmp/Ba1CO326bj line 1␤␤»
13:23 pochi :x(2)
13:23 psch m: say (:2x).WHAT
13:23 camelia rakudo-moar c5dfd7: OUTPUT«(Pair)␤»
13:23 psch m: say (:2x).perl
13:23 camelia rakudo-moar c5dfd7: OUTPUT«:x(2)␤»
13:23 grondilu oh, that's a thing?  Ok.
13:23 jnthn Most often shows up as things like :1st
13:23 psch m: $_ = "foo foo"; s:2nd/foo/bar/; .say
13:23 camelia rakudo-moar c5dfd7: OUTPUT«foo bar␤»
13:23 Zoffix or :42days :)
13:24 * Zoffix uses it for everything
13:24 grondilu can be useful for physical units and stuff
13:26 dalek doc: fffe595 | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod:
13:26 dalek doc: link to definition of where
13:26 dalek doc: review: https://github.com/perl6/doc/commit/fffe595aad
13:27 Zoffix If anyone has a penchant for long technical documents and has interest in the new IRC::Client, I welcome feedback for my new design: https://github.com/zoffixznet/perl6-IRC-Client/blob/rewrite/DESIGN/01-main.md
13:27 Zoffix AlexDaniel, ^ you had some interest in it awhile back.
13:27 AlexDaniel yaaay
13:28 AlexDaniel Zoffix: by the way, what's up with the memory leaks and stuff?
13:28 AlexDaniel Zoffix: have you found any way to localize it?
13:28 Zoffix No, I chose to go with "ignore it for now and hope someone fixes it" route.
13:29 Zoffix And they were before jnthn++'s frame work, so *shrug* they may not be there any more for all I know.
13:29 AlexDaniel because, you know… your module can be 100% gold but nobody is going to start using it because of such problems :(
13:30 AlexDaniel Zoffix: OK I'll read that and let you know what I think
13:31 jnthn Were they before or after the big gen2 leak fix in Moar also?
13:31 jnthn That was likely to blame for a lot of leakage in longer-running things.
13:31 Zoffix I'm 85% they were in this version: This is Rakudo version 2016.04-117-g7db7b46 built on MoarVM version 2016.04
13:32 Zoffix *85% sure
13:33 AlexDaniel Zoffix: “provide a programmatic interface to IRC” it sound like a bot, why not say that it is for creating bots? Or are you hoping that people will create IRC clients on top of that?
13:33 AlexDaniel s
13:33 jnthn Zoffix: 7f2a6fa8416 was the fix in question
13:33 jnthn Zoffix: Which git describes itself as 2016.03-96-g7f2a6fa, so it's maybe not that
13:34 Zoffix AlexDaniel, they can if they want to. I might create one if I get bored enough :P
13:35 Zoffix call it 6IRC
13:35 RabidGravy joined #perl6
13:35 Zoffix with a stylzed logo of half a butterfly seen behind IRC :P
13:35 jnthn Zoffix: If it still leaks, please do file a report though. I've spent quite some effort on fixing/building stuff that makes it easier to hunt leaks down. :)
13:35 BenGoldberg joined #perl6
13:35 Zoffix jnthn, k :)
13:36 * timotimo is sitting outside on a little (actually, big) picnic blanket :3
13:36 jnthn timotimo: nice :)
13:36 jnthn Hope you don't have thunderstorms forecast to start imminently like here ;-)
13:37 AlexDaniel Zoffix: “A program may have multiple Client Objects, but each of them can be connected only to one IRC server.” why?
13:37 dalek ecosystem: 771c2a4 | yowcow++ | META.list:
13:37 dalek ecosystem: add Digest::MurmurHash3
13:37 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/771c2a43cb
13:37 dalek ecosystem: 08c8b73 | titsuki++ | META.list:
13:37 dalek ecosystem: Merge pull request #212 from yowcow/add-digest-murmurhash3
13:37 dalek ecosystem:
13:37 dalek ecosystem: Add Digest::MurmurHash3
13:37 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/08c8b738dd
13:38 timotimo AlexDaniel: because clients have state, like what channels they have been joined to, what flags they have, realname nickname, ...
13:38 Zoffix AlexDaniel, simpler to implement.
13:38 gfldex m: sub f(&c where :(Int, Str)) { say c(10, 'ten') }; sub g(Int $i, Str $s){ $s ~ $i }; f(&g);
13:38 camelia rakudo-moar c5dfd7: OUTPUT«Constraint type check failed for parameter '&c'␤  in sub f at /tmp/rkBIxNJdUa line 1␤  in block <unit> at /tmp/rkBIxNJdUa line 1␤␤»
13:38 timotimo makes sense to have that per Client object
13:38 Zoffix AlexDaniel, also, you have nicks and usernames that likely are different on different servers
13:39 psch m: sub f(&c:(Int, Str)) { say c(10, 'ten') }; sub g(Int $i, Str $s){ $s ~ $i }; f(&g);
13:39 camelia rakudo-moar c5dfd7: OUTPUT«ten10␤»
13:39 AlexDaniel yeah but if I wanted to create a bot that will connect to multiple servers at the same time, things will become seriously hard for me
13:40 Zoffix Like what?
13:41 Zoffix As in, what is a specific area of hardness?
13:41 Zoffix start IRC::Client.new(:server<foo.net>).run; start IRC::Client.new(:server<bar.net>).run;
13:42 timotimo seriously hard seems like a really big overstatement here
13:42 AlexDaniel unnecessarily hard is probably a better way to describe it
13:42 Zoffix my $stuff-that-does-things = IRC::Client::Plugin::Whatever.new; start { IRC::Client.new(:server($_), :plugins($stuff-that-does-thigns)).run } for <foo.net bar.net>;
13:43 AlexDaniel Zoffix: then what? I want to have the same state between several servers, but as far as I can see each plugin is probably going to be on its own
13:43 AlexDaniel e.g. if it's a factoid, for example
13:43 AlexDaniel and also want no code duplication, because you know…
13:44 AlexDaniel my proposed solution was to just add a server:channel to the list of channels to join, and that's it. You handle everything else
13:44 Zoffix AlexDaniel, in the example above, you have just one plugin object. If it's a factoid, it'd be using the same DB.
13:45 BenGoldberg This isn't python, people.  It's allowable to have more than one solution to a problem.
13:46 Zoffix AlexDaniel, I don't see how such a solution would handle, say, using different nicks on different servers
13:46 timotimo especially since you don't actually have full control over your nickname, or what channels you're in
13:46 AlexDaniel Zoffix: $.irc.nick: 'ZofBot', 'ZofBot_', 'ZofBot__'; changes the nickname on all servers
13:46 AlexDaniel Zoffix: $.irc.nick: 'ZofBot', 'ZofBot_', 'ZofBot__', :server(‘XXX’); changes the nickname on some particular server
13:47 Zoffix AlexDaniel, what about $.irc.send: where => '#perl6', what => 'Hello'? What about $.irc.channel('#perl6').has: 'Zoffix'?
13:47 Zoffix You can add :server() to all of them sure, but that just adds complexity to the implementation and the docs, which I don't see justified when the alternative is the code example above.
13:48 AlexDaniel Zoffix: there are several possible solutions to this one. For example, if you're on the same channel on several servers, then it may turn into something like ‘#perl6<freenode>’
13:48 Zoffix And you can determine which server you're on by calling $.irc.server (I didn't spec it, but all the attributes will be available)
13:48 AlexDaniel Zoffix: otherwise it's just ‘#perl6’ and it DWIMs
13:49 AlexDaniel Zoffix: I'm not sure why the implementation has to be easy for you and not for the user
13:50 Zoffix AlexDaniel, I don't see your proposal as easier than start { IRC::Client.new(:server($_), :plugins($stuff-that-does-thigns)).run } for <foo.net bar.net>;
13:50 AlexDaniel Zoffix: supplying :server(…) when you need it is not a rocket science
13:50 Zoffix AlexDaniel, but it's data duplication.
13:50 Zoffix Especially within a plugin, that doesn't need to know what server it's on.
13:50 dalek doc: 5b29667 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Signature.pod:
13:50 dalek doc: show how to constrain function references
13:50 dalek doc: review: https://github.com/perl6/doc/commit/5b29667d22
13:50 pochi m: enum Days ( Sat => 6, Sun => 7 ); my %t = (Sat => "Saturday", Sun => "Sunday"); say %t.keys>>.Int
13:50 camelia rakudo-moar c5dfd7: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5Sat' (indicated by ⏏)␤  in block <unit> at /tmp/U3YbVb8nzI line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/U3YbVb8nzI line 1␤␤»
13:51 timotimo what about servers that allow < > in their channel names?
13:51 AlexDaniel if it doesn't need to know, then there's no :server stuff in the code.
13:51 AlexDaniel timotimo: turn it into an object if that's the case, not a big deal
13:51 AlexDaniel make it a pair or something
13:53 pochi how do I used enums as has keys?
13:54 pochi *use even
13:55 psch m: enum Foo < bar baz >; my %h{Any}; %h{bar} = 1; say %h.perl; say %h.keys[0].WHAT
13:55 camelia rakudo-moar c5dfd7: OUTPUT«(my Any %{Any} = Foo::bar => 1)␤(Foo)␤»
13:55 gfldex m: enum Days ( Sat => 6, Sun => 7 ); my %t{Days} = (Sat => "Saturday", Sun => "Sunday"); say %t.keys>>.Int
13:55 camelia rakudo-moar c5dfd7: OUTPUT«Type check failed in binding key; expected Days but got Str ("Sat")␤  in block <unit> at /tmp/KbAoNGnygb line 1␤␤»
13:55 psch m: enum Foo < bar baz >; my %h{Any}; %h{bar} = 1; say %h.perl; say %h.keys[0].value
13:55 camelia rakudo-moar c5dfd7: OUTPUT«(my Any %{Any} = Foo::bar => 1)␤0␤»
13:55 psch m: enum Foo < bar baz >; my %h{Any}; %h{bar} = 1; say %h.perl; say %h.keys[0].Int
13:55 camelia rakudo-moar c5dfd7: OUTPUT«(my Any %{Any} = Foo::bar => 1)␤0␤»
13:55 Zoffix AlexDaniel, what I mean is if I have a plugin that does, say, irc-privmsg-me ($msg) { $.irc.send: where => '#perl6', what => "$msg.nick() is messaging me!" }; That plugin will be inherently broken the moment your client connects to multiple servers. The correct way to write it might be irc-privmsg-me ($msg) { $.irc.send: where => '#perl6', server => $msg.server, what => "$msg.nick() is messaging me!" }; Which (a) is unneccesarry complexity (b) will
13:55 Zoffix result in some plugins being broken because users didn't/forgot to add the essentially-mandatory `server` argument.
13:57 gfldex m: enum Days ( Sat => 6, Sun => 7 ); my %t{Days} = (Sat, "Saturday", Sun, "Sunday"); say %t.keys>>.Int
13:57 camelia rakudo-moar c5dfd7: OUTPUT«(6 7)␤»
13:57 gfldex m: enum Days ( Sat => 6, Sun => 7 ); my %t{Days} = (Sat, "Saturday", Sun, "Sunday"); say %t.keys
13:57 camelia rakudo-moar c5dfd7: OUTPUT«(Sat Sun)␤»
13:57 Zoffix And, say, $.irc.channel('#perl6').topic; would require a mandatory server argument too, except it won't be available just anywhere. You have to fetch from some $msg or pass it hardcoded.
13:58 gfldex m: enum Days ( Sat => 6, Sun => 7 ); my %t{Days} = (Pair.new(Sat, "Saturday"), Pair.new(Sun, "Sunday")); say %t.keys
13:58 camelia rakudo-moar c5dfd7: OUTPUT«(Sat Sun)␤»
13:58 gfldex pochi: ^^^
13:58 pochi so it's => that ruins it? :-)
13:58 Zoffix It quotes it
13:58 gfldex m: dd 6 => "foo"
13:58 camelia rakudo-moar c5dfd7: OUTPUT«6 => "foo"␤»
13:58 AlexDaniel Zoffix: so basically what you're saying is that if at some point I decide to add a channel on another server to the list of channels to join, I have to create another Client object, configure it the same way, then wrap all commands with for-s, start using a database so that plugins inside different Client objects have the same data… I'm pretty sure that the list does not stop here. Not that you're wrong, a lot of irc modules do exactly
13:58 AlexDaniel the same thing, but I'm not sure why your new one cannot be better in that respect.
13:59 setty1 joined #perl6
13:59 pochi right
13:59 psch m: enum Days ( Sat => 6, Sun => 7 ); my %t{Days} = Sat, "Saturday", Sun, "Sunday"; say %t.keys
13:59 camelia rakudo-moar c5dfd7: OUTPUT«(Sat Sun)␤»
13:59 tailgate Can a perl6 class be a singleton? i.e. instantiated once and only holding static members?
14:00 psch tailgate: i'd rather make .new die and only use class variables instead of instance variables
14:00 psch tailgate: although that's more a fully static class than a singleton
14:00 psch well, not quite in the Java sense of "static" :)
14:02 tailgate psch: fully static works for me. Is there an example?
14:02 dalek ecosystem: b347748 | (Shoichi Kaji)++ | META.list:
14:02 dalek ecosystem: Add IO::TailFile to ecosystem
14:02 dalek ecosystem:
14:02 dalek ecosystem: See https://github.com/skaji/perl6-tail
14:02 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/b3477481c3
14:02 gfldex m: dd 1/2 => "foo"
14:02 camelia rakudo-moar c5dfd7: OUTPUT«0.5 => "foo"␤»
14:03 gfldex I take it the fat arrow doesn't autoquote if the LHS is a Numeric?
14:03 psch m: class A { my $foo; method foo is rw { $foo }; method new { die "can't instantiate this" }; }; A.foo = "bar"; say A.foo
14:03 camelia rakudo-moar c5dfd7: OUTPUT«bar␤»
14:03 psch tailgate: ^^^ something like that, probably.  you can of course also use getter/setter instead of an rw method
14:04 psch and, well, you don't really need the &die in .new either
14:05 psch because all "my" declarations are shared between instances as well
14:05 AlexDaniel Zoffix: I don't think that your example is very realistic. How often do you want to send a message to some specific channel on some specific server, and you want it to be hardcoded? That's a bit weird. Like, look at camelia or any other bot, that's a rare thing to have. And if you want to do that – sure, it is “potentially” broken, which means that if you join the same channel on two different servers then your module will probably
14:05 AlexDaniel throw a warning and that's it. If you don't, then you wont even notice it
14:05 psch so if you eventually discover that you do need un-shared state between instances you could also do that... vOv
14:05 keix joined #perl6
14:06 AlexDaniel Zoffix: and again, adding one parameter is easy. Reworking your whole code base is hard.
14:07 gfldex m: my $signle = Any but role :: { has $.foo; method new(){die 'nope'}}; dd $signle; $single.new;
14:07 camelia rakudo-moar c5dfd7: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ZYVwgAxdYH␤Variable '$single' is not declared. Did you mean '$signle'?␤at /tmp/ZYVwgAxdYH:1␤------> 3 method new(){die 'nope'}}; dd $signle; 7⏏5$single.new;␤»
14:07 dalek gtk-simple: 1f7c486 | finanalyst++ | / (3 files):
14:07 dalek gtk-simple: get-active method to combobox
14:07 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/1f7c486cbe
14:07 dalek gtk-simple: 30ec795 | RabidGravy++ | / (3 files):
14:07 dalek gtk-simple: Merge pull request #39 from finanalyst/master
14:07 dalek gtk-simple:
14:07 dalek gtk-simple: get-active method to combobox
14:07 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/30ec795dad
14:07 gfldex tailgate: if you don't want to introduce a type name for your singleton ^^^
14:08 gfldex m: my $single = Any but role :: { has $.foo; method new(){die 'nope'}}; dd $single; $single.new;
14:08 camelia rakudo-moar c5dfd7: OUTPUT«Any+{<anon|81365312>} $single = Any+{<anon|81365312>}␤nope␤  in method new at /tmp/kZswVNFiZh line 1␤  in block <unit> at /tmp/kZswVNFiZh line 1␤␤»
14:08 Zoffix AlexDaniel, the hardcoded channel is irrelevant. The issue is the mandatory requirement to include :server
14:08 gfldex works better without typos ofc
14:08 Zoffix Include it everywhere
14:09 Zoffix I'm not sure how that qualifies as making things easy.
14:09 AlexDaniel Zoffix: it's not mandatory if you are not joining the same channel on multiple servers
14:09 AlexDaniel and if you do, then you just add one parameter instead of reworking your whole code
14:10 Zoffix Then whether your plugin is broken depends entirely on which channels you care to join? What about plugins that are released into the ecosystem. It become mandatory for them
14:10 AlexDaniel only if they're trying to send messages to some specific channels
14:11 Zoffix There's only one for-s wrap involved: the instantiation of the IRC::Client objects. The plugins are single objects used by all the clients. I'm not sure what you mean by having to add a database
14:11 AlexDaniel replying to the same channel works everywhere
14:14 pmurias joined #perl6
14:14 pmurias hi
14:14 Zoffix The only issue I can see is ensuring your plugin is operating in a threadsafe way, since you now have several clients in several threads
14:14 Zoffix \o
14:15 AlexDaniel Zoffix: OK so you're saying that using the same plugin object in several clients is supposed to work better?
14:15 AlexDaniel you may be right, but it sounds a little bit weird
14:17 mohae joined #perl6
14:18 Zoffix It just seems more robust and much easier to use. I don't need to worry about shoving a server everywhere in my code and I don't have to worry that author Joseph Smith forgot to add a server argument in their plugin.
14:18 Zoffix The $.irc.channel('...') stuff would have to to require a mandatory server argument, for example
14:18 AlexDaniel yeah sure you don't have to care about stuff that you don't support, I'm not arguing that
14:19 AlexDaniel … but to me it feels like using more than one server should be supported, at least in some sense
14:20 Zoffix It is ???? just instantiate multiple IRC::Clients
14:21 AlexDaniel Zoffix: sounds like torturing myself and not the implementor of IRC::Client and its plugins
14:21 AlexDaniel it's fine, I guess. It's just that I am expecting a bit more from it than from a typical irc module
14:22 Zoffix Not to me. I rather put a single `for @servers` than use :server($whatever) every time I use a command from the Client Object. Providing I have the server available in the first place.
14:23 * Zoffix takes a break to play Assasin's Creed Rogue
14:23 tailgate thanks
14:24 AlexDaniel Zoffix: you can easily throw an awesome warning if the client is connected to multiple servers. “on line X you're trying to send a message, but no server is specified. However, you're connected to two servers. Use :server(…) to make it work” ¯\_(ツ)_/¯
14:24 Zoffix AlexDaniel, but I don't *want* to use :server(...) all over the place
14:25 Zoffix And I can avoid it with for @servers when I instantiate the clients
14:25 AlexDaniel Zoffix: if you're not connected to multiple servers then you don't have to ¯\_(ツ)_/¯
14:25 Zoffix Then my plugin is not robust and will break the first time I or anyone else connects to multiple servers.
14:25 AlexDaniel but you may be right, I don't know
14:26 Zoffix And I can't release it into the ecosystem. And if I do, I become the Joseph Smith who forgot to add the server :P
14:27 AlexDaniel someone will probably submit a pull request. Especially if the error message is good enough. Or use IRC::Client :strict; :)
14:27 AlexDaniel but okay, whatever
14:28 ggoebel114 joined #perl6
14:31 rindolf joined #perl6
14:34 sufrostico joined #perl6
14:34 k-man joined #perl6
14:40 khw joined #perl6
14:42 pochi m: sub foo() returns Str { return Nil }; foo()
14:42 camelia rakudo-moar c5dfd7: ( no output )
14:42 pochi m: subset StrStr where :(Str,Str); sub foo() returns StrStr { return Nil, Nil }; foo()
14:42 camelia rakudo-moar c5dfd7: OUTPUT«Type check failed for return value; expected StrStr but got List ($(Nil, Nil))␤  in sub foo at /tmp/b4KcIDtBdo line 1␤  in block <unit> at /tmp/b4KcIDtBdo line 1␤␤»
14:43 pochi why does Str match Nil, but my StrStr doesn't match Nil,Nil?
14:48 buharin joined #perl6
14:52 dogbert17 does anyone have time to review yet another doc snippet, method 'of' in class Hash? https://gist.github.com/dogbert17/ac2e37814987267451d3a04cfdad324a
14:53 CIAvash joined #perl6
14:56 rindolf dogbert17: looks fine.
14:57 dogbert17 rindolf: thx
15:01 pochi m: my Array of Int @a; @a[0] = [1,2,3]
15:01 camelia rakudo-moar c5dfd7: OUTPUT«Type check failed in assignment to @a; expected Array[Int] but got Array ($[1, 2, 3])␤  in block <unit> at /tmp/e2pBx_HZAh line 1␤␤»
15:02 pochi how do I stuff things into @a?
15:02 ugexe thats an array of array [int]
15:02 ugexe assigning an array to a specific item in an array like that
15:03 dalek doc: 7e63db0 | (Jan-Olof Hendig)++ | doc/Type/Hash.pod:
15:03 dalek doc: Added docs for method of in class Hash and removed som trailing spaces. rindolf++
15:03 dalek doc: review: https://github.com/perl6/doc/commit/7e63db00bd
15:03 pmurias Zoffix: have you considered using a server/channel pair object instead of strings for channels?
15:04 CIAvash m: my Array of Int @a; @a[0] = Array[Int].new: 1,2,3
15:04 camelia rakudo-moar c5dfd7: ( no output )
15:04 gfldex m: my @a if Int; @a = 1,2,3; dd @a;
15:04 camelia rakudo-moar c5dfd7: OUTPUT«Array @a = [1, 2, 3]␤»
15:05 pochi so it doesn't understand that [1,2,3] is an Int array?
15:06 gfldex m: my Array of Int @a; my @b of Int = 1,2,3; @a[0] = @b; dd @a;
15:06 camelia rakudo-moar c5dfd7: OUTPUT«Array[Array[Int]] @a = Array[Array[Int]].new(Array[Int].new(1, 2, 3))␤»
15:06 gfldex there is no literal to express Array of type X.
15:06 pochi ok
15:07 gfldex m: my Array of Int @a; @a[0] = Array[Int].new(1,2,3); dd @a;
15:07 camelia rakudo-moar c5dfd7: OUTPUT«Array[Array[Int]] @a = Array[Array[Int]].new(Array[Int].new(1, 2, 3))␤»
15:08 ttyl joined #perl6
15:08 gfldex pochi: ^^^ that's the illiteral way
15:09 pochi thanks
15:09 * gfldex wonders if that's doced
15:09 ugexe m: my Int @a  = 1, 2, 3; say @a.perl; # you were doing an array of array of int
15:09 camelia rakudo-moar c5dfd7: OUTPUT«Array[Int].new(1, 2, 3)␤»
15:09 ugexe not the same thing as array of int
15:11 ugexe assigning a literal array to an Array[Int] slot would obviously never work
15:11 pochi Doesn't Array of Int @a specify a structure such as @a = ( [1,2,3], [2,3,4], ... )?
15:11 espadrine joined #perl6
15:13 ugexe maybe *goes back to drinking caffeine*
15:13 gfldex no, it constructs a nominally type constraint.
15:14 gfldex m: my Array[Array[Int]] $a;
15:14 camelia rakudo-moar c5dfd7: ( no output )
15:14 gfldex that's a Array of Arrays of Int.
15:15 gfldex ([1,2,3], [2,3,4]) is a List of Arrays who happen to have Ints inside.
15:16 Zoffix pmurias, to what end?
15:20 Zoffix It won't solve the issue of having to specify a server all over the place.
15:20 Zoffix (if you're referring to the earlier conversation about having multiple servers per client instance)
15:24 gfldex m: my Array of Int @a; @a[0] = my Int @ = 1,2,3; dd @a;
15:24 camelia rakudo-moar c5dfd7: OUTPUT«Array[Array[Int]] @a = Array[Array[Int]].new(Array[Int].new(1, 2, 3))␤»
15:25 gfldex m: my Array of Int @a; @a[0] = (1,2,3).Array[Int]; dd @a;
15:25 camelia rakudo-moar c5dfd7: OUTPUT«Use of Nil in string context  in block <unit> at /tmp/EfPI1Idc84 line 1␤Indexing requires an instance, tried to do: [ (Int) ]␤  in block <unit> at /tmp/EfPI1Idc84 line 1␤␤»
15:26 gfldex how would I coerce to a parametric type?
15:27 iH2O joined #perl6
15:31 CIAvash m: my Array of Int @a; @a[0] = Array[Int](1,2,3); say @a;
15:31 camelia rakudo-moar c5dfd7: OUTPUT«[[1 2 3]]␤»
15:36 firstdayonthejob joined #perl6
15:36 iH2O left #perl6
15:45 anomie__ joined #perl6
15:46 anomie__ Is there a way to install perl6 without using git? My internet is 16KB/s, and I just can't keep a connection for that long (and git cloning can not continue after it's been interrupted).
15:48 lizmat anomie__ : http://rakudo.org/downloads/rakudo/ contains tarballs for download
15:48 lizmat perhaps you can find a downloader with resume function
15:48 sQuEE joined #perl6
15:49 anomie__ Ah, thanks.
15:49 anomie__ Can't believe i didn't notice.
15:49 lizmat that's why we also have an IRC channel  :-)
15:51 anomie__ So like, should I build rakudo, then nqp, then star?
15:51 psch anomie__: i think the tarballs work in one step, probably Configure.pl as usual
15:51 lizmat perl Configure.pl --gen-moar --gen-nqp --backends=moar   # is what I usually do
15:52 lizmat problem is, that will try to use git to download moar and nqp  :-(
15:52 lizmat and that brings us back to the 16KB/s issue
15:53 lizmat http://www.moarvm.org/releases/MoarVM-2016.05.tar.gz   # latest MoarVM tarball
15:53 anomie__ Eh, I'll try to figure it out. Hopefully there's some --nqp-dir flag or something.
15:53 lizmat anomie__: there is
15:53 anomie__ Good.
15:54 psch the star tarballs has nqp and moar bundled, and if those are already there it doesn't download anything
15:54 lizmat psch: good point
15:54 psch so it's really just 'perl Configure.pl --gen-moar --backends=moar --prefix=$PREFIX'
15:54 lizmat seems that would be the easiest way
15:54 psch well, and --make-install maybe :)
15:54 lizmat there's --make-install ?
15:54 psch yeah
15:55 * lizmat learned a thing today
15:55 anomie__ So star tarballs are updated less frequently though, so I'll do it the hard way.
15:55 psch anomie__: but star also has a bunch of modules
15:56 psch anomie__: which you otherwise would have to download with a module manager (via git, usually) or manually
15:56 gfldex anomie__: do you think a git pull will work after you got the clone done?
15:56 anomie__ gfldex: Yeah.
15:56 gfldex i may be able to help you
15:57 psch could probably just download the zip (or whatever) from github?  or do those not carry the .git folder?
15:58 anomie__ psch: Those don't carry the .git folder.
15:58 psch ah, shame :/
15:59 anomie__ anomie__: Yeah.
15:59 anomie__ Err, Yes, i do I have xz installed.
16:01 lizmat wouldn't it be just a matter of git create in that folder, and then tweaking the files in .git?
16:01 vendethiel joined #perl6
16:01 zakharyas joined #perl6
16:01 psch no idea if git works like that
16:01 psch i mean, i'd guess doing a 'git init', setting the remote, and the pulling *could* work...
16:01 lizmat psch: yeah, git init I meant
16:02 Ven joined #perl6
16:02 lizmat you wouldn't have any history, but I'm pretty sure it will allow you to git pull etc from there
16:02 smls joined #perl6
16:03 smls What is the expected behavior when two .pm modules `use` each other?
16:03 mst ideally, a small gnome exits the back of the monitor and hits the developer with a mallet
16:03 smls I would have probably expected an error, but right now it hangs and keeps eating RAM
16:04 smls (this is regarding https://rt.perl.org/Ticket/Display.html?id=128275#txn-1403059 )
16:04 Deep_Thought joined #perl6
16:05 psch smls: we did have circular module loading detection at some point... probably got clobbered with all CUR work though :/
16:05 psch +the
16:05 smls ok, I'll rename the RT accordingly.
16:05 lizmat psch: before, the detection lived in the nqp code, if I recall
16:06 lizmat now, it is the responsibility of the CUR to detect circularities
16:06 lizmat a start would be writing a test  :-)
16:09 dalek doc: ff5caf0 | (Jan-Olof Hendig)++ | / (3 files):
16:09 dalek doc: Added docs for X::Caller::NotDynamic and fixed a broken link relating to that
16:09 dalek doc: review: https://github.com/perl6/doc/commit/ff5caf090d
16:11 dogbert17 stupid question time :)
16:11 * lizmat is working through the twisty maze that is the List reifier code
16:11 dogbert17 on http://doc.perl6.org/type/Proc::Async there is an example where some bytes are written through hexdump
16:13 dogbert17 it works but if I change that program name to e.g. hexdump2 it just dies, I expected it not to work but there is no error message at all. Is it supposed to be like that?
16:13 psch m: my $promise = start { die "blerg" }; await $promise
16:13 camelia rakudo-moar c5dfd7: OUTPUT«blerg␤  in block <unit> at /tmp/GV1rJr0SlU line 1␤␤»
16:13 psch m: my $promise = start { die "blerg" }; try await $promise
16:13 camelia rakudo-moar c5dfd7: ( no output )
16:14 psch dogbert17: the example doesn't have code that handles the failure in any meaningful way
16:14 psch dogbert17: i'm assuming it dies with something along the lines of "no such file: hexdump2"?
16:15 dogbert17 psch: shouldn't there be any output on STDERR?
16:15 psch oh, *no* error message at all
16:15 psch that's curious, actually
16:15 * psch is really good at only paying half attention :)
16:17 dogbert17 ususally the error messages from perl6 are very good but here there's nothing. It's a bit odd so I thought I should ask
16:18 gfldex $prog.start should return a bottled up exception that tells you about the lack of executable and it's name
16:20 Zoffix Seems calling .write "defuses" the broken promise
16:23 dogbert17 if I put a    say 'can I see this' after the await line no text is shown when running the code
16:23 psch dogbert17: yeah, that's what i saw too just now
16:23 anomie__ Really though, the git clones wouldn't be nearly as problematic if there was a way to pass a --depth=1 option. Can I do that?
16:24 Zoffix Oh, actually .write exits the program
16:24 dogbert17 that seem a bit harsh no?
16:24 gfldex anomie__: maybe https://www.perforce.com/blog/141218/git-beyond-basics-using-shallow-clones
16:25 Zoffix dogbert17, well, I mean that's the apparent behaviour not that it's actually calling exit :P
16:25 dogbert17 Zoffix: aha, I jumped to conclusions :)
16:26 psch :/
16:26 psch spooky async bugs
16:26 profan joined #perl6
16:26 Zoffix m: $*SCHEDULER.WHAT.say
16:26 camelia rakudo-moar c5dfd7: OUTPUT«(ThreadPoolScheduler)␤»
16:27 psch perl6-gdb-m correctly errors out, with "no such file or directory"
16:29 dogbert17 psch: on the plus side, if it's a bug we have a good testcase
16:29 lizmat afk for some X-Apocalypse
16:29 psch dogbert17: oh, it's most definitely a bug, but it disappearing under gdb is just annoying
16:31 ugexe i like how running without `:w` or passing .write a Str gets an exception but still runs the process after exiting the initial perl6 process
16:32 huggable joined #perl6
16:34 ugexe perl6 -e 'my $p = Proc::Async.new("hexdump", "-C"); my $promise = $p.start; await $p.write("asdf"); say $promise; $p.close-stdin; await $promise;' # then press `Enter` after the exception exits the process
16:34 dogbert17 I haven't tried perl6-gdb-m before but I had to try, got 'Program received signal SIGPIPE, Broken pipe.' and then a gdb prompt
16:37 psch dogbert17: that's a bit weird, are you on HEAD?
16:37 psch m: say 1
16:37 camelia rakudo-moar c5dfd7: OUTPUT«1␤»
16:37 psch ah, i'm behind anyway
16:37 psch hm, but it's only the Hash.keyof commit that i'm missing
16:38 ggoebel114 joined #perl6
16:38 dogbert17 psch: running what Camelia is running i.e. c5dfd7
16:39 psch yeah, that's HEAD...
16:39 Zoffix m: class Plug { has $.irc is rw }; my $p = Plug.new; class IRC { has @.plugs; method run { $_.irc = rand for @.plugs; }; method meow { say .irc for @.plugs} }; await ^2 .map: {start {.run,.meow given IRC.new(:plugs($p))}};
16:39 camelia rakudo-moar c5dfd7: OUTPUT«0.89240370869378␤0.730070228046375␤»
16:40 Zoffix AlexDaniel++ thanks for bring up the multi-server thing. My current design is flawed. Can't re-use the same plugin in multiple clients ^
16:40 Zoffix because $.irc object will be the same one :/
16:40 psch oh
16:40 psch i got the SIGPIPE before, too
16:40 domidumont joined #perl6
16:40 psch running 'cont' is what gave the NSFOD
16:41 AlexDaniel Zoffix: glad to help
16:41 psch no idea what's behind that :/
16:42 dogbert17 it's definitely strange
16:45 anomie__ failed to load library 'dynext/libperl6_ops_moar.so'
16:45 anomie__ Eh? I got that error after running `perl Configure.pl --prefix=/tmp/prefix'
16:45 anomie__ Actually, after running make -j3
16:46 anomie__ I installed moarvm and nqp into that prefix.
16:50 itaipu joined #perl6
16:57 Zoffix "P6 in production thread": http://perlmonks.org/index.pl?node_id=1163803
16:58 Zoffix If anyone with an account cares to reply to cavac that our github system is only temporary, I'll appreciate it :)
16:58 Deep_Thought joined #perl6
16:58 Zoffix Oh, never mind, there's already an answer to that point
17:01 mr-foobar joined #perl6
17:04 AlexDaniel by the way, what's the status on perl 6 cpan equivalent?
17:06 grondilu "but p6 still has a perl-esque feel."  what an euphemism
17:06 Zoffix AlexDaniel, haven't heard anything ever since I wrote this: http://docs.perl6.org/language/modules#The_Future_of_Ecosystem and the metacpan fork has no commits this year
17:07 mst AlexDaniel: the status is "nobody's working on it at all except a couple perl5 people, and one of them is me and currently sucking at writing a blog post"
17:08 Zoffix mst, you don't have access to perlmonks.org accounts, by any chance, do you? I have an account, but I've no idea what email address I used for it or what my pass is
17:09 mst no
17:10 itaipu joined #perl6
17:12 sQuEE joined #perl6
17:21 grondilu I have an perlmonks account, but I'm not sure saying the current ecosystem system being temporary is such a great thing to say about it.
17:22 grondilu I mean that will go in the sense that Perl 6 is not ready for production.
17:22 Zoffix Why not? It's the truth.
17:22 Zoffix Hiding the truth doesn't magically make things better.
17:22 grondilu it's not higing the truth not to say what you don't want to be known.  (well, I think it's not)
17:23 grondilu damned I phrased that poorly
17:23 mst you have two possibilities here
17:23 mst (1) admit the current ecosystem is a giant janky hack that will likely be replaced by somethingsuitable for real usage
17:23 Zoffix The alternative is to let them keep thinking our *permanent* system is based on github and accepting their critique on such a system
17:23 mst (2) present perl6 as a language that thinks the giant janky hack is actually a good and worthy thing
17:24 mst if (2) is true, then, frankly, I might as well cancel my YAPC::NA talk and /part now
17:24 mst but I really don't think it is
17:24 mst or, "what Zoffix said"
17:25 geekosaur perl's often gotten a lot of mileage out of janky hacks (see: references, p5 "objects")... but this doesn't strike me as one of those
17:25 grondilu I'm unaware of this github hate anyway, is that a serious thing?
17:25 mst what
17:25 mst not 'github hate'
17:25 mst nobody said 'github hate'
17:26 grondilu haters rarely say "I hate"
17:26 Zoffix It's not github hate. It's having your shit break just because author of XYZ decided to push a new commit :P
17:27 mst right
17:27 mst I dunno how you think github is relevant here
17:27 tadzik if your shit relies on git HEAD...
17:27 mst it'd be a janky hack with a different backend
17:27 tadzik . o O ( then you're a shit-HEAD )
17:27 geekosaur sadly, that is increasingly common in certain ecosystems
17:27 geekosaur (go, node, ...)
17:27 mst grondilu: let me put this another way: for perl6 to go into production for me, either the current ecosystem stuff needs replacing or I need to replace it myself :)
17:28 mst mostly because the various sysadmins involved would frigging murder me otherwise
17:32 ugexe nobody should be using "use XXX::YYY" in production without :ver<>:auth<> anyway
17:32 mohae_ joined #perl6
17:34 Zoffix The problem is there's ambiguity of what :ver<whatever> actually is. I can release version 1.001001 and then break it by pushing a few commits without changing the version number
17:35 ugexe a Distribution is meant to be immutable
17:36 pmurias joined #perl6
17:37 mst right, and the current implementation of the ecosystem doesn't get that quite right
17:37 mst I guess moving it to tags will help
17:38 ugexe the metacpan instance jdv runs handles it
17:40 ugexe this is why ive left my versions at "*" on github, because thats the only version that should be mutable
17:41 mst right
17:41 Actualeyes left #perl6
17:45 ugexe and regarding the perlmonk comments: jdv's (alpha?) metacpan can be used with zef, and the modules `use`d with their full identity. so an example of such a non-github ecosystem for perl6 can already be demonstrated
17:45 mst and we should be able to slot cpan itself in underneath as storage soon enough
17:48 pmurias a version of metacpan works for Perl 6?
17:49 ugexe http://hack.p6c.org:5001/
17:49 ugexe http://hack.p6c.org:5000/v0/release/_search?q=distribution:DBIish
17:52 |meta joined #perl6
17:56 Xliff_ joined #perl6
17:56 patrickz joined #perl6
17:57 dalek doc: a526f32 | titsuki++ | doc/Type/IO.pod:
17:57 dalek doc: Fix the example of the open method
17:57 dalek doc: review: https://github.com/perl6/doc/commit/a526f326c1
17:57 dalek doc: 5ea48f4 | (Zoffix Znet)++ | doc/Type/IO.pod:
17:57 dalek doc: Merge pull request #555 from titsuki/fix-open
17:57 dalek doc:
17:57 dalek doc: Fix the example of the open method
17:57 dalek doc: review: https://github.com/perl6/doc/commit/5ea48f4458
18:02 CIAvash joined #perl6
18:02 kurahaupo joined #perl6
18:05 b2gills anomie__: I think you should be able to call git pull to finish off an interrupted git clone
18:06 anomie__ b2gills: Nope. When a git clone is interrupted, there is no .git.
18:07 anomie__ Unless it's changed since I last tried.
18:09 mohae joined #perl6
18:12 mohae__ joined #perl6
18:12 labster joined #perl6
18:14 geekosaur it hasn't
18:15 BenGoldberg joined #perl6
18:19 RabidGravy joined #perl6
18:21 Ven joined #perl6
18:28 grondilu joined #perl6
18:28 gnull Hello everyone
18:29 gnull I've been reading perl6 tutorial at https://learnxinyminutes.com/docs/perl6/
18:29 DrForr Yay, how do you like it so far?
18:29 tadzik welcome gnull :)
18:30 gnull It is awesome. Never been so happy to learn new language since Haskell
18:30 gfldex :o
18:32 gnull The question is: how up-to-date is it? It states that some of the features are not implemented, like `lazy` or `quietly`. Is it still so?
18:33 psch m: /a b/;
18:33 camelia rakudo-moar c5dfd7: OUTPUT«Potential difficulties:␤    Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)␤    at /tmp/QVRSwULc5g:1␤    ------> 3/a7⏏5 b/;␤»
18:33 psch m:  quietly /a b/
18:33 camelia rakudo-moar c5dfd7: OUTPUT«Potential difficulties:␤    Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)␤    at /tmp/W0N6qRewyL:1␤    ------> 3quietly /a7⏏5 b/␤»
18:34 psch m: my @a = lazy 1..*; say @a[^10]
18:34 camelia rakudo-moar c5dfd7: OUTPUT«(1 2 3 4 5 6 7 8 9 10)␤»
18:34 ugexe m: quietly { /a b/ }
18:34 camelia rakudo-moar c5dfd7: OUTPUT«Potential difficulties:␤    Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)␤    at /tmp/ITLVsuHjHt:1␤    ------> 3quietly { /a7⏏5 b/ }␤»
18:34 jnthn m: warn "foo"
18:34 camelia rakudo-moar c5dfd7: OUTPUT«foo  in block <unit> at /tmp/wTRav7ZPSx line 1␤»
18:34 ugexe hmm i thought quietly worked some way
18:34 jnthn m: quietly warn "foo"
18:34 camelia rakudo-moar c5dfd7: ( no output )
18:34 psch that looks like it should be quiet
18:34 jnthn It's for *runtime* warnings
18:34 psch ahh, so no
18:34 jnthn "Potential difficulties" is a compile time thing :)
18:35 gfldex gnull: expect it to be outdated in some spots. You will be closer to $now with http://perl6intro.com/
18:39 AlexDaniel gnull: I don't think that it is outdated at all
18:41 AlexDaniel gnull: look at the history: https://github.com/adambard/learnxinyminutes-docs/commits/master/perl6.html.markdown
18:41 AlexDaniel not too bad
18:41 buharin joined #perl6
18:41 AlexDaniel gnull: if you stumble upon something that doesn't work, then just open an issue
18:42 gnull Thank you.
18:43 gnull I see that `quietly` works. How about `lazy`? http://perl6intro.com/ doesn't tell abything about it. Any usage examples?
18:43 gnull anything*
18:43 psch m: my @a = 1..*;
18:43 camelia rakudo-moar c5dfd7: ( no output )
18:43 psch m: my @a = 1..*; say @a[^10]
18:43 camelia rakudo-moar c5dfd7: OUTPUT«(1 2 3 4 5 6 7 8 9 10)␤»
18:43 psch meh vOv
18:44 gnull These are lazy lists I guess
18:44 psch m: my @a = (1..*).map({ ++$_ });
18:44 camelia rakudo-moar c5dfd7: ( no output )
18:44 gnull I thought that I could do something like: $a = lazy 1 + 2
18:45 gnull and 1 + 2 won't be evaluated until i access the value of $a
18:45 gnull The statement prefix `lazy` is what I'm interested in
18:45 ugexe m: my @a = lazy 1..100; say @a.elems
18:45 camelia rakudo-moar c5dfd7: OUTPUT«Cannot .elems a lazy list␤  in block <unit> at /tmp/8F8jSutE9d line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/8F8jSutE9d line 1␤␤»
18:45 Deep_Thought joined #perl6
18:46 psch gnull: it's only for iterators, not subs in general
18:46 psch ...or Iterables?  i'm not quite sure there
18:48 psch m: my $a = lazy 1..* X+ 1..*; say $a[^5]
18:48 camelia rakudo-moar c5dfd7: OUTPUT«(2 3 4 5 6)␤»
18:48 psch m: my $a = 1..* X+ 1..*; say $a[^5] # timeout
18:48 camelia rakudo-moar c5dfd7: OUTPUT«(timeout)»
18:49 AlexDaniel m: say now; my $a = { sleep 3; 4 + 8 }; say now; say $a(); say now
18:49 camelia rakudo-moar c5dfd7: OUTPUT«Instant:1464461392.946288␤Instant:1464461392.949612␤12␤Instant:1464461395.950710␤»
18:49 AlexDaniel gnull: perhaps you want something like this?
18:49 AlexDaniel gnull: ↑
18:50 AlexDaniel m: say now - BEGIN now; my $a = { sleep 3; 4 + 8 }; say now - BEGIN now; say $a(); say now - BEGIN now
18:50 camelia rakudo-moar c5dfd7: OUTPUT«0.0884493␤0.0524130␤12␤3.0159767␤»
18:51 qwe_ joined #perl6
18:52 gnull Yes exactly. Are these `{}` code blocks always lazily evaluated?
18:53 psch any Callable is only evaluated when you invoke it
18:54 AlexDaniel but it is evaluated each time you invoke it, so it's not exactly what you wanted
18:54 AlexDaniel is there any way to make a cached block?
18:54 ugexe use a Proxy
18:56 gnull psch: What do you mean by invocation? Why `$a = { sleep 3; 4 + 8 }` isn't invocation?
18:57 psch m: my $a = { sleep 10; 4 + 8 }; say $a
18:57 camelia rakudo-moar c5dfd7: OUTPUT«-> ;; $_? is raw { #`(Block|70246464) ... }␤»
18:57 psch m: my $a = { sleep 10; 4 + 8 }; say $a()
18:57 ugexe its a callable code block unless you `do` it
18:57 psch gnull: it isn't because it's a declaration :)
18:57 camelia rakudo-moar c5dfd7: OUTPUT«12␤»
18:57 gnull m: sub a {say 'hooah'}; my $b = a;
18:57 camelia rakudo-moar c5dfd7: OUTPUT«hooah␤»
18:58 psch m: sub a {say 'hooah'}; my $b = &a;
18:58 camelia rakudo-moar c5dfd7: ( no output )
18:59 gnull m: my $b = {say 'hooah'; 1}; $b
18:59 camelia rakudo-moar c5dfd7: OUTPUT«WARNINGS for /tmp/OPVadx_MZ6:␤Useless use of $b in sink context (line 1)␤»
18:59 gnull m: my $b = {say 'hooah'; 1}; say $b;
18:59 camelia rakudo-moar c5dfd7: OUTPUT«-> ;; $_? is raw { #`(Block|74992952) ... }␤»
18:59 buharin joined #perl6
18:59 ugexe m: my $b = do {say 'hooah'; 1 }; say $b
18:59 camelia rakudo-moar c5dfd7: OUTPUT«hooah␤1␤»
19:00 gnull Ok, when i do `$b = {say 'hooah'; 1};` the perl remebmers that to get the value of $b it must evaluate the code block
19:01 ugexe do executes the statement immediately. it doesnt remember anything
19:02 ugexe oops i misread do `$b` as `do $b`
19:02 gnull I don't understand the case without `do`
19:02 gnull then I try to `say $b`, I expect it to evaluate the block and `say 'hooah'`
19:02 ugexe its callable, you have to call it
19:02 psch m: my &b = {say 'hooah'; 1}; b
19:02 camelia rakudo-moar c5dfd7: OUTPUT«hooah␤»
19:02 ugexe by `say $b` you are just calling .gist on it
19:03 ugexe m: say sub foo { 1 + 1 }
19:03 camelia rakudo-moar c5dfd7: OUTPUT«sub foo () { #`(Sub|68445288) ... }␤»
19:04 gnull Ok, now it's clear
19:04 gnull Thanks you very much
19:11 TEttinger joined #perl6
19:11 AlexDaniel gnull: if you have any other questions we would love to answer them :)
19:13 gnull AlexDaniel: love this community)
19:13 grondilu raydiak: Math::Symbolic dies on invocation with:
19:13 grondilu ===SORRY!===
19:13 grondilu No such method 'key' for invocant of type 'Array'
19:13 AlexDaniel huggable: hug gnull
19:13 * huggable hugs gnull
19:14 psch m: say Array.^can('key')
19:14 camelia rakudo-moar c5dfd7: OUTPUT«()␤»
19:15 grondilu lately I've been looking for a solution for a multivariate polynomials arithmetics.  Not quite happy with what I've found.  There's a Perl 5 library and I've considered translating it but meh I'm too lazy.
19:15 s_kilk joined #perl6
19:17 grondilu it'd be nice to be able to multiply and add undefined numeric variables and get polynomials as a result.
19:18 AlexDaniel grondilu: you want that to be built in? :o
19:19 grondilu nah, not built-in.  I often have unreasonable desires for the core, but not that one.
19:19 grondilu anyway if raydiak wants some encouragement to keep on working on Math::Symbolic, here it is.
19:20 grondilu using undefined variables may not be the best interface for it on second thought, but I'm not sure using a string is the best either.
19:22 grondilu I mean something like Polynomial.new('2*x + 1') would be kind of lame.
19:23 grondilu FYI I was considering something like that for my Clifford module.  I may make it crazy efficient.
19:24 mst grondilu: basically you need multiple whatever stars
19:24 mst grondilu: %*{'x'} # ISAGN
19:25 grondilu "ISAGN"?
19:25 mst I See A Great Need
19:25 mst usenet-ism, usually at least slightly tongue in cheek
19:26 _28_ria joined #perl6
19:26 ssotka joined #perl6
19:26 grondilu seriously though, I've thought a bit about what would be the best interface to a multivariate polynomials module, could not quite decide on something.
19:27 grondilu at first I thought of:  use Polynomials; my Real $X; say $X**2 - 1 == ($X + 1)*($X - 1)  # that would say "True", amazingly enough.
19:28 grondilu ^if someone can make this work, I'd be amazed.
19:28 wamba joined #perl6
19:28 grondilu notice how $X is undefined here.
19:29 grondilu aynway for various reasons I was not entirely conviced by such method anyway.
19:33 AlexDaniel m: my $X; say quietly $X**2 - 1 == ($X + 1)*($X - 1)
19:33 camelia rakudo-moar c5dfd7: OUTPUT«True␤»
19:33 AlexDaniel grondilu: ↑ there you go, where's my cookie?
19:37 Deep_Thought joined #perl6
19:41 hankache joined #perl6
19:43 RabidGravy boom I win! threads lose
19:43 hankache good evening #perl6
19:44 * grondilu never saw "quietly" before
19:45 grondilu m: my $X; say quietly $X**2 + 1 == ($X + 1)*($X - 1)
19:45 camelia rakudo-moar c5dfd7: OUTPUT«False␤»
19:45 jnthn grondilu: Just hacked together https://gist.github.com/jnthn/75321e83b4155b2b99d87ddf8d6f0d18 which may be a pointer in a useful direction :)
19:49 grondilu binary tree, huh?  I thought about doing this like that too, but got discouraged in the end.
19:49 grondilu it's also not quite how people seem to do it
19:56 jnthn I'm a compiler writer, I see everything as a tree or a graph :P
19:56 jnthn Or a string waiting to be turned into one :P
19:56 jnthn You can build whatever data structure you want, though
19:57 jnthn My point was more that with care you can overload operators and use .VAR in a way that lets you find the symbol names
19:57 cpage_ joined #perl6
20:02 TakinOver joined #perl6
20:10 RabidGravy my problem of yesterday appears to be something in the region of promise and react contending over a single resource in closing a channel and thus keeping a promise :-\
20:11 RabidGravy replace the react with a $channel.list and it's all fine
20:14 jnthn RabidGravy: If you've got a golf of it, I can take a look next week.
20:14 RabidGravy I couldn't get a degenerate case to do it
20:14 jnthn Ah, hm
20:15 RabidGravy there may be a funny timing issue with libshout too
20:15 jnthn Does the case it occurs it depend on anything that's hard to run (native libs and stuff)?
20:16 RabidGravy yeah, libshout and icecast required :-\
20:16 jnthn Gotta go now, but I'll have some bug hunting time next week, so if I can reproduce it... :)
20:16 jnthn Ah
20:16 jnthn Hm
20:16 jnthn Though maybe those are easily apt-get-able or so?
20:17 jnthn Anyways, time for me to go relax for now... bbt
20:17 sufrostico joined #perl6
20:29 masak m: sub foo { sub bar { state $x; $x++; say $x }; bar; bar }; foo; foo
20:29 camelia rakudo-moar 7500ea: OUTPUT«1␤2␤1␤2␤»
20:29 masak :)
20:32 huggable joined #perl6
20:34 patrickz joined #perl6
21:02 mr-foobar joined #perl6
21:09 sufrostico joined #perl6
21:36 masak 'night, #perl6
21:36 hankache night masak
21:37 grondilu m: my $X; say quietly $X**2 + $_ == ($X + 1)*($X - 1) for -1, 1
21:37 camelia rakudo-moar 7500ea: OUTPUT«(True False)␤»
21:37 grondilu ^that baffles me
21:37 grondilu m: say ((my $)**2).WHAT
21:37 camelia rakudo-moar 7500ea: OUTPUT«Use of uninitialized value of type Any in numeric context  in block <unit> at /tmp/EWTPIh_Kwx line 1␤(Int)␤»
21:37 grondilu m: say quietly ((my $)**2).WHAT
21:37 camelia rakudo-moar 7500ea: OUTPUT«(Int)␤»
21:38 psch m: say Int + -1
21:38 camelia rakudo-moar 7500ea: OUTPUT«Invocant requires an instance of type Int, but a type object was passed.  Did you forget a .new?␤  in block <unit> at /tmp/0w9EO_nM_m line 1␤␤»
21:38 psch m: say Int + 1
21:38 camelia rakudo-moar 7500ea: OUTPUT«Invocant requires an instance of type Int, but a type object was passed.  Did you forget a .new?␤  in block <unit> at /tmp/cIhsWygYSu line 1␤␤»
21:38 grondilu I guess it takes it as 0.
21:38 grondilu m: say quietly 0 == my $
21:38 camelia rakudo-moar 7500ea: OUTPUT«True␤»
21:38 grondilu m: say quietly 1 == my $
21:38 camelia rakudo-moar 7500ea: OUTPUT«False␤»
21:38 psch m: my $X; my $a = quietly $X**2 + $_; my $b = quietly ($X + 1)*($X - 1) for -1, 1; say $a.WHAT; say $b.WHAT
21:38 camelia rakudo-moar 7500ea: OUTPUT«(Int)␤(List)␤»
21:38 grondilu ok, mystery solved
21:39 psch m: my $X; my $a = quietly $X**2 + $_; my $b = quietly ($X + 1)*($X - 1); say $a.WHAT; say $b.WHAT
21:39 camelia rakudo-moar 7500ea: OUTPUT«(Int)␤(Int)␤»
21:39 psch m: my $X; my $a = quietly $X**2 + $_; my $b = quietly ($X + 1)*($X - 1); say $a; say $b
21:39 camelia rakudo-moar 7500ea: OUTPUT«0␤-1␤»
21:39 psch eh, i'm not even being helpful there anyway
21:39 * psch better goes to bed as well
21:40 hankache night psch
21:41 DrForr Heading to bed myself. Incidentally one of the talk evaluations I got read "A great introduction to perl 6 for someone who has never even used perl 5 before."
21:48 yqt joined #perl6
22:00 sufrostico joined #perl6
22:08 Emeric my @list = (0, 1, 3, 4);
22:08 Emeric Can I an add a value between the 1 and the 2 ?
22:08 Emeric is there a method to do that ?
22:14 b2gills splice
22:15 b2gills m: my @list = (0, 1, 3, 4);@list.splice(1,0,32); say @list
22:15 camelia rakudo-moar 7500ea: OUTPUT«[0 32 1 3 4]␤»
22:28 gorgonzola joined #perl6
22:37 ssotka joined #perl6
22:40 wbill joined #perl6
23:09 jack_rabbit joined #perl6
23:40 buharin_ joined #perl6
23:44 sufrostico joined #perl6
23:56 itaipu joined #perl6

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

Perl 6 | Reference Documentation | Rakudo