Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-03-19

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:01 CurtisOvidPoe joined #perl6
00:10 spider-mario joined #perl6
00:24 colomon joined #perl6
00:26 RabidGravy I'n sitting here listening to a Perl 6 program sending random notes to a synthesizer
00:33 AlexDaniel RabidGravy: I am sitting here controlling a robotic vacuum cleaner with Perl 6 :)
00:34 RabidGravy this is a cool thing
00:35 itaipu joined #perl6
00:36 RabidGravy so Perl 6 will rule the world
00:37 adu joined #perl6
00:40 timotimo rule, token or regex.
00:40 michaelvipub joined #perl6
00:42 cpage_ joined #perl6
00:42 itaipu joined #perl6
00:58 kid51 joined #perl6
01:13 t_ joined #perl6
01:39 gnommer joined #perl6
01:40 stmuk joined #perl6
01:57 adu joined #perl6
02:02 kalkin-_ joined #perl6
02:08 kaare_ joined #perl6
02:10 Ben_Goldberg joined #perl6
02:15 jack_rabbit joined #perl6
02:29 AlexDaniel OK, so IO::Handle.split does not really work?
02:30 AlexDaniel it looks like it returns a non-lazy list
02:32 SmokeMachine____ hi again! I have a question:
02:32 SmokeMachine____ when I use [X] on a list with 3 tuples on it, it returns a list of tuples with 3 elements each
02:32 SmokeMachine____ m: my @a = (1, 2, 3, 4, 5), (10, 20, 30, 40, 50), (100, 200, 300, 400, 500); ([X] @a).say
02:32 camelia rakudo-moar 4f7cb8: OUTPUT«((1 10 100) (1 10 200) (1 10 300) (1 10 400) (1 10 500) (1 20 100) (1 20 200) (1 20 300) (1 20 400) (1 20 500) (1 30 100) (1 30 200) (1 30 300) (1 30 400) (1 30 500) (1 40 100) (1 40 200) (1 40 300) (1 40 400) (1 40 500) (1 50 100) (1 50 200) (1 50 300) (1…»
02:33 SmokeMachine____ https://www.irccloud.com/pastebin/wIvpqV9X/
02:33 AlexDaniel SmokeMachine____: and what do you want instead?
02:35 pyrimidi_ joined #perl6
02:36 SmokeMachine____ when I do it with 2 tuples, it returns tuples with 2 elements:
02:36 SmokeMachine____ m: my @a = (1, 2, 3, 4, 5), (10, 20, 30, 40, 50); ([X] @a).say
02:36 camelia rakudo-moar 4f7cb8: OUTPUT«((1 10) (1 20) (1 30) (1 40) (1 50) (2 10) (2 20) (2 30) (2 40) (2 50) (3 10) (3 20) (3 30) (3 40) (3 50) (4 10) (4 20) (4 30) (4 40) (4 50) (5 10) (5 20) (5 30) (5 40) (5 50))␤»
02:37 AlexDaniel SmokeMachine____: that's how X works :)
02:37 SmokeMachine____ so, why it returns only 1 tuple with all elements when I use a list with 1 tuple?
02:37 SmokeMachine____ m: my @a = (1, 2, 3, 4, 5); ([X] @a).say
02:37 camelia rakudo-moar 4f7cb8: OUTPUT«((1 2 3 4 5))␤»
02:37 AlexDaniel m: my @a = (1, 2, 3, 4, 5); ([X] @a).perl.say
02:37 camelia rakudo-moar 4f7cb8: OUTPUT«((1, 2, 3, 4, 5),).Seq␤»
02:38 geekosaur seems to make sense to me, picks one element from each input tuple -- which, there being one, means one element. and there's no "1-tuple"
02:39 geekosaur m: ((1),(2),(3),(4),(5)).say
02:39 camelia rakudo-moar 4f7cb8: OUTPUT«(1 2 3 4 5)␤»
02:39 SmokeMachine____ but that doesn't "do what I mean"...
02:40 geekosaur that being?
02:40 SmokeMachine____ my problem is:
02:41 AlexDaniel m: .say for $*IN.lines
02:41 camelia rakudo-moar 4f7cb8: OUTPUT«Céad slán ag sléibhte maorga Chontae Dhún na nGall␤Agus dhá chéad slán ag an Eireagal ard ina stua os cionn caor is coll;␤Nuair a ghluais mise thart le Loch Dhún Lúich’ go ciúin sa ghleann ina luí␤I mo dhiaidh bhí gleanntáin ghlas’ G…»
02:41 AlexDaniel m: .say for $*IN.split(splitter => ‘ ’)
02:41 camelia rakudo-moar 4f7cb8: OUTPUT«␤C␤é␤a␤d␤ ␤s␤l␤á␤n␤ ␤a␤g␤ ␤s␤l␤é␤i␤b␤h␤t␤e␤ ␤m␤a␤o␤r␤g␤a␤ ␤C␤h␤o␤n␤t␤a␤e␤ ␤D␤h␤ú␤n␤ ␤n␤a␤ ␤n␤G␤a␤l␤l␤␤␤A␤g␤u␤s␤ ␤d␤h␤á␤ ␤c␤h…»
02:41 cognominal joined #perl6
02:41 AlexDaniel ???
02:46 Cabanossi joined #perl6
02:46 AlexDaniel ah, I'm not reading the docs right
02:46 AlexDaniel m: .say for $*IN.split(‘ ’)
02:46 camelia rakudo-moar 4f7cb8: OUTPUT«Céad␤slán␤ag␤sléibhte␤maorga␤Chontae␤Dhú​n␤na␤nGall␤Agus␤dhá␤chéad␤slán␤ag␤an␤Eireagal␤a​rd␤ina␤stua␤os␤cionn␤caor␤is␤coll;␤Nuair␤a␤ghlu​ais␤mise␤thart␤le␤Loch␤Dhún␤Lúich’␤go␤ciúi…»
02:46 molaf_ joined #perl6
02:46 saaki psch: ah that was it, thanks! i was wanting to use "," rather than "|" there
02:46 saaki trying*
02:46 SmokeMachine____ m: my @a = (1, 2, 3), (10, 20, 30), (100, 200, 300); say "call-func-with({ $_.join(q|, |) })" for [X] @a
02:46 SmokeMachine____ m: my @a = (1, 2, 3), (10, 20, 30); say "call-func-with({ $_.join(q|, |) })" for [X] @a
02:46 SmokeMachine____ m: my @a = (1, 2, 3); say "call-func-with({ $_.join(q|, |) })" for [X] @a
02:46 camelia rakudo-moar 4f7cb8: OUTPUT«call-func-with(1, 10, 100)␤call-func-with(1, 10, 200)␤call-func-with(1, 10, 300)␤call-func-with(1, 20, 100)␤call-func-with(1, 20, 200)␤call-func-with(1, 20, 300)␤call-func-with(1, 30, 100)␤call-func-with(1, 30, 200)␤call-func-with(1, 30, 30…»
02:46 camelia rakudo-moar 4f7cb8: OUTPUT«call-func-with(1, 10)␤call-func-with(1, 20)␤call-func-with(1, 30)␤call-func-with(2, 10)␤call-func-with(2, 20)␤call-func-with(2, 30)␤call-func-with(3, 10)␤call-func-with(3, 20)␤call-func-with(3, 30)␤»
02:46 camelia rakudo-moar 4f7cb8: OUTPUT«call-func-with(1, 2, 3)␤»
02:46 adu joined #perl6
02:47 ilbot3 joined #perl6
02:47 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!
02:51 FROGGS_ joined #perl6
03:03 perlawhirl joined #perl6
03:05 jstimpfle joined #perl6
03:14 SmokeMachine____ AlexDaniel: you said you liked the idea of Test::Fuzz... just to let you know, the module is getting better... I did the fuzz method that you "asked for"... if you have a free time and want to critic: https://github.com/FCO/Test-Fuzz
03:16 zacts hi perl6 nerds
03:16 vendethiel joined #perl6
03:19 AlexDaniel SmokeMachine____: sounds great. Consider adding it to the ecosystem once it gets more or less ready :)
03:20 SmokeMachine____ AlexDaniel: I will! thanks! have a good night!!
03:37 noganex joined #perl6
03:38 jack_rabbit joined #perl6
03:49 frew joined #perl6
03:57 vendethiel joined #perl6
03:58 xtreak joined #perl6
04:05 jack_rabbit joined #perl6
04:12 wamba joined #perl6
04:41 Upasaka joined #perl6
05:06 colomon joined #perl6
05:21 perlawhirl joined #perl6
05:48 Upasaka joined #perl6
05:55 Cabanossi joined #perl6
05:55 buharin joined #perl6
06:08 perlawhirl hi perlers
06:08 perlawhirl who's awake
06:09 sortiz perlawhirl, Hi
06:10 perlawhirl how can i do a defined-or subscript?
06:10 perlawhirl m: my @a = <one two three>; say @a[5 || 1];
06:10 camelia rakudo-moar 4f7cb8: OUTPUT«(Any)␤»
06:11 perlawhirl or do i have to ne content with $var = @a[5] || @a[1];
06:12 sortiz The later, but use //
06:12 perlawhirl ahh yeh.. the defined-or op :D
06:12 perlawhirl alright, just checking if there was a shorter way
06:16 CIAvash joined #perl6
06:17 sortiz m:  my @a = <a b c d e>;  say @a[10,4,3,5].first(*.defined); # Not shorter ;-)
06:17 camelia rakudo-moar 4f7cb8: OUTPUT«e␤»
06:18 perlawhirl hah
06:18 sortiz And I expect 'c' :-(, Need more coffee
06:26 perlawhirl maybe thats why you've got "c" on the brain... your bodies telling you C-offee
06:27 perlawhirl and i blame my poor grammar on lack of sleep and too much coffe
06:29 sortiz Coffee ready :-)
06:30 perlawhirl ok... more random defindedness related shenanegans...
06:30 perlawhirl m: my @a = <one two three>; 12 ~~ /(\d+) { ?@a[$0].defined } /
06:31 camelia rakudo-moar 4f7cb8: ( no output )
06:31 perlawhirl m: my @a = <one two three>; say 12 ~~ /(\d+) { ?@a[$0].defined } /
06:31 camelia rakudo-moar 4f7cb8: OUTPUT«「12」␤ 0 => 「12」␤»
06:31 perlawhirl why does the regex succeed if @a[12] is not defined, and can/should it backtrack to 1?
06:31 perlawhirl read: is there a way to make it so
06:32 * perlawhirl is off to read regexes doc again
06:37 PerlJam m: my @a = <one two three>; say 12 ~~ /(\d+) <?{ ?@a[$0].defined }> /
06:37 camelia rakudo-moar 4f7cb8: OUTPUT«「1」␤ 0 => 「1」␤»
06:37 PerlJam perlawhirl: like that?
06:39 michaelvipub joined #perl6
06:40 perlawhirl oh right... the ? i totes forgot
06:40 perlawhirl i could have just referred to one of my other scripts
06:40 perlawhirl again... did i mention i'm sleeped deprived :D
06:42 * PerlJam needs to get to bed actually
06:42 PerlJam my brain hasn't worked quite right all day and no sleep doesn't help that for tomorrow
06:50 domidumont joined #perl6
06:56 domidumont joined #perl6
07:10 virtualsue joined #perl6
07:28 xtreak joined #perl6
07:32 Upasaka joined #perl6
07:51 tokomer joined #perl6
07:54 xtreak joined #perl6
07:54 vendethiel joined #perl6
08:07 rindolf joined #perl6
08:10 geekosaur joined #perl6
08:15 darutoko joined #perl6
08:26 pierrot joined #perl6
08:41 Exodist joined #perl6
08:48 firstdayonthejob joined #perl6
08:55 stmuk
08:56 azawawi joined #perl6
08:57 azawawi hi
08:58 azawawi anyone with Mac OSX to test a Selenium::WebDriver?
08:59 azawawi re https://travis-ci.org/azawawi/perl6-se​lenium-webdriver/jobs/117081139#L3594
09:10 azawawi any news on 2016.03?
09:11 * azawawi listens to the echo in the room
09:23 nine echo, echo, echo, echo, ...
09:23 virtualsue joined #perl6
09:26 azawawi :)
09:27 azawawi nine: do you have by any chance a macosx environment around you? :)
09:28 nine Nope...I'm a free software zealot
09:29 azawawi nine: cool. i respect that :)
09:32 frithnanth joined #perl6
09:45 Ven joined #perl6
09:46 RabidGravy joined #perl6
09:47 Ven azawawi: cloning!
09:47 azawawi Ven: which MacOSX?
09:48 Ven 10.10.5 yosemite
09:48 Ven (updating rakudo first)
09:49 azawawi cool thanks
09:49 azawawi basically phantomjs is refusing to start for some reason via Proc::Async
09:52 Ven sent a PR your way WRT phantomjs on mac os
09:53 Ven well, `make install` is failing for me. "An exception occurred while evaluating a constant.   Could not find symbol '&bool'"
09:58 azawawi Ven: link output please?
09:58 virtualsue joined #perl6
09:58 Ven cleaned up my install, rebuilding :)
10:01 Ven updating panda now.
10:03 azawawi cool thx for your help. I really appreciate it :)
10:04 azawawi is it me or did they Apple remove the i7 CPU option from iMac?
10:04 azawawi s/did they/did/
10:04 Ven no idea, sorry :)
10:07 azawawi oh you get it in the custom builds section now :)
10:07 azawawi for only +200$  (hehe)
10:08 wamba joined #perl6
10:08 Ven well, HTTP::UserAgent's tests fail here
10:09 xtreak joined #perl6
10:10 azawawi NETWORK_TESTING enabled?
10:10 Ven dunno, I just panda install'd it
10:10 Ven (so: no)
10:11 azawawi link the output please?
10:11 pmurias joined #perl6
10:11 Ven just "host unreachable"
10:12 azawawi panda update && panda install HTTP::UserAgent
10:12 Ven and now it worked on the second try :P. guessed it was just a spurious failure
10:13 azawawi most likely a HTTP::UserAgent test not adhering to "NETWORK_TESTING" being off
10:13 azawawi echo $NETWORK_TESTING # to be sure
10:14 Ven it's empty
10:14 Ven okay, got it to "Cannot obtain a session after 30 attempts" on Selenium::WebDriver
10:14 azawawi good
10:15 azawawi phantomjs --webdriver=5555 --webdriver-loglevel=DEBUG
10:16 Ven same error
10:16 azawawi no did phantomjs give any output?
10:16 azawawi for the command above?
10:16 Ven no
10:16 Ven well, it started, but nothing more. "GhostDriver - Main - running on port 5555"
10:17 azawawi telnet localhost 5555
10:17 hankache joined #perl6
10:17 azawawi can you clone the S:WebDriver repo please?
10:18 hankache morning *
10:18 azawawi Ven: Try to debug this please https://github.com/azawawi/perl6-selenium-webdrive​r/blob/master/lib/Selenium/WebDriver/Wire.pm6#L44
10:19 azawawi Ven: maybe _empty-port is not getting us a port
10:19 azawawi hankache: morning
10:19 pippo joined #perl6
10:20 perlawhirl joined #perl6
10:20 hankache hi azawawi
10:21 bjz joined #perl6
10:25 azawawi Ven: https://gist.github.com/az​awawi/f9b8356ed8ed0a4c3c0f  # Use this for testing it quickly
10:25 azawawi hankache: hey
10:32 dalek DBIish/myGLR: 0055e68 | (Salvador Ortiz)++ | / (2 files):
10:32 dalek DBIish/myGLR: GLR test target
10:32 dalek DBIish/myGLR: review: https://github.com/perl6/DBIish/commit/0055e683e5
10:32 dalek DBIish/myGLR: 3849814 | (Salvador Ortiz)++ | lib/DBDish/StatementHandle.pm6:
10:32 dalek DBIish/myGLR: The GLR of DBDIsh. $sth.allrows now returns Seq
10:32 dalek DBIish/myGLR:
10:32 dalek DBIish/myGLR: Fetching rows is now lazy, plus:
10:32 dalek DBIish/myGLR: - named ':hash' of .row method is now implemented by the role.
10:32 dalek DBIish/myGLR: - legacy '.fetchrow' requirement removed from drivers, a simple one
10:32 dalek DBIish/myGLR:   implement by the role.
10:32 dalek DBIish/myGLR: - Allows driver's ._row method return a simple list of typed values
10:32 dalek DBIish/myGLR: review: https://github.com/perl6/DBIish/commit/3849814c55
10:32 dalek DBIish/myGLR: d20be30 | (Salvador Ortiz)++ | lib/DBDish/ (3 files):
10:32 dalek DBIish/myGLR: Simplify drivers for post GLR role
10:32 dalek DBIish/myGLR: review: https://github.com/perl6/DBIish/commit/d20be30e1b
10:33 dalek DBIish/myGLR: 4ae1c57 | (Salvador Ortiz)++ | / (4 files):
10:33 dalek DBIish/myGLR: Bump to v0.5.0
10:33 dalek DBIish/myGLR:
10:33 dalek DBIish/myGLR: DBDish's changes deserve the version incremented.
10:33 dalek DBIish/myGLR: review: https://github.com/perl6/DBIish/commit/4ae1c57475
10:47 firstdayonthejob joined #perl6
10:49 spider-mario joined #perl6
10:50 michaelvipub joined #perl6
10:54 RabidGravy I'm happy, Perl 6 is fast enough to generate a passible acid house bassline at ~120bpm
10:55 azawawi RabidGravy: cool
10:55 azawawi RabidGravy: what's your machine specs btw?
10:55 timotimo neato
10:55 timotimo and good morning
10:55 SCHAAP137 joined #perl6
10:56 RabidGravy azawawi, it's >5yo i7
10:56 RabidGravy with 8gig of memory
10:56 azawawi RabidGravy: Geoforce Titan X with 8 Xeon E7 CPUs :)
10:57 * azawawi one can dream
10:57 RabidGravy well if I had one of those I could probably do the synthesis part as well
10:58 azawawi most probably your old i7 will beat my old AMD FX-8150 16GB on single thread performance :)
10:58 azawawi an i5 is already doing that
11:01 timotimo RabidGravy: oh, so that's only midi commands now?
11:01 RabidGravy yeah, well you know how hard it was to generate a sine in the time budget?
11:02 RabidGravy adding a LPF and a volume envelope I  guess would be good for one note a second or something
11:03 RabidGravy instead of ~32
11:04 cpage_ joined #perl6
11:06 timotimo right
11:06 RabidGravy it may or may not be playing at http://rabidgravy.com:8000/stream
11:06 timotimo i'd think adding those things will only slow the thing down a little bit, compared to the overall overhead we already had
11:07 timotimo but it's still pretty bad to have all these gc pauses in there
11:07 timotimo (we have a way to make that faster, fortunately)
11:08 xinming joined #perl6
11:09 * azawawi listens
11:10 RabidGravy is it actually playing, jack has the soundcard here so I can't actually listen to the stream
11:11 RabidGravy but fwiw, Perl6 generating the note data, perl6 reading the audio stream, perl6 encoding to mp3 and perl6 streaming to the icecast server
11:12 frithnanth joined #perl6
11:13 RabidGravy if it's doing all those things reasonably, then it's "fast enough" and I don't give a stuff about no ten million iteration loop
11:13 perlawhirl it is playing
11:14 psch and it definitely sounds somewhat like acid
11:14 perlawhirl i lasted about 3 mins before my eyes started bleeding
11:14 psch hard to tell if it actually drops out or if that's the synth
11:14 psch as in, there's minor glitchy bits occassionally
11:15 RabidGravy possibly, I've got the latency optimistically low on the jackd
11:15 psch the tempo also doesn't seem completely consistent...
11:17 RabidGravy it probably isn't streaming quite right, but I'm hand calculating the note length in millis so that could be faulty too :)
11:18 RabidGravy right, I'll leave that going while I have a shower
11:21 timotimo i wonder if we can find out some more good stuff by doing a C-level profile of your workload
11:22 timotimo ideally, when we have a big bunch of arithmetic operations, we'd be 100% in jit-land, but since things aren't always inlined nicely, we'll also be having some invocation overhead, increasing and decreasing frame reference counters etc
11:44 nienacko joined #perl6
11:56 RabidGravy yeah
11:56 RabidGravy anyway I had a realisation when I was in the shower
11:57 timotimo keep it real!
11:58 perlawhirl the best code ideas happen in the shower, on the toilet, or while sleeping
11:58 timotimo i agree with that statement
11:58 perlawhirl who knows what would happen if you fell asleep in the shower and pee'd on yourself! :D
11:58 timotimo :\
11:59 RabidGravy I wasn't thinking hard enough about the realtime synthesis thing, and if the Meeblip can do a good virtual analgue synthesis on a 16Mhz AVR in ~1000 lines of AVR assembler then it *must* be possible in a Perl 6 program
12:00 RabidGravy going to kill the stream now
12:01 RabidGravy want to put it at a more sensible latency value and also have jack use the dummy driver so I can listen to the stream
12:05 RabidGravy also later I'm going to haul out a real synthesizer and a mixer as this could be quite awesome
12:08 RabidGravy or synthesizer*s*
12:11 RabidGravy right off out for a bit anyway
12:11 timotimo where was the code for the sine sound again?
12:14 colomon joined #perl6
12:14 vendethiel joined #perl6
12:17 timotimo https://twitter.com/HourlyCa​ts/status/711084648873508864 - this is approximately how awake i feel right now
12:25 cpage_ joined #perl6
12:42 kid51 joined #perl6
12:44 BenGoldberg joined #perl6
12:50 jin_ joined #perl6
13:09 vendethiel joined #perl6
13:13 AlexDaniel joined #perl6
13:15 andreoss joined #perl6
13:17 andreoss m: my \i =$= 1; say ++i;
13:17 camelia rakudo-moar 319ec8: OUTPUT«2␤»
13:17 andreoss m: my \i =$(1); say ++i;
13:17 camelia rakudo-moar 319ec8: OUTPUT«Cannot call prefix:<++>(Int); none of these signatures match:␤    (Mu:D $a is rw)␤    (Mu:U $a is rw)␤    (Int:D $a is rw)␤    (int $a is rw)␤    (Bool $a is rw)␤    (Num:D $a is rw)␤    (Num:U $a is rw)␤    (num $a is rw)␤  in block <uni…»
13:18 andreoss m: my \i :=$= 1; say ++i;
13:18 camelia rakudo-moar 319ec8: OUTPUT«2␤»
13:19 psch m: use nqp; my \i =$= 1; say nqp::iscont(i); my \j =$(1); say nqp::iscont(j)
13:19 camelia rakudo-moar 319ec8: OUTPUT«1␤0␤»
13:19 andreoss what's $?
13:19 psch andreoss: 'i = $ = 1' assigns an anonymous scalar and assigns 1 to that
13:20 psch andreoss: 'i = $(1)' assigns an itemizes single-item list
13:20 jnthn An anonymous state variable. Which means that the =$= idiom is not threadsafe. :)
13:20 jnthn (Or at least, it's risky depending what you're doing with it)
13:20 bakedb joined #perl6
13:21 jnthn Together with it looking darn weird that's a good technical reason to consider avoiding it. ;)
13:22 andreoss m: my \a =@= 1,2,3; a.push: 4; say a;
13:22 camelia rakudo-moar 319ec8: OUTPUT«[1 2 3 4]␤»
13:24 jnthn m: sub foo($i) { my \a =@= 1,2,3; foo(0) if $i; a.push: 4; say a; }; foo(1)
13:24 camelia rakudo-moar 319ec8: OUTPUT«[1 2 3 4]␤[1 2 3 4 4]␤»
13:24 shinobicl joined #perl6
13:25 ribasushi joined #perl6
13:25 andreoss when i should use this stuff? they do make sigiless variables more friendly for mutable use
13:25 psch m: my \a = [1,2,3]; a.push: 4; say a
13:25 camelia rakudo-moar 319ec8: OUTPUT«[1 2 3 4]␤»
13:26 andreoss m: my \a = 1, 2, 3; a.push: 4; say a
13:26 camelia rakudo-moar 319ec8: OUTPUT«Cannot call 'push' on an immutable 'List'␤  in block <unit> at /tmp/q_pAan7Buw line 1␤␤»
13:26 jnthn andreoss: Yes, but it goes against the cultural trend to use them for immutable things...
13:27 shinobicl r: my @rr1 = Nil xx 5; say @rr1.perl; my @rr2 = Any xx 5; say @rr2.perl
13:27 camelia rakudo-jvm 978754: OUTPUT«cannot connect to eval server: Connection refused␤»
13:27 camelia ..rakudo-moar 319ec8: OUTPUT«[Any, Any, Any, Any, Any]␤[Any, Any, Any, Any, Any]␤»
13:27 shinobicl say Any ~~ Nil;
13:27 shinobicl r: say Any ~~ Nil;
13:27 camelia rakudo-jvm 978754: OUTPUT«cannot connect to eval server: Connection refused␤»
13:27 camelia ..rakudo-moar 319ec8: OUTPUT«False␤»
13:27 musiKk_ joined #perl6
13:28 jnthn andreoss: It's unfriendly for a reason :)
13:28 shinobicl Hi all, i need to discriminate for an empty value and undefined value, Why i can not have an array of Nil?
13:28 jnthn shinobicl: Because Nil's assignment behavior is "set this thing back to its default"
13:28 jnthn shinobicl: Maybe use :exists?
13:29 shinobicl r: say Any ~~ Mu; say Nil ~~ Mu;
13:29 camelia rakudo-jvm 978754: OUTPUT«cannot connect to eval server: Connection refused␤»
13:29 camelia ..rakudo-moar 319ec8: OUTPUT«True␤True␤»
13:29 jnthn m: my @a is default(42); @a = Nil xx 5; say @a;
13:29 camelia rakudo-moar 319ec8: OUTPUT«[42 42 42 42 42]␤»
13:30 jnthn m: my @a; @a[1] = 5; say @a[0]:exists;
13:30 camelia rakudo-moar 319ec8: OUTPUT«False␤»
13:30 shinobicl So, how can i be sure if something is undefined?
13:31 shinobicl I mean
13:31 jnthn The .defined method, or the defined function, or use with/without
13:32 shinobicl Ok lets say that i have an array of 10 elements, but only with 5 defined, what should i put in the other 5 to say that is not yet assigned?
13:33 psch m: my @a[10] = ^5; say @a[5]:exists
13:33 camelia rakudo-moar 319ec8: OUTPUT«False␤»
13:33 psch m: my @a[10] = ^5; say @a[5]:exists; say @a[0..4]:exists
13:33 camelia rakudo-moar 319ec8: OUTPUT«False␤(True True True True True)␤»
13:33 kid511 joined #perl6
13:35 jnthn shinobicl: Just don't assign to them at all
13:36 jnthn Or if you already did then :delete them
13:37 jnthn (I assume you need ordering and thus didn't go for the "just use a hash" approach)
13:44 vendethiel azawawi: sorry, had to run
13:45 kaare_ joined #perl6
13:59 brrt joined #perl6
14:00 shinobicl r: my @a[10] = ^5; say @a.perl
14:00 camelia rakudo-jvm 978754: OUTPUT«cannot connect to eval server: Connection refused␤»
14:00 camelia ..rakudo-moar 319ec8: OUTPUT«Array.new(:shape(10,), [0, 1, 2, 3, 4, Any, Any, Any, Any, Any])␤»
14:01 shinobicl r: say Int ~~ Any;
14:01 camelia rakudo-moar 319ec8: OUTPUT«True␤»
14:01 camelia ..rakudo-jvm 978754: OUTPUT«cannot connect to eval server: Connection refused␤»
14:01 virtualsue joined #perl6
14:02 Actualeyes joined #perl6
14:02 shinobicl r: my @a[10] = ^5; say @a.perl; say @a[0]
14:02 camelia rakudo-moar 319ec8: OUTPUT«Array.new(:shape(10,), [0, 1, 2, 3, 4, Any, Any, Any, Any, Any])␤0␤»
14:02 camelia ..rakudo-jvm 978754: OUTPUT«cannot connect to eval server: Connection refused␤»
14:03 shinobicl r: my @a[10] = ^5; say @a.perl; say @a[0]:exists; say @a[9]:exists;
14:03 camelia rakudo-moar 319ec8: OUTPUT«Array.new(:shape(10,), [0, 1, 2, 3, 4, Any, Any, Any, Any, Any])␤True␤False␤»
14:03 camelia ..rakudo-jvm 978754: OUTPUT«cannot connect to eval server: Connection refused␤»
14:03 shinobicl thanks! :) i think i got it now
14:03 virtualsue joined #perl6
14:05 FROGGS_ shinobicl: btw, you can use "m:" to query rakudo-moar only
14:06 shinobicl how can i define a method callable like :exists?
14:07 shinobicl i'm not familiar with this $var:something syntax
14:10 geekosaur that's not a method, it's a named/keyword parameter to something else. in @x[n]:exists it is a named parameter to the postcircumfix:<<[ ]>> method
14:11 RabidGravy joined #perl6
14:12 shinobicl Ahhhh nice! so when i define the postcincumfix op i just define  a named argument called :exists and see if "$exists" it is defined or not
14:12 geekosaur yep
14:12 shinobicl :D
14:12 shinobicl thanks!
14:14 psch m: sub postcircumfix:<' '>($it, $arg, :$double) { say $double ?? 2 * $it * $arg !! $it * $arg }; 2'3'; 2'3':double
14:14 camelia rakudo-moar 319ec8: OUTPUT«5===SORRY!5=== Error while compiling /tmp/AUrHjKD5d0␤Unable to parse expression in postcircumfix:sym<' '>; couldn't find final $stopper ␤at /tmp/AUrHjKD5d0:1␤------> 3 ?? 2 * $it * $arg !! $it * $arg }; 2'3'7⏏5; 2'3':double␤»
14:14 RabidGravy Rarr!
14:14 psch huh
14:14 psch m: sub postcircumfix:<' '>($it, $arg, :$double) { say $double ?? 2 * $it * $arg !! $it * $arg }; 2'3'
14:14 camelia rakudo-moar 319ec8: OUTPUT«6␤»
14:14 psch m: sub postcircumfix:<' '>($it, $arg, :$double) { say $double ?? 2 * $it * $arg !! $it * $arg }; 2'3':double
14:14 camelia rakudo-moar 319ec8: OUTPUT«5===SORRY!5=== Error while compiling /tmp/lx3nwuMA77␤Unable to parse expression in postcircumfix:sym<' '>; couldn't find final $stopper ␤at /tmp/lx3nwuMA77:1␤------> 3 $it * $arg !! $it * $arg }; 2'3':double7⏏5<EOL>␤    expecting any of:…»
14:15 jameslenz joined #perl6
14:20 chkk joined #perl6
14:40 virtualsue joined #perl6
14:41 virtualsue joined #perl6
14:43 tmch joined #perl6
14:57 virtualsue joined #perl6
14:57 skids joined #perl6
15:00 khw joined #perl6
15:04 RabidGravy there, glitch free and everything - http://rabidgravy.com:8000/stream
15:07 Begi joined #perl6
15:11 masak RabidGravy: what's that?
15:13 RabidGravy a perl program sequencing nekobee live and another perl program encoding the output and streaming it
15:13 RabidGravy but it's lost it now
15:15 masak Perl 5?
15:15 RabidGravy er perl 6
15:15 masak woo
15:16 RabidGravy the problem happens when the GC kicks in and it doesn't have enough time headroom to catch back up again
15:16 masak today's autopun spotting: http://xkcd.com/1657/
15:17 lucs m: use Test; is(15 + 27, 42)  # This is fine.
15:17 camelia rakudo-moar 319ec8: OUTPUT«ok 1 - ␤»
15:17 lucs m: require Test; is(15 + 27, 42)  # But how does 「require」 work?
15:17 camelia rakudo-moar 319ec8: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Hk_O5lXaCZ␤Undeclared routine:␤    is used at line 1␤␤»
15:17 masak RabidGravy: I wonder what kind to GC setting might help in such cases where non-stuttering matters more than being conservative with memory.
15:17 ugexe require doesn't import anything
15:17 masak problem is, you have to GC at some point, I guess.
15:18 lucs m: require Test; Test::is(15 + 27, 42)  # ?
15:18 camelia rakudo-moar 319ec8: OUTPUT«Could not find symbol '&is'␤  in block <unit> at /tmp/QgcI3c_ZTr line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/QgcI3c_ZTr line 1␤␤»
15:18 ugexe put your entire program in DESTROY and hope its not collected
15:18 ugexe `is` is not `our` scoped within Test
15:20 brrt joined #perl6
15:20 lucs ugexe: Not sure what to do with that info :/
15:20 brrt joined #perl6
15:21 ugexe im not sure what you are trying to do
15:21 lucs I'm trying to 「require Test」 and use its functions.
15:21 brrt joined #perl6
15:21 RabidGravy lucs, you have to call import
15:22 brrt joined #perl6
15:22 RabidGravy otherwise the functions "don't exist" in your scope
15:22 ugexe m: require Test <&is>; is(1,1)
15:22 camelia rakudo-moar 319ec8: OUTPUT«ok 1 - ␤»
15:22 lucs Aha, thanks.
15:22 brrt joined #perl6
15:22 ugexe the import statement is implied by the <&is>
15:23 brrt joined #perl6
15:23 lucs How would I explicitly invoke the 'import'?
15:25 RabidGravy import Test
15:25 lucs Oh, okay.
15:26 ugexe http://design.perl6.org/S11.html#Exportation # most of this is valid
15:26 lucs Thanks
15:28 ugexe if `require Test <&is>;` doesn't work on your local perl6 you probably need to upgrade, as I think that type of symbol importing was added in the last month or two
15:29 rindolf joined #perl6
15:29 lucs ugexe: Yeah, works fine (I have a rather recent build).
15:29 rindolf Hi all. Who here is Wga Van Dick?
15:30 rindolf s/Dick/Dijk/ - sorry.
15:30 rindolf lucs: hi , sup?
15:30 ugexe thats wendy isnt it?
15:30 lucs rindolf: Same old same old, but with Perl 6 :)
15:31 RabidGravy masak, I could foresee some sort of "I need 0.001 secs" directive for a block and the GC won't take time below that
15:31 lucs rindolf: Yes, Wendy (according to google).
15:31 rindolf lucs: ah.
15:31 RabidGravy and not here right now
15:31 rindolf lucs: what is her nickname?
15:31 rindolf RabidGravy: ah.
15:35 ugexe is IO::Spec extendable such that it could be made to accept file uri? (file://<...>)?
15:37 nadim joined #perl6
15:39 rudi_s Is there a way to get the native file descriptor of Async::Proc's stdin?
15:40 skids There wasn't as of a week ago IIRC.
15:40 jnthn rudi_s: No; we don't actually expose the handles at all
15:41 mst jnthn: I can't get the fdno out of a filehandle?
15:42 rudi_s jnthn: Ok. - So I guess there's no way to use a native C function which writes to a file descriptor and use that with Async::Proc? I tried to use it with plain run but I get deadlocks when the programs writes to stdout and stderr and reads from stdin.
15:43 rudi_s Which is kind-of obvious when you think about. I then try to use Supply on $proc.out and $proc.err, but that hangs when I run $proc.out.Supply.tap(...).
15:44 jnthn mst: Out of a file handle yes, but Proc::Async doesn't expose the handles at all. In no small part 'cus it's hard to imagine anything going well when libuv is "owning" them
15:44 mst aha, ok, this is probably fair enough
15:45 jnthn rudi_s: Are you trying to work around something we're missing?
15:45 gnommer joined #perl6
15:46 mst I suspect the use cases I'm thinking of will involve me nativecalling fork+exec myself anyway
15:46 rudi_s jnthn: Well, maybe.
15:46 rudi_s I want to run a program, write to its stdin and get its stdout/stderr.
15:47 rudi_s In addition I need the native file descriptor of stdin because I want to call a C function which writes to an fd.
15:48 rudi_s But as a I said, I can't get it to work with just run because of deadlocks and Proc::Async has no way to get the native file descriptor.
15:49 pmurias masak: there are different GC for situations where non-stuttering is important
15:50 pmurias RabidGravy: is your streaming program up for reading somewhere?
15:51 RabidGravy yeah, it's an example in Audio::PortAudio
15:51 RabidGravy https://github.com/jonathanstowe/Audio-Por​tAudio/blob/master/examples/stream-source
15:54 jnthn rudi_s: Yeah, Proc::Async would handle that great except the native descriptor bit...
15:54 rudi_s jnthn: Yeah. Any idea how I could get it to work with run without the deadlock?
15:55 jnthn rudi_s: Well, do you know how much data you're going to get back?
15:55 rudi_s jnthn: No.
16:00 Actualeyes joined #perl6
16:02 wamba joined #perl6
16:03 jnthn rudi_s: OK. Then not sure.
16:03 * jnthn gotta go take care of home stuffs...
16:03 jnthn bbl
16:04 rudi_s jnthn: Ok, thanks anyway. For now I have a workound and write to a temp file and then read that in and use Proc::Async. But it's not nice.
16:11 zakharyas joined #perl6
16:17 BenGoldberg joined #perl6
16:26 beatdown joined #perl6
16:40 tmch joined #perl6
16:43 azawawi joined #perl6
16:43 azawawi hi
16:44 azawawi im getting some weird behavior on Proc::Async. Is it working on Mac OSX?
16:44 azawawi https://travis-ci.org/azawawi/perl6-se​lenium-webdriver/jobs/117109148#L3596
16:49 ugexe azawawi: all the problems i had with it on osx boiled down to: https://rt.perl.org/Public/​Bug/Display.html?id=125758
16:49 * azawawi reads
16:51 ugexe i.e. osx has some problem with `await Promise.allof(@promised)`, but `for @promised { await $_; }` works, with the difference being the first one doesnt seem to sink all the promises so they never get out of Planned state
16:53 ugexe and that would cascade into all sorts of other errors
16:53 azawawi do you have a MacOS X development environment?
16:53 RabidGravy perl6 channeling Junior Mance on speed http://rabidgravy.com:8000/stream
16:53 ugexe not now. i use macincloud.com when i need to test on osx
16:53 ugexe but $
16:55 woodruffw joined #perl6
16:55 ugexe a hack i found to also work was to call `?$p.result;` before using $p
16:56 ugexe so in your test, maybe `my $p = $process.start; ?$p.result; say("phantomjs...`
17:00 rudi_s jnthn: Btw. is it expected that tap on $proc.out.Supply will block or is this supposed to work?
17:00 azawawi ugexe: we should start doing rakudostar binary builds... because it is silly... we're using precious travis ci time (and developer time) waiting for test result
17:01 jameslenz joined #perl6
17:02 azawawi for rakudobrew 2016.xy, couldnt we update the travis ci container image to take ready-made binaries instead of slow source make/test
17:02 ugexe tony-o has shown you can archive the rakudo directory in a travis build and reuse it
17:02 virtualsue joined #perl6
17:03 azawawi ugexe: where is that?
17:03 ugexe https://github.com/tony-o/perl6-travis-bin
17:03 azawawi ugexe: thx
17:03 azawawi RabidGravy: awesome
17:06 RabidGravy that's what nearly a gig of piano sample sounds like ;-)
17:07 RabidGravy same program as before, using linux sampler instead of nekobee and streaming via darkice rather audio::portaudio
17:08 ugexe azawawi: there is also caching on travis, but i could never get it to work before my attention span moved on https://docs.travis-ci.com/user/caching/
17:08 jnthn rudi_s: I suspect so, given handles currently can't be used across multiple threads
17:09 RabidGravy I say the same program, it's actually slightly weighted toward the third and fifth of the mixolydian
17:10 rudi_s jnthn: Multiple threads? I just have one thread which calls run.
17:13 jnthn rudi_s: I was explaining why $handle.Supply.tap blocks
17:14 rudi_s jnthn: I know. But why is this related to multiple threads?
17:14 * TimToady prefers inverted hungarian, or whatever that's called that's used in Samson and Delilah, with a major third but a minor second
17:15 TimToady so two 1.5 step intervals, but between 2nd/3rd and 6th/7th
17:15 TimToady Phrygian or some such
17:16 RabidGravy I was just about to say phrygian, yep
17:16 * TimToady likes raised 9th chords too :)
17:17 jnthn rudi_s: Well, *something* has to be reading from the handle and showing the read stuff into the Supply
17:17 jnthn *shoving
17:18 rudi_s jnthn: Oh, so this is handled by threads? I expected something like epoll or similar.
17:18 azawawi btw, Samson in Arabic is pronounced as Shamshon (شمشون)
17:18 RabidGravy sounds like Sean Connery saying it ;-)
17:19 jnthn rudi_s: Even then some thread needs to play event loop
17:19 rudi_s jnthn: The main "thread"?
17:19 jnthn rudi_s: Proc::Async, IO::Socket::Async, IO::Notification etc. all proxy operations to a single thread that serves as the event loop
17:19 rudi_s And that's not the normal main thread?
17:20 jnthn rudi_s: It then dispatches results into the queue of ThreadPoolScheduler
17:20 jnthn rudi_s: For non-async things, though, we don't handle them through an event loop-y thing at present
17:20 jnthn File handles are just normal buffered I/O
17:20 azawawi RabidGravy: it is like Shamshoon
17:20 jnthn (All this is subject to change.)
17:21 rudi_s jnthn: Ah, ok. Good to know. Thanks.
17:21 TimToady well, back to cleaning out the garage (and all the other infrastructural things I've been putting off for the last 15 years for some reason...)
17:21 jnthn ;-)
17:21 jnthn TimToady: 15 years would give a garrage time to accumulate a good amount of stuff, I'd guess :)
17:22 Ven joined #perl6
17:22 RabidGravy yeah we got a skip last year and dumped ten years worth of junk
17:22 TimToady oh, it was already accumulating for a number years before that :)
17:22 Ven azawawi: back
17:23 RabidGravy I spent three days shredding stuff
17:23 * jnthn moved apartment after just *5* years in it last year, and was shocked how much more stuff he had than when he'd moved in there... :)
17:23 azawawi Ven: weclome back. So far I traced it to https://travis-ci.org/azawawi/perl6-se​lenium-webdriver/jobs/117109148#L3596
17:23 TimToady we'll probably wait till we get our Free Shredding Day in Mountain View
17:23 Ven I've seen you linked me a gist, but I've been unable to find it atm
17:23 RabidGravy :)
17:24 Ven azawawi: I don't even get that – I get "Starting phantomjs process"
17:24 jnthn I suspect I'll be moving again within the next 5 years...though for once I intend it *not* to be an international move. :-)
17:25 azawawi Ven: i will simplify it into a test scrit... give me  a min plz
17:25 Ven no problem :). sorry for the delay.
17:25 Ven (I reconnected a bit earlier but you were away)
17:28 azawawi Ven: https://gist.github.com/az​awawi/c4c2f5b5b31906ea28ed
17:28 azawawi Ven: try this code and paste output please
17:29 RabidGravy If wanted to make something that was like an "enum Foo ..." but the values were lists is it just sub-class EnumMap?
17:31 azawawi Ven: sample output here (Linux) http://pasteboard.co/2o2oIRph.png
17:31 _nadim joined #perl6
17:33 azawawi Ven: no need to worry about the delay. I was outside enjoying the beautiful spring sunny weather :)
17:34 RabidGravy Boo, it's freezing and yuck in London still
17:34 Ven azawawi: phantomjs path: /Users/ven/.opam/system/bin/phantomjs phantomjs port: 5555 phantomjs returned Proc::Async promise: Promise.new(scheduler => ThreadPoolScheduler.new(initial_threads => 0, max_threads => 16, uncaught_handler => Callable), status => PromiseStatus::Planned)
17:34 azawawi RabidGravy: hehe :)
17:35 RabidGravy we seem to be going through a period of one day of pleasant spring-like weather and three days of winter
17:36 azawawi Ven: Is there any DEBUG output like "Config - init - Configuration..."... see the above picture link
17:36 Ven azawawi: "Config - config.init - {"ip":"127.0.0.1","port":"5555","hub":null​,"proxy":"org.openqa.grid.selenium.proxy.D​efaultRemoteProxy","version":"","logFile":​null,"logLevel":"DEBUG","logColor":false}"
17:36 azawawi RabidGravy: it was raining but today is sunny and green :)
17:37 azawawi Ven: strange
17:39 azawawi Ven: 'git pull' the selenium git repo please and test it
17:39 Ven trying t/02
17:40 Ven azawawi: "phantomjs returned Proc::Async promise: Promise.new(scheduler => ThreadPoolScheduler.new(initial_threads => 0, max_threads => 16, uncaught_handler => Callable), status => PromiseStatus::Planned)" but it's using the wrong port
17:40 azawawi Ven: no it is using a random free empty port
17:41 Ven oke :)
17:41 azawawi Ven: https://github.com/azawawi/perl6-selenium-webdrive​r/blob/master/lib/Selenium/WebDriver/Wire.pm6#L818
17:42 Ven hahaha
17:48 azawawi Ven: can you please pastebin the following command: prove -v -e 'perl6 -Ilib' t/02-phantomjs.t ?
17:49 Ven not sure why you go through `prove` in this case, but...
17:50 Ven azawawi: https://gist.github.com/vend​ethiel/6df07e0ed75749643264
18:01 azawawi Ven: sleep is working correctly on Mac OS X?
18:02 Ven yes :)
18:02 azawawi Ven: does the test take time to finish or right away?
18:03 Ven azawawi: it takes 32.8s to run (real)
18:03 azawawi Ven: but no output from phantomjs process...
18:04 Ven indeed
18:06 azawawi Ven: try to curl it from another shell while the test is running https://gist.github.com/az​awawi/e30986625e31cae4f2e9
18:07 Ven that worked
18:08 azawawi aha
18:08 azawawi same random port?
18:09 azawawi and killall phantomjs # just in case
18:09 Ven no, I mean – the curl worked. but that didn't make the test work.
18:10 azawawi make sure no phantomjs process is still there by killing them all: killall phantomjs
18:10 azawawi then try that curl command
18:11 domidumont joined #perl6
18:12 go|dfish joined #perl6
18:12 dalek ecosystem: 3c5d499 | (Fernando Correa de Oliveira)++ | META.list:
18:12 dalek ecosystem: Update META.list
18:12 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/3c5d499c45
18:12 dalek ecosystem: 33ae8ba | azawawi++ | META.list:
18:12 dalek ecosystem: Merge pull request #174 from FCO/patch-1
18:12 dalek ecosystem:
18:12 dalek ecosystem: Update META.list
18:12 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/33ae8ba5a9
18:13 TreyHarris is there shorthand for one grammar referring to another grammar's TOP in one of its rules?
18:14 azawawi Ven: Try add :port(5555) parameter to https://github.com/azawawi/perl6-selenium-​webdriver/blob/master/t/02-phantomjs.t#L45
18:15 Ven now there's only one test failing: "not ok 86 - Only One session should be there" line 57
18:15 azawawi Ven: maybe the free port range is somehow bad for osx
18:16 azawawi Ven: good
18:16 azawawi Ven: let it run them without curl-ing
18:16 Ven huh?
18:16 azawawi Ven: s/them/then
18:17 azawawi Ven: that curl http post is actually requesting  a new session and the test checks for only one session which it has created earlier
18:18 Ven oh. I didn't curl it. It just worked
18:20 azawawi good then empty-port sucks on macosx :)
18:20 azawawi i wonder why
18:22 azawawi My guess is this assumption is bad on osx https://github.com/azawawi/perl6-selenium-webdrive​r/blob/master/lib/Selenium/WebDriver/Wire.pm6#L829
18:25 azawawi Ven: thanks a lot :)
18:25 azawawi Ven++
18:25 Ven good!
18:27 itaipu joined #perl6
18:27 azawawi Ven: also we're testing for an empty port against 127.0.0.1:XYZ ... maybe phantomjs is binding itself to something else
18:28 * azawawi waits for travis ci results
18:32 dbohdan How production-ready is Perl 6 on the JVM for web development? I am looking for a fun, expressive JVM language in which to write a small (public) web application, and Perl 6 seems like fun. :-)
18:32 timotimo TreyHarris: no, you'll have to spell out the "TOP" part again i'm afraid
18:33 RabidGravy just for TimToady http://rabidgravy,com:8000/stream now playing in Phrygian mode
18:33 timotimo i have no idea what that means :|
18:34 RabidGravy the phrygian part?
18:35 RabidGravy it's one of the greek musical modes
18:35 TreyHarris timotimo: okay. is it an antipattern to be doing things like parsing a doc that can include subdocs in HERE-like format by referring to the subdoc's grammar's TOP? or just something which is too uncommon for syntactic sugar to be necessary?
18:36 timotimo well, we're using multiple grammars in rakudo, too
18:36 RabidGravy flattened second and fourth compared to a major scale
18:36 timotimo every quote is already a sub-language
18:36 timotimo so are regexes
18:37 lucs RabidGravy: How was that composed? (re. Phrygian stream)
18:38 RabidGravy it's a perl 6 program sequencing linuxsampler live
18:38 RabidGravy one of the examples from the forthcoming Audio::PortMIDI :)
18:39 TreyHarris timotimo: right, that's why I asked because I'd looked in nqp for examples of referring to another TOP and didn't find any
18:39 TreyHarris timotimo: but i was just doing 'ack --nqp TOP', so could've missed something
18:40 colomon joined #perl6
18:40 timotimo hm, look for something like nibble or something?
18:42 timotimo i haven't tried to understand the mechanism yet, because i never needed to modify anything about it
18:43 TreyHarris timotimo: yes, i see nibble. that seems more self-documenting anyway. thanks!
18:47 kid511 What is the best way to report a typo in http://doc.perl6.org/routine/spurt ?
18:48 kid511 RT?
18:48 timotimo nah, it's better to go to the github repo; there's a link at the far bottom
18:50 azawawi kid511: https://github.com/perl6/doc/issues
18:51 jack_rabbit joined #perl6
18:54 sufrostico joined #perl6
18:55 kid511 azawawi: Thanks.  Created https://github.com/perl6/doc/issues/427
18:58 woodruffw joined #perl6
19:05 wamba joined #perl6
19:11 BenGoldberg joined #perl6
19:13 kid511 In the REPL, the following statement fails to compile:
19:14 kid511 given prompt "Enter a number: " { when * < 0 { say "Negative"; } when * > 0 { say "Positive"; } default { say "Zero"; } }
19:14 kid511 It will only compile when I put ';' after the '}' if the first 2 'when' blocks.
19:14 kid511 given prompt "Enter a number: " { when * < 0 { say "Negative"; }; when * > 0 { say "Positive"; }; default { say "Zero"; } }
19:15 kid511 However, those semicolons are *not* necessary if I enter this same code into a file and run it.  Anyone know why?
19:19 woodruffw joined #perl6
19:21 labster joined #perl6
19:21 timotimo because you've put newlines after the } probably
19:21 timotimo a } at the end of a line gives you a ; for free
19:24 lucasb joined #perl6
19:24 kid511 thx
19:27 lucasb about the Bool/defined methods from yesterday, I think lizmat's commit only fixed half of the problem
19:27 mohae joined #perl6
19:27 lucasb only Bool(Mu:D:) was changed, but I think the same thing applies to Bool(Mu:U:)
19:28 timotimo please elaborate?
19:28 lucasb m: say ?class { method defined { True } }
19:28 camelia rakudo-moar 319ec8: OUTPUT«False␤»
19:28 lucasb star: say ?class { method defined { True } }
19:28 camelia star-m 2016.01: OUTPUT«True␤»
19:28 timotimo i don't remember 100%, but didn't we say you have to implement method Bool if you want ? to behave differently?
19:29 sufrostico joined #perl6
19:29 RabidGravy yeah I thought that was what was decided
19:30 lucasb if you append ".new" to my examples, you will see I don't need to define Bool
19:30 lucasb so, the behavior is different is you ask a type object or a instance
19:31 lucasb I can accept it, if someone says that's how things will be from now on :)
19:31 lucasb *the behavior is different if you ask
19:32 timotimo hmm
19:33 timotimo i'm not 100% convinced any more this is all right
19:35 lichtkind__ joined #perl6
19:35 lucasb yeah, it's a little confusing to be able to change the definedness of some object...
19:36 domidumont joined #perl6
19:41 timotimo well, it's useful for things that act like proxies to other things
19:41 timotimo and are supposed to be transparent
19:41 timotimo what you can't change is the DEFINITEness
19:41 lucasb right
19:42 jantore joined #perl6
19:42 timotimo in general, it's bound to cause confusion one way or the other
19:47 Begi joined #perl6
19:57 musiKk_ joined #perl6
19:57 sufrostico joined #perl6
20:03 t999 joined #perl6
20:06 t999 left #perl6
20:06 sufrostico joined #perl6
20:11 BenGoldberg joined #perl6
20:14 BenGoldberg joined #perl6
20:17 * masak accidentally writes !~ and gets told off by perl6
20:21 rudi_s Is it possible to automatically initialize a class member on .new call? I have something like has SetHash $.foo and I'd like to get a SetHash after I call new. Is this possible?
20:21 timotimo yeah, just write "has SetHash $.foo = SetHash.new"
20:23 masak m: class C { has $.foo = 42 }; say C.new.foo
20:23 camelia rakudo-moar 319ec8: OUTPUT«42␤»
20:23 masak rudi_s: ^^
20:24 masak m: class C { has $.foo = (1..6).roll }; say C.new.foo for ^3
20:24 camelia rakudo-moar 319ec8: OUTPUT«2␤3␤5␤»
20:24 Begi joined #perl6
20:26 DarthGandalf joined #perl6
20:27 rudi_s Oh, nice. Didn't know that this works. Awesome. Thank you timotimo, masak.
20:27 masak it's nice when you know about it, yes
20:27 masak one way to explain it is to say that the `= 42` and `= (1..6).roll` bits are *thunks* and they run in a separate *phase* (namely, at object construction time)
20:35 zakharyas joined #perl6
20:38 RabidGravy yeah and a nice implication of that is you can use other attributes in the initialiser
20:38 RabidGravy m: class F { has Int $.one is required; has Int $.two = do { $!one * 2 }; };  say F.new(one => 3).perl
20:38 camelia rakudo-moar 319ec8: OUTPUT«F.new(one => 3, two => 6)␤»
20:38 Ven joined #perl6
20:39 moritz m: class F { has Int $.one is required; has Int $.two = $!one * 2 }; say F.new(one => 3).perl
20:39 camelia rakudo-moar 319ec8: OUTPUT«F.new(one => 3, two => 6)␤»
20:39 moritz no need for that do block
20:40 RabidGravy yeah, superstitious on my part
20:40 BenGoldberg m: class Foo { my SetHash $.foo .= new; }; Foo.new.say;
20:40 camelia rakudo-moar 319ec8: OUTPUT«Foo.new␤»
20:41 BenGoldberg m: class Foo { my SetHash $.foo .= new; }; Foo.new.foo.say;
20:41 camelia rakudo-moar 319ec8: OUTPUT«SetHash.new()␤»
20:42 lucasb m: class C { has $.a = $!b; has $.b = 42 }; say C.new
20:42 camelia rakudo-moar 319ec8: OUTPUT«C.new(a => Any, b => Any)␤»
20:43 lucasb ^^ interesting, no? :D
20:43 RabidGravy the order of the attributes is important there
20:43 tmch joined #perl6
20:43 lucasb I could expect C.new(a => Any, b => 42)
20:44 masak the `do` block is unnecessary exactly *because* it's a thunk
20:46 RabidGravy lucasb, I missed that, I can however understand why it is happening
20:53 TEttinger joined #perl6
20:57 _nadim joined #perl6
21:00 Begi Can we imagine, in the future, a translation of doc ?
21:00 Begi *of the Perl 6 doc
21:02 TreyHarris "has Int(Cool) $.count is rw;" is "insufficiently type-like". Is there a way to make it dwim?
21:02 masak Begi: a translation in general, or to some particular language?
21:02 RabidGravy I can imagine it, but it won't happen unless someone else does it
21:02 masak Begi: either way, I'm pretty sure we can imagine it ;)
21:02 Begi It'd be super !
21:02 Begi I'm French, so I can help with French
21:03 Begi step by step
21:04 spider-mario so can I
21:06 masak merveilleux!
21:06 TreyHarris p6: class CoolInt { has Int(Cool) $.x is rw; }; say CoolInt.new(:x("3")).perl;
21:06 camelia rakudo-moar 319ec8: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tmpfile␤Coercion Int(Cool) is insufficiently type-like to qualify a variable␤at /tmp/tmpfile:1␤------> 3class CoolInt { has Int(Cool) $.x is rw7⏏5; }; say CoolInt.new(:x("3")).perl;␤    expecting …»
21:07 Begi masak : you're German, right ?
21:07 spider-mario I programmed with ints before they were cool
21:07 masak Begi: no, I'm from .se
21:07 masak Begi: you might be thinking of moritz; easy to confuse
21:08 Begi ah yes, wouupps :)
21:08 masak easy to confuse one for the other, I mean -- it's not moritz who is easily confused... :P
21:08 * masak is easy to confuse, though
21:09 Begi so, do you think I should start the translation of some parts of the documentation ? (in French)
21:10 RabidGravy yes, just doing things is better than waiting for everyone to say yes :)
21:14 Begi sure :)
21:16 awwaiid m: for <100 10_000 100_000> -> $batch { my $start = now; ((10..99) X (10..99)).map({$_[0] * $_[1]}).grep(-> $n { $n.Str eq $n.Str.flip }).sort[* - 1].say ; my $end = now; say "Batch $batch took { $end - $start } seconds" }
21:16 camelia rakudo-moar 319ec8: OUTPUT«9009␤Batch 100 took 0.2074571 seconds␤This Seq has already been iterated, and its values consumed␤(you might solve this by adding .cache on usages of the Seq, or␤by assigning the Seq into an array)␤  in block <unit> at /tmp/w2TzV4qVr2 line 1␤␤»
21:16 awwaiid Which Seq is it talking about? the ((10..99) X (10..99)) ?
21:17 awwaiid If so, why did it get re-used between iterations of the for-loop?
21:27 timotimo awwaiid: perhaps the sort made it problematic?
21:27 timotimo or the [* - 1]
21:46 jantore joined #perl6
21:52 BenGoldberg joined #perl6
21:53 woodruffw joined #perl6
21:53 lostinfog joined #perl6
22:07 woodruffw joined #perl6
22:07 AlexDaniel joined #perl6
22:21 TreyHarris Hm... I'm trying to parse a file format where the final line is special, and it can be anything, including something that would ordinarily be valid if the file were to continue. Is that a situation I can only deal with out-of-band (either by taking the last line off the string before parsing, or by removing it from the parse tree after parsing), or is there some way in a grammar to say that?
22:22 nadim joined #perl6
22:23 TreyHarris oh, duh, I just make TOP a regex instead of something racheting. I imagine that will kill my performance though.
22:27 itaipu joined #perl6
22:30 n1cky left #perl6
22:38 mst
22:39 mst joined #perl6
22:43 Ben_Goldberg joined #perl6
22:46 _nadim joined #perl6
22:48 BenGoldberg_ joined #perl6
22:51 nadim joined #perl6
23:04 colomon joined #perl6
23:14 perlawhirl joined #perl6
23:35 espadrine_ joined #perl6
23:46 firstdayonthejob joined #perl6
23:58 bjz joined #perl6

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

Perl 6 | Reference Documentation | Rakudo