Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2011-12-02

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:16 gfldex joined #perl6
00:17 arlinius joined #perl6
00:27 cognominal_ jnthn++
00:33 betterworld joined #perl6
00:36 arlinius joined #perl6
00:39 djanatyn okay, I've been incredibly lazy
00:40 djanatyn let's get to work on faq.perl6.org
00:41 ascent_ joined #perl6
00:45 jaldhar joined #perl6
01:00 tokuhirom joined #perl6
01:08 plutoid joined #perl6
01:08 benabik joined #perl6
01:10 woosley joined #perl6
01:12 mkramer joined #perl6
01:14 mkramer1 joined #perl6
01:25 sivoais joined #perl6
01:25 mkramer joined #perl6
01:38 mkramer joined #perl6
01:40 mkramer joined #perl6
01:45 whiteknight joined #perl6
01:51 am0c joined #perl6
02:00 mkramer joined #perl6
02:10 djanatyn moritz: mowyw is cool :D
02:16 wolfman2000 joined #perl6
02:17 mkramer joined #perl6
02:36 felher joined #perl6
02:36 mkramer joined #perl6
02:49 satyavvd joined #perl6
02:51 mkramer joined #perl6
02:54 mkramer joined #perl6
03:06 mkramer1 joined #perl6
03:10 ilogger2 joined #perl6
03:13 ethndbst joined #perl6
03:20 alvis joined #perl6
03:39 mkramer joined #perl6
03:41 molaf joined #perl6
04:10 lestrrat joined #perl6
04:14 mkramer joined #perl6
04:18 mkramer joined #perl6
04:21 mkramer1 joined #perl6
04:25 sorear good * #perl6
04:27 sorear TimToady: +1 to correctness first and having + not do overflowing stuff by default
04:28 mkramer joined #perl6
04:31 kaleem joined #perl6
04:48 mkramer joined #perl6
05:01 mkramer joined #perl6
05:10 mkramer left #perl6
05:11 * sorear wants talk (with TimToady or anyone) about w and XID_{Start,Continue}
05:12 PerlJam sorear: I'd talk but I have no idea what you're talking about   :)
05:12 PerlJam What's XID_{Start,Continue}
05:19 lestrrat joined #perl6
05:26 sorear PerlJam: http://www.unicode.org/reports/tr31/
05:27 mkramer1 joined #perl6
05:27 woosley joined #perl6
05:28 PerlJam Ah, I see.
05:28 sorear basically, I want $spin̈al to parse
05:29 sorear currently STD is using approximately <alpha> \w*
05:29 moritz djanatyn: glad you like it
05:29 moritz good morning
05:29 sorear o/ djanatyn
05:29 sorear o/ moritz I mean
05:30 sorear the problem is the U+0308 COMBINING DIAERESIS in the middle
05:30 PerlJam \w doesn't match it but you think it should
05:30 sorear the Official Unicode Solution, as described in tr31, is to consider (most) combining characters to be \p{XID_Continue}
05:31 sorear XID_Continue fills the same role as \w
05:31 sorear however it seems ... slightly wrong ... to have "\u0308" ~~ /\w/ be true
05:31 moritz .u U+0308
05:31 phenny moritz: Sorry, no results
05:32 djanatyn trying to get faq.perl6.org looking nice >_>
05:32 djanatyn been experimenting for quite a while
05:32 sorear another option would be to change STD to use XID_Start and XID_Continue and leave alpha and \w exactly as they are
05:32 djanatyn also realized I'm horrible at CSS :)
05:32 sorear which is _probably_ better
05:33 sorear I really need to talk to TimToady on this one I think
05:33 PerlJam yeah, probably.
05:33 sorear .u 0308
05:33 phenny U+0308 COMBINING DIAERESIS (◌̈)
05:33 sorear oh wow, I even spelled it right \o/
05:33 PerlJam but what you've said so far makes sense and I agree and the change to STD you just mentioned is what I would probably do  :)
05:34 PerlJam Is there a way to make is match \w but only if it's combined?
05:34 PerlJam s/is/it/
05:34 moritz sorear: in p5, it does match \w
05:35 PerlJam really?
05:35 * PerlJam tries
05:35 moritz perl -wE 'say "\x{0308}" ~~ /\w/'
05:36 Chillance joined #perl6
05:36 PerlJam That does seem weird and slightly wrong though
05:37 dalek book: 7ffba6e | moritz++ | src/operators.pod:
05:37 dalek book: fix typo, (David Romano)++
05:37 dalek book: review: https://github.com/perl6/book/commit/7ffba6efc6
05:37 * moritz finds that it DWIMs
05:38 PerlJam I'd never want an isolated combining to match \w
05:38 PerlJam combining char
05:39 moritz but you want to match words as \w+, no?
05:39 sorear a related question is whether we want STD.pm6 to be running in grapheme mode
05:39 PerlJam moritz: ah yes, I see your point.
05:40 TimToady it's not clear that \w can operate correctly in codepoint mode, which is why we want to be in grapheme mode most of the time
05:41 sorear TimToady: it is unclear to me what \w means in grapheme mode
05:42 djanatyn http://i.imgur.com/dlGHL.png -- any suggestions for how to improve this?
05:42 TimToady it means the base char matches \w, and you ignore marks
05:42 djanatyn (http://faq.perl6.org/)
05:43 djanatyn trying to make it prettier! :D
05:43 TimToady but \w matches the whole grapheme, so you don't have to skip the combining codepoints explicitly
05:44 PerlJam djanatyn: that looks pretty enough for me :)
05:45 sorear TimToady: what if there is no base char?
05:46 PerlJam djanatyn: though now that I think about it for another second or two, I'd like to see the code sections boxed off and syntax highlighted
05:46 sorear TimToady: I'm thinking especially of Hangul
05:46 sorear "obviously", Hangul grapheme clusters should be \w and CRLF grapheme clusters should be \W
05:46 sorear but I'd like to have something more formal
05:47 djanatyn PerlJam: okay, I'll work on that
05:47 djanatyn dunno about syntax highlighting, but I can certainly box them off
05:48 sorear on a more meta level I'm worried about reinventing TR31 badly.  Square wheels and all that.
05:48 PerlJam djanatyn++
05:48 djanatyn :D
05:49 TimToady well, there's also the possibility of reinventing TR31 goodly...
05:49 TimToady sometimes the tail wags the dog
05:50 TimToady correctness first, then standards compliance :)
05:59 sorear I maintain that the concept of a "base character of a grapheme" is ill-defined.
06:00 djanatyn boxing was too tricky, because the answers use <code> tags all over the place and I don't want to edit them
06:01 djanatyn so I tried to make the code stand out like this: http://i.imgur.com/mAIoH.png
06:01 PerlJam djanatyn: nice
06:01 djanatyn also, looks like the shadows work on firefox
06:01 djanatyn okay, I'm tired
06:01 djanatyn and I have school in a few hours
06:01 PerlJam djanatyn: when will this new look be rolling out?
06:02 djanatyn PerlJam: in a few minutes, if you guys help me :D
06:02 PerlJam djanatyn++
06:03 djanatyn yeah, all I need to do is, uhh, submit one file to https://github.com/perl6/faq and get them to run the script again
06:03 djanatyn the hard work was done before I even started
06:07 mkramer joined #perl6
06:10 mkramer joined #perl6
06:12 mkramer left #perl6
06:16 Chillance joined #perl6
06:26 djanatyn okay, I'm sorry, but I'm not that familiar with git >_>
06:26 djanatyn could someone walk me through how to make a pull request with this modified file?
06:29 Woodi hmm, clone repository, modify file, git add <file>, git commit, git push ?
06:29 djanatyn oh, maybe.
06:30 Woodi assuming you have rights to push to remote repo
06:30 djanatyn oh, I don't think I can push
06:30 Woodi and yes, maybe :)
06:30 djanatyn it says I need to make a pull request
06:30 Woodi you have user on github ?
06:30 djanatyn Yep.
06:31 Woodi then clone repo on github, clone into your box, modify, push to your repo and someone with right rights will know what to do
06:35 koban joined #perl6
06:40 tadzik joined #perl6
06:41 masak joined #perl6
06:42 felher joined #perl6
06:42 yath joined #perl6
06:45 djanatyn okay, pull request sent
06:46 djanatyn PerlJam: I lied, it won't be done in a few minutes, sorry
06:47 djanatyn there's another process I didn't think about - the pull request has to either be approved or denied, and then somebody has to run that perl script again
06:47 djanatyn but if accepted, it should be live pretty soon
06:47 * moritz looks
06:48 nebuchadnezzar joined #perl6
06:48 djanatyn moritz: :D
06:48 nebuchadnezzar yo
06:49 cognominal_ nom: how(class A {}); my $last; sub how(Mu $class) { exit if (my $nm = $class.HOW.name("")) eq $last;  say $nm; $last = $nm;  how($class.HOW) }
06:49 p6eval nom b9aa5b: OUTPUT«Use of uninitialized value in string context␤A␤Perl6::Metamodel::C​lassHOW␤NQPClassHOW␤KnowHOW␤»
06:52 agentzh joined #perl6
06:52 dalek faq: b17e9b3 | Jonathan++ | web/ (2 files):
06:52 dalek faq: added css for gci
06:52 dalek faq: review: https://github.com/perl6/faq/commit/b17e9b3443
06:52 dalek faq: 5e66efc | moritz++ | web/ (2 files):
06:52 dalek faq: Merge pull request #1 from djanatyn/master
06:52 dalek faq:
06:52 dalek faq: have style!
06:52 dalek faq: review: https://github.com/perl6/faq/commit/5e66efc48f
06:53 djanatyn :D :D :D
06:53 djanatyn that was my first pull request :)
06:53 djanatyn and my first fork
06:53 djanatyn and my first contribution to...open source!
06:53 djanatyn now to sleep :)
06:55 moritz \o/
06:56 dalek faq: e4ee5f6 | moritz++ | answers.md:
06:56 dalek faq: grammar
06:56 dalek faq: review: https://github.com/perl6/faq/commit/e4ee5f6abe
06:58 djanatyn oh, wait. I really need to fix that list >_>
06:58 djanatyn that's not a good thing
06:58 moritz djanatyn: yes, I think so too, but it was good enough to close the GCI task
06:59 djanatyn okay
06:59 djanatyn moritz: what's next? :D
06:59 moritz I also don't really like that the headlines with round corners are indented, but the h3 aren't
06:59 djanatyn I want to do some actual programming
06:59 djanatyn oh yeah, that should be fixed too
07:01 moritz djanatyn: http://www.google-melange.com/gci​/task/view/google/gci2011/7174240 and http://www.google-melange.com/gci​/task/view/google/gci2011/7177376 are about writing code, which I consider "actual programming"
07:03 djanatyn okay, writing tests seems both fun and productive
07:03 * djanatyn claims the first one
07:32 icwiener joined #perl6
07:35 * sorear sleeps, will try to get more info out of w tomorrow
07:38 hundskatt joined #perl6
07:46 am0c joined #perl6
08:27 Trashlord joined #perl6
08:33 tzhs joined #perl6
08:39 moritz nom: multi f(&a, *@b) { }; multi f(*@b) { }; f { $^a }, 1, 2, 3,
08:39 p6eval nom b9aa5b: OUTPUT«Ambiguous dispatch to multi 'f'. Ambiguous candidates had signatures:␤:(Callable &a, Positional @b)␤:(Positional @b)␤␤  in block <anon> at /tmp/IpkWqhNM_W:1␤  in <anon> at /tmp/IpkWqhNM_W:1␤»
08:39 moritz jnthn: that one blocks sort() from working properly
08:40 moritz the sub form, that is
08:45 mj41 joined #perl6
08:54 moritz niecza: say sort { $^a[0] <=> $^b[0] }, ['a', 0], ['foo', 5], ['z', 3]
08:54 p6eval niecza v12-2-geb42dfa: OUTPUT«Use of uninitialized value in string context␤  at /home/p6eval/niecza/lib/CORE.setting line 773 (warn @ 2) ␤  at /home/p6eval/niecza/lib/CORE.setting line 168 (Mu.Str @ 9) ␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /home/p6eval/niecza/lib/CORE.setting l…
08:55 moritz sorear: that looks broken, it seems to try to sort by string somehow
08:59 orafu joined #perl6
09:06 odoacre joined #perl6
09:18 moritz nom: say &join.^does(Callable)
09:18 p6eval nom b9aa5b: OUTPUT«Bool::True␤»
09:23 moritz nom: multi f(&a, *@b) is default { }; multi f(*@b) { }; f { $^a }, 1, 2, 3,
09:23 p6eval nom b9aa5b:  ( no output )
09:24 moritz let's see if that trait works in the setting...
09:31 moritz nope :(
09:31 moritz bootstrapping nastinesses all over
09:43 flussence joined #perl6
09:58 woosley left #perl6
09:58 jnthn morning
09:58 moritz \o jnthn
09:59 jnthn nom: multi f($a, *@b) { }; multi f(*@b) { }; f { $^a }, 1, 2
09:59 p6eval nom b9aa5b: OUTPUT«Ambiguous dispatch to multi 'f'. Ambiguous candidates had signatures:␤:(Any $a, Positional @b)␤:(Positional @b)␤␤  in block <anon> at /tmp/P192VoriDT:1␤  in <anon> at /tmp/P192VoriDT:1␤»
09:59 jnthn hm...was sure that one worked.
09:59 moritz it did, in b
09:59 moritz b: multi f($a, *@b) { }; multi f(*@b) { }; f { $^a }, 1, 2
09:59 p6eval b 1b7dd1: OUTPUT«Ambiguous dispatch to multi 'f'. Ambiguous candidates had signatures:␤:(Any $a, *@b)␤:(*@b)␤␤  in main program body at line 22:/tmp/krakiEkVCh␤»
09:59 moritz huh.
10:00 moritz b: multi f(&a, *@b) { }; multi f(*@b) { }; f { $^a }, 1, 2
10:00 p6eval b 1b7dd1: OUTPUT«Ambiguous dispatch to multi 'f'. Ambiguous candidates had signatures:␤:(&a, *@b)␤:(*@b)␤␤  in main program body at line 22:/tmp/kbGHzOVY9U␤»
10:00 moritz hm
10:01 jnthn Apparently not...
10:02 jnthn Will have a look, though should work on advent calendar first.
10:02 moritz I was pretty sure I had copied the lines for &sort from src/old/, but I might have been mistaken
10:03 moritz I have a workaround now, which fixes many tests in sort.t
10:04 moritz just waiting for the spectest to finish
10:05 jnthn TimToady: Pondered the native op/overflow thing. How about if the native ops throw *immediately* if the result will overflow? That way we catch overflows, don't have to do some nasty trickery with the return type, and "no strict :overflow" just imports a set of multi candidates that don't do the overflow check.
10:06 moritz but how do you catch overflow?
10:07 moritz by doing the calculation in Int space, and then trying to unbox?
10:11 jnthn moritz: I was thinking a set of opcodes that do the checking, CLR style.
10:12 * moritz wishes the carry flag from the CPU was easily available in parrot
10:12 mkramer joined #perl6
10:13 dalek rakudo/nom: 3c862ba | moritz++ | src/core/Any.pm:
10:13 dalek rakudo/nom: fix &sort with a closure
10:13 dalek rakudo/nom:
10:13 dalek rakudo/nom: works around a multi dispatch limitation
10:13 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3c862bad8f
10:13 dalek rakudo/nom: 4c311bf | moritz++ | t/spectest.data:
10:13 dalek rakudo/nom: run a test file that had regressed on &sort with closure
10:13 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/4c311bf518
10:13 dalek roast: 336ec16 | moritz++ | S32-list/sort.t:
10:13 dalek roast: unfudge &sort tests for rakudo
10:13 dalek roast: review: https://github.com/perl6/roast/commit/336ec16995
10:18 alvis joined #perl6
10:20 moritz nom: sub f() { my $a := pir::find_caller_lex__Ps('$/'); $a = 5; }; f; say $/
10:20 p6eval nom b9aa5b: OUTPUT«5␤»
10:22 jnthn pir::find_caller_lex__Ps('$/') = 5 # should also work
10:22 moritz I know it does :-)
10:26 moritz nom: augment class Sub { method my_invoke { self() } }; &join.my_invoke
10:26 p6eval nom b9aa5b: OUTPUT«===SORRY!===␤augment not allowed without 'use MONKEY_TYPING' at line 1, near "{ method m"␤»
10:26 moritz nom: use MONKEY_TYPING; augment class Sub { method my_invoke { self() } }; &join.my_invoke
10:26 p6eval nom b9aa5b: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&self' called (line 1)␤»
10:27 moritz jnthn: that seems to be a false positive
10:27 wk_ joined #perl6
10:46 jnthn moritz: Yes and no. If the optimizer is saying that, I bet it actually fails at runtime too, rightly or wrongly.
10:47 jnthn ...and in a dwim sense, almost certainly wrongly :)
10:47 moritz nom: use MONKEY_TYPING; augment class Sub { method my_invoke($self:) { $self() } }; &join.my_invoke
10:47 p6eval nom 4c311b:  ( no output )
10:47 jnthn It's safe as
10:47 jnthn nom: Int()
10:47 p6eval nom 4c311b: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&Int' called (line 1)␤»
10:48 jnthn *same
10:48 moritz seems to be no problem when applied to a Callable:D
10:48 jnthn moritz: Right, it's the term:name case
10:48 moritz erm
10:48 jnthn The self() one is
10:48 moritz we're talking past each other, I think
10:49 jnthn no, term:identifier. But anyway...
10:49 jnthn moritz: The reason $self() works is because it parses as a variable and a postcircumfix.
10:50 moritz hm, even with --optimize=0, the CHECK is done
10:50 jnthn --optimize=off
10:50 jnthn will completely disable it.
10:51 jnthn 0 means "don't transform anything"
10:51 moritz ah right,  Could not find sub &self
10:51 moritz I now see what you mean.
10:52 jnthn :)
10:53 jnthn So, mis-compile rather than optimizer bug.
10:54 dalek rakudo/nom: 676b356 | moritz++ | src/core/Regex.pm:
10:54 dalek rakudo/nom: Regex.ACCEPTS for arrays and hashes
10:54 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/676b3564b3
10:54 jnthn moritz: File a ticket for it if you didn't already.
10:55 * jnthn plans to have a crack at some ticket queue items during the weekend.
10:55 dalek roast: 827e592 | moritz++ | S (2 files):
10:55 dalek roast: rakudo un/refudges
10:55 dalek roast: review: https://github.com/perl6/roast/commit/827e5921ad
10:55 moritz jnthn: I'd find a stab at autovivification much more useful :-)
10:57 jnthn moritz: Let's see if pmichaud++'s next-week tuits materialize, then I can ask what he thinks that stab should look like, which will probably be more efficient than trying to figure it from what's done so far. :)
10:58 moritz jnthn: sounds good
10:59 jnthn I really want to get arrays in native call back in place by the end of the weekend too, so the mysql stuff can work again.
11:00 moritz that would be really cool
11:01 wk joined #perl6
11:01 moritz will it invove Array[int] working too? :-)
11:03 wk__ joined #perl6
11:03 jnthn moritz: I'm not sure it *will* be Array[int] (more)
11:03 moritz right
11:03 jnthn I asked a while ago it native arrays wanted to be lazy and the answer was "probably not"
11:03 jnthn Or some such :)
11:03 jnthn Since Array *is* lazy, we probably really want some kind of PackedArray[int]
11:03 moritz also I wonder how Array can be both an array and a parametric role at the same time
11:04 jnthn Then we find a way to make "my int @foo;" use that
11:04 jnthn moritz: Yes, that's also a fun issue.
11:12 dalek roast: a850bf0 | moritz++ | S32-scalar/undef.t:
11:12 dalek roast: simplify tests
11:12 dalek roast: review: https://github.com/perl6/roast/commit/a850bf0a22
11:13 moritz nom: say ''<foo>.WHAT
11:13 p6eval nom 4c311b: OUTPUT«Method 'at_key' not found for invocant of class 'Str'␤  in method postcircumfix:<{ }> at src/gen/CORE.setting:1066␤  in block <anon> at /tmp/pCJpob7AFP:1␤  in <anon> at /tmp/pCJpob7AFP:1␤»
11:14 moritz pugs: say ''<foo>.WHAT
11:14 p6eval pugs b927740: OUTPUT«*** Odd number of elements found where hash expected: VStr ""␤    at /tmp/nooRK1Nq0C line 1, column 5 - line 2, column 1␤»
11:14 moritz niecza: say ''<foo>.WHAT
11:14 p6eval niecza v12-2-geb42dfa: OUTPUT«Unhandled exception: Cannot use hash access on an object of type Str␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /home/p6eval/niecza/lib/CORE.setting line 248 (Any.at_key @ 6) ␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /tmp/J0HwqlN7ly line 1 (mainline…
11:14 moritz hm, all three implementations agree
11:14 moritz then I'll change the test
11:16 dalek roast: 5fbb323 | moritz++ | S02-literals/listquote.t:
11:16 dalek roast: update a test to fit current understanding
11:16 dalek roast: review: https://github.com/perl6/roast/commit/5fbb323d52
11:18 moritz perl6: say :foo < 3
11:18 p6eval niecza v12-2-geb42dfa: OUTPUT«Unhandled exception: Cannot use value like Pair as a number␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /home/p6eval/niecza/lib/CORE.setting line 190 (Any.Numeric @ 4) ␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /tmp/XujAJMDKPy line 1 (mainline @ 1) ␤ …
11:18 p6eval ..rakudo 4c311b: OUTPUT«No applicable candidates found to dispatch to for 'Real'. Available candidates are:␤:(Mu, Mu %_)␤␤  in method Real at src/gen/CORE.setting:639␤  in sub infix:<<> at src/gen/CORE.setting:2110␤  in block <anon> at /tmp/lXu_zbyPQA:1␤  in <anon> at /tmp/lXu_zbyPQA:1␤»…
11:18 p6eval ..pugs b927740: OUTPUT«*** ␤    Unexpected end of input␤    expecting "\\", variable name, ">" or "<"␤    at /tmp/WSIuo2qt5_ line 2, column 1␤»
11:21 moritz there was an old spec item that a List in scalar context becomes a Capture (or so)
11:21 moritz is that still current thinking?
11:23 moritz I guess not...
11:24 dalek roast: 56fb51b | moritz++ | S02-literals/listquote.t:
11:24 dalek roast: correct and re-fudge list and Parcel tests
11:24 dalek roast: review: https://github.com/perl6/roast/commit/56fb51b944
11:24 daxim joined #perl6
11:34 moritz nom: role A::B { }; say A::B.gist
11:34 p6eval nom 676b35: OUTPUT«A::B()␤»
11:34 moritz nom: package A { role B { } }; say A::B.gist
11:34 p6eval nom 676b35: OUTPUT«B()␤»
11:34 cognominal___ joined #perl6
11:34 moritz there's a test in S14-roles/namespaced.t that expects the first one to be just B() too
11:34 moritz is that still right?
11:37 moritz nom: use fatal; fail(); say 'alive'
11:37 p6eval nom 676b35: OUTPUT«alive␤»
11:38 moritz nom: use fatal; say $*FATAL;
11:38 p6eval nom 676b35: OUTPUT«Bool::True␤»
11:38 moritz nom: say $*FATAL;
11:38 p6eval nom 676b35: OUTPUT«Failure.new()␤»
11:38 jnthn moritz: Not sure, I could argue it both ways. It's trivial to change it to just be B() if that's what is wanted.
11:39 jnthn oh
11:39 am0c joined #perl6
11:39 jnthn Well, the sepc I think said what .WHAT gives stringifies to the short name.
11:40 * jnthn tries to find
11:40 moritz I vaguely recall that too, but I always found that a bit weird
11:40 jnthn WHAT        the type object of the type, .gist returns MyClass()
11:40 jnthn WHICH       the object's identity value
11:40 jnthn WHO         the package supporting the object, stringifies to long name
11:40 jnthn It calls out WHO as giving the long name.
11:41 moritz so we should really be debugging with WHO instead of WHAT?
11:41 cognominal_ joined #perl6
11:41 * moritz wonders if cultural pressure can change the spec here
11:41 jnthn moritz: Maybe the short name is often enough :)
11:41 jnthn .WHAT strinfigies to whatever is in .^name, anyway
11:41 jnthn er, gistifies
11:41 jnthn :)
11:42 jnthn And that's just a decision taken when creating the meta-object, so it's easy to change.
11:47 cognominal_ I dont understand why the &name methods in *HOW roles expect an argument and ignore it
11:48 jnthn cognominal_: In class-based OO it's kinda boring.
11:48 jnthn cognominal_: It's more for prototype based OO
11:49 cognominal_ concistency is necessary here?
11:51 cognominal_ *consistency
12:09 mkramer1 joined #perl6
12:10 cognominal_ joined #perl6
12:13 Psyche^ joined #perl6
12:14 koban left #perl6
12:17 cognominal_ my $a; say $a eq ''
12:17 cognominal_ nom:  my $a; say $a eq ''
12:17 p6eval nom 676b35: OUTPUT«Use of uninitialized value in string context␤Bool::True␤»
12:17 cognominal_ is this normal that it complains?
12:22 jnthn believe it's correct, yes
12:37 jnthn http://perl6advent.wordpress.com/2011/1​2/02/grammartracer-and-grammardebugger/
12:37 cosimo joined #perl6
12:37 jnthn lemme know if any typos or thinkos slipped in, but I think I caught 'em all :)
12:39 moritz jnthn++
12:42 moritz jnthn: you might want to turn the first mention of these modules into links to their github repos
12:42 moritz or to the common repo, dunno if they share one
12:43 jnthn moritz: they share 1; I linked to it later
12:51 cognominal_ joined #perl6
12:59 xinming joined #perl6
13:01 bluescreen10 joined #perl6
13:05 moritz nom: my %h = c => 1; say %h ~~ .{'c'}
13:05 p6eval nom 676b35: OUTPUT«Bool::True␤»
13:05 moritz nom: my %h = c => 0; say %h ~~ .{'c'}
13:05 p6eval nom 676b35: OUTPUT«Bool::False␤»
13:09 moritz S03-smarmatch/any-hash-slice.t seems rather out of date
13:22 cognominal___ joined #perl6
13:22 colomon jnthn++
13:25 bluescreen10 joined #perl6
13:26 moritz colomon: dunno if you've seen it yet, here is my draft for tomorrow's advent post: http://moritz.faui2k3.org/tmp/03-binary-io-buf.pod
13:30 colomon moritz++
13:31 moritz wow, we've got 890 visits yesterday
13:31 jnthn wow
13:33 colomon !!!!!
13:36 sftp joined #perl6
13:36 moritz I've just posted my post for tomorrow, will be automatically published at 0630 UTC
13:47 colomon \o/
13:48 colomon do we have a day four yet?  there's nothing on the schedule
13:49 jnthn Seems not yet
13:59 wk joined #perl6
14:10 Sarten-X joined #perl6
14:15 moritz http://moritz.faui2k3.org/tmp/traits.txt # example script to start explaining traits
14:17 [Coke] moritz: ow.
14:19 moritz [Coke]: please be more verbose
14:19 jnthn I thought Elvis only left the building? :)
14:19 moritz well, he need to enter first, no?
14:19 moritz but I can make him leave too
14:19 jnthn :)
14:20 moritz but OTOH we already have a leave function... erm, should have
14:21 jnthn moritz: Another way to do this for something more practical could be to use HTTP::Server::Simple and make something like what you did, but for URL dispatch.
14:21 moritz jnthn: I wanted to mention that, but didn't want to explain the whole code that would be necessary for that
14:22 jnthn moritz: ah, ok
14:23 moritz any nice puns on 'traits'?
14:24 jnthn .oO( character traits )
14:24 moritz traits -- meta data with character
14:24 jnthn :D
14:32 PerlJam moritz++ nice but if you can come up with a less contrived example, that woudl be better IMHO  :)
14:32 sayu joined #perl6
14:33 [Coke] moritz: without comments, I find that code very hard to follow.
14:34 moritz [Coke]: I've already added comments to my local copy
14:34 [Coke] *more* comments, I guess I should said. it's not obvious what you're trying to tell me, especially since I don't know anything about traits in perl6 just yet.
14:34 kaleem joined #perl6
14:35 PerlJam Is there some simple Moose module that uses traits that would be instructive if ported to Perl 6?
14:36 PerlJam (it doesn't have to be Moose, but that and Catalyst are where I tend to see traits used)
14:37 toebu joined #perl6
14:42 colomon jnthn: any progress on the guts that would be needed to make 'is symmetric' work?
14:42 * colomon is wondering about 'is cached' as well...
14:42 PerlJam Is "is cached" memoization?  that would be a nice example.
14:43 moritz hm, that would be nice indeed
14:44 toebu rakudo:  my @x = :yes,:!no;.perl.say for @x;
14:44 p6eval rakudo 676b35: OUTPUT«"yes" => Bool::True␤"no" => Bool::False␤»
14:44 colomon PerlJam: yes
14:44 moritz nom: say sub f { }
14:44 p6eval nom 676b35: OUTPUT«Sub.new()␤»
14:44 colomon PerlJam: I think it might even be spec.  ;)
14:44 moritz nom: say (sub f { }).Str
14:44 p6eval nom 676b35: OUTPUT«f␤»
14:44 toebu nom:  my @x = :yes,:!no;.perl.say for @x;
14:44 p6eval nom 676b35: OUTPUT«"yes" => Bool::True␤"no" => Bool::False␤»
14:44 PerlJam colomon: the spec has too many words for my puny brain  :)
14:45 colomon PerlJam: yeah, I might be dreaming, too.  ;)
14:46 * colomon had a dream this morning which amounted to about the first four chapters of a Tim Powers-style modern fantasy...
14:48 colomon "sub fib is cached" appears in the S06.
14:49 PerlJam aye, I didn't think you were dreaming as I vaguely recalled it was specced too
14:50 jnthn quick and dirty is cached implementation: https://gist.github.com/1423496
14:50 colomon and there's an entire "is cached" description a bit later.  colomon is not delusional in this case!
14:50 moritz I'm sure the postcircumfix args needs a |
14:50 jnthn I'm pretty sure it doesn't :)
14:50 PerlJam jnthn: traits *and* roles!  :)
14:50 colomon jnthn: that works now?!  \o/
14:50 jnthn colomon: yes
14:51 colomon \o/
14:51 moritz jnthn: I'm working on one that uses .wrap
14:51 colomon jnthn++
14:51 colomon etc, etc, etc
14:51 moritz for demonstration purposes, that is
14:51 colomon much joy
14:52 jnthn oh yeah, wrap!
14:52 colomon jnthn: why $r.clone?
14:52 [Coke] jnthn++
14:52 jnthn https://gist.github.com/1423496 now as a working wrap version too
14:52 * colomon had been meaning to check and see if wrap was implemented in nom
14:53 jnthn *has
14:53 moritz colomon: you need to grab a hold of the original routine to be able to invoke it
14:53 jnthn colomon: Because we want to be able to call the original routines without the role mixed in.
14:53 jnthn In theory we should be able to nextsame from postcircumfix:<( )>
14:53 colomon I think we've got another Advent post here.  ;)
14:53 jnthn Though I didn't get that to work just yet
14:53 jnthn (It should be easy enough to...)
14:54 jnthn The wrap one saves having to explain roles etc though
14:54 [Coke] someone ping mjd have have him harden that. ;)
14:54 PerlJam colomon: by my count there are 3 potential posts in this one conversation
14:54 Radvendii joined #perl6
14:54 Radvendii hello?
14:54 [Coke] I wonder if we could get Damian to write something for the calendar.
14:54 PerlJam Radvendii: hi there!
14:54 [Coke] Radvendii: good day.
14:54 moritz http://moritz.faui2k3.org/tmp/cached.txt # independently developed version with wrap
14:54 Radvendii hey. what eactly is this for?
14:54 PerlJam [Coke]: that could be interesting
14:55 moritz but not so nice as jnthn++'s
14:55 PerlJam Radvendii: Perl 6 (a programming languages)
14:55 PerlJam er, language
14:55 jnthn moritz: yeah, should the routine being cached get GC'd we leak its cache storage that way.
14:55 Radvendii right, i got that much. but what within that? any kind of help?
14:55 colomon recursive fib is the perfect example, because you can see a huge speed improvement with  is cached
14:56 moritz jnthn: yes, it also avoids conflicts
14:56 moritz jnthn: (with closures, that is)
14:56 jnthn yeah
14:56 PerlJam Radvendii: do you have Perl 6 questions?
14:56 jnthn that too
14:56 Radvendii about panda specifically (the perl 6 module installer)
14:56 moritz jnthn: like, in the cae of   sub f() is cached { }; { sub f() is cached {} }
14:57 jnthn moritz: *nod*
14:57 Radvendii im getting weird errors trying to install it
14:57 PerlJam Radvendii: what version of Rakudo are you running?
14:57 moritz Radvendii: I don't think it works on nom yet... tadzik should be able to tell you
14:57 colomon afk # playdate
14:57 Radvendii how do i find that out? perl6 -v?
14:58 PerlJam Radvendii: perl6 --version
14:58 jnthn It basically works on "nom", it won't bootstrap though
14:58 jnthn Due to test failure in at least Test::Mock
14:58 Radvendii PerlJam: "version 2011.11-80-gaa15f3a built on parrot 3.10.0 revision RELEASE_3_10_0-77-g6081fbd"
14:58 jnthn moritz: Did you get the 4th test file of JSON::Tiny running?
14:58 toebu rakudo:  { sub x { say 1} } ;x;
14:58 p6eval rakudo 676b35: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&x' called (line 1)␤»
14:58 toebu rakudo:  { our sub x { say 1} } ;x;
14:58 p6eval rakudo 676b35: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&x' called (line 1)␤»
14:58 PerlJam Radvendii: so ... what jnthn said probably.
14:59 toebu nom:  { our sub x { say 1} } ;x;
14:59 p6eval nom 676b35: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&x' called (line 1)␤»
14:59 moritz jnthn: well... emitting of escaped strings is still broken, but the tests were TODOed before already
14:59 Radvendii i dont know abou JSON::Tiny but Test::Mock wont work
14:59 toebu how can I make the sub visible outside the local block ?
14:59 moritz so the tests pass, even though the module is broken-ish :/
14:59 moritz toebu: our sub foo() { ... }
14:59 Radvendii so is there a way of installing panda?
15:00 toebu moritz so rakudo is broken ? see above
15:00 moritz toebu: no, you need to call it differently
15:00 moritz nom: package A { { our sub x { say 1 }; A::x }
15:00 p6eval nom 676b35: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 1␤»
15:01 moritz nom: package A { { our sub x { say 1 } }; A::x }
15:01 p6eval nom 676b35: OUTPUT«1␤»
15:01 moritz toebu: you can also do something like
15:01 moritz nom: my &x; { &x := sub { say 1 } }; x
15:01 p6eval nom 676b35: OUTPUT«1␤»
15:01 Radvendii Is there a solution to the panda installation fail?
15:02 moritz maybe try copying the module files to ~/.perl6/lib yourself
15:02 jnthn Radvendii: What moritz said probably works; also, if you wait a bit, tadzik (panda author) will probably be about and will know the answer.
15:02 toebu moritz: ok to the my &x ... what if there is no package ? ::x ? what is x referring to then ?
15:02 moritz toebu: I don't think there's an implicit package in Perl 6
15:03 jnthn nom: { our sub foo() { say 1 } }; GLOBAL::foo()
15:03 p6eval nom 676b35: OUTPUT«1␤»
15:03 moritz toebu: but... are you sure you can't find a better solution? It's usually design smell if you need that
15:04 * jnthn wonders back to $dayjob-tasks for a bit :)
15:04 toebu moritz: just trying out edge cases
15:04 jnthn *wanders
15:04 moritz toebu: ok
15:04 toebu jnthn: thanks
15:04 toebu in rakudo * 11.07 foo with out GLOBAL worked
15:05 moritz does anybody want to do the advent post on traits, with the 'is cached' example?
15:05 moritz I can it, but I've already written one for tomorrow...
15:05 moritz toebu: yes, spec changed
15:05 Radvendii i also had a question about substitution regex in perl 6: is there an option (s:opt///) that makes it return the modified string rather than modifying the string itself?
15:05 jnthn toebu: Yeah...it wrongly worked, I'm afraid. Rakudo was out of line with the spec.
15:05 toebu grin
15:05 [Coke] ARRRGH. typed "rm *" instead of "rm *~"
15:05 toebu got to update my p6 tutorial then ...
15:05 moritz Radvendii: you can do   $str.subst(/regex/, 'substitution')
15:06 jnthn moritz: If nobody else takes it on, I can. :)
15:06 moritz or you a closure as the substitution
15:06 moritz jnthn: that's nice, but you also had one already; I try not to overwork all of us :-)
15:06 jnthn moritz: Sure, I'd be happy for somebody else to take the idea and do it :)
15:07 jnthn Cconsider me a backup option :)
15:07 Radvendii yeah, but that looks clunky and with options it's even more annoying, is there no way to get it of the form "string" ~~ s:opt/regex/substitution/?
15:07 Radvendii closure as the substituion?
15:07 Radvendii what's that?
15:08 moritz a piece of code that is executed for each substitution
15:08 Radvendii how would that look?
15:08 moritz sub double($x) { $x.subst(:g, /\d+/, { 2 * $/ }) }
15:09 Radvendii but that still requires .subst syntax. . ?
15:10 moritz yes.
15:10 moritz I never said otherwise :-)
15:10 Radvendii dang.
15:12 Radvendii is there a syntax for adding regex options?
15:12 moritz Radvendii: you mean besides convincing TimToady that it belongs into core? :-)
15:13 Radvendii yes, isn't perl 6 supposed to be extendable without changing the core?
15:13 moritz it is, and there is a syntax for that, but it's not yet implemented in any compiler
15:13 jnthn It boils down to creating a Perl 6 sub language.
15:14 Radvendii ah, shucks. alright, thanks guys
15:14 jnthn It will be possible...though in this case, perhaps not necesarily easy.
15:17 toebu rakudo: for 1 ..^ <a b c> -> $n { say $n; }
15:17 p6eval rakudo 676b35: OUTPUT«(timeout)»
15:18 toebu nom: for 1 ..^ <a b c> -> $n { say $n; }
15:18 p6eval nom 676b35: OUTPUT«(timeout)»
15:18 slavik1 joined #perl6
15:18 moritz toebu: 'rakudo' and 'nom' are aliases here
15:18 toebu niecza: for 1 ..^ <a b c> -> $n { say $n; }
15:18 p6eval niecza v12-2-geb42dfa:  ( no output )
15:20 toebu nom: for 1 ..^ <a b c> .elems-> $n { say $n; }
15:20 p6eval nom 676b35: OUTPUT«===SORRY!===␤Missing block at line 1, near ".elems-> $"␤»
15:20 toebu nom: for 1 ..^[ <a b c> ].elems-> $n { say $n; }
15:20 p6eval nom 676b35: OUTPUT«===SORRY!===␤Unsupported use of -> as postfix; in Perl 6 please use either . to call a method, or whitespace to delimit a pointy block at line 1, near " $n { say "␤»
15:20 toebu nom: for 1 ..^ [ <a b c> ].elems-> $n { say $n; }
15:20 p6eval nom 676b35: OUTPUT«===SORRY!===␤Unsupported use of -> as postfix; in Perl 6 please use either . to call a method, or whitespace to delimit a pointy block at line 1, near " $n { say "␤»
15:21 moritz toebu: need whitespace before ->
15:21 toebu nom: for 1 ..^ [ <a b c> ].elems -> $n { say $n; }
15:21 p6eval nom 676b35: OUTPUT«1␤2␤»
15:21 toebu nom: for 1 ..^ [ <a b c> ] -> $n { say $n; }
15:21 moritz that one should be easy-ish to fix
15:21 p6eval nom 676b35: OUTPUT«(timeout)»
15:21 moritz probably just needs a coercion to .Numeric somewhere
15:27 toebu fly away
15:29 moritz hm
15:29 Trashlord joined #perl6
15:30 moritz I know that prefix:<^> needs to coerce to .Numeric
15:30 moritz but I'm not sure about infix ..^
15:30 moritz which allows Str ranges too, iirc
15:30 jnthn I guess it'd follow the same rule as for ranges normally...but I forget exactly what that is.
15:31 moritz I guess it would DWIM to coerce the second argument to Numeric if the first one is numeric too, and the second is neither Whatever nor WhateverCode
15:35 * moritz calls it a day, decommute &
15:37 jnthn o/
15:59 tokuhirom joined #perl6
16:12 MayDaniel joined #perl6
16:38 itz I'm getting an SSL cert issue with git pull from github?
16:40 flussence what URL are you pulling from?
16:43 flussence (fwiw, the website is giving me no errors here and its SSL cert's SHA1 begins "CE 67 99 25")
16:45 * mathw was excited to see the Advent Calendar back
16:45 itz https://github.com/rakudo/rakudo.git
16:45 PerlJam mathw: want to contribute an article or two?
16:46 flussence hm, "git clone https://github.com/rakudo/rakudo.git" works for me...
16:47 itz odd
16:47 PartyJ joined #perl6
16:47 itz maybe I broke my openssl libs or something weird
16:47 TimToady maybe you've been haxored
16:48 mathw PerlJam: I would, but I've not touched Perl 6 for ages, I've been very busy with my new job which has required me to become very good at C# in a very short space of time
16:50 flussence itz: if all else fails, just clone using git:// and verify the last commit SHA1 is the same as on the webpage :)
16:53 itz I ain't afraid of no MIM
16:53 itz MITM even
17:02 TimToady jnthn: re throwing on detecting overflow, that's what I was suggesting at http://irclog.perlgeek.de/​perl6/2011-12-01#i_4780387
17:03 jnthn TimToady: Oh, I thought you still meant "on storage" at that point :)
17:04 jnthn TimToady: It's the (int, int) --> Int thing that I'd really prefer to avoid.
17:04 TimToady and I agree with moritz++ that it'd be nice if we could get the carry flag
17:04 jnthn Well, it's machine specific, afaik.
17:04 jnthn I suspect it's best hidden behind a set of ops. The CLR already has this stuff...on x86 it emits a "jno" or something.
17:05 TimToady C doesn't help us much here though
17:07 jnthn No, sadly not :(
17:08 * jnthn googles and instead manages to get "How to Carry the U.S. Flag"
17:17 kaare_ joined #perl6
17:21 tokuhirom joined #perl6
17:43 fsergot joined #perl6
17:47 donri joined #perl6
17:49 Trashlord joined #perl6
17:54 birdwindupbird joined #perl6
17:54 birdwindupbird left #perl6
17:56 Trashlord joined #perl6
17:58 mathw how... useful
18:05 _twitch joined #perl6
18:10 [Coke] aloha, seen TimToady?
18:10 aloha [Coke]: TimToady was last seen in #perl6 1 hours 5 mins ago saying "C doesn't help us much here though".
18:16 moritz [Coke]: http://moritz.faui2k3.org/tmp/traits.pod is that understandable for somebody who doesn't know much about traits?
18:17 donri is this for advent?
18:17 Kharec joined #perl6
18:18 moritz yes
18:18 donri moritz++
18:19 moritz I'm still hoping that soembody signs up for day 4, but I keep that as a backup (and post it later if not needed now)
18:19 sorear good * #perl6
18:20 [Coke] moritz++ # sehr güt.
18:21 moritz \o/
18:21 sorear [Coke]: once I did rm -rf * in $HOME by mistake.  I think it happens to everytbody at least once.
18:21 donri moritz: how come it matches for ":$cached!"; shouldn't "cache" be a role or something?
18:22 donri I have alias rm=trash-put
18:22 sorear mathw: if you're a C# expert who wants to contribute, how about Niecza instead of Advent-Calendar? :D
18:25 donri like https://github.com/masak/web/b​lob/master/lib/LolDispatch.pm
18:25 flussence (speaking of disasters, I've done some horrible things at $dayjob... like accidentally wiping a partition table)
18:26 sorear std: method () { self }
18:26 p6eval std be1f10e: OUTPUT«ok 00:01 120m␤»
18:26 sorear std: method () { self() }
18:26 p6eval std be1f10e: OUTPUT«[31m===[0mSORRY![31m===[0m�Undeclared routine:� 'self' used at line 1�Check failed�FAILED 00:01 120m�»
18:26 sorear How do I post comments on bugs?  Just reply to the mail?
18:26 donri oh i see, it's the difference between trait_mod and trait_auxilliary?
18:27 [Coke] flussence: my worst was nuking the NIS+ master server and then making it replicate to all the remote servers. that was fun.
18:27 [Coke] sorear: with RT?
18:27 sorear [Coke]: yes
18:27 sorear #105186
18:27 [Coke] (if so, yes, or you can login to the website and comment there; but if you do that, be sure to hit the cc the list button)
18:28 sorear what address do I need to send the reply to?  does RT read p6c?
18:29 PerlJam moritz: you have the %cache scoped poorly
18:30 * sorear is thinking perl6-bugs-followup@ needs to get the mail
18:31 dalek roast: 15f65f0 | coke++ | integration/99problems-41-to-50.t:
18:31 dalek roast: Update blocker description
18:31 dalek roast: review: https://github.com/perl6/roast/commit/15f65f0696
18:31 dalek roast: 5e5122b | coke++ | S05-match/arrayhash.t:
18:31 dalek roast: unfudge for rakudo/nom
18:31 dalek roast: review: https://github.com/perl6/roast/commit/5e5122ba22
18:31 Kharec left #perl6
18:31 * sorear pokes [Coke]
18:32 [Coke] sorear: yes, that one. but if you email it and don't cc the list, it's just a comment on the ticket, and only RT viewers will see it. (I think.)
18:32 * [Coke] would just reply all at that point.
18:32 sorear [Coke]: I tried reply all, mutt set To: p6c, Cc: empty
18:32 sorear I think I need to change one or the other
18:33 [Coke] I can't fix your mail client. ;)
18:33 [Coke] let me see what gmail does.
18:33 sorear [Coke]: I'm not asking you to fix mutt
18:33 sorear [Coke]: I'm just asking what I need to have in To: and Cc:
18:33 [Coke] sorear: that was not a serious statement. see the smiley.
18:34 [Coke] All I can tell you is what /my/ mail client does. which I'm about to do .
18:34 [Coke] to: perl6-compiler@perl.org, perl6-compiler@perl.org
18:34 sorear ah.
18:34 [Coke] cc: bugs-bitbucket@rt.perl.org
18:34 [Coke] why gmail dups it, I have no idea. Enjoy.
18:34 tyatpi joined #perl6
18:35 sorear thanks
18:45 Trashlord joined #perl6
19:06 Trashlord joined #perl6
19:12 Trashlord joined #perl6
19:17 kmwallio joined #perl6
19:21 mkramer joined #perl6
19:21 mkramer left #perl6
19:23 lab7 joined #perl6
19:31 lab7 joined #perl6
19:41 wolfman2000 joined #perl6
19:49 bluescreen10 joined #perl6
20:02 ksi joined #perl6
20:11 xinming joined #perl6
20:16 [Coke] nom: my @array = 1,2,3; say @array.exists(-1);
20:16 p6eval nom 676b35: OUTPUT«Bool::False␤»
20:16 [Coke] nom: my @array = 1,2,3; say @array.exists(*-1);
20:16 p6eval nom 676b35: OUTPUT«No applicable candidates found to dispatch to for 'Numeric'. Available candidates are:␤:(Mu, Mu %_)␤␤  in method Numeric at src/gen/CORE.setting:634␤  in sub infix:<+> at src/gen/CORE.setting:2054␤  in method exists at src/gen/CORE.setting:4465␤  in block <anon> at /t…
20:18 [Coke] looking at http://perlcabal.org/syn/S32/Containers.html, it seems like both of those constructs are wrong. yes?
20:18 leprevost joined #perl6
20:19 [Coke] niecza: my @array = 1,2,3; say @array.exists(-1);
20:19 p6eval niecza v12-2-geb42dfa: OUTPUT«Unhandled exception: Unable to resolve method exists in class Array␤  at /tmp/PyMgW0L0oO line 1 (mainline @ 1) ␤  at /home/p6eval/niecza/lib/CORE.setting line 2224 (ANON @ 2) ␤  at /home/p6eval/niecza/lib/CORE.setting line 2225 (module-CORE @ 58) ␤  at /hom…
20:20 colomon moritz: I like your "is cached" post.  moritz++ jnthn++
20:22 colomon moritz: btw, I just tested it on jnthn's wrap version, and it calculates fib(100) almost instantly, so the caching clearly works, even on self-recursive functions.  \o/
20:23 colomon hmmm... wonder if is symmetric can also be implemented this way right now....
20:24 jnthn oh
20:25 jnthn colomon: Do you just need to handle binary functions?
20:25 colomon jnthn: seems like
20:25 jnthn (arity 2)
20:25 colomon right
20:25 jnthn Yeah, you can likely do it.
20:25 colomon at least, that would be a fantastic start
20:25 jnthn Here's why it's hard
20:25 colomon you need to be able to extract the signature types from the original sub somehow
20:26 jnthn You need to get a sub that actually has - in terms the multi-dispatcher will understand - the right signature.
20:26 jnthn Well
20:26 jnthn That bit is easy
20:26 jnthn The hard part is building the new one.
20:27 PerlJam jnthn: eval :)
20:27 jnthn ewwwww.
20:27 colomon oh, you can't just say wrap( -> Type1 $a, Type2 $b { blah } )
20:27 jnthn colomon: How would it work with wrap?
20:27 jnthn colomon: You need to add an extra multi candidate.
20:27 colomon oh, right, wrap replaces the original
20:28 jnthn colomon: Here's what I guess a solution will look like...
20:28 jnthn You will get an individual candidate. To get back to the actual proto, which holds the candidates, you'll can call .dispatcher.
20:28 jnthn That gives you the proto.
20:28 jnthn You can then .add_dispatchee (I think that's what it's called)
20:29 jnthn Generating the thing to add is the hard part. Because if you just do
20:29 jnthn sub ($a, $b) { $orig($b, $a) }
20:29 jnthn It'll invoke BUT miss the types of course :)
20:29 sorear ello colomon
20:29 colomon o/ sorear
20:30 jnthn You can either make a generator, which you pass the two types in...it has a (::T1, ::T2) signature which I guess you can then use
20:30 jnthn But that probably still doesn't reify them soon enough for the multi-dispatcher.
20:30 jnthn So you probably need to do a trick with a parametric role.
20:30 jnthn Which do ensure signature reification of type vars.
20:33 jnthn colomon: oh, there's a simpler way.
20:34 moritz can't you simply .clone the signature, and use it for the wrapper block
20:34 icwiener joined #perl6
20:34 moritz but use the opcode that gives the argument list for processing it
20:34 colomon you've got to reverse the signature
20:35 * [Coke] kills some spec tests.
20:35 dalek roast: 7eadbcb | coke++ | S32-array/exists.t:
20:35 dalek roast: remove invalid "exists" tests
20:35 dalek roast:
20:35 dalek roast: S32 says:
20:35 dalek roast:
20:35 dalek roast: our Bool method exists (@array: Int $index)
20:35 dalek roast: True if the specified Array element has been assigned to
20:35 dalek roast:
20:35 dalek roast: so the -1 would fail (nothing at -1 index) and *-1 is invalid.
20:35 dalek roast: review: https://github.com/perl6/roast/commit/7eadbcb711
20:37 jnthn nom: sub gen(::T1, ::T2) { (sub (T1 $a, T2 $b) { }).instantiate_generic(nqp::hash('T1', T1, 'T2', T2)); }; gen(Int, Int).signature.say
20:37 p6eval nom 676b35: OUTPUT«:(Int $a, Int $b)␤»
20:37 localhost joined #perl6
20:37 jnthn Should just be able to pass a Perl 6 hash in there really...
20:38 jnthn But anyway, that just uses the mechanism that parametric roles use under the hood.
20:38 colomon nom: sub gen(::T1, ::T2) { (sub (T1 $a, T2 $b) { }).instantiate_generic(nqp::hash('T1', T1, 'T2', T2)); }; gen(Int, Rat).signature.say
20:38 p6eval nom 676b35: OUTPUT«:(Int $a, Rat $b)␤»
20:39 jnthn colomon: Nest that inside your trait aod inside that inner sub (yeah, we're gonna be 3 subs deep here :)) you can do a call to the original thing
20:39 jnthn So anyway, looks like we potentially have "is symmetric" in like, five lines of code or so... :)
20:39 colomon Not sure I understand that, but I'll give it a try when I get back from the barbershop.  :)
20:40 jnthn oh come on, the code wasn't *that* hairy P
20:40 jnthn *:P
20:40 moritz nom: sub wrapper() { nextsame(|pir::perl6_current_args_rpa__P()) }; nqp::bindattr(&wrapper, Code, '$!signature', &join.signature); say &wrapper.signature.perl
20:40 p6eval nom 676b35: OUTPUT«:(Any)␤»
20:41 moritz nom: say &join.signature.perl
20:41 p6eval nom 676b35: OUTPUT«:(Any)␤»
20:42 jnthn |pir::perl6_current_args_rpa__P()) is not going to end well, I suspect :)
20:42 jnthn But yeah, you can do signature games like that above. I'm not sure I'd say it's especially a good idea though.
20:50 cooper joined #perl6
20:54 sorear I still do not understand the advent idea well enough to pick a topic, but if someone has an idea for me, I'll donate time.
20:57 PerlJam sorear: the idea is to write "something cool about Perl 6" for each day of advent.
20:58 * sorear is not convinced there have been 25 days worth of cool changes in Perl 6 this year
20:58 jnthn A lot of people reading probably won't know Perl 6 well. So it's fine to have some about cool but not especially new.
20:58 jnthn (Or know it at all in some cases.)
20:58 jnthn Doesn't just ahve to be about stuff in the last year.
20:59 PerlJam sorear: you could write anything you want, but if you look at https://github.com/perl6/mu/blob/master/m​isc/perl6advent-2011/topic-brainstorming you can see there's some niecza-specific ideas :)
21:02 moritz sorear: nice perl 6 idioms are also good blog post material, doesn't need to be a new feature
21:03 jnthn ...when wondering why "git stash apply" is taking forever, make sure you didn't type "git apply"
21:05 arnsholt Heh =)
21:05 icwiener joined #perl6
21:05 icwiener joined #perl6
21:07 japhb There are some rumblings about possibly using (Perl 5) Mojolicious at $day-job, which made me of course instantly wonder about what has already been written for Perl 6 ... has someone already started work on a Mojolicious (or Dancer, or what have you) port to Perl 6?
21:08 PerlJam japhb: https://github.com/tadzik/Bailador
21:20 simcop2387 joined #perl6
21:20 snearch joined #perl6
21:20 donri joined #perl6
21:20 dalek nqp: 0fce58c | jnthn++ | src/6model/reprs/CStruct.c:
21:20 dalek nqp: Fix a typo.
21:20 dalek nqp: review: https://github.com/perl6/nqp/commit/0fce58cbeb
21:20 dalek nqp: a298ab3 | jnthn++ | / (3 files):
21:20 dalek nqp: Start to sketch out CArray representation.
21:20 dalek nqp: review: https://github.com/perl6/nqp/commit/a298ab36c3
21:20 dalek nqp: 721f08d | jnthn++ | tools/build/Makefile.in:
21:20 dalek nqp: Actually link in the CArray object file!
21:20 dalek nqp: review: https://github.com/perl6/nqp/commit/721f08dca9
21:20 dalek nqp: ad94412 | jnthn++ | src/ops/nqp_dyncall.ops:
21:20 dalek nqp: Teach the call engine how to handle a CArray representation (though we can't do anything much useful with it yet).
21:20 dalek nqp: review: https://github.com/perl6/nqp/commit/ad94412b31
21:22 japhb PerlJam, thank you.  I can't believe I forgot Bailador.
21:24 simcop2387 joined #perl6
21:24 felher joined #perl6
21:42 orafu joined #perl6
21:46 [Coke] nom: (v) (;,,;) (v)
21:46 p6eval nom 676b35: OUTPUT«===SORRY!===␤Confused at line 1, near "(v) (;,,;)"␤»
21:48 * jnthn tries to work that smiley out
21:51 * [Coke] squirts ink all over jnthn and scuttles away.
21:52 jnthn ...it's a squid?
21:53 lab7 joined #perl6
21:54 apejens joined #perl6
21:54 ethndbst joined #perl6
21:55 [Coke] why not zoidberg?
21:55 ethndbst joined #perl6
21:56 jnthn oh!
22:17 japhb phenny, ask tadzik Why did you choose to clone Dancer, as opposed to Mojolicious or one of the other Perl 5 frameworks?  Just the one you were most familiar with, or was there a deeper reason?
22:17 phenny japhb: I'll pass that on when tadzik is around.
22:19 japhb seen mberends
22:19 aloha mberends was last seen in #perl6 15 days 4 hours ago joining the channel.
22:21 jnthn whoa, I saw mberends IRL just a bit longer than that ago...
22:31 japhb @production-ready-definitions.push: 'When I can teach my 8-year-old programming using one of the Perl 6 implementations, and not be surprised by something seemingly simple that is broken or out of spec.'
22:31 dalek nqp: b2d7aa2 | jnthn++ | tools/build/Makefile.in:
22:31 dalek nqp: Add missing deps.
22:31 dalek nqp: review: https://github.com/perl6/nqp/commit/b2d7aa2f3f
22:31 dalek nqp: 945817d | jnthn++ | src/6model/reprs/CArray.c:
22:31 dalek nqp: Sketch out a bit more of CArray representation.
22:31 dalek nqp: review: https://github.com/perl6/nqp/commit/945817da7e
22:32 jnthn Grr, getting tired.
22:32 jnthn Will get this basically working tomorrow.
22:33 japhb Get some good rest, jnthn++!  :-)
22:39 orafu joined #perl6
22:40 jnthn Hopefully. I've felt oddly tired the whole week...hope next week I've more energy, given I'm eatching.
22:40 jnthn grr...teaching :)
22:40 jnthn I don't nom my students :)
22:40 jnthn anyway, night &
22:44 donri left #perl6
22:45 japhb phenny, ask jnthn OOC, what do you teach?
22:45 phenny japhb: I'll pass that on when jnthn is around.
22:54 donri joined #perl6
23:00 ascent_ joined #perl6
23:21 tyatpi joined #perl6
23:33 tadzik joined #perl6
23:45 donri left #perl6

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

Perl 6 | Reference Documentation | Rakudo