Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2014-12-09

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:02 rmgk_ joined #perl6
00:21 BenGoldberg joined #perl6
00:31 aborazmeh joined #perl6
00:35 Mouq joined #perl6
00:46 rjbs Surely today's Advent post should say p6 isn't installed on most unix systems *yet*. :)
00:51 dayangkun joined #perl6
01:06 telex joined #perl6
01:17 tinyblak joined #perl6
01:53 dalek rakudo/rt-123116: fbe2009 | (Rob Hoelz)++ | src/Perl6/Actions.nqp:
01:53 dalek rakudo/rt-123116: Allow make_where_block to take a custom QAST block
01:53 dalek rakudo/rt-123116:
01:53 dalek rakudo/rt-123116: Normally, when building a where block, we want to use the current value
01:53 dalek rakudo/rt-123116: of $_.  Sometimes, however, we want to perform additional work (in the
01:53 dalek rakudo/rt-123116: case of closure parameters, we want to match against $_.signature rather
01:53 dalek rakudo/rt-123116: than $_ itself)
01:53 dalek rakudo/rt-123116: review: https://github.com/rakudo/rakudo/commit/fbe20092dd
01:53 dalek rakudo/rt-123116: fbc87d2 | (Rob Hoelz)++ | src/Perl6/Grammar.nqp:
01:53 dalek rakudo/rt-123116: Parse closure parameters
01:53 dalek rakudo/rt-123116:
01:53 dalek rakudo/rt-123116: See SO6/Closure parameters.  For example:
01:53 dalek rakudo/rt-123116:
01:54 dalek joined #perl6
01:59 ssqq joined #perl6
02:00 ssqq nqp-m: my %h := { key => 'value'; }
02:00 camelia nqp-moarvm: ( no output )
02:01 davido_ joined #perl6
02:02 ssqq nqp-m: my %h := { key => 'value' }; say(%h);
02:02 camelia nqp-moarvm: OUTPUT«cannot stringify this␤   at gen/moar/stage2/NQPCORE.setting:682  (/home/camelia/rakudo-inst-2/languages/nqp/lib/NQPCORE.setting.moarvm:print:13)␤ from gen/moar/stage2/NQPCORE.setting:688  (/home/camelia/rakudo-inst-2/languages/nqp/lib/NQPCORE.setting.moarvm:sa…»
02:04 ssqq Why the debug information of NQP is *magnificent*, How to reduce it?
02:05 immortal joined #perl6
02:07 tinyblak joined #perl6
02:09 ssqq_ joined #perl6
02:11 vendethiel joined #perl6
02:12 tinyblak_ joined #perl6
02:16 rmgk joined #perl6
02:22 DarthGandalf joined #perl6
02:24 ssqq_ MOP = 'meta Object protocol'
02:34 vendethiel joined #perl6
02:37 geekosaur actually we would not clal that magnificent; arguably it is LTA (it doesn't say what it can't stringify and gives no hints as to why, although I'd guess "function")
02:37 geekosaur oh, nqp level, you're on your own :p
02:45 ssqq_ geekosaur: thanks your reply. I think the debug information is helpful with core programmer.
02:45 geekosaur well, nqp is kinda intended for internals hacking; you should expect internals-style errors
02:45 geekosaur it's the "implementation language" for perl6, not intended to be visible to users
02:45 geekosaur if you get an nqp error when working in perl6, it IS a bug, if only because the error should be caught by perl6 and turned into something meaningful
02:56 aborazmeh joined #perl6
02:58 kurahaupo joined #perl6
03:13 Mso150 joined #perl6
03:13 noganex joined #perl6
03:16 aborazmeh joined #perl6
03:17 dalek rakudo/nom: fbc87d2 | (Rob Hoelz)++ | src/Perl6/Grammar.nqp:
03:17 dalek rakudo/nom: Parse closure parameters
03:17 dalek rakudo/nom:
03:17 dalek rakudo/nom: See SO6/Closure parameters.  For example:
03:17 dalek rakudo/nom:
03:17 dalek joined #perl6
03:20 konsolebox joined #perl6
03:20 chenryn joined #perl6
03:21 prime joined #perl6
03:21 prime joined #perl6
03:25 vendethiel joined #perl6
03:28 Mso150 joined #perl6
03:30 Mouq joined #perl6
03:49 PZt joined #perl6
03:52 chenryn joined #perl6
03:54 aborazmeh joined #perl6
04:04 Yamin joined #perl6
04:04 Yamin what is perl?
04:07 Timbus a miserable pile of syntax
04:10 anaeem1_ joined #perl6
04:12 anaeem1 joined #perl6
04:16 erkan joined #perl6
05:01 atroxaper joined #perl6
05:03 kaare_ joined #perl6
05:07 aborazmeh joined #perl6
05:07 aborazmeh joined #perl6
05:30 Alula joined #perl6
05:32 kjs_ joined #perl6
05:34 ggoebel111111116 joined #perl6
05:35 aborazmeh joined #perl6
05:39 ptc_p6 joined #perl6
05:50 chenryn joined #perl6
05:50 tinyblak joined #perl6
05:57 vendethiel joined #perl6
06:10 tinyblak_ joined #perl6
06:12 Akagi201_ joined #perl6
06:13 Mouq joined #perl6
06:16 TimToady at least it's not a pile of miserable syntax :)
06:17 kaare_ joined #perl6
06:18 cibs joined #perl6
06:19 kurahaupo joined #perl6
06:27 [Sno] joined #perl6
06:28 japhb Three pounds of flax.
06:30 dayangkun joined #perl6
06:31 erkan joined #perl6
06:37 chenryn joined #perl6
06:39 eiro \o #perl6
06:42 kurahaupo joined #perl6
06:42 vendethiel joined #perl6
06:49 kaleem joined #perl6
06:51 eiro any perl6 replacement for    for my $mate (qw( joe bob )) {  *{$mate} = sub { say "hello $mate" }
06:53 xinming joined #perl6
06:54 lue m: say "Hello, $_" for <Joe Bob>  # one way to do it
06:54 camelia rakudo-moar 662447: OUTPUT«Hello, Joe␤Hello, Bob␤»
06:55 bjz joined #perl6
07:03 TimToady eiro: it would be better to use a hash than the symbol table, especially since P6 doesn't look for routines in the current package anymore
07:05 TimToady m: for <joe bob> -> $mate { OUR::{'&' ~ $mate} = sub { say "hello $mate" } }; OUR::joe()  # about as close as you can get
07:05 camelia rakudo-moar 662447: OUTPUT«Cannot find method 'Any'␤  in block <unit> at /tmp/hyb9p5QKT3:1␤␤»
07:05 TimToady assuming OUR:: were implemented correctly :)
07:06 TimToady but subroutines are all stored in lexical scopes nowadays, which may not be changed at run time
07:06 TimToady so you'd have to do it in a macro or BEGIN block
07:07 TimToady m: BEGIN for <joe bob> -> $mate { MY::{'&' ~ $mate} = sub { say "hello $mate" } }; joe()  # probably won't work either
07:07 camelia rakudo-moar 662447: OUTPUT«===SORRY!===␤Cannot modify an immutable Any␤»
07:08 anaeem1_ joined #perl6
07:08 TimToady m: BEGIN for <joe bob> -> $mate { COMPILING::{'&' ~ $mate} = sub { say "hello $mate" } }; joe()  # probably won't work either
07:08 camelia rakudo-moar 662447: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/L7sCSGMg_Gâ�¤Undeclared routine:â�¤    joe used at line 1â�¤â�¤Â»
07:08 TimToady rakudo is a bit weak on pseudopackages ye
07:09 TimToady *yet
07:10 TimToady doubtless there's a way to do it in the nqp underpinnings, but don't do that :)
07:16 aborazmeh joined #perl6
07:17 TimToady mutable symbol tables is one of the things that makes it very difficult to optimize Perl 5
07:19 gfldex joined #perl6
07:22 eiro lue, not what i wanted :)
07:23 eiro TimToady, just read your lines. thanks for helping.
07:23 eiro indeed: YA thing that doesn't work :(
07:24 eiro i'll try to work around with eval
07:28 darutoko joined #perl6
07:28 eiro Undeclared routine: eval :(
07:29 eiro let's try macros :)
07:31 jimmy_ joined #perl6
07:33 Timbus its EVAL now. you need to yell it
07:37 FROGGS joined #perl6
07:40 blackbolt joined #perl6
07:47 blackbolt joined #perl6
07:49 masak morning, #perl6
07:49 eiro \o masak
07:49 masak eiro: haven't backlogged -- what is it you're trying to do?
07:50 masak oh, registering a sub dynamically.
07:50 eiro masak, same as perl6-users
07:50 eiro but i think i'm close to the solution
07:51 eiro TimToady pointed me on EVAL, i now have to do this eval at compile time
07:52 eiro (if i don't, the compiler complains when functions are called)
07:53 atroxaper joined #perl6
07:54 eiro (and BEGIN { doesn't work: i'm searching in the doc
07:55 eiro but enought perl6 for today: i have to go back to my job :(
07:55 eiro thanks everyone
07:55 denis_boyun_ joined #perl6
07:57 chenryn joined #perl6
07:58 tinyblak joined #perl6
08:10 vti joined #perl6
08:13 zakharyas joined #perl6
08:13 aborazmeh joined #perl6
08:14 tinyblak_ joined #perl6
08:18 rurban joined #perl6
08:23 Mso150 joined #perl6
08:30 vendethiel joined #perl6
08:32 Isp-sec joined #perl6
08:43 azawawi joined #perl6
08:43 azawawi hi
08:43 yoleaux 8 Dec 2014 20:20Z <timotimo> azawawi: tony-o built a little "HiJacking" middleware that allows us to steal sockets at an early point so that we can do special things for websockets and eventsource. websockets are going to require some extra fiddling to get the protocol right, whereas eventsource is easy, but only one-way
08:45 azawawi timotimo: thanks for the answer
08:49 fhelmberger joined #perl6
08:55 atroxaper joined #perl6
08:55 ptc_p6 joined #perl6
09:00 khisanth_ joined #perl6
09:00 abraxxa joined #perl6
09:04 ptc_p6 joined #perl6
09:08 fhelmberger joined #perl6
09:08 Rounin joined #perl6
09:10 abraxxa1 joined #perl6
09:21 rurban joined #perl6
09:22 FROGGS joined #perl6
09:26 telex joined #perl6
09:26 virtualsue joined #perl6
09:29 dalek ufo: 674f272 | (Rob Hoelz)++ | bin/ufo:
09:29 dalek ufo: Remove calls to .path in favor of .IO
09:29 dalek ufo:
09:29 dalek ufo: .path is deprecated
09:29 dalek ufo: review: https://github.com/masak/ufo/commit/674f2720b7
09:29 dalek ufo: d9182c8 | moritz++ | bin/ufo:
09:29 dalek ufo: Merge pull request #22 from hoelzro/master
09:29 dalek ufo:
09:29 dalek ufo: Fix deprecations - Remove calls to .path in favor of .IO
09:29 dalek ufo: review: https://github.com/masak/ufo/commit/d9182c8043
09:40 masak m: role A::B {}; sub foo(A $a) {}
09:40 camelia rakudo-moar 662447: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/TNiNkxUsddâ�¤Type A cannot be used as a nominal type on a parameterâ�¤at /tmp/TNiNkxUsdd:1â�¤------> [32mrole A::B {}; sub foo(A [33mâ��[31m$a) {}[0mâ�¤    expecting any of:â�¤        statement …»
09:41 * masak submits LTA rakudobug
09:41 masak it's true that A, which is in some sense less real than A::B (or not "inhabited" or whatever), but the error message should explain that.
09:42 masak it's especially confusing that it calls A a "type".
09:42 kjs_ joined #perl6
09:45 masak in fact, I think it would be enough if it just said "Containing package A cannot be used..."
09:47 moritz m: package A { }; sub foo(A $a) { }
09:47 camelia rakudo-moar 662447: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/VqZ7Dwi6I3â�¤Type A cannot be used as a nominal type on a parameterâ�¤at /tmp/VqZ7Dwi6I3:1â�¤------> [32mpackage A { }; sub foo(A [33mâ��[31m$a) { }[0mâ�¤    expecting any of:â�¤        statemen…»
09:47 moritz masak: not just containing packages
09:50 masak good point.
09:51 masak I mean, in some sense A is a type. in both cases.
09:51 jnthn It's not even "in some sense".
09:51 masak but the fact that it's not enough of a useful type is the more important fact to highlight in the message.
09:51 masak it's not the kind of type to be used for typing :)
09:51 jnthn The message is already a LOT better than it just not accepting anything at runtime.
09:52 masak granted.
09:52 dakkar joined #perl6
09:52 masak m: role A::B {}; sub foo($a) { say $a }; foo(A)
09:52 camelia rakudo-moar 662447: OUTPUT«(A)␤»
09:52 masak I mean, passing these things ain't a problem.
09:53 jnthn Just remove the word "Type" at the start of the error and it's probably a lot less misleading.
09:53 masak +1
09:53 jnthn Or at least, less scizophrenic :)
09:54 * masak .oO( schizophrenia != multiple personality disorder )
09:55 dalek rakudo/nom: 0e44d93 | moritz++ | src/Perl6/Actions.nqp:
09:55 dalek rakudo/nom: remove the initial "Type" from "Type A cannot be used as a nominal type" error message
09:55 dalek rakudo/nom:
09:55 dalek rakudo/nom: masak++, jnthn++
09:55 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/0e44d939a9
09:56 masak m: package A {}; my A $a; say $a
09:56 camelia rakudo-moar 662447: OUTPUT«(A)␤»
09:56 masak m: role A::B {}; my A $a; say $a
09:56 camelia rakudo-moar 662447: OUTPUT«(A)␤»
09:56 masak why is this fine but the parameter case ain't?
09:56 jnthn masak: Because that case is missing some checks, apparently... :P
09:57 * masak submits rakudobug
09:57 masak moritz: https://rt.perl.org/Ticket/Display.html?id=123396
09:57 jnthn Probably something wants factoring out/re-using...
09:58 masak should the "package A" one be forbidden too?
09:58 jnthn Yes, it's the exact same case.
09:59 jnthn (As in, you can't differentiate the two in terms of the objects being created)
10:01 rindolf joined #perl6
10:02 Ulti ok so I notice that in the rakudo source coerce type methods dont declare their return types... and that looks to be how to avoid this weird circular dep problem I'm having. This feels like I am missing something really obvious and important though. What is the Perl6 equivalent of using a header file in C, something that just gives you the ability to use a class rather than include it in a strong way.
10:03 Ulti actually that doesn't help me either since I still need to create a new instance
10:04 Ulti like I'm not wanting to essentially include all the source from some file at a given line I just want to hint at where the symbols for things I'm talking about are found
10:05 moritz Ulti: well, you can stub types with  class A { ... } (with literal ...), but then you have to actually declare it later on in the same compilation unit
10:05 moritz Ulti: but in general, if you want to talk about a type, you must include the module that declares it
10:06 Ulti with use or in some other way?
10:08 Ulti urgh I cant even move it to the role since obviously they use the role too
10:08 vti joined #perl6
10:08 Ulti this feels like I am having a brain fart
10:09 rurban joined #perl6
10:21 pecastro joined #perl6
10:32 telex joined #perl6
10:34 rurban_ joined #perl6
10:35 salv0 joined #perl6
10:45 erkan joined #perl6
10:53 abraxxa joined #perl6
11:00 Ulti so imagine you wanted to do Num.Str without using the nqp unbox and box string stuff in Rakudo, how would that be done in pure Perl6?
11:00 Ulti even in the same file I have the problem of class declaration order
11:07 Mouq joined #perl6
11:08 rurban_ Oh my. Our IO::CaptureOutput replacement does not work on windows
11:08 rurban_ oops, wrong channel
11:17 chenryn joined #perl6
11:28 fhelmberger joined #perl6
11:37 ssqq joined #perl6
11:38 ssqq nqp-m: ok( nqp::ishash( { key => 'value'; } ), 'this is a hash');
11:38 camelia nqp-moarvm: OUTPUT«not ok 1 - this is a hash␤»
11:39 arnsholt Wut?
11:41 woolfy left #perl6
11:41 ssqq nqp-moarvm: ok( nqp::ishash( {} ), 'this is hash');
11:41 camelia nqp-moarvm: OUTPUT«ok 1 - this is hash␤»
11:45 colomon nqp-m: ok( nqp::ishash( { key => 'value'\ } ), 'this is a hash');
11:45 camelia nqp-moarvm: OUTPUT«Unable to parse expression in blockoid; couldn't find final '}'  at line 2, near "key => 'va"␤   at gen/moar/stage2/NQPHLL.nqp:485  (/home/camelia/rakudo-inst-2/languages/nqp/lib/NQPHLL.moarvm:panic:105)␤ from gen/moar/stage2/NQPHLL.nqp:492  (/home/camelia/rak…»
11:45 colomon nqp-m: ok( nqp::ishash( { key => 'value' } ), 'this is a hash');
11:45 camelia nqp-moarvm: OUTPUT«not ok 1 - this is a hash␤»
11:45 colomon huh
11:47 mvuets joined #perl6
11:48 woolfy joined #perl6
11:49 ssqq nqp-m: ok( nqp::ishash( :key<value> ), "this is hash");
11:49 camelia nqp-moarvm: OUTPUT«not ok 1 - this is hash␤»
11:51 smls joined #perl6
11:51 denis_boyun joined #perl6
11:51 smls o/
11:56 ssqq joined #perl6
11:56 jnthn {...} is not a hash composer in NQP
11:56 jnthn Uh, I think the empty case works.
11:56 arnsholt Oh, right!
11:56 arnsholt I keep forgetting that the hash constructor is nqp::hash(...)
11:57 jnthn Right
11:57 chenryn joined #perl6
11:57 jnthn Yeah, NQP tends towards small/simple, not DWIM like Perl 6.
11:58 ssqq nqp-m: ok(nqp::ishash( nqp::hash(:key<value>) ), 'this is hash');
11:58 camelia nqp-moarvm: OUTPUT«Iteration past end of iterator␤   at gen/moar/stage2/QAST.nqp:1933  (/home/camelia/rakudo-inst-2/languages/nqp/lib/QAST.moarvm::20)␤ from gen/moar/stage2/QAST.nqp:1931  (/home/camelia/rakudo-inst-2/languages/nqp/lib/QAST.moarvm::68)␤ from gen/moar/stage2/QAS…»
11:58 jnthn You have to do it like this:
11:58 jnthn nqp::hash('key', 'value')
11:58 jnthn There's no Pair objects in NQP, they only really make sense in certain special cases (like arguments)
12:01 fhelmberger joined #perl6
12:04 perturbation joined #perl6
12:12 baest_ joined #perl6
12:14 colomon ye gads, 20+ new modules failing tests overnight.  :(
12:14 colomon hmnmm, NativeCall broken?
12:15 colomon s/new modules failing/modules started failing/
12:18 jnthn I wonder if https://github.com/jnthn/zavolaj/commit/4d9eb738eeb65795b45bc381327c718da2660262 happened but a version bump to Rakudo and NQP did not
12:18 atroxaper joined #perl6
12:24 colomon jnthn!  \o/
12:24 colomon I don't see any sign of a version bump in the last 24 hours of rakudo
12:25 colomon commits
12:27 jnthn OK, then let's try that :)
12:27 ssqq jnthn: how to write a closure in oneline?
12:28 ssqq :nqp-m { my sub inner() { say('this is inner sub'); }; }; inner();
12:28 jnthn ssqq: Use the pointy block syntax
12:28 jnthn Well, that line won't work in NQP or Perl 6.
12:28 jnthn But you can do it with a sub or a pointy block or the {...} block syntax if no args are needed.
12:29 jnthn All of them should behave right; we use closure semantics a good bit in the compiler.
12:32 ssqq jnthn: thanks, I would looking compiler code carefully.
12:32 lwa joined #perl6
12:32 jnthn ssqq: What are you using NQP for, out of curiosity?
12:36 colomon jnthn: I can confirm the NativeCall test you linked above is the one that is failing.
12:37 smls m: sub g ($x) { return { "$x: $_" } }; my &f = g "foo"; say f $_ for <a b c>;
12:37 camelia rakudo-moar 0e44d9: OUTPUT«foo: a␤foo: b␤foo: c␤»
12:37 smls Gotta love closures :)
12:39 chenryn joined #perl6
12:39 jnthn colomon: OK, then goto chance the bump will help
12:39 jnthn I'll do it in a bit, just a bit tied up fiddling with some network stuffs at he moment
12:39 kaleem joined #perl6
12:39 colomon jnthn++
12:40 jnthn (So if anyone wants to beat me to it... :))
12:40 * colomon has to get a kid ready to go to kindergarten at the moment...
12:43 chenryn joined #perl6
12:44 onebitboy joined #perl6
12:54 hoelzro o/ #perl6
12:58 tadzik masak, masak, ping
12:58 tadzik masak: unping, nevermind :)
13:02 * moritz hopes tadzik sent a revocable ICMP paket the first time :-)
13:03 tadzik me too :)
13:03 Timbus he left you hangin; thats a syn
13:06 dalek rakudo/newio: 2e16662 | (Elizabeth Mattijsen)++ | src/core/IO (5 files):
13:06 dalek rakudo/newio: Implement IO::Locally role + IO::Local class
13:06 dalek rakudo/newio: review: https://github.com/rakudo/rakudo/commit/2e16662037
13:07 dalek rakudo/newio: fbc87d2 | (Rob Hoelz)++ | src/Perl6/Grammar.nqp:
13:07 dalek rakudo/newio: Parse closure parameters
13:07 dalek rakudo/newio:
13:07 dalek rakudo/newio: See SO6/Closure parameters.  For example:
13:07 dalek rakudo/newio:
13:08 dalek joined #perl6
13:08 moritz Timbus: if it was a SYN, he can just (SYN) NACK :-)
13:11 smls re "<rjbs>  Surely today's Advent post should say p6 isn't installed on most unix systems *yet*. :)"   I don't know about that...
13:11 smls Distros don't bundle scripting language interpreters based on how awesome the language is, they bundle things that are required to boot and run the base system.
13:11 dalek roast: 37a17ea | (Rob Hoelz)++ | S06-signature/closure-parameters.t:
13:11 dalek roast: Test closure parameters without calling the parameter
13:11 dalek roast:
13:11 dalek roast: This way, we can test if failure is occurring in the as a result
13:11 dalek roast: of binding arguments in the function that accepts a closure parameter,
13:11 dalek roast: rather than calling the closure parameter itself.  For example:
13:11 dalek roast:
13:11 smls And with the move to things like systemd on Linux, scripting languages are starting to play a smaller role there.
13:11 dalek roast:     my sub call-me(&blondie:(Str)) { blondie('') }
13:11 dalek roast:
13:11 dalek roast: Does `call-me(-> Int $foo { })` fail while binding `call-me` or
13:11 dalek roast: `&blondie`?
13:11 dalek roast: review: https://github.com/perl6/roast/commit/37a17ea459
13:13 ssqq_ joined #perl6
13:15 ssqq_ NQP support *C-Like-Macro* syntax with '#?'?
13:16 smls Only sh/bash and Perl are really ubiquitous on *nix systems; Python etc. didn't manage to take over that niche, and I don't think Perl 6 will either, because two things that matter a lot there are   1) supporting legacy code   and   2) insanely fast script start-up time to support tight shell loops.
13:18 masak tadzik: pong, unpong.
13:21 jnthn ssqq: No, that's just handled by a separate script used in the NQP and Rakudo build process
13:21 jnthn They're gone by the time we feed it to NQP itself.
13:22 atroxaper joined #perl6
13:24 hoelzro jnthn: in https://github.com/jnthn/zavolaj/issues/51, you mentioned how CArray support for NativeCall was pending 6pe support; is there anything I can do on that?
13:24 jnthn hoelzro: Well, port what I did so far in Moar to the JVM and Parrot backends is one step.
13:25 jnthn 6model on the JVM is structurally quite similar, so that's the easier one
13:25 jnthn and there's a test file in the NQP branch to tell you if you got it approximately correct. :)
13:26 hoelzro alright
13:26 hoelzro is there work that needs to be done to make it live on Rakudo?
13:26 jnthn On JVM I'd like a full p6e impl (which includes the bounded serialization additions that I've yet to get implemented). For Parrot...the minimal thing that needs doing to not regress what works today will do me.
13:27 hoelzro alright
13:27 dayangkun joined #perl6
13:28 smls lizmat: Do you know the Path::Tiny module for Perl 5? (I only learned about it recently.)
13:28 jnthn At Rakudo level: it's a little hard for me to delegate things at this point because my first implementation attempt at something is the point I tend to do the fine-grained design work.
13:28 smls I has some similarities to Perl 6 built-in I/O, e.g. «my @lines = path("foo.txt")->lines;»
13:28 jnthn Once we get a bit further along probably I can.
13:29 hoelzro jnthn: I figured as much; either way, porting the Moar work would probably build an understanding I would need for it anyway =)
13:29 jnthn But I'm hopeful that once we get the primitives ported over to JVM, then the additions at the MOP level in Rakudo will Just Work.
13:29 smls It occured to me, that «path("foo.txt").lines» might be even more self-explanatory than «"foo".IO.lines».
13:29 smls Might it worth adding as a convenience function?
13:30 jnthn hoelzro: Once I get native arrays into Rakudo, it will probably also provide a very clear example that can be used to update CArray in nativecall, so if you're up for taking on that bit, that's another thing I could nicely delegate.
13:30 hoelzro jnthn: I can try
13:31 jnthn Sure, I'll be happy to help too :)
13:31 * jnthn didn't hack any nativecall stuff for a long while
13:31 jnthn Though I've used it recently :)
13:31 jnthn Still quite like it. :)
13:32 hoelzro it's awesome; one of Perl 6's killer features, imo
13:32 jnthn Room for improvement, still. :)
13:32 jnthn ooh, I gotta go catch a train
13:32 hoelzro don't worry; I have a list =)
13:32 jnthn bbiab...train wifi :)
13:32 hoelzro alright, thanks for the guidance jnthn
13:33 jnthn Welcome :)
13:33 jnthn Lemme know if you need any more hints
13:33 jnthn &
13:33 hoelzro will do
13:35 hoelzro tadzik: you wrote a library that uses NativeCall to call some native helper code that wraps some not-so-fun bits, right?
13:35 tadzik hoelzro: correct, for steroids
13:35 hoelzro how did you manage installation of that native helper?
13:36 abraxxa joined #perl6
13:36 hoelzro I mean, if I were to do something simliar, how could I make that module panda-install-able?
13:39 kurahaupo joined #perl6
13:41 carlin hoelzro: take a look at LibraryMake, and Inline::Perl5 for an example module that uses it
13:41 hoelzro carlin: oh, thanks!
13:41 tadzik hoelzro: it's not quite pandable, steroids
13:41 hoelzro ='(
13:41 tadzik hoelzro: but you could write a custom Build.pm to compile that part
13:42 tadzik I think one of jnthn's projects does that
13:42 tadzik or it used to
13:43 tadzik used to: https://github.com/jnthn/rakudo-debugger/blob/31763150227b59d2e88a7e572158817be967c86c/Build.pm
13:44 vendethiel joined #perl6
13:44 hoelzro cool, thanks!
13:51 anaeem1 joined #perl6
13:55 dalek roast: 91a4cc9 | (Rob Hoelz)++ | S06-signature/definite-return.t:
13:55 dalek roast: Start on tests for definite return values
13:55 dalek roast: review: https://github.com/perl6/roast/commit/91a4cc9734
13:56 pecastro joined #perl6
14:04 anaeem1 joined #perl6
14:14 Alina-malina joined #perl6
14:18 FROGGS joined #perl6
14:21 BigBear joined #perl6
14:28 aborazmeh joined #perl6
14:42 * jnthn back
14:48 dalek nqp: d74907d | jonathan++ | tools/build/MOAR_REVISION:
14:48 dalek nqp: Bump MoarVM revision for native callback changes.
14:48 dalek nqp: review: https://github.com/perl6/nqp/commit/d74907d960
14:52 dalek rakudo/nom: 37b37fd | jonathan++ | tools/build/NQP_REVISION:
14:52 dalek rakudo/nom: NQP bump to get MoarVM with callbacks changes.
14:52 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/37b37fde00
14:52 tinyblak joined #perl6
14:52 jnthn colomon: Hopefullly this helps the NativeCall situation.
14:53 colomon jnthn: will check
14:55 jnthn Thanks.
14:56 colomon jnthn++ # works!
14:58 jnthn yays
14:59 molaf joined #perl6
14:59 colomon launching a new smoke test now
15:00 mathw jnthn++
15:00 * mathw really wanted NativeCall last night
15:06 tinyblak joined #perl6
15:07 PerlJam Is someone working on a post for Advent day 10?
15:07 jnthn When is day 10?
15:07 tadzik . o O ( now )
15:07 jnthn I started working on a post about MoarVM
15:07 colomon tomorrow
15:08 jnthn I may be able to finish it on the train today
15:08 jnthn I won't have time to finish it this evening though if it ain't done by the time I get to Stockholm
15:08 tadzik seen nine?
15:08 tadzik yoleaux: help
15:08 tadzik :(
15:08 jnthn So I'd not like to commit to 10th
15:09 jnthn I see 11th is free; I can certainly have it ready for that.
15:24 carlin I wrote up a quick thing about how to make modules that use NativeCall need to compile C code installable with panda: https://viennan.net/pandamonium.html
15:32 pecastro joined #perl6
15:35 ugexe is that type of stuff going to be done by the /hooks folder of a module in the future?
15:36 tadzik was there such plan?
15:36 tadzik carlin: nice :)
15:36 * jnthn never heard of one... :)
15:38 ugexe hooks: All files in this directory should contain executable Perl 6 code, to be executed at various stages of the install process of this distribution.
15:38 ugexe i guess makefile isnt perl6 though
15:38 jnthn Oh no!!!
15:39 jnthn I really will have to find a better way to do what that article wnats
15:39 rurban joined #perl6
15:39 PerlJam That business with the "native" subroutine makes me think that we should have some variation where  "is native(&find-my-lib)" could work.
15:39 jnthn Because you're doing something a module load time that is meant to be done at compile time
15:40 jnthn and so you'll end up with the effects serialized into a downstream module using your one
15:41 jnthn Which means if you have a module that does this, lets call it A, and pepole write module B and module C that each use A, and then somebody tries to load both B and C in a program (or another moudle) there'll probably be a deserialization conflict.
15:42 jnthn The trait needs applying at module A's compile time.
15:42 pmichaud joined #perl6
15:42 pmichaud good morning, #perl6
15:42 PerlJam greetings pm!
15:42 jnthn I'll have to come up with something in native call to let us do this dynamic lookup properly, without causing such bustage. :)
15:43 jnthn pmichaud: o/
15:44 jnthn PerlJam: And yes, that is certainly one possible answer.
15:45 jnthn PerlJam: That'd mean we apply the trait at the correct time still.
15:47 BigBear joined #perl6
15:47 pmichaud I wanted to give a Pm availability/status update
15:47 pmichaud Thanksgiving week didn't turn out at all as expected.  This week I'm booked with robotics.
15:47 colomon pmichaud!  \o/
15:48 pmichaud Next week I'm completely open, and will be working on GLR.
15:49 mathw \o/
15:51 jnthn \o/
15:55 * jnthn has Friday mostly free for Perl 6 things, plus should have tuits at the weekend.
15:56 jnthn And a limited supply on the next couple of evenings too.
15:56 jnthn Though not this evening.
15:56 jnthn I'll continue on 6pe and working towards native array support.
15:58 tadzik 6pe?
15:58 jnthn 6model parametric extensions
15:58 tadzik oh :)
15:58 PerlJam I guess that leaves NFG for TimToady ;)
16:00 jnthn A small 6model extension that provides a little bit of missing glue at the runtime level, so we can neatly deal with a bunch of the bugs in typed arrays today, get native arrays without them, implement coercion types in a decent way, and so forth.
16:03 moritz sounds like a useful thing to have :-)
16:04 jnthn Yes, took a while to come up with.
16:04 jnthn I like small additions that will help me solve a bunch of design problems at once. :)
16:05 mathw it's a bit of a hint that you might have got something right, isn't it? :)
16:06 jnthn Well, it's at least a good clue you're onto the small problem at the heart of the bigger ones. :)
16:07 mathw And that this step might be better than the previous step
16:08 mathw It's a good feeling :)
16:08 * mathw out
16:24 kaare_ joined #perl6
16:26 kaleem joined #perl6
16:38 BigBear joined #perl6
16:46 mr-foobar joined #perl6
16:48 [Sno] joined #perl6
16:50 [Sno] joined #perl6
16:55 awwaiid joined #perl6
16:58 atroxaper joined #perl6
17:17 Mouq joined #perl6
17:17 BigBear joined #perl6
17:34 telex joined #perl6
17:39 denis_boyun joined #perl6
17:40 aborazmeh joined #perl6
17:43 isBEKaml joined #perl6
17:50 mephinet joined #perl6
17:54 robinsmidsrod joined #perl6
17:54 BigBear joined #perl6
18:02 mvuets joined #perl6
18:09 robinsmidsrod joined #perl6
18:10 rurban joined #perl6
18:10 rurban1 joined #perl6
18:10 denis_boyun___ joined #perl6
18:11 Mso150 joined #perl6
18:12 isBEKaml joined #perl6
18:13 vti joined #perl6
18:17 vendethiel oh, did github just add diff highlighting? great!
18:17 vendethiel Also, (whoever made today p6advent's post)++! It's really good. Of course, (everybody else who contributed)++ :)
18:17 jnthn diff highlighting?
18:17 moritz vendethiel: it was smls++
18:17 spider-mario joined #perl6
18:17 [Coke] .u clock face one oclock
18:17 yoleaux U+1F550 CLOCK FACE ONE OCLOCK [So] (????)
18:17 vendethiel smls++
18:18 vendethiel jnthn: https://github.com/jashkenas/coffeescript/pull/3754/files
18:18 grettis joined #perl6
18:18 jnthn ohh...shiny :)
18:18 moritz there's nobody signed up for tomorrow
18:18 telex joined #perl6
18:18 smls Huh? I don't have anything to do with github highlighting...
18:18 moritz I might have some tuits, but I could also spend that on configuring the perl 6 comunity server
18:18 jnthn smls: You were being ++'d for the blog post :)
18:19 smls oh
18:19 isBEKaml smls: lol, the context! :-)
18:19 robinsmidsrod joined #perl6
18:19 smls :)
18:19 jnthn I had too many $dayjob bits to tend to on the train journey, so didn't get time to finish up a blog post. I can do the 11th, I think, but not the 10th.
18:20 jnthn Oooh...snow tomorrow :D
18:22 robinsmidsrod joined #perl6
18:22 mvuets m: sub incr($n){$n++}; my $n=0; incr($n)
18:22 camelia rakudo-moar 37b37f: OUTPUT«Cannot assign to a readonly variable or a value␤  in sub postfix:<++> at src/gen/m-CORE.setting:4941␤  in sub incr at /tmp/uma1503w3w:1␤  in block <unit> at /tmp/uma1503w3w:1␤␤»
18:23 mvuets sub apnd(@n){push @n, 0}; my @n; apnd(@n); say @n
18:23 jnthn You need to declare it "$n is rw" for that to work out
18:23 mvuets hello #perl6!
18:23 mvuets right
18:24 mvuets my question is different though (-:
18:24 mvuets does the immutable constrain apply to scalars only?
18:24 mvuets m: sub apnd(@n){push @n, 0}; my @n; apnd(@n); say @n
18:24 camelia rakudo-moar 37b37f: OUTPUT«0␤»
18:26 jnthn Yes, it's about scalar containers
18:26 jnthn It does apply to slurpys too
18:27 TimToady the intent is for it to work on arrays eventually somehow, so don't rely on it not breaking someday
18:27 jnthn Note that it also doesn't stop you mutating an object through its methods if it lives in a scalar
18:27 jnthn TimToady: Uh, I don't know that we can change that post-6.0.0.
18:28 jnthn It *will* be relied on.
18:28 ptc_p6 joined #perl6
18:29 jnthn And...we don't have any viable plan for changing it in the near future.
18:29 mvuets m: sub incr(*@ns){for @ns -> $n {$n++}}; incr(1, 2, 3); # slurpys behave!
18:29 camelia rakudo-moar 37b37f: OUTPUT«Cannot assign to a readonly variable or a value␤  in sub postfix:<++> at src/gen/m-CORE.setting:4941␤  in sub incr at /tmp/2tjH40lf_K:1␤  in block <unit> at /tmp/2tjH40lf_K:1␤␤»
18:30 TimToady that's not slurpy doing that
18:30 TimToady that's 1 refusing to be changed
18:30 jnthn Slurpy may do it, mind...
18:31 jnthn I know is rw on a slurpy does something different from it not being there.
18:31 jnthn I think it's a bind/assign distinction to the slurping array though
18:31 TimToady slurpies are generally exempt from the readonly nature of parameters, since they're not a ref to anything external
18:32 TimToady (as a whole)
18:32 robinsmidsrod joined #perl6
18:33 dalek perl6-roast-data: f45413d | coke++ | / (5 files):
18:33 dalek perl6-roast-data: today (automated commit)
18:33 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/f45413d1bb
18:35 [Coke] I've been seing commits to rakudo-js happening recently, haven't I? Nothing on https://github.com/pmurias/rakudo-js
18:35 moritz [Coke]: maybe in a branch?
18:36 moritz [Coke]:  
18:36 moritz [Coke]: or maybe it was nqp-js?
18:39 TimToady pretty sure it was nqp-js
18:44 robinsmidsrod joined #perl6
18:49 Rounin joined #perl6
18:49 treehug88 joined #perl6
18:50 [Coke] ah.
18:51 robinsmidsrod joined #perl6
18:54 kurahaupo joined #perl6
18:56 mvuets what is the rationale behind immutable scalar function parameters?
18:56 mvuets in terms that only scalars are immutable.
18:57 moritz mvuets: what you call "immutable" generally goes only one level deep in Perl 6
18:58 mvuets i was wondering about it
18:58 moritz mvuets: and array and hash variables contain are a container object, which presents a layer of indirection
18:59 smls In case someone wants to use the remaining 5 hours 'til  Dec 10, 0:00 UTC  to write an advent post, but doesn't have an idea for a topic, here are some not-yet-fully-fleshed-out ideas I had: https://gist.github.com/smls/116c4e55de020e17829a
19:00 moritz smls: I'm writing about symbol table introspection right now
19:00 moritz ... and it's getting way too long
19:00 mvuets i appreciate the idea of immutable types
19:00 moritz I guess I should split it up
19:00 smls ok
19:01 mvuets only these immutable scalars looks to be a half-measure to me. i hope i am missing something?
19:01 dalek mu: 5cd284d | moritz++ | misc/perl6advent-2014/schedule:
19:01 dalek mu: p6advent: claim tomorrow
19:01 dalek mu: review: https://github.com/perl6/mu/commit/5cd284d460
19:01 kurahaupo joined #perl6
19:03 mvuets do you see what i mean?
19:04 moritz mvuets: we've had some interesting discussions about them, with no clear way forward
19:05 mvuets so you want to support const/immutable variables, but there is no straightforward way to achieve it yet?
19:05 moritz mvuets: what we mostly want is to provide a deeply immutable view of an otherwise mutable object
19:05 moritz mvuets: and that seems non-trivial
19:06 mvuets i see, sigh
19:07 mvuets moritz: thanks for shedding light on the problem
19:08 mvuets i have an another question that bugs me. i expected it would work, but now am a bit surprised it actually works...
19:08 mvuets m: my @a = <a o e>; my $a = @a; push $a, "u"; say "[@a[]] [$a]"
19:08 camelia rakudo-moar 37b37f: OUTPUT«[a o e u] [a o e u]␤»
19:08 mvuets what's a distinction between @a and $a? sigils seems redundant in this case )-:
19:09 FROGGS_ joined #perl6
19:09 moritz m: my @a = <a o e>; my $a = @a; say "a" for @a; say "scalar:"; say "a" for $a
19:09 camelia rakudo-moar 37b37f: OUTPUT«a␤a␤a␤scalar:␤a␤»
19:10 gfldex joined #perl6
19:10 jerzi joined #perl6
19:11 moritz mvuets: http://faq.perl6.org/#ref
19:13 BigBear joined #perl6
19:13 jerzi What are Other Ways To Do This? my $acc = "abc".subst(/b/, 'c', :g )
19:14 jerzi I dont like calling a method on string. It is sooo boring. I want some crazy operators.
19:14 moritz m: my $acc = 'abc'; $acc ~~ s:g/b/c/; say $acc
19:14 camelia rakudo-moar 37b37f: OUTPUT«acc␤»
19:14 moritz m: my $acc = 'abc'; $acc ~~ s:g[b] = 'c'; say $acc
19:14 camelia rakudo-moar 37b37f: OUTPUT«acc␤»
19:15 moritz jerzi: better? :-)
19:15 jerzi somewhat
19:15 rjbs joined #perl6
19:16 moritz jerzi: what would you have hoped for?
19:16 jerzi I wish my $acc = "abc" ~~ s:g:return_copy_not_bool /b/c worked
19:17 PerlJam jerzi: beware the hobgoblin of foolish inconsistency  ;)
19:19 raydiak good morning #perl6
19:19 mvuets moritz: mhmm! interesting! so sigils sort of impose behavior on an underlying value, but not necessarily impose a type
19:20 PerlJam jerzi: also ... if you want "some crazy operators", you know that you can make your own without much difficulty, right?
19:20 jerzi so if I have an immutable $i and I want to substitute, I have to do my $j = $i.subst… or $j = copy(i); $j ~~ … ?
19:21 jerzi I don't, but I prefer to be understood over being fancy, so defining operators, no thanks
19:21 raydiak or (my $acc = "abc") ~~ s:g/b/c/
19:22 jerzi what is usual Perl name for a throwaway variable? In Go or Haskell it would be _
19:22 mvuets m: my $a = [<a o e>]; my $b = 8; my @a = $a; my @b = $b; say "@a[], @b[]"
19:22 camelia rakudo-moar 37b37f: OUTPUT«a o e, 8␤»
19:22 colomon jerzi: $_ maybe?
19:23 colomon it's not exactly throwaway, though
19:23 raydiak $ is an anonymous scalar
19:23 colomon for a variable you don't ever want to access, just $ works
19:26 jerzi my $sum = 0; $sum += (my $ = "x5") ~~ s:g/x//
19:27 jerzi hmm, that does not add 5, it adds 1
19:28 [Coke] m: my \_ = 3; say _;
19:28 camelia rakudo-moar 37b37f: OUTPUT«3␤»
19:29 PerlJam m: sub x { (state $)++ }; say x; say x; say x;
19:29 camelia rakudo-moar 37b37f: OUTPUT«0␤1␤2␤»
19:29 [Coke] .tell pmurias I am unable to get nqp-js to run a test here. Happy to provide more info…
19:29 yoleaux [Coke]: I'll pass your message to pmurias.
19:29 PerlJam colomon: did I "access" that variable there?
19:30 colomon PerlJam: hmmm, good point
19:33 Mouq joined #perl6
19:33 mvuets in the previous example i was fooled by say() flattening arrays when i thought it was «@a = $a» flattening
19:33 mvuets m: my $a = [<a o e>]; my @a1 = $a; my @a2 = @$a; say "@a1[]; @a2[]"; say @a1.perl; say @a2.perl; say @a1 ~~ @a2;
19:33 camelia rakudo-moar 37b37f: OUTPUT«a o e; a o e␤Array.new(["a", "o", "e"])␤Array.new("a", "o", "e")␤False␤»
19:34 mvuets this is more clear and less confusing
19:34 Mso150_l_y joined #perl6
19:42 jerzi does Perl have named result parameters? like Go https://golang.org/doc/effective_go.html#named-results
19:45 denis_boyun_ joined #perl6
19:47 denis_boyun___ joined #perl6
19:47 colomon jerzi: no.
19:48 mvuets technically perl6 returns a single values, does it?
19:48 mvuets which can be of type Array and carry multiple scalar values, for instance
19:49 moritz technically, perl6 can return named results
19:49 moritz I don't think it works though
19:49 colomon m: sub foo() { (5, "hello"); }; say foo.WHAT
19:49 camelia rakudo-moar 37b37f: OUTPUT«(Parcel)␤»
19:49 mvuets Parcels, Lists, Arrays /o\
19:49 colomon mvuets: or of type Parcel.  though I guess that may become List next week?  Same effect, anyway
19:54 colomon m: sub foo() { (5, "hello"); }; my ($num, $str) = fool; say $num; say $str;
19:54 camelia rakudo-moar 37b37f: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/zg9wqK1a_Mâ�¤Undeclared routine:â�¤    fool used at line 1. Did you mean 'foo'?â�¤â�¤Â»
19:54 colomon m: sub foo() { (5, "hello"); }; my ($num, $str) = foo; say $num; say $str;
19:54 camelia rakudo-moar 37b37f: OUTPUT«5␤hello␤»
19:56 Woodi evening #perl6 :)
19:57 Woodi moritz: how goes with kvm ? still something needs to be researched ?
19:59 PerlJam I wonder if there's a way to use hash unpacking of the return type to do something similar to what jerzi asked for.
19:59 denis_boyun_ joined #perl6
19:59 Mso150_l_y_u joined #perl6
20:02 moritz Woodi: I've managed to install a host for the WWW server
20:03 moritz Woodi: erm, guest
20:04 denis_boyun___ joined #perl6
20:07 Mso150_l_y_u_x joined #perl6
20:07 moritz I have some trouble setting up ipv6, but I guess that's not even related to kvm
20:11 jercos yeah the KVM bits should only ever see ethernet frames after all.
20:12 Woodi maybe some special switches for iptables or other ip or what was used ?
20:13 masak m: foo(); sub foo { say "OH HAI" }
20:13 camelia rakudo-moar 37b37f: OUTPUT«OH HAI␤»
20:13 masak m: foo(); my $x; sub foo { say $x }
20:13 camelia rakudo-moar 37b37f: OUTPUT«(Any)␤»
20:14 Woodi anyway, DDR4, yay :)
20:19 gluckwunsch joined #perl6
20:23 jerzi my regex num { \d+ }; my $r = /<num>X<num>/; $r.perl
20:23 jerzi Can I get the original regexp from $r?
20:24 jerzi I mean, /\d+X\d+/
20:24 jerzi m:my regex num { \d+ }; my $r = /<num>X<num>/; $r.perl
20:24 jerzi m: my regex num { \d+ }; my $r = /<num>X<num>/; $r.perl
20:24 camelia rakudo-moar 37b37f: ( no output )
20:25 jerzi m: my regex num { \d+ }; my $r = /<num>X<num>/; say $r.perl
20:25 camelia rakudo-moar 37b37f: OUTPUT«regex (Mu: *%_) { #`(Regex|46934048) ... }␤»
20:25 jerzi I'd like to get /\d+X\d+/
20:26 moritz nope (at least not easily)
20:27 colomon m: my regex num { \d+ }; my $r = /<num>X<num>/; say $r<num>.perl
20:27 camelia rakudo-moar 37b37f: OUTPUT«Failure.new(exception => X::AdHoc.new(payload => "postcircumfix:<\{ }> not defined for type Regex"))␤»
20:28 colomon wait, you're looking for the actual regex, rather than what it captured?
20:31 jerzi yes, I want to define the regexp in the longwinded way and then get an oneliner from it
20:31 jerzi as a string
20:38 [Coke] There isn't a good way yet to get the textual representation of a regex.
20:39 [Coke] There's something in the irc logs where jnthn does some magic with a macro to get it.
20:39 atroxaper joined #perl6
20:43 Mouq joined #perl6
20:43 virtualsue joined #perl6
20:45 jerzi m: {'a' => 4}<a> # What's the name for the <a> thing?
20:45 camelia rakudo-moar 37b37f: ( no output )
20:45 jerzi m: say {'a' => 4}<a> # What's the name for the <a> thing?
20:45 camelia rakudo-moar 37b37f: OUTPUT«4␤»
20:47 colomon https://news.ycombinator.com/item?id=8724727 # p6 Advent calendar on front page of Hacker News
20:49 jerzi m: ( {'a' => 4}, {'a' => 5} )».at_key('a') # can I use <a> somehow here?
20:49 camelia rakudo-moar 37b37f: ( no output )
20:49 jerzi m: say ( {'a' => 4}, {'a' => 5} )».at_key('a') # can I use <a> somehow here?
20:49 camelia rakudo-moar 37b37f: OUTPUT«4 5␤»
20:51 nige joined #perl6
20:51 moritz with .map
20:51 moritz m: ( {'a' => 4}, {'a' => 5} ).map: *<a>
20:51 camelia rakudo-moar 37b37f: ( no output )
20:51 moritz m: say  ( {'a' => 4}, {'a' => 5} ).map: *<a>
20:51 camelia rakudo-moar 37b37f: OUTPUT«4 5␤»
20:51 nige hi
20:52 nige just a quickie ...
20:52 nige I'm looking at "now"
20:53 nige and trying to drive the REPL to uncover its origins
20:53 nige is it Cool?
20:53 colomon m: say ( {'a' => 4}, {'a' => 5} )».<a>
20:53 camelia rakudo-moar 37b37f: OUTPUT«Cannot find method 'postcircumfix:<( )>'␤  in sub METAOP_HYPER_CALL at src/gen/m-CORE.setting:19827␤  in block <unit> at /tmp/SZhGllDqck:1␤␤»
20:54 jerzi colomon: I tried that
20:54 moritz nige: what do you mean yb "its origins"?
20:54 moritz nige: it's a term. It's not namespaced
20:54 colomon jerzi: missed your attempt in the backlog.  :)
20:54 nige ah ok
20:55 jerzi colomon: I tried that offline ;) Still wondering why it did not work
20:55 jerzi seemed such a good idea
20:55 nige is there any MOPish incantations you can use to show its term origins?
20:56 moritz jerzi: because >> goes recursively through arrays and hashes, and only tries to dereference once it finds a leaf position
20:56 moritz jerzi: but of course then there's nothing left to to dereference/index
20:56 colomon moritz++
20:56 moritz jerzi: though iirc the current spec says otherwise; rakudo still lags behind a bit
20:57 moritz m: say CORE.keys.grep(/now/)
20:57 camelia rakudo-moar 37b37f: OUTPUT«␤»
20:57 moritz nige: not really
20:57 moritz m: say CORE::.keys.grep(/now/)
20:57 camelia rakudo-moar 37b37f: OUTPUT«&term:<now>␤»
20:57 moritz ah yes
20:57 moritz I just have to do correctly
20:58 nige ok - interesting
20:58 nige so now exists in the CORE namespace
21:00 nige thanks moritz++
21:00 moritz http://perl6advent.wordpress.com/2014/12/10/day-10-introspecting-the-symbol-tables/?preview=true&amp;preview_id=2502&amp;preview_nonce=56bdb7158d preview for tomorrow's post
21:00 moritz feedback/corrections very welcome
21:03 colomon moritz++
21:05 colomon moritz: might need a bit more explanation here?  "Instead of OUTER::<$x>, you can also say $OUTER::x"
21:06 colomon I (think) I got it after thinking a bit, but another sentence or two might be a big help for the non-p6 savvy
21:07 colomon overall that's a great post.  I learned stuff.  :)
21:13 moritz colomon: I've added a small sentence to explain it; if you have a better idea what to add, please do tell :-)
21:15 smls colomon: Ouch, hackernews is not being very charitable in their assessment of my advent post.
21:15 smls (...or the Perl 6 syntax demonstrated therein)
21:17 moritz smls: well, some of that is pretty dense, so it's generally not so well accessible for outsiders
21:19 jerzi thanks for answering my questions
21:19 jerzi https://codereview.stackexchange.com/questions/72123/perl-6-oneliner-to-sum-up-all-numbers-in-a-text-file reason why I was asking
21:21 colomon moritz: is that the right explanation?  I was imagining them as two separate mechanisms for solving the same problem that happened to look kind of similiar.  But I may be completely full of it.
21:21 colomon smls: hackernews is full of it.  It's a fine post.
21:22 smls moritz: I could have explained thing in more details for people with no Perl background, but I was already worried that the post was getting a little long.
21:22 arnsholt Yeah, HN is in many ways kind of narrow-minded
21:23 arnsholt Which is actually a bit hilarious, seeing how it's supposed to be all "disruptive" and stuff =)
21:23 moritz smls: no worry, it was fine
21:23 moritz smls: it has 27 upvotes, and a few negative comments
21:25 timo1 joined #perl6
21:25 PerlJam smls: your post was excellent as far as I'm concerned
21:25 PerlJam smls++
21:25 masak so... jnthn is doing Thursday?
21:27 treehug88 joined #perl6
21:28 zakharyas joined #perl6
21:33 masak smls++ # http://perl6advent.wordpress.com/2014/12/09/day-9-data-munging-in-perl-6-vs-perl-5/
21:33 masak 'night, #perl6
21:33 colomon \o
21:33 timotimo wow, look at that peak in visitor counts
21:34 vendethiel timotimo: numbers? :)
21:35 timotimo "have you seen the upgraded stats page? show me!"
21:35 * timotimo clicks
21:35 timotimo are you *fucking* *kidding* *me*
21:36 timotimo dec 9 has 2k views by 1.2k visitors
21:36 [Coke] ?
21:36 timotimo dec 8 had 900 views by 370 visitors
21:36 brrt joined #perl6
21:36 timotimo the best day before dec 9 was 1.8k views by 1.5k visitors
21:37 bauerbob joined #perl6
21:37 timotimo today's post has been hackernewsed
21:37 vendethiel has it been? link?
21:37 [Coke] ah
21:37 vendethiel https://news.ycombinator.com/item?id=8724727
21:37 treehug88 joined #perl6
21:38 timotimo someone needs to point out that the whatever star is not "special syntax to get a one-argument lambda"
21:38 brrt how did i get the HOW magic thingies again for something
21:39 brrt m: say "Foo".^HOW
21:39 camelia rakudo-moar 37b37f: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/C4rTvRwl6mâ�¤Cannot use .^ on a non-identifier method callâ�¤at /tmp/C4rTvRwl6m:1â�¤------> [32msay "Foo".^HOW[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        method argumentsâ�¤Â»
21:39 smls http://i.imgur.com/6eJAcRY.png  # screenshot of visitor stats, for those who don't have login access to the advent blog backend
21:40 timotimo very civil conversation, i see
21:40 hoelzro timotimo: someone should also point out that Scala has this too
21:40 geekosaur m: say "Foo".HOW
21:40 camelia rakudo-moar 37b37f: OUTPUT«Perl6::Metamodel::ClassHOW.new()␤»
21:40 brrt yes, very nice
21:40 smls someone should tell them that the Whatever-star is a term, not an operator... :)
21:40 geekosaur hm
21:40 timotimo hoelzro: but scala is also a horrible horrible language! :)
21:41 hoelzro is it?
21:41 * hoelzro didn't know
21:41 timotimo it's also the duke nukem forever of languages! er, and ... it's slow!
21:41 timotimo and it uses lots of ram!
21:42 brrt totally unlike perl6 of course
21:42 smls I don't haven't learned Scala, but from the what I've seen of and heard about it, I thought it was one of the better ones?
21:42 brrt geekosaur: but but what happened to the .^ syntax
21:42 timotimo don't haven't ... so you did do learn it?
21:42 timotimo yes, scala is generally well-liked
21:43 smls tsk, I seem to be a little typing impaired today
21:43 timotimo a friend of mine is in a not entirely unsimilar position compared to me
21:43 geekosaur brrt: I think the point is applying HOW directly to a container gets you the container and not the value?
21:43 timotimo so kind of sort of core developer
21:43 geekosaur I don't recall
21:43 brrt m: my @a = 1,2,3; say @a.^HOW;
21:43 camelia rakudo-moar 37b37f: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/5PE_b145htâ�¤Cannot use .^ on a non-identifier method callâ�¤at /tmp/5PE_b145ht:1â�¤------> [32mmy @a = 1,2,3; say @a.^HOW[33mâ��[31m;[0mâ�¤    expecting any of:â�¤        method argumentsâ�¤Â»
21:43 timotimo HOW is a regular method
21:43 geekosaur m: my $a = 'foo'; say $a.HOW; say $a.^HOW
21:43 camelia rakudo-moar 37b37f: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/a7YCpBGE8hâ�¤Cannot use .^ on a non-identifier method callâ�¤at /tmp/a7YCpBGE8h:1â�¤------> [32mmy $a = 'foo'; say $a.HOW; say $a.^HOW[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        method…»
21:43 geekosaur hm
21:43 brrt m: my @a = 1,2,3; say @a.HOW;
21:43 camelia rakudo-moar 37b37f: OUTPUT«Perl6::Metamodel::ClassHOW.new()␤»
21:43 geekosaur oh, methods
21:44 timotimo .^ is the syntax you use to get the .HOW and the instance passed as first argument to the method
21:44 brrt my @a = 1,2,3; say @a.^methods;
21:44 brrt m: my @a = 1,2,3; say @a.^methods;
21:44 camelia rakudo-moar 37b37f: OUTPUT«new bind_pos delete_pos flattens name of default dynamic REIFY STORE PARAMETERIZE_TYPE at_pos assign_pos perl new Bool Int end fmt flat list lol flattens Capture Parcel Supply eager elems exists_pos gimme infinite iterator munch pick pop shift plan roll re…»
21:45 brrt timotimo: i don't get that at /all/
21:45 brrt (mostly a civil discussion, not all the way totally civil)
21:47 geekosaur I knew/understood this once. I'm totally discombobulated today...
21:47 FROGGS_ foo.^bar(baz) is identical to foo.HOW.bar(foo, baz)
21:48 FROGGS_ m: say Int.^name
21:48 camelia rakudo-moar 37b37f: OUTPUT«Int␤»
21:48 FROGGS_ m: say Int.HOW.name(Int)
21:48 camelia rakudo-moar 37b37f: OUTPUT«Int␤»
21:48 brrt ahaaah
21:48 FROGGS_ it is a shortcut
21:48 brrt i see
21:49 FROGGS_ and ^ point upwards to the HOW
21:50 timotimo brrt: oh *that*; i was about to apologize for my very poorly formulated explanation of .^
21:50 brrt :-)
21:50 brrt m: .say for dir().shift.lines;
21:50 camelia rakudo-moar 37b37f: OUTPUT«Failure.new(exception => X::IO::Directory.new(path => q|rakudo-inst-2|.IO(:SPEC(IO::Spec::Unix),:CWD</home/camelia>), trying => "open", use => Any, os-error => Any))␤»
21:51 brrt nice
21:51 timotimo damn, i think i messed up the TERM variable again before starting weechat
21:57 konsolebox joined #perl6
22:01 jerzi m: my @arr; "dog @arr[0] cat"
22:01 camelia rakudo-moar 37b37f: OUTPUT«use of uninitialized value @arr of type Any in string context  in block <unit> at /tmp/Ysy1O8Z8q8:1␤␤»
22:01 jerzi know any way to silence the warning? "use of uninitialized value @arr of type Any in string context"
22:02 timotimo sure, you can {@arr[0].gist} or {@arr[0].perl}
22:03 jerzi and if I want to still get the same result from the expression?
22:03 jerzi m: my @arr; say "dog @arr[0] cat"
22:03 camelia rakudo-moar 37b37f: OUTPUT«use of uninitialized value @arr of type Any in string context  in block <unit> at /tmp/shDYuFpEYy:1␤␤dog  cat␤»
22:03 jerzi m: my @arr; say "dog {@arr[0].gist} cat"
22:03 camelia rakudo-moar 37b37f: OUTPUT«dog (Any) cat␤»
22:03 timotimo in that case, you can use "dog { @arr[0] // "" } cat"
22:05 jerzi http://doc.perl6.org/language/operators#infix_%2F%2F oh, good to know
22:05 timotimo yup, // is cool
22:05 andreoss joined #perl6
22:06 brrt left #perl6
22:06 TimToady m: say ( {'a' => 4}, {'a' => 5} )»<a>
22:06 camelia rakudo-moar 37b37f: OUTPUT«4 5␤»
22:06 TimToady seems to work fine if you don't put the .
22:07 andreoss (! $all-of-them == 0) is not the same as ($all-of-them != 0). why? . $all-of-them is all(...).
22:07 * timotimo doesn't see the original code
22:08 timotimo m: say all( 1, 2, 3) != 0
22:08 camelia rakudo-moar 37b37f: OUTPUT«True␤»
22:08 timotimo m: say (all( 1, 2, 3) != 0).perl
22:08 camelia rakudo-moar 37b37f: OUTPUT«Bool::True␤»
22:08 timotimo er
22:08 timotimo m: say (all( 1, 2, 3 ) == 0).perl
22:08 camelia rakudo-moar 37b37f: OUTPUT«all(Bool::False, Bool::False, Bool::False)␤»
22:08 timotimo what terrifying magic does != cause?
22:09 timotimo did i accidentally break that when i tried to improve METAOP_NEGATE?
22:11 timotimo um, != is just callstatic &infix:<!=> so it's at least not my fault
22:11 moritz negated ops are special-cased wrt junctions
22:11 moritz so that it behaves more like !(all(1, 2,3) == 0)
22:11 timotimo oh, it's that thing
22:11 timotimo i think at some point i was annoyed about that rule
22:12 timotimo i don't remember if i came around, though
22:12 timotimo anyway, i'll be off :)
22:12 moritz feather replacement is now running.
22:12 timotimo i'll give you my ssh public key some time this week :)
22:13 moritz ok
22:13 * moritz will probably blog/mail about it tomorrow
22:13 moritz the www server is also running, though not yet configured
22:14 timotimo thank you for your organisational efforts and everything! :)
22:14 andreoss http://fpaste.org/158144/16320714/
22:14 moritz I'll build the high-risk virtual machine when necessary
22:14 moritz timotimo: you're welcome
22:15 timotimo andreoss: you may be interested in how the [&&] operator works
22:17 andreoss why not || ?
22:17 moritz m: sub is-prime(Int $x) { so $x %% none(2..($x-1)) }; say grep &is-prime, ^20
22:17 camelia rakudo-moar 37b37f: OUTPUT«0 1 2 3 5 7 11 13 17 19␤»
22:17 timotimo because i'm tired and at least a small part of my brain is already in bed
22:18 timotimo moritz' solution looks good
22:18 andreoss does the negation of all() implies any() or none() ?
22:19 TimToady neither
22:19 timotimo oh btw
22:19 timotimo https://twitter.com/raocl/status/542360594737688578 ← we have a new nice little benchmark
22:19 timotimo go wild
22:21 timotimo please.
22:21 timotimo and make me proud :)
22:30 gtodd m:  my @arr; for  "11/22/14    21:00:00    5,854   2,105   1,290\n11/22/14    21:02:35    7,692   2,593   2,649\n11/22/14    21:05:10    1,639   5,458   9,444".lines {  push @arr, [$_.trans("\,"=>"").split(/\s+/)]; }; for 2..4 -> $col { say  [@arr[*;$col].sort(-*)][0] }
22:30 camelia rakudo-moar 37b37f: OUTPUT«7692␤5458␤9444␤»
22:30 gtodd oops
22:31 gtodd timotimo: so we need to get it to go faster before you wake up ? :-)
22:35 andreoss R has junctions too, but somehow perl6 all() acts like R any()
22:41 andreoss in R: ! any( ... == x )  === all( ... != y )
22:42 dalek doc: 1695b5c | raydiak++ | lib/Type/Str.pod:
22:42 dalek doc: Tiny adjustment for example consistency
22:42 dalek doc: review: https://github.com/perl6/doc/commit/1695b5cb56
22:47 aborazmeh joined #perl6
22:49 aborazmeh joined #perl6
22:50 andreoss left #perl6
22:52 ab5tract joined #perl6
22:54 ab5tract o/
22:54 raydiak \o
22:55 nige joined #perl6
22:55 robinsmidsrod joined #perl6
22:55 ab5tract how's it going raydiak?
22:56 smls moritz: "Finally, methods live in a classes or roles, and" -- typo
22:57 smls moritz: "Outer lexicals are accessible through the OUTER:: pseudo package:" -- Will everyone understand what an "outer lexical" is without explanation?
22:58 dalek mu: da1d983 | jonathan++ | misc/perl6advent-2014/schedule:
22:58 dalek mu: Update schedule
22:58 dalek mu: review: https://github.com/perl6/mu/commit/da1d9832a4
22:58 jnthn I've taken 11th. I've got a start on something, and will finish it after tomorrow's teaching.
22:58 smls moritz: "It's list, because it includes methods from superclasses"  -- missing "a"
22:58 ab5tract smls: your blog post was great :)
22:59 smls thanks :)
22:59 ab5tract i was thinking about backporting your code example style into my post
23:00 smls moritz: ".^methods(:all) includes methods from all superclasses, with the :all, methods from classes Cool, Any and Mu." -- confusing sentence structure
23:00 smls moritz++  # informative (draft) advent post
23:01 smls (and linking to relevant p6doc pages, which maybe I should have done in mine, too...)
23:02 sjohnson joined #perl6
23:10 jnthn Time for some sleep. Evidently the smls++ blog post should be my morning read while on the metro to the butthole of nowhere to teach tomorrow... :) 'night
23:11 raydiak not too bad ab5tract, planning world domination w/math::symbolic n'stuff...what are you up to?
23:12 ab5tract i spent a bit of last night hacking up an example for a potential followup to my advent post
23:12 ab5tract https://gist.github.com/ab5tract/e73592ae73516477a522
23:13 BenGoldberg joined #perl6
23:14 raydiak oh nice
23:16 raydiak I haven't kept up on the advent posts (or any of my regular reading), but I read yours b/c the picture hooked me :)
23:16 ab5tract hehe
23:20 ab5tract i've been feeling like the entire idea could use a little more excplication. the post maintained it's original diatribe-ish character, and went a bit tangential on the YAPAE
23:21 ab5tract i'm still developing these ideas a bit
23:23 ab5tract but in the meantime, coercion could use a more practically minded post
23:27 raydiak sorry my attention is a bit divided atm
23:27 raydiak I liked how the original post had a casual sort of exploratory feel
23:27 pecastro joined #perl6
23:28 raydiak but I see how you could have more content in another way with a direct approach and less story
23:34 raydiak definitely coercion in general would be nice to know about...I don't even know what the state of coercion support in rakudo is these days
23:40 ab5tract I'm glad you liked it. re: coercion, it's an interesting point where sugar happens. what i was attempting was to point out that sugar no longer immediately implies magic in perl6
23:41 leedo_ i'm trying to find a better way to do something like this: @a = <a b c>; (@a.pick(*) Z @a).hash
23:41 ab5tract m: %( this => "does", coerce => "yes?" )
23:41 camelia rakudo-moar 37b37f: ( no output )
23:41 leedo_ but i want to make sure an element doesn't get matched with itself
23:41 ab5tract m: %( this => "does", coerce => "yes?" ).say
23:41 camelia rakudo-moar 37b37f: OUTPUT«"coerce" => "yes?", "this" => "does"␤»
23:43 ab5tract the support seems to be where you would expect it. but the lines can still be fuzzy. for instance i'm now unsure as to whether %() is a composer sugar or a coercer sugar ..
23:44 ab5tract but in the sense that you can create specialized coercions to any type just by writing a method on your class
23:44 ab5tract it seems to be all there :)
23:51 grettis joined #perl6
23:56 ab5tract in the meantime, something i couldn't help writing tonight: sub snow($col) { for 0..Inf { say [~] [ '❆ ','❄ ', '❅ ', ' ' xx 80 ].Bag.roll($col); } }; snow(150)

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

Perl 6 | Reference Documentation | Rakudo