Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-09-26

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 thou joined #perl6
00:03 [Coke] m: my $a = Proc::Async.new(<doesnt exist>); $a.stdout.tap(->$a {}); $a.stderr.tap(->$a {}); if (await $a.start).exitcode { say "oops"} else { say "ok"}\
00:03 camelia rakudo-moar 1af2a7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3.exitcode { say "oops"} else { say "ok"}7⏏5\␤»
00:04 [Coke] m: my $a = Proc::Async.new(<doesnt exist>); $a.stdout.tap(-> $a {}); $a.stderr.tap(-> $a {}); if (await $a.start).exitcode { say "oops"} else { say "ok"}\
00:04 camelia rakudo-moar 1af2a7: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3.exitcode { say "oops"} else { say "ok"}7⏏5\␤»
00:04 cpage_ joined #perl6
00:04 [Coke] m: my $a = Proc::Async.new(<doesnt exist>); $a.stdout.tap(-> $a {}); $a.stderr.tap(-> $a {}); if (await $a.start).exitcode { say "oops"} else { say "ok"}
00:04 camelia rakudo-moar 1af2a7: OUTPUT: «Proc::Async is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in method new at src/RESTRICTED.setting line 32␤  in block <unit> at <tmp> line 1␤␤»
00:05 [Coke] if I run that locally, I get Unhandled exception in code scheduled on thread 6
00:06 [Coke] Unhandled exception in code scheduled on thread 6 (and again on 7), and then two "no such file or directory".
00:06 ryn1x joined #perl6
00:12 [Coke] (I need the tap to avoid output when it *does* work, but having the tap when the command is bad dies)
00:14 mcmillhj joined #perl6
00:19 pilne joined #perl6
00:19 epony joined #perl6
00:31 mcmillhj joined #perl6
00:35 aborazmeh joined #perl6
00:35 aborazmeh joined #perl6
00:42 mryan50 joined #perl6
00:42 Geth ¦ doc: 11609476f4 | (Will "Coke" Coleda)++ | xt/aspell.t
00:42 Geth ¦ doc: convert aspell.t to use Proc::Async…
00:42 Geth ¦ doc:
00:42 Geth ¦ doc: …except in the initial aspell check because Proc::Async fails if you
00:42 Geth ¦ doc: try to tap a non-existant program's output
00:42 Geth ¦ doc: review: https://github.com/perl6/doc/commit/11609476f4
00:42 Geth ¦ doc: ba421f17c5 | (Will "Coke" Coleda)++ | xt/aspell.t
00:42 Geth ¦ doc: make aspell.t respect TEST_THREADS
00:42 Geth ¦ doc: review: https://github.com/perl6/doc/commit/ba421f17c5
00:46 Ven`` joined #perl6
00:47 mcmillhj joined #perl6
00:50 samcv my Final Grand Report is now up! https://cry.nu/grant-report/
00:52 TEttinger wowza, just clicked your contrib graph samcv https://github.com/samcv
00:52 TEttinger 3450 is wow
00:52 samcv :)
00:53 Zoffix .oO( lightweight :P )
00:53 [Coke] samcv++
00:54 TEttinger however, I did hit a 1200-day commit streak today
00:55 TEttinger my contrib count is far less, 1230 this year
00:59 mr-foobar joined #perl6
00:59 Cabanossi joined #perl6
01:15 astj joined #perl6
01:17 ryn1x joined #perl6
01:27 ryn1x joined #perl6
01:29 Cabanossi joined #perl6
01:30 astj joined #perl6
01:42 ryn1x joined #perl6
01:54 ilbot3 joined #perl6
01:54 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:59 cdg joined #perl6
02:00 mr-foobar joined #perl6
02:02 cdg joined #perl6
02:05 llfourn joined #perl6
02:20 llfourn joined #perl6
02:29 Cabanossi joined #perl6
02:31 mcmillhj joined #perl6
02:44 cdg joined #perl6
02:53 noganex joined #perl6
02:58 Ven`` joined #perl6
02:59 mr-foobar joined #perl6
03:02 ugexe can default values be assigned to a hash parameter inside a signature somehow?
03:03 ugexe m: sub foo(%all [:$a = 1, *%_]) { %all }; say foo({ b => 2 })
03:03 camelia rakudo-moar 36f0ab: OUTPUT: «{b => 2}␤»
03:10 AlexDaniel m: sub foo(%all (:$bar=42, *%_)) { $bar }; say foo(%(foo => 90))
03:10 camelia rakudo-moar 36f0ab: OUTPUT: «42␤»
03:10 AlexDaniel m: sub foo(%all (:$bar=42, *%_)) { $bar }; say foo(%(foo => 90, bar => 95))
03:10 camelia rakudo-moar 36f0ab: OUTPUT: «95␤»
03:10 AlexDaniel ugexe: like this?
03:11 AlexDaniel m: sub foo(%all (:$bar=42, *%_)) { %all }; say foo(%(foo => 90))
03:11 camelia rakudo-moar 36f0ab: OUTPUT: «{foo => 90}␤»
03:11 AlexDaniel ah, I see
03:11 zakharyas joined #perl6
03:13 llfourn joined #perl6
03:15 AlexDaniel that's a weird error message
03:15 AlexDaniel m: sub foo(%all [:$a = 1, *%_]) { %all }; say foo({ b => 2 })
03:15 camelia rakudo-moar 36f0ab: OUTPUT: «{b => 2}␤»
03:15 AlexDaniel not this one
03:15 AlexDaniel m: sub foo(@all is copy ($a, $b, $c=3)) { @all }; say foo(<a b>)
03:15 camelia rakudo-moar 36f0ab: OUTPUT: «replace this Array is copy logic␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
03:16 mcmillhj joined #perl6
03:19 bisectable6 joined #perl6
03:21 BenGoldberg joined #perl6
03:28 Cabanossi joined #perl6
03:28 nowan joined #perl6
03:35 thou joined #perl6
03:43 Ven`` joined #perl6
03:46 mudman joined #perl6
03:46 thou joined #perl6
03:55 ryn1x joined #perl6
04:00 Sgeo joined #perl6
04:05 knobo joined #perl6
04:07 coverable6 joined #perl6
04:07 committable6 joined #perl6
04:07 nativecallable6 joined #perl6
04:13 Cabanossi joined #perl6
04:24 geekosaur joined #perl6
04:30 wamba joined #perl6
04:31 vendethiel- joined #perl6
04:41 mudman joined #perl6
04:56 ufobat joined #perl6
04:58 Cabanossi joined #perl6
04:59 andrzejku_ joined #perl6
05:02 andrzejku_ joined #perl6
05:03 thou m: say ' ' ~~ / ^ ' ' ** { 1 ^.. 3 } $ /;
05:03 camelia rakudo-moar 36f0ab: OUTPUT: «「 」␤»
05:03 thou m: say ' ' ~~ / ^ ' ' ** { 2 .. 3 } $ /;
05:03 camelia rakudo-moar 36f0ab: OUTPUT: «Nil␤»
05:03 thou Shouldn't those two behave the same?
05:17 HoboWithAShotgun joined #perl6
05:27 araujo joined #perl6
05:28 Cabanossi joined #perl6
05:30 mr-foobar joined #perl6
05:37 domidumont joined #perl6
05:53 lowbro joined #perl6
05:53 lowbro joined #perl6
05:58 Cabanossi joined #perl6
06:11 domidumont joined #perl6
06:30 eliv joined #perl6
06:32 eliv joined #perl6
06:35 darutoko joined #perl6
06:43 knobo joined #perl6
06:56 pmurias joined #perl6
06:56 pmurias should I ask language designy question I have in regards to roast in here or in #perl6-dev?
06:58 pmurias the first one is that in the test we check that something like 3.base(10, 2**100) throws and OutOfRange exception
06:58 pmurias (rather than running out of memory or such a gigantic string working)
06:59 pmurias this seems implementation dependent
07:01 mr-foobar joined #perl6
07:01 leont joined #perl6
07:02 jonas1 joined #perl6
07:06 wamba joined #perl6
07:10 lizmat pmurias: #perl6-dev is probably a better place
07:10 teatime m: say ' ' ~~ / ^ ' ' ** { 1 ^.. 3 } $ /; say ' ' ~~ / ^ ' ' ** { 2 .. 3 } $ /;
07:10 camelia rakudo-moar 36f0ab: OUTPUT: «「 」␤Nil␤»
07:11 teatime m: say ' ' ~~ / ^ ' ' ** 1^..3 $ /; say ' ' ~~ / ^ ' ' ** 2..3 $ /;
07:11 camelia rakudo-moar b0af54: OUTPUT: «Nil␤Nil␤»
07:11 teatime m: say ' ' ~~ / ^ '  ' ** 1^..3 $ /; say ' ' ~~ / ^ '  ' ** 2..3 $ /;
07:11 camelia rakudo-moar b0af54: OUTPUT: «Nil␤Nil␤»
07:11 teatime m: say '  ' ~~ / ^ ' ' ** 1^..3 $ /; say '  ' ~~ / ^ ' ' ** 2..3 $ /;
07:11 camelia rakudo-moar b0af54: OUTPUT: «「  」␤「  」␤»
07:12 teatime m: say ~{1^..3}
07:12 camelia rakudo-moar b0af54: OUTPUT: «Block object coerced to string (please use .gist or .perl to do that)␤␤  in block <unit> at <tmp> line 1␤»
07:12 teatime m: say ~(1^..3)
07:12 camelia rakudo-moar b0af54: OUTPUT: «2 3␤»
07:13 teatime hmm
07:13 ufobat joined #perl6
07:18 * lizmat clickbaits https://p6weekly.wordpress.com/2017/09/25/2017-39-smarting-up-the-pool/
07:18 tyil wow!
07:20 teatime is tyil a bot?
07:21 tyil no :(
07:21 tyil w-why
07:21 teatime tyil: thought you were responding to a "clickbaits" command :)
07:21 * teatime is obv. confused.  what is wow-ing you at the moment?
07:21 tyil I wow-ed at the new p6weekly
07:21 tyil it doesnt feel like a week passed
07:22 tyil I didnt do anything last week that got in the weekly :(
07:27 sacomo hi all
07:27 rindolf joined #perl6
07:28 tyil hi
07:28 sacomo is there a way to disable module exports without using export tags?
07:28 dakkar joined #perl6
07:28 sacomo hi tyil, heard you were a bot
07:28 sacomo jk
07:29 tyil sacomo: ;~;
07:31 teatime heh, sorry tyil :)
07:31 tyil dont worry, I can handle it :p
07:33 sacomo I am looking to export a bunch of subs by default, but have an easy toggle to disable exports on demand
07:36 sacomo also, not sure if this means anything, but something like this: "use Foo :!DEFAULT" behaves like "use Foo :DEFAULT"
07:45 cdg joined #perl6
07:53 llfourn joined #perl6
07:56 sproctor joined #perl6
07:58 Cabanossi joined #perl6
08:02 mr-foobar joined #perl6
08:31 nadim_ joined #perl6
08:33 abraxxa joined #perl6
08:37 mcmillhj joined #perl6
08:52 wamba joined #perl6
08:54 mcmillhj joined #perl6
08:58 Cabanossi joined #perl6
09:03 esh joined #perl6
09:06 Aaronepower joined #perl6
09:06 mcmillhj joined #perl6
09:15 mcmillhj joined #perl6
09:31 mr-foobar joined #perl6
09:33 ryn1x joined #perl6
09:35 xinming joined #perl6
09:43 setty1 joined #perl6
09:58 Cabanossi joined #perl6
09:59 astj joined #perl6
10:00 mr-foobar joined #perl6
10:05 kurahaupo joined #perl6
10:05 kurahaupo joined #perl6
10:06 kurahaupo joined #perl6
10:15 Zoffix thou, yeah, looks like a bug to me. Filed as https://rt.perl.org/Ticket/Display.html?id=132166
10:15 teatime lol, Zoffix I have been tracking it down for fun
10:16 teatime but noticed just now it is already reported at https://rt.perl.org/Public/Bug/Display.html?id=130127
10:17 teatime rakudo/src/core/Match.pm : method DYNQUANT_LIMITS
10:18 Zoffix Ok, thanks
10:20 Zoffix teatime: so, you'll submit a patch to fix it? :)
10:21 teatime well, I kindof hit a knowledge-wall now, because I don't know what is OK to do there
10:22 Zoffix teatime: looks like anything, basically
10:22 teatime can you call Range.minmax or .int-bounds there
10:22 Zoffix Should be, yeah
10:22 Zoffix Just keep this in mind:
10:22 Zoffix m: say (2.2^..^6.5).int-bounds
10:22 camelia rakudo-moar 8cf083: OUTPUT: «Cannot determine integer bounds␤  in block <unit> at <tmp> line 1␤␤»
10:24 teatime yeah.  but do non-int ranges need to work in regex quantifier?
10:24 Zoffix m: say "foo.txt".IO.extension: 1.1..2.2
10:24 camelia rakudo-moar 8cf083: OUTPUT: «Cannot resolve caller extension(IO::Path: Range); none of these signatures match:␤    (IO::Path:D $: *%_)␤    (IO::Path:D $: Int :$parts!, *%_)␤    (IO::Path:D $: Range :$parts!, *%_)␤    (IO::Path:D $: Str $subst, Int :$parts = 1, Str :$joiner =…»
10:25 Zoffix m: say "foo.txt".IO.extension: :parts(1.1..2.2)
10:25 camelia rakudo-moar 8cf083: OUTPUT: «txt␤»
10:25 Zoffix They work in other places, so why not
10:25 Zoffix m: dd Rakudo::Internals.RANGE-AS-ints: 2.2^..^6.5
10:25 camelia rakudo-moar 8cf083: OUTPUT: «Too few positionals passed; expected 3 arguments but got 2␤  in block <unit> at <tmp> line 1␤␤»
10:25 teatime 'aa' ~~ / 'a' ** 1.1..3.3 /
10:25 teatime m: say 'aa' ~~ / 'a' ** 1.1..3.3 /
10:25 camelia rakudo-moar 8cf083: OUTPUT: «Nil␤»
10:26 Zoffix m: dd Rakudo::Internals.RANGE-AS-ints: 2.2^..^6.5, 'Cannot use non-Numeric Ranges'
10:26 camelia rakudo-moar 8cf083: OUTPUT: «(3, 5)␤»
10:26 Zoffix Don't know how sane that method is due to its behaviour with Inf
10:26 Zoffix m: dd Rakudo::Internals.RANGE-AS-ints: 2.2^..Inf, 'Cannot use non-Numeric Ranges'
10:26 camelia rakudo-moar 8cf083: OUTPUT: «(3, 9223372036854775807)␤»
10:28 Cabanossi joined #perl6
10:30 teatime hmm.  welp, I will give it a try after sleep.  thanks for the tips.
10:30 Zoffix teatime: I see another bug with it:
10:31 Zoffix m: say "xxxxx" ~~ /"x" ** { -5..-1 }/
10:31 camelia rakudo-moar 8cf083: OUTPUT: «「xxxxx」␤»
10:31 Zoffix It doesn't check whether -1 was its own doing or something that came from the Range
10:31 teatime there were several tickets about dynamic ranges
10:33 teatime it feels pretty sketchy that DYNQUANT is doing so much work, logic I'd expect to be largely inside Range and/or wherever non-dynamic regex ** ranges are handled.
10:35 Zoffix Range itself is iffy. The whole stringy ranges thing should probably be burnt with fire and then Range split into int ranges and non-int
10:35 teatime heh, I had the same thought.
10:35 wictory[m] Is there a way to read lines from $*IN (or some other standard in method) using a supply. I want to use a react and setup an eventloop and do some other stuff concurrently while I read input from the user interactively
10:36 Zoffix wictory[m]: handles have .Supply method
10:36 wictory[m] I tried $*IN.Supply(:size<1>).lines, but it does not work satisfactory
10:36 Zoffix Ah, ok then, nevermind :)
10:37 eliasr joined #perl6
10:37 wictory[m] When I look the process with strace, I see that it reads every line separately from stdin, but it does not seems to trigger the whenever
10:38 Zoffix wictory[m]: this appears to work fine for me: perl6 -e 'react { whenever $*IN.Supply(:size<1>).lines { .say } }'
10:39 samcv is there a way to turn a parsetree into a hash easily?
10:39 * Zoffix &
10:39 astj joined #perl6
10:40 wictory[m] Zoffix: that line does not read the input interactively for me. hmm
10:41 wictory[m] Zoffix: can it be that you have some newer version of rakudo ? :)
10:47 wictory[m] (my perl6 --version gives "This is Rakudo version 2017.08-108-g760530a52 built on MoarVM version 2017.08.1-150-g0b81969db
10:47 wictory[m] implementing Perl 6.c.")
10:49 sacomo hi all, is there a way to disable module exports without using export tags?
10:50 sacomo something like: use Foo :!DEFAULT
10:50 eliv joined #perl6
10:55 Zoffix sacomo: write `need Foo` instead of `use Foo`
10:56 Zoffix wictory[m]: don't recall anything specifically fixing that, though were have been some commits with IO. What do you mean "interactively" precicely? I type a line of text, press ENTER, the program displays it
10:57 sacomo ah, ok thanks.
10:57 Zoffix wictory[m]: if you mean receiving keystrokes as user types them, then I don't know why `.lines` is involved and you'd need to make the terminal non-buffering. There's Term::termios and Terminal::Print modules that can assist with that
10:57 sacomo Zoffix, thanks that is perfect.
10:58 Cabanossi joined #perl6
11:00 wictory[m] Zoffix: I mean that when the user types a line and presses enter, the program should write it out. When I run the program you suggested, I type multiple lines and nothing happens, the program outputs when I end it with ^D.
11:00 mr-foobar joined #perl6
11:02 Zoffix That's not the behaviour I'm observing: https://gist.github.com/zoffixznet/3154c55844f16556f4e3fffe1ae4468b
11:02 Zoffix Try perl6 -e 'react { whenever $*IN.lines.Supply { .say } }'
11:02 * Zoffix &&
11:03 lowbro joined #perl6
11:03 lowbro joined #perl6
11:06 DrForr Aah, every new hacker's *true* first bug hunt - learning exactly what's broken since the *last* time someone updated the installation manual for the core software.
11:22 rgrau joined #perl6
11:25 astj joined #perl6
11:30 itaylor57 joined #perl6
11:35 wictory[m] Zoffix: this is my corresponding output https://gist.github.com/wictory/15309bfb3e70b460665f13723c6bb609 when I exit with ^C, nothing comes out. I will update rakudo and check if anything changes...
11:38 wamba joined #perl6
11:40 astj joined #perl6
11:44 itaipu joined #perl6
11:51 wictory[m] Zoffix: with the new rakudo version, it works. Thanks for the help!
11:57 patrickz joined #perl6
11:58 zakharyas joined #perl6
11:59 wander4096 joined #perl6
12:02 wander4096 https://gist.github.com/W4anD0eR96/4dafd143c86048915c96434fe5c39228
12:03 wander4096 i think they are almost run in the same way
12:03 wander4096 but the p6 ver. spent a few minutes
12:03 wander4096 while the py ver. spent under 1 second
12:04 wander4096 did i write p6 code in a inefficient way?
12:04 wander4096 or the efficiency of `set` is lack
12:08 jnthn set() is immutable in Perl 6, so it'll be doing the union operation and making a full copy each time. Maybe try replacing the lot with something like: my $set = set($text.lines.map(*.split(' ==> ')).flat)
12:08 wander4096 oh
12:08 wander4096 that' it
12:08 wander4096 that's it
12:09 wander4096 dont know it is immutable
12:09 jnthn Though I'd probably write it $text.lines.map(*.split(' ==> '')).flat.unique if I didn't have other needs for the set
12:10 jnthn Wwithout the duplicated ', oops :)
12:11 nadim joined #perl6
12:17 lizmat jnthn: why did you put the .flat in there ?
12:17 timotimo because the keys and values, as it were, ought to get put into the set individually
12:18 jnthn .split returns a List, so without it we'd end up unique'ing the list of lists
12:18 ChoHag joined #perl6
12:18 timotimo i.e. a => b, c => d should turn into a, b, c, d
12:22 HoboWithAShotgun joined #perl6
12:29 lizmat jnthn timotimo: ah, duh, /me would have probably slipped the result of the split
12:32 wamba joined #perl6
12:40 HoboWithAShotgun joined #perl6
12:42 mcmillhj joined #perl6
12:45 tbrowder ref travis: will specifying a specific perl6 version like 2017.NN speed up a travis run?
12:58 Cabanossi joined #perl6
12:59 mr-foobar joined #perl6
13:00 HoboWithAShotgun good day you lovely humans and bots
13:02 moritz m: say 0x2013.uniname
13:02 camelia rakudo-moar 33e113: OUTPUT: «EN DASH␤»
13:02 moritz m: say 0x2014.uniname
13:02 camelia rakudo-moar 33e113: OUTPUT: «EM DASH␤»
13:05 nadim joined #perl6
13:08 piojo joined #perl6
13:10 cdg joined #perl6
13:11 wander4096 joined #perl6
13:19 wander4096 https://gist.github.com/W4anD0eR96/e8356c847c6440fa987e6a62b42aa718
13:20 wander4096 Too many positionals passed; expected 1 argument but got 2
13:20 ChoHag joined #perl6
13:20 wander4096 puzzled
13:20 wander4096 it can be corrected in a hard way, but why
13:21 Zoffix m: class {}.item
13:21 camelia rakudo-moar 33e113: ( no output )
13:21 skids joined #perl6
13:21 timotimo token doesn't require you to leave out psaces
13:22 Zoffix wander4096: the default Actions object is a Mu, and it has all the Mu methods, so your <item> token results in an attempt to call .item on that object and number of args doesn't match
13:22 Zoffix m: class :: is Mu {}.item: 'meows'
13:22 camelia rakudo-moar 33e113: OUTPUT: «Too many positionals passed; expected 1 argument but got 2␤  in block <unit> at <tmp> line 1␤␤»
13:23 Zoffix There's a ticket for it, but I couldn't find an easy way around it. As soon as you make it something less than a Mu, it refuses to fit anywhere
13:23 wander4096 i think i can rename `item'
13:23 Zoffix This one https://rt.perl.org/Ticket/Display.html?id=127945#ticket-history
13:24 Zoffix wander4096: and the other fix would be providing an Actions object that implements `item`, though, I think renaming it is more robust :)
13:25 wander4096 sure >_<
13:25 wander4096 thank you
13:26 Zoffix .oO( make default Actions object a speshul class and don't check its methods at all... )
13:31 dogbert17 joined #perl6
13:33 ryn1x joined #perl6
13:48 ChoHag joined #perl6
14:01 mr-foobar joined #perl6
14:10 ShalokShalom_ joined #perl6
14:10 mr-foobar joined #perl6
14:11 mspo where is MP_GEN_RANDOM_MAX supposed to come from?
14:13 timotimo from inside libtommath
14:14 mspo thanks
14:14 timotimo all MP_ and mp_ stuff lives there
14:15 mspo ugh WTFPL
14:28 Cabanossi joined #perl6
14:28 mspo looks like I just needed to upgrade that to 1.0.1
14:35 HoboWithAShotgun joined #perl6
14:44 gfldex_work joined #perl6
14:45 mr-foobar joined #perl6
14:51 itaipu joined #perl6
14:54 mcmillhj joined #perl6
14:58 Cabanossi joined #perl6
15:04 skids https://gist.github.com/skids/08245ef93cf4cc78417affa78afe2a10  <== What magic ingredient am I missing here?
15:04 nadim joined #perl6
15:09 AlexDaniel joined #perl6
15:09 lostinfog joined #perl6
15:12 ChoHag joined #perl6
15:15 mr-foobar joined #perl6
15:20 astj joined #perl6
15:33 khw joined #perl6
15:35 kurahaupo joined #perl6
15:39 AlexDaniel joined #perl6
15:45 ChoHag joined #perl6
15:47 mr-foobar joined #perl6
15:49 kyan joined #perl6
15:55 wamba joined #perl6
15:58 timotimo now i'm interested how good the better version of wander4096's set code got by writing it with split, flat, unique?
16:01 robertle joined #perl6
16:02 nadim joined #perl6
16:02 robertle in the MAIN() type of cmdline arg parsing, how can I handle a named argument that may appear multiple times?
16:09 ilmari $ perl6 -e 'multi sub MAIN(:$foo) { $foo.say }' --foo=42 --foo=37
16:09 ilmari [42 37]
16:09 ilmari robertle: like that?
16:12 robertle yes, but I thought I had tried that...
16:13 robertle $ perl6 -e 'multi sub MAIN(Str :$foo) { $foo.say }' --foo=42 --foo=37
16:13 ilmari add a multi that takes a List
16:13 ilmari $ perl6 -e 'multi sub MAIN(Str :$foo) { say "gone one ", $foo }; multi sub MAIN(List :$foo) { say "got many ", $foo }' --foo=42 --foo=37
16:14 ilmari got many [42 37]
16:14 robertle right! makes sense now
16:14 robertle thanks!
16:20 ChoHag joined #perl6
16:20 Zoffix Or don't add a `Str` type constraint
16:21 robertle Zoffix: yeah, that's what I am doing now. and that also makes it understandable...
16:23 leont joined #perl6
16:32 MasterDuke joined #perl6
16:36 ugexe is it possible to enter a non-Str type via MAIN / commandline anyway?
16:38 nadim joined #perl6
16:38 ilmari Int works
16:38 ugexe its an IntStr
16:38 ugexe Bool maybe
16:38 mcmillhj joined #perl6
16:38 ilmari $ perl6 -e 'multi sub MAIN(Int :$foo) { say "gone one ", $foo }' --foo=wibble
16:38 ilmari Usage:
16:38 ilmari -e '...' [--foo=<Int>]
16:40 ugexe what i mean is declaring Str :$foo is pointless
16:41 mst except possibly as a hint that it's a plain string
16:41 ugexe because everything passed is a FooString
16:41 Zoffix We have the enum processor
16:41 mst though in that case maybe you'd want a named subtype for clarity
16:42 ilmari ugexe: no, String :$foo means you can only specify it once
16:42 ugexe ah good point
16:43 Zoffix m: @*ARGS = "Purr"; enum Meows (Purr => 42); sub MAIN(Meows $x) { dd +$x }
16:43 camelia rakudo-moar c9f1e0: OUTPUT: «42␤»
16:44 domidumont joined #perl6
16:45 mcmillhj joined #perl6
16:47 ZYo9 joined #perl6
16:52 eliv77 joined #perl6
16:58 eliv77 joined #perl6
17:02 foo3 joined #perl6
17:04 foo3 I think I hit a bug:  typing "Rat.^roles" into the REPL eats all memory until OOM. tested on windows and linux with rakudo / moarvm 2017.07
17:04 eliv77 joined #perl6
17:05 Zoffix Looks to hang in non-repl too
17:06 Zoffix bisect: Rat.^roles
17:06 bisectable6 Zoffix, Bisecting by exit signal (old=2015.12 new=c9f1e05). Old exit signal: 0 (None)
17:07 foo3 it doesn't just hang, the OOM rendered my ubuntu unresponsive, so take care :)
17:07 Zoffix :)
17:07 bisectable6 Zoffix, bisect log: https://gist.github.com/c103a4d077d3999e71df6c3e6cfdd293
17:07 bisectable6 Zoffix, (2017-06-29) https://github.com/rakudo/rakudo/commit/41ed2c03abcce884aa20e91564a790a245336715
17:07 * ilmari did a 'ulimit -v $((128*1024))' first
17:07 eliv joined #perl6
17:07 * ilmari presumes bisectable6 has sensible resource limits in place too
17:08 foo3 yeah presumably. just saying tho :D
17:08 Zoffix Can someone restart hack? I don't have access to a box that both has a GUI to run virt-manager and key added to root users
17:11 timotimo hold on
17:11 wander4096 joined #perl6
17:11 wander4096 how can i get a element in Math::Matrix
17:12 eliv joined #perl6
17:12 Zoffix foo3: I think I see a fix. Gonna try it out after I push the current commit I'm working on
17:13 wander4096 given `$A = Math::Matrix.new([[0,1,1,0], [1,0,0,1], [1,0,0,1], [1,1,0,0]])', is there something like $A[0][1]?
17:13 foo3 Zoffix: sure, just wanted to let you know. is there an official place to report bugs btw? or is irc cool?
17:13 timotimo hack is booting back up now
17:13 Zoffix huggable: rakudobug
17:13 huggable Zoffix, Report bugs by emailing to <rakudobug@perl.org>. See also: https://github.com/rakudo/rakudo/wiki/rt-introduction
17:13 foo3 ty
17:13 dalek joined #perl6
17:13 timotimo wander4096: hey, how did the script with the ==> turn out when you used the .flat.unique thing?
17:13 Zoffix foo3: ^ that is it. IRC is OK if some dev sees it and says they'll take care of it right now; otherwise, there's a good chance it'll get missed or forgotten :)
17:14 timotimo i mean how much slower was it than the python code?
17:14 wander4096 3s
17:14 wander4096 while py 0.8s
17:14 Zoffix wander4096: what's the code?
17:14 foo3 Zoffix: that's what I was thinking, hence the question. ty :)
17:14 Zoffix I tried going to your gist, but it was already deleted
17:14 wander4096 wait a minute
17:15 Zoffix Also a perf fix just went in that affects all chainable ops. Dunno how much impact it has tho
17:16 HoboWithAShotgun joined #perl6
17:17 Zoffix OMIGAWD! Run for your lives! That hobo's got a shotgun!
17:17 * foo3 hides
17:17 * timotimo runs
17:17 mcmillhj joined #perl6
17:18 timotimo Zoffix: the code was more or less "path".IO.lines.map(*.split(" ==> ")).flat.unique.elems or something
17:18 timotimo well, teh old code was a for loop doing $set (|)= $x; $set (|)= $y with my ($x, $y) = .split(' ==> ');
17:18 timotimo that with in there was not syntax
17:18 Zoffix And what's the input? Do all lines just have one ==> ?
17:19 timotimo i assume so
17:19 timotimo the python code also only has x, y in there for holding the results of split
17:19 robertle joined #perl6
17:19 wander4096 timotimo: https://gist.github.com/W4anD0eR96/98330496d89021c4a28a91de81ee96e9
17:20 timotimo the other version spent a few minutes, yeah?
17:20 wander4096 the raw file `acl.txt' is more than 120000+ lines
17:20 wander4096 right
17:21 wander4096 in form `P12-1040 ==> W99-0201' each line
17:21 Zoffix wander4096: what's sample input I can try out this with?
17:22 timotimo i wonder if the file is basically columns, and two substr calls would be even faster
17:22 wander4096 how can i share a file?
17:23 Zoffix wander4096: just copy-paste it into a gist
17:23 timotimo you can also put it into the gist, worst case you use the git clone for that
17:23 yht joined #perl6
17:25 wander4096 https://gist.github.com/W4anD0eR96/49c40632194510cb3b8d4dcccb74a4df
17:25 eliv joined #perl6
17:25 wander4096 over 120000 lines, maybe open a bit slowly
17:25 Zoffix wget https://gist.githubusercontent.com/W4anD0eR96/49c40632194510cb3b8d4dcccb74a4df/raw/4ff6bf67c245cf4302868810798a2373b9e6e71d/acl.txt
17:25 wander4096 timotimo: nearly
17:26 wander4096 timotimo: but few special case don't fit
17:26 timotimo right
17:26 timotimo i wonder how .split(["\n", " ==> "]) would do
17:26 timotimo instead of .lines.map(*.split(...))
17:27 wander4096 oh
17:28 timotimo that would also get rid of the need for .flat
17:28 Cabanossi joined #perl6
17:29 Zoffix wander4096: this version makes it 2.3x faster: say "/tmp/opt/acl.txt".IO.slurp.split(["\n", ' ==> ']).unique.elems;
17:30 wander4096 it does
17:30 troys joined #perl6
17:31 timotimo nice.
17:32 timotimo so rather close to the python code
17:32 MasterDuke and if/when this https://github.com/MoarVM/MoarVM/pull/705 gets merged the slurp itself might get a bunch faster
17:32 timotimo while being a bit shorter, too
17:32 * timotimo AFKBBL
17:33 wander4096 clever and, hopeful :)
17:34 Zoffix oh wait
17:35 Zoffix wander4096: this version makes it 5.2x faster than original: say "/tmp/opt/acl.txt".IO.open(:nl-in["\n", ' ==> ']).lines.unique.elems;
17:36 Zoffix just tells the VM to use your splitter chars as line dilimiters
17:36 Zoffix s/chars/strings/;
17:37 kyan Huh, that gist page is kinda slow to load in my Firefox... I guess that kind of thing is why I shouldn't have like 40 addons installed, heh
17:37 kyan good old less handles it just fine though
17:37 Zoffix kyan: slow for me too. You could use the `wget` line I pasted to just download that file raw
17:37 kurahaupo_ joined #perl6
17:37 kyan Yeah, i'm just a sucker and wanted to see how it performed :3
17:38 kurahaupo joined #perl6
17:38 wander4096 0.971s total
17:38 Zoffix m: say .971/.8
17:38 camelia rakudo-moar 6ec21c: OUTPUT: «1.21375␤»
17:38 Zoffix So 20% slower than python
17:38 kurahaupo joined #perl6
17:38 kyan The mostly text-based Links browser opens the page pretty much instantly
17:39 wander4096 i use linux command `time', so it may be faster
17:40 kurahaupo joined #perl6
17:41 epony joined #perl6
17:42 SourceBaby joined #perl6
17:43 Zoffix timotimo++ # I can now login to hack
17:43 nadim joined #perl6
17:45 tyil kyan: links is amazing
17:45 koki joined #perl6
17:46 mr-foobar joined #perl6
17:47 kerframil joined #perl6
17:49 eliv77 joined #perl6
17:53 cognominal joined #perl6
17:58 Cabanossi joined #perl6
18:00 espadrine joined #perl6
18:03 imcsk8 joined #perl6
18:04 raschipi joined #perl6
18:09 AlexDaniel ilmari: “presumes bisectable6 has sensible resource limits in place too” – actually… not really
18:10 AlexDaniel ilmari: but so far it had more resources than rakudo can possibly eat in 10 seconds
18:10 AlexDaniel at least typically
18:10 Aaronepower joined #perl6
18:11 mcmillhj joined #perl6
18:11 Zoffix c: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" xx 9999999999
18:11 committable6 Zoffix, ¦"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx": «Cannot find this revision (did you mean “HEAD”?)»
18:12 Zoffix c: HEAD "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" xx 9999999999
18:12 committable6 Zoffix, ¦HEAD(6ec21cb): «»
18:12 Zoffix heh ok then :)
18:12 Zoffix c: HEAD use NativeCall; sub fork is native {}; fork while 1
18:12 * AlexDaniel is interested to see what's going to happen
18:12 Zoffix oops :}
18:13 AlexDaniel did it OOM kill the whole bot instead of killing just the eval process?
18:13 * masak .oO( needs more nice(1) )
18:13 Zoffix I think it forkbombed the whole box. I can't ssh into it
18:14 AlexDaniel bisectable6: help
18:14 bisectable6 AlexDaniel, Like this: bisectable6: old=2015.12 new=HEAD exit 1 if (^∞).grep({ last })[5] // 0 == 4 # See wiki for more examples: https://github.com/perl6/whateverable/wiki/Bisectable
18:14 Zoffix Nice going, Zoffix!
18:14 Zoffix huh, ok, nevermind :)
18:14 AlexDaniel but bisectable6 is still working?
18:14 AlexDaniel but I can't ssh also… :)
18:14 Zoffix lol
18:14 moritz pro tip: run it as a separate UNIX user, set up resource limits
18:14 AlexDaniel I'm suspecting it'll take a few seconds to swapoff the required things, maybe
18:15 moritz even easier with systemd
18:15 AlexDaniel moritz: volunteers welcome :)
18:15 raschipi With systemd there's no need to set up a user for limits, it does it wih cgroups
18:15 mst ulimit works pretty well if you're still running a unix-like system
18:16 AlexDaniel or if somebody can point me to whatever is needed to do it with systemd, I can maybe do it myself right now
18:17 moritz AlexDaniel: this is the systemd file for camelia: https://github.com/perl6/evalbot/blob/master/service/camelia@.service
18:17 squashable6 joined #perl6
18:18 moritz it's templated (so @ in the name and %i inside the config file) because you can have multiple instances (on for each IRC server)
18:18 moritz you might not need that
18:18 AlexDaniel maybe I need that so that I can have 1 file for all bots
18:19 Morfent joined #perl6
18:19 AlexDaniel bisectable6: I don't get it, you're on the same server, right?
18:19 AlexDaniel bisectable6: help
18:19 AlexDaniel ok
18:20 moritz https://www.freedesktop.org/software/systemd/man/systemd.exec.html has some stuff about how to set various limits
18:20 Zoffix ZofBot: I guess that means I got myself on the kill list when the robot uprising occurs, eh?
18:21 * AlexDaniel also looks at systemd-nspawn
18:22 mcmillhj joined #perl6
18:22 Zoffix \o/
18:24 itaipu joined #perl6
18:24 Zoffix How to tell parametarization params in a role? I just wanna take a look at 'em
18:25 Zoffix m: dd class :: does Rational[UInt, UInt] {}
18:25 camelia rakudo-moar 6ec21c: OUTPUT: «<anon|63793344>␤»
18:25 Zoffix how to see?
18:25 quotable6 joined #perl6
18:25 committable6 joined #perl6
18:25 unicodable6 joined #perl6
18:25 coverable6 joined #perl6
18:25 bisectable6 joined #perl6
18:25 bloatable6 joined #perl6
18:25 nativecallable6 joined #perl6
18:25 benchable6 joined #perl6
18:25 releasable6 joined #perl6
18:25 greppable6 joined #perl6
18:25 evalable6 joined #perl6
18:25 squashable6 joined #perl6
18:25 statisfiable6 joined #perl6
18:26 Zoffix Ah, ok, .^roles does show. Got it
18:27 setty1 joined #perl6
18:29 Zoffix um
18:29 Zoffix m: role Foo[::A, ::B = Int] {}; Foo[Int].new.^roles.say
18:29 camelia rakudo-moar 6ec21c: OUTPUT: «((Foo[Int]))␤»
18:29 Zoffix It doesn't show the ::B's value.
18:35 Zoffix m: role Foo[::A, ::B = ::A] {};
18:35 camelia rakudo-moar 6ec21c: ( no output )
18:35 Zoffix This doesn't compile in core :/ says no such symbol A
18:35 Ven`` joined #perl6
18:38 Xliff Zoffix: Parametized roles?
18:38 haxmeister joined #perl6
18:38 haxmeister https://pastebin.com/9ewun504
18:38 Xliff (Perl6's templates, I presume?)
18:39 andrzejku_ joined #perl6
18:39 mcmillhj joined #perl6
18:40 haxmeister installing modules continues to be a confusing issue for me :/
18:40 Zoffix haxmeister: the error message say "501 Protocol scheme 'https' is only supported if IO::Socket::SSL is installed"
18:40 Zoffix zef install IO::Socket::SSL
18:41 timotimo haxmeister: GTK::Simple downloads gtk DLL files from our server when you're on windows
18:41 Zoffix Xliff: yeah, I wanna know what the parameters were
18:41 haxmeister Zoffix: thank you, your always so helpful
18:41 Zoffix \o/
18:42 haxmeister timotimo: I seen that after going through the mess of installing GTK the other way..lol
18:42 Xliff Zoffix: Yes, I got that, but I was trying to think how to do that, and you have just shown me.
18:42 Zoffix Ohhh...
18:42 Zoffix m: my role Irrational[::NuT = Int, ::DeT = ::Nut] does Real {}
18:42 camelia rakudo-moar 6ec21c: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤No such symbol 'Nut'␤at <tmp>:1␤------> 3le Irrational[::NuT = Int, ::DeT = ::Nut7⏏5] does Real {}␤»
18:42 timotimo oh, you mean the gtk installer that exists somewhere?
18:42 Zoffix m: my role Irrational[::N = Int, ::DeT = ::N] does Real {}
18:42 camelia rakudo-moar 6ec21c: ( no output )
18:42 Xliff Although most of the reasons I would use templates in C++/Java aren't really necessary in perl6
18:42 Zoffix Looks like it's matching just for single letters
18:42 eliv joined #perl6
18:43 timotimo m: my role Irrational[::NuT = Int, ::DeT = ::NuT] does Real {}
18:43 camelia rakudo-moar 6ec21c: ( no output )
18:43 timotimo Zoffix: you just typo'd
18:43 Zoffix Oh god. I need to start wearing glasses
18:43 Zoffix timotimo++
18:43 timotimo yeah, i wear glasses, so i was able to spot that %)
18:43 haxmeister timotimo: they have instructions on their website which include installing a terminal emulator and using pacman
18:43 Zoffix :D
18:44 Xliff So what was the typo? :p
18:44 Xliff (And I am wearing my glasses)
18:44 Zoffix Xliff: Nut vs. NuT
18:44 timotimo Nut instead of NuT
18:44 Xliff *snork*
18:46 mr-foobar joined #perl6
18:47 haxmeister Zoffix: https://pastebin.com/7VQLs83h
18:47 Zoffix Hm, it still doesn't like me:
18:48 Zoffix $ ./perl6 -e 'Rational.new.^roles.say'
18:48 Zoffix Internal error: inconsistent bind result
18:48 Zoffix m: my role Irrational[::NuT = Int, ::DeT = ::NuT] does Real {}; Irrational[Int].new.^roles.say
18:48 camelia rakudo-moar 6ec21c: OUTPUT: «((Irrational[Int]) (Real) (Numeric))␤»
18:48 Zoffix Yet works fine here :/
18:48 timotimo haxmeister: that's a problem with the PowerShell code in there, but it should work? :\
18:49 kyan moritz: Sorry to bother you, but I wanted to check — did my emails get through? Thanks. :)
18:49 haxmeister I dunno... probably works fine at home on my linux machines
18:54 moritz kyan: yes; sorry, I wasn't very responsive yet :/
18:54 kyan no worries! Just wanted to make sure it didn't get eaten by a hungry computer somewhere
18:54 kyan Thanks :)
18:55 mcmillhj joined #perl6
18:58 Cabanossi joined #perl6
19:02 Zoffix m: role Irrational[::NuT = Int, ::DeT = NuT] does Real { method new(NuT \nu = 0, DeT \de = 1) {self.bless} }; Irrational.new.^roles.say
19:02 camelia rakudo-moar 6ec21c: OUTPUT: «Internal error: inconsistent bind result␤  in method new at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
19:03 Zoffix Any idea how to fix that?
19:04 Zoffix m: role Irrational[::NuT = Int, ::DeT = ::("NuT")] does Real { method new(NuT \nu = 0, DeT \de = 1) {self.bless} }; Irrational.new.^roles.say
19:04 camelia rakudo-moar 6ec21c: OUTPUT: «((Irrational) (Real) (Numeric))␤»
19:04 Zoffix Thanks!
19:04 Zoffix ^_^
19:07 Zoffix Dunno if the first version is a bug; filed as https://rt.perl.org/Ticket/Display.html?id=132169
19:08 ufobat joined #perl6
19:09 lizmat joined #perl6
19:10 mcmillhj joined #perl6
19:16 TreyHarris joined #perl6
19:21 AlexDaniel heh, local online supermarket has 0€ shipping promotion today. Ordered a banana for 0.14€. Then also an apple and an onion. All scheduled on separate days.
19:22 Zoffix Marketing department: "OK, we clearly should never run a 0€ promotion again"
19:23 mcmillhj joined #perl6
19:24 moritz reminds me of when Microsoft announce OneDrive without capacity limits
19:25 moritz and some asshole put multiple Tera or even Peta bytes in his account in the first few weeks, permanently ruining it for everybody
19:25 moritz (and yes, they couldn't have kept this up for free, I know...)
19:26 astj joined #perl6
19:26 Zoffix :)
19:28 moritz but what everybody[tm] knows is that you only give out free stuff if it's either dirt cheap, or linked to a min required amount, or in any other way effectively limited
19:28 moritz or limited total amount of free stuff, or "at our discretion"
19:28 AlexDaniel I'm estimating that it costs them 4€ or so per delivery, so my fun is only 12€ worth
19:29 moritz AlexDaniel: I'm not hold that little fun against you, just reminiscing the bad auld days :-)
19:30 moritz I also wonder how many others do the same :-)
19:30 moritz (get free shipping for cent totals)
19:31 AlexDaniel all it takes is 1 person posting about it on facebook and there will be hundreds…
19:31 ChoHag joined #perl6
19:33 xinming joined #perl6
19:33 mcmillhj joined #perl6
19:33 bdmatatu joined #perl6
19:34 TimToady joined #perl6
19:34 moritz AlexDaniel: what you really need to do is write something like "Send me a screenshot of ordering free delivery with a total of less than USD 1, and I'll send you a free sticker"
19:35 moritz or make it a contest: what's the cheapest item you can find? send a screenshot of your order confirmation!
19:36 skids .oO(this is why we can't have nice things.)
19:36 eliv77 joined #perl6
19:37 AlexDaniel skids: normaly they have free delivery for orders over 40€. That's nice enough.
19:44 riatre joined #perl6
19:46 Ven`` joined #perl6
19:56 thou joined #perl6
19:57 kurahaupo joined #perl6
20:47 mr-foobar joined #perl6
20:54 cdg joined #perl6
21:00 mudman joined #perl6
21:09 mcmillhj joined #perl6
21:13 Cabanossi joined #perl6
21:19 TEttinger joined #perl6
21:19 ChoHag joined #perl6
21:21 notostraca joined #perl6
21:30 audiatorix joined #perl6
21:32 audiatorix If I .tap several supplies (which are grepped from a "parent" supply), what thread or threads will each one be run on?
21:33 audiatorix the handler, that is
21:36 jnthn In absence of something introducing concurrency, then the thread that emits the value
21:37 audiatorix Hmm okay, that was sorta my worst case scenario. What's a good way to parallelize that?
21:38 audiatorix I suppose the handler could return a promise
21:40 audiatorix Wait, nevermind--the handler doesn't need to return anything
21:40 audiatorix what am I thinking
21:40 jnthn Supplies are primarily a tool for taming, not introducing, concurrency
21:41 HoboWithAShotgun what do you guys think of this ( https://hastebin.com/zipepodape.rb ) interface? can you immedeatly tell me what the code does?
21:41 gfldex m: constant b = -> $s { say "$s‽" }; sub s(&c){ c 'oi' }; s(b);
21:41 camelia rakudo-moar 0961ab: OUTPUT: «oi‽␤»
21:42 jnthn Though there are ways to introduce it too. For example, .schedule-on($*SCHEDULER) will shuffle execution of the rest of the stuff chained after it onto the thread pool
21:43 jnthn A Channel may also help; the sender just pays the (very low) cost of sticking a value into the queue, and then another receiving thread (or multiple threads) can obtain the values
21:43 jnthn And then do the processing there
21:43 audiatorix Hmmm
21:44 audiatorix Yeah, that does seem a bit more like the behaviour I want
21:47 audiatorix And I could call .Supply on the channel and then tap it just like I'm doing now, but the emitting (sending) thread won't block?
21:47 jnthn There's a few options
21:47 jnthn That's one of them
21:48 jnthn If you want to dedicate a thread to processing the values then you can also do something like start for $channel.list -> $value { }
21:48 audiatorix That still doesn't really introduce concurrency, though
21:48 audiatorix My solution, I mean
21:48 jnthn Do you want concurrent processing of the emitted values?
21:49 audiatorix Yeah, that's the goal
21:49 jnthn Or just want to process them off the sender?
21:49 jnthn Oh
21:49 audiatorix Well, both really
21:49 audiatorix So obviously a Channel will need to be involved
21:49 HoboWithAShotgun take a step back, a deep breath and describe the actual problem :)
21:49 jnthn Well, there is another way now I understand you want parallel processing of values too, which is to use the .start method on Supply
21:50 jnthn Which basically schedules the processing on the thread pool
21:50 audiatorix Sorry for being vague about it
21:50 jnthn You then end up with a Supply of Supply
21:50 jnthn You might find it more comfortable to write it like
21:50 jnthn start react {
21:51 jnthn whenever $the-supply {
21:51 jnthn whenever start do-work($_) { ... process result if needed here ... }
21:51 jnthn }
21:51 jnthn and write sub do-work that does the work
21:51 jnthn That way you'll get errors handled correctly and stuff
21:52 jnthn (In general, prefer the react/supply + whenever block syntax over calling .tap)
21:53 HoboWithAShotgun in sight of the Internet of Shit, errm, Things, i am sure we will see a wherever keyword soon
21:55 audiatorix Okay, I see what you mean
21:56 audiatorix By the way, are you Jonathan Worthington?
21:56 jnthn Yes
21:56 audiatorix Wow
21:56 audiatorix Your talks are great
21:56 jnthn Glad you enjoy them :)
21:57 HoboWithAShotgun I envy you for having been in asia so often
21:58 HoboWithAShotgun did you ever sleep in one of those coffin hotels?
21:59 jnthn No, didn't (yet :)) do that
22:03 HoboWithAShotgun i am writing a little terminal based widget system, jnthn, to build uis with
22:03 timotimo HoboWithAShotgun: that looks neat
22:04 timotimo oh, i was scrolled one page up
22:04 audiatorix joined #perl6
22:04 jnthn It works for the latest too :)
22:04 HoboWithAShotgun i'm still here :)
22:04 HoboWithAShotgun the latest?
22:04 audiatorix What would it look like if I were to use .start?
22:06 jnthn HoboWithAShotgun: Is it in the ecosystem yet, or not ready for that yet?
22:06 timotimo m: Supply.interval(0.1).start({ say now - $*INIT-INSTANT; sleep 1; say $_; say now - $*INIT-INSTANT });
22:06 camelia rakudo-moar 0961ab: ( no output )
22:06 jnthn audiatorix: $the-supply.start(&the-thing-to-do-per-value).flat.tap or so
22:06 timotimo m: await Supply.interval(0.1).start({ say now - $*INIT-INSTANT; sleep 1; say $_; say now - $*INIT-INSTANT }).head(5);
22:06 camelia rakudo-moar 0961ab: ( no output )
22:06 timotimo m: react whenever Supply.interval(0.1).start({ say now - $*INIT-INSTANT; sleep 1; say $_; say now - $*INIT-INSTANT }).head(5) { };
22:07 camelia rakudo-moar 0961ab: ( no output )
22:07 jnthn timotimo: .start returns a Supply of Supply
22:07 HoboWithAShotgun it's not even written :) that's just a mockup of the interface
22:07 timotimo oh, i should whenever the result inside then
22:07 jnthn timotimo: Try .flat
22:07 timotimo m: react whenever Supply.interval(0.1).start({ say now - $*INIT-INSTANT; sleep 1; say $_; say now - $*INIT-INSTANT }).flat.head(5) { };
22:07 jnthn That'll make sure the errors get propagated out
22:07 camelia rakudo-moar 0961ab: OUTPUT: «0.0817190␤0.1949666␤0.2880887␤0.39119071␤0.48389776␤0.58691915␤0.68995390␤0.78270783␤0.8858456␤0.98890416␤0␤1.0857346␤1.08650834␤1.18233746␤1␤1.19585490␤1.2824913␤2␤1.2891061␤1.3827881␤3␤1.39211376␤1.4827730␤…»
22:07 jnthn As well as results :)
22:07 jnthn There we go
22:09 HoboWithAShotgun i have two problems, more colors than ansi and detecting keypress like alt_key_down
22:09 tony-o joined #perl6
22:09 audiatorix .flat would not be necessary if the results did not matter, right
22:10 audiatorix Reactions to the values being passed down will be passed back up in a different way
22:11 jnthn audiatorix: Potentially not, but be careful; not doing it will result in errors being dropped on the floor
22:11 jnthn So if you're handling the erorrs yourself also then you're OK I guess :)
22:12 epony joined #perl6
22:17 pilne joined #perl6
22:20 timrs2998 joined #perl6
22:20 audiatorix Ah! I just thought of an excellent way to restructure system and make the issue of concurrency more straightforward
22:20 audiatorix the system*
22:21 epony joined #perl6
22:24 jnthn Simplifications are nice :)
22:25 jnthn Sleep time for me, 'night all o/
22:25 timotimo gnite jnthn :)
22:26 kurahaupo joined #perl6
22:39 haxmeister left #perl6
22:40 skids joined #perl6
22:43 Cabanossi joined #perl6
22:44 mudman joined #perl6
22:56 kurahaupo joined #perl6
23:02 astj joined #perl6
23:02 kurahaupo_ joined #perl6
23:03 kurahaupo_ joined #perl6
23:03 kurahaupo joined #perl6
23:08 kurahaupo_ joined #perl6
23:11 tbrowder hi, #perl6
23:11 tbrowder anyone around that can help debug a p6 cgi script?
23:13 tbrowder ok, if anyone is interested, leave me a msg via .tell, bye
23:19 BenGoldberg joined #perl6
23:30 tbrowder ref: unit class
23:31 timotimo tbrowder: it's difficult to get excited about cgi scripts :)
23:31 timotimo can you give a bit more detail?
23:31 tbrowder we can package a class
23:34 tbrowder well, i think the problem may be something else. i have a module, CGI, which is in file CGI.pm6, and the top of the file has the line...having trouble with my keyboard.
23:35 tbrowder timotimo: let me put all this in a gist and tell you about it tomorrow. story too long...better in a gist. will you be here tomorrow?
23:38 timotimo i think i will, but this time of day is when i go to bed
23:38 tbrowder when i get it ready i’ll leave a .tell msg
23:38 tbrowder yeah, i’m fading too...
23:39 tbrowder thanks
23:42 timotimo gnite :)
23:46 virtualsue joined #perl6
23:50 mr-foobar joined #perl6
23:53 mcmillhj joined #perl6
23:53 thou teatime, Zoffix, thanks for looking at that 'x' ** { 1^..* } question for me!
23:56 MasterDuke joined #perl6
23:58 Cabanossi joined #perl6
23:59 Zoffix Any time :)_

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

Perl 6 | Reference Documentation | Rakudo