»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
Radvendii i LOVE perl6s integration of unicode :D no more annoying 0x342Fs :D 01:25
what happened to .uc? 01:27
b: say <a,b,c>».uc;
p6eval b 1b7dd1: OUTPUT«A,B,C␤»
Radvendii oh
huh. 01:28
Radvendii question though: what happened to `command` executing a command in the command line? how do i do that now? 01:30
b: "ls".exec 01:31
p6eval b 1b7dd1: OUTPUT«Method 'exec' not found for invocant of class 'Str'␤ in main program body at line 22:/tmp/wHi4N5uTBE␤»
Radvendii b: `ls`
p6eval b 1b7dd1: OUTPUT«===SORRY!===␤Confused at line 22, near "`ls`"␤»
Radvendii anyone? 01:35
b: q:x[ls] 01:38
p6eval b 1b7dd1: OUTPUT«===SORRY!===␤Colons may not be used to delimit quoting constructs at line 22, near ":x[ls]"␤»
Radvendii b: qx[ls]
p6eval b 1b7dd1: OUTPUT«Operation not permitted in safe mode␤ in 'Safe::forbidden' at line 2:/tmp/kXDkKbmO4G␤ in main program body at line 1:/tmp/kXDkKbmO4G␤» 01:39
Radvendii never mind. i figured it out 01:40
shinobicl_ rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say "AAA" !== "BBB" ?? "Distinct" !! "Same" ; 01:45
p6eval rakudo f70f20: OUTPUT«Same␤»
dalek kudo/nom: 66edf0b | moritz++ | / (2 files):
properly handle bigish numbers in Num.floor and .ceiling
01:46
Radvendii huh? 01:50
what's with that output?
shinobicl_ it should say "Distinct" 01:51
Radvendii i know
htats really weird
try putting parens around the "AAA" !== "BBB" part?
rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say( ("AAA" !== "BBB") ?? "Distinct" !! "Same" ); 01:53
p6eval rakudo f70f20: OUTPUT«Same␤»
shinobicl_ rakudo: our multi infix:<**>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say "AAA" ** "BBB" ?? "Distinct" !! "Same" ;
p6eval rakudo f70f20: OUTPUT«Distinct␤»
shinobicl_ The problem is with the "!==" 01:54
Radvendii ah
rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say "AAA" &[!==] "BBB" ?? "Distinct" !! "Same" ;
p6eval rakudo f70f20: OUTPUT«Not enough positional parameters passed; got 0 but expected 2␤ in sub <anon> at src/gen/CORE.setting:8515␤ in block <anon> at /tmp/erevJSopZd:1␤ in <anon> at /tmp/erevJSopZd:1␤»
shinobicl_ somehow i can't overload it
Radvendii rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say &[!==]"AAA", "BBB" ?? "Distinct" !! "Same" ;
p6eval rakudo f70f20: OUTPUT«===SORRY!===␤Confused at line 1, near "say &[!==]"␤»
Radvendii what's the syntax?
rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say &[!==]( "AAA", "BBB") ?? "Distinct" !! "Same" ; 01:55
p6eval rakudo f70f20: OUTPUT«Distinct␤»
Radvendii there we go
rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say &[!==] === *!==*;
p6eval rakudo f70f20: OUTPUT«WhateverCode.new()␤»
Radvendii how do we tell if two things are just references to the same thing? 01:56
rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say &[!==] ~~ *!==*;
p6eval rakudo f70f20: OUTPUT«No applicable candidates found to dispatch to for 'Numeric'. Available candidates are:␤:(Mu, Mu %_)␤␤ in method Numeric at src/gen/CORE.setting:638␤ in sub infix:<==> at src/gen/CORE.setting:2178␤ in block <anon> at /tmp/wWquJRqr44:1␤ in <anon> at /tmp/wWquJRqr…
Radvendii rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say &[!==] ~~ (* !== *);
p6eval rakudo f70f20: OUTPUT«No applicable candidates found to dispatch to for 'Numeric'. Available candidates are:␤:(Mu, Mu %_)␤␤ in method Numeric at src/gen/CORE.setting:638␤ in sub infix:<==> at src/gen/CORE.setting:2178␤ in whatevercode <anon> at /tmp/EmYYfHb0yc:1␤ in method ACCEPTS a…
moritz Radvendii: strings are value types, so there's no difference between "the same string" and "references to the the same string"
shinobicl_ that's the error i'm having
i can't overload !== for a specific datatype. It complains about the !== needing "Numeric" 01:57
Radvendii no... if you use &[!==]($s1, $s2) as the function call it works. i think it's not parsing !== as the operator you defined 01:58
moritz it has to do with !== normally being a meta operator
shinobicl_ ohh, i see
Radvendii rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say &[!==]("aaa", "bbb"); 01:59
shinobicl_ and === is a metaoperator too?
p6eval rakudo f70f20: OUTPUT«Bool::True␤»
Radvendii versus
Radvendii rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say "aaa" !== "bbb"; 01:59
p6eval rakudo f70f20: OUTPUT«Bool::False␤»
Radvendii rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; (* !== *)==&[!==] ; 02:00
p6eval rakudo f70f20: ( no output )
Radvendii rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say (* !== *)==&[!==] ;
p6eval rakudo f70f20: OUTPUT«WhateverCode.new()␤»
Radvendii rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say (* !== *)==&[!==] ?? "yes" !! "no" ;
p6eval rakudo f70f20: OUTPUT«WhateverCode.new()␤»
Radvendii rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say ((* !== *)==&[!==]); 02:01
p6eval rakudo f70f20: OUTPUT«WhateverCode.new()␤»
Radvendii rakudo: our multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say ((* !== *)==&[!==] ?? "yes" !! "no");
p6eval rakudo f70f20: OUTPUT«WhateverCode.new()␤»
Radvendii what the hell?
whatever. im pretty sure it's not recognizing !== as the operator you defined 02:02
TimToady why are you using "our"? 02:02
functions are lexically scoped in Perl 6
perl6: my multi infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say( ("AAA" !== "BBB") ?? "Distinct" !! "Same" ); 02:03
p6eval niecza v12-4-g8c09133: OUTPUT«Use of uninitialized value in string context␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 773 (warn @ 2) ␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 168 (Mu.Str @ 9) ␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /home/p6eval/niecza/src/Niec…
..rakudo f70f20: OUTPUT«Same␤»
..pugs b927740: OUTPUT«Distinct␤»
TimToady niecza: my multi infix:<!==>(Str $, Str $) { say "HERE" }; 'a' !== 'b' 02:19
p6eval niecza v12-4-g8c09133: OUTPUT«Use of uninitialized value in string context␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 773 (warn @ 2) ␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 168 (Mu.Str @ 9) ␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /home/p6eval/niecza/src/Niec…
TimToady niecza: my sub infix:<!==>(Str $, Str $) { say "HERE" }; 'a' !== 'b'
p6eval niecza v12-4-g8c09133: OUTPUT«HERE␤»
TimToady perl6: my sub infix:<!==>(Str $s1, Str $s2) { return ($s1 ne $s2); }; say( ("AAA" !== "BBB") ?? "Distinct" !! "Same" ); 02:20
p6eval rakudo f70f20: OUTPUT«Same␤»
..pugs b927740, niecza v12-4-g8c09133: OUTPUT«Distinct␤»
TimToady LTM failure for rakudo, methinks
mind, it's bad style to override metaoperators
shinobicl_ i din't know it was a metaoperator, my fault 02:21
moritz only mentioned it half an hour ago
dalek : 53ff291 | moritz++ | misc/perl6advent-2011/topic-brainstorming:
[advent] clean up topic list a bit
02:22
shinobicl_ moritz: yes i remember :), i didn't know before that.... but is === a metaoperator too? 02:23
TimToady no
and it's only the ! that is the meta
it's ordinarly applied to == when you say !==
in += the = is a metaoperator 02:24
in X=> it's the X
shinobicl_ i thought that, if "==" is the opposite of "!=", then the opposite of "===" should be "!=="
TimToady != is just an alias to !== 02:25
shinobicl_ i fact i din't know it existed before trying to overload it
TimToady metaops don't replace characters like that though
there are currently 8 metaoperators, described in perlcabal.org/syn/S03.html#Meta_operators 02:26
shinobicl_ "To avoid visual confusion with the !! operator, you may not modify any operator already beginning with !." 02:28
i'll use eq and ne then :)
TimToady that's what they're there for 02:29
like !=, ne is just an alias for !eq
pat_js if I have a regex like /<foo>* |<bar>/ in a grammar, how can I access them in a Actions-object? 03:32
with them I refer to $<foo> and $<bar>
oh my regex is not the one I'm asking for, it's more like /[<foo>|<bar>]*/ 03:33
TimToady the bits should still show up in $<foo> and $<bar> 03:36
if you'd used () instead of [], you'd need $0<foo> instead 03:37
pat_js and the order?
japhb moritz, it looks like you pushed a bump to NQP_REVISION in rakudo 66edf0b6eb , but didn't push nqp?
TimToady the subparts will be in the order matched, but you can't tell the relative order between the two lists unless you look at match positions 03:38
actually, if you'd used ()*, then $0[*] would be the order, and each of those would contain either foo or bar 03:39
often if you're starting to use $0, it means you really need a named subrule though 03:40
so you'd match <foobar>*, and foobar would match foo or bar
the standard grammar uses very few numbered captures 03:41
pat_js I don't think that will work, because <foo> is, in my case a proto token and <bar> is a recursive call
TimToady I meant <foobar>* would match <foo> or <bar>, so it isn't bothered by proto or recursion 03:45
TimToady that's no different from (<foo>|<bar>)*, except with a named rule 03:45
shinobicl_ perl6: multi infix:<op>(Int $n1, Int $n2) { return ($n1.log10.floor == $n2.log10.floor); }; say (1 op 9) ?? "Same" !! "Distinct"; say (1 op 11) ?? "Same" !! "Distinct"; 03:47
p6eval niecza v12-4-g8c09133: OUTPUT«Use of uninitialized value in string context␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 773 (warn @ 2) ␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 168 (Mu.Str @ 9) ␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /home/p6eval/niecza/src/Niec…
..pugs b927740: OUTPUT«Same␤Distinct␤»
..rakudo f70f20: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 1␤»
TimToady from the outside a named rule is simply that; it's invisible to the caller whether it's calling a proto, or something recursive
shinobicl_ perl6: multi infix:<eq>(Int $n1, Int $n2) { return ($n1.log10.floor == $n2.log10.floor); }; say (1 eq 9) ?? "Same" !! "Distinct"; say (1 eq 11) ?? "Same" !! "Distinct"; 03:48
TimToady (though it does change what is returned, of course)
p6eval niecza v12-4-g8c09133: OUTPUT«Use of uninitialized value in string context␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 773 (warn @ 2) ␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 168 (Mu.Str @ 9) ␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /home/p6eval/niecza/src/Niec…
..pugs b927740, rakudo f70f20: OUTPUT«Same␤Distinct␤»
japhb shinobicl_, you can /msg p6eval as well, if you want to just play around and try things without an audience
TimToady esp since niecza doesn't like the multi 03:50
shinobicl_ japhb: sorry, i just want to know something about the operator overloading... 03:55
what should it happen if i declare an operator as "multi" but has not been defined yet? 03:56
TimToady huh, my nom doesn't build
error: pathspec '2011.11-110-g29cc6d8' did not match any file(s) known to git.
TimToady shinobicl_: it should autogen a proto for you 03:57
shinobicl_ rakudo: multi infix:<eqmag>(Int $n1, Int $n2) { return ($n1.log10.floor == $n2.log10.floor); }; say (1 eqmag 9) ?? "Same" !! "Distinct"; say (1 eqmag 11) ?? "Same" !! "Distinct"; 03:58
p6eval rakudo f70f20: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 1␤»
shinobicl_ rakudo: multi infix:<eq>(Int $n1, Int $n2) { return ($n1.log10.floor == $n2.log10.floor); }; say (1 eq 9) ?? "Same" !! "Distinct"; say (1 eq 11) ?? "Same" !! "Distinct";
p6eval rakudo f70f20: OUTPUT«Same␤Distinct␤»
shinobicl_ so,, these two should return the same even if there is no a previous "eqmag" operator ? 03:59
JimmyZ Hello, TimToady 04:00
colomon nom: multi infix:<eqmag>(Int $n1, Int $n2) { return ($n1.log10.floor == $n2.log10.floor); }; say (1 eqmag 9) ?? "Same" !! "Distinct"; say (1 eqmag 11) ?? "Same" !! "Distinct";
p6eval nom f70f20: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 1␤»
colomon std: multi infix:<eqmag>(Int $n1, Int $n2) { return ($n1.log10.floor == $n2.log10.floor); }; say (1 eqmag 9) ?? "Same" !! "Distinct"; say (1 eqmag 11) ?? "Same" !! "Distinct"; 04:01
p6eval std be1f10e: OUTPUT«ok 00:01 127m␤»
colomon shinobicl: Pretty sure you're looking at a (known) nom-bug.
shinobicl_ oh.. i see..thanks colomon!
colomon so the answer is yes, they should return the same. 04:02
pat_js thanks a lot, another little question, I now got the right structure of lists, I want, but it is filled with Mu()s, is that ~$/ thing still working on Rakudo? 04:04
pat_js ah sorry, had a typo in my method declarations 04:10
sorear good * #perl6 04:25
phenny sorear: 06 Dec 21:51Z <[Coke]> tell sorear that "make spectest" should be green again; all failures that were blocking it now have tickets.
sorear colomon: in principle, it would be possible to factor out some of the ff logic into a function, but if I did that the arguments would have to be thunkified and it wouldn't save much ugliness 04:29
[Coke]: awesome 04:31
japhb TimToady, in case you hadn't figured it out already, moritz's most recent commit bumped NQP_REVISION, but he'd forgotten to push nqp itself. The solution is to git checkout HEAD^ , and then you should be able to build. 04:51
dalek p: d5649fd | moritz++ | tools/build/PARROT_REVISION:
bump parrot revision to one that has the is_inf_or_nan opcode
05:58
moritz evalbot rebuild nom
p6eval OK (started asynchronously)
moritz sorry about that 06:00
pat_js rakudo: sub infix:<±> ($a,$b) {($a-$b)..($a+$b)}; say 4 ± 1 06:34
p6eval rakudo f70f20: OUTPUT«===SORRY!===␤Confused at line 1, near "say 4 \x{b1} 1"␤»
pat_js that had worked a year ago, i think
perl6: sub infix:<±> ($a,$b) {($a-$b)..($a+$b)}; 4 ± 1 06:35
p6eval rakudo f70f20: OUTPUT«===SORRY!===␤Confused at line 1, near "4 \x{b1} 1"␤»
..niecza v12-4-g8c09133: ( no output )
..pugs b927740: OUTPUT«decodeUTF8': bad data: '\177'␤decodeUTF8': bad data: '\177'␤»
moritz b: sub infix:<±> ($a,$b) {($a-$b)..($a+$b)}; say 4 ± 1
p6eval b 1b7dd1: OUTPUT«345␤»
pat_js who's b?
moritz an older rakudo version 06:36
Woodi want to note that current law in Poland delegalized "mass netto +- a little" on wrappings. Maybe similiar happens in all EU countries ? New standard is "epsilon" marked with "e" on wrapping... 06:56
geekosaur hasn't that been an eu directive for a while? 07:02
Woodi yes, forced here in 2009 07:20
japhb Moritz, I'm not sure if the Rakudo build is still broken, or if it's just me. 07:34
japhb 2011.11-110 has a different checkin SHA1 than the one in NQP_REVISION 07:37
s/checkin/commit/ of course 07:38
sleep &
grondilu perl Configure.pl --gen-nqp => 09:07
error: pathspec '2011.11-110-g29cc6d8' did not match any file(s) known to git.
Command failed (status 256): git checkout 2011.11-110-g29cc6d8
?
dalek kudo/nom: 735d127 | moritz++ | tools/build/NQP_REVISION:
fix NQP revision, moritz--
09:23
grondilu thks :) 09:26
nom: multi sub postfix:<!> (Int $n) { $n < 2 ?? 1 !! $n*($n-1) }; say 4!;' 09:32
p6eval nom f70f20: OUTPUT«===SORRY!===␤Confused at line 1, near "say 4!;'"␤»
grondilu this is still not working :(
oops, I meant: multi sub postfix:<!> (Int $n) { [*] 1 .. $n }; say 4!;' 09:33
jnthn hmm...wonder how hard i would be to just put back the way it worked before 09:38
er, IT would be...
jnthn maybe I get chance to try it this evening... 09:44
moritz hm 11:10
precompiled PIR with NaN and Inf in it seems to be broken again :/ 11:11
dalek p: aa20f03 | moritz++ | src/PAST/NQP.pir:
add nqp::isspecial_n alias for pir::is_inf_or_nan__In
11:25
jnthn moritz: I think I woulda preferred the NQP iop the mention inf and nan in its name rather than "special" 12:32
*op
moritz jnthn: what name would you prefer?
jnthn isnanorinf would be clearer 12:37
I think it's obvious enough that it only applies to num too
moritz ok 12:38
jnthn: I'll do the rename today or tomorrow 12:39
jnthn ok, no hurry :) 12:40
dalek p: 987cd89 | moritz++ | src/PAST/NQP.pir:
rename nqp::isspecial_n to isnanorinf
12:44
moritz turns out I haven't pushed the usage of the nqp:: op anyway 12:46
jnthn aha :) 12:50
jnthn heh...I told my students they could take a break for coffee and cake, and yet the whole class is still sat here hacking away! Developers. :) 13:19
dalek kudo/nom: 7cb7f2a | moritz++ | / (2 files):
use nqp::isnanorinf op in rounders
13:36
raiph %greet<en> 13:45
S06:1289 "as the flattening C<*> does" is that a fossil?
benabik raiph: I don't think so. It's discussing the difference between sub foo(**@bar) and sub foo(*@bar) 13:47
moritz benabik is right 13:49
benabik \o/
benabik is always unsure with spec questions, since I never read it _that_ carefully.
raiph benabik, moritz: thanks 13:51
moritz phenny: tell mberends that the timing code in Test.pm has a wee problem -- the assignment to $time_after changes the return value, which should be True for passing tests, and False for failed ones. Now it's just always a timestamp 14:01
phenny moritz: I'll pass that on when mberends is around.
moritz nom: proto foo(|$) {*}; sub foo() { } 14:08
p6eval nom 7cb7f2: OUTPUT«===SORRY!===␤Illegal redeclaration of routine 'foo' at line 1, near ""␤»
dalek ast: f4e1734 | moritz++ | S (6 files):
Merge branch 'master' of git://github.com/perl6/roast
14:12
ast: 3654c37 | moritz++ | S (2 files):
simplify some tests
PerlJam Am I imagining things or is compiling Rakudo taking even longer these days? (I'd time it myself, but I don't want to wait for the compile again :) 14:25
moritz it is rather slow 14:33
during my bigint work I've discovered that some routines in the actions are run twice
I guess it'd help if we avoided that :-) 14:34
benabik Possibly due to backtracking.
Noticed that on some toy languages I wrote with nqp.
moritz benabik: src/Perl6/Actions.pm contains not a single regex, just tokens and rules (which shouldn't backtrack) 14:35
of course there can still be failed alternatives that aren't LTM'ed
benabik moritz: I thought rules backtracked. :-/ 14:36
moritz benabik: nope 14:36
rule implies :s :ratchet
benabik huh
moritz token implies just :ratchet
S05:549-551 14:38
dalek kudo/nom: 9fd40d8 | moritz++ | src/core/Num.pm:
fix Inf.perl
14:41
PerlJam rakudo++ I had accidentally typed $:foo when I meant :$foo and the error message I got told me so! :-) 14:47
pmichaud_ ...why are we checking for nan/inf in ceil/floor? Shouldn't the ceil/floor parrot ops do this also?
raiph pmichaud: o/ 14:50
pmichaud raiph: o/ 14:51
raiph moritz recently wrote ".WHICH ... does object identity comparsion (like the === operator), but caching needs object equivalence comparsion (like the eqv operator)." 14:53
moritz pmichaud: because we can't box a NaN of Inf into an Int 14:54
pmichaud ...can't nqp::p6bigint take care of that, though? 14:55
raiph what would be the equivalent of WHICH that does deep eqv?
moritz raiph: nothing of that sort is specced
pmichaud it seems like p6bigint needs to be smart enough to handle NaN and Inf anyway 14:56
moritz pmichaud: maybe, but I'm not smart enough to do that :/
at least not efficiently
pmichaud it's in src/ops/perl6.ops, line 502 14:57
[Coke] pmichaud: o/
pmichaud basically, check for NaN/Inf there
moritz I don't think we're using that op anymore
pmichaud it's shown in the patch you just submitted
moritz but rather we use the nqp_bigint_* variants 14:58
pmichaud oh, nqp::p6bigint is mapped somewhere else now? looking
moritz oh, that's my mistake then
should be a different op
that returns an Int, not a Num for big-ish numbers
pmichaud I look forward to seeing the updated patch :) 14:59
[Coke]: o/
afk again for a while :-/ 15:00
moritz should use nqp::fromnum_I(..., Int)
pmichaud then nqp::fromnum_I needs to be smart enough to handle NaN/Inf, I think :) 15:02
since NaN and Inf are valid num values
PerlJam The advent calendar schedule looks empty for the next 4 days. 15:31
:(
colomon is working on an emergency post 15:33
PerlJam colomon++
colomon dunno if it will be any good or not, mind you. 15:34
PerlJam colomon: what's the topic?
jnthn I may be able to do an emergency one, but could use a topic suggestion
colomon currently "Adding a Feature to Niecza"
PerlJam who's taking on the "ecosystem update" topic? 15:35
jnthn So if there's anything you'd really like to see me write on... :)
PerlJam it's not on the scheule and I don't think I've heard anyone mention it.
jnthn tadzik++ would be the logical person for that, but I think he's quite tied up with stuff at the moment
colomon isn't the ecosystem update at the moment "ecosystem just barely functional"? 15:37
I'd rather push that later and fix the ecosystem in the meantime. ;)
PerlJam sure.
colomon nom: say 14.3.ceiling 15:40
p6eval nom 9fd40d: OUTPUT«15␤»
dalek ecza: 0c3157b | coke++ | t/spectest.data:
Run this passing test.
15:51
Util is working on a `Idiomatic Perl 6 and Perl 6 Idioms` advent post 16:00
PerlJam Util++ 16:01
Util (I am working on-site through Thu evening, and so have not committed to a posting date) 16:02
tadzik jnthn: I'll be quite free after friday 16:09
jnthn tadzik: yay! 16:10
tadzik: Do you know what blocks ecosystem bootstrap still?
Just Test::Mock tests?
tadzik json tests as well, I believe
jnthn ah, I thought moritz++ had taken care of those already 16:11
tadzik oh, maybe 16:12
PerlJam I'm refactoring ff and adding the fff variants. Does this look like a reasonable implementation? gist.github.com/1443400 16:17
(secondly to that, when I compiled it just now and attempted to test it, I keep getting complaints: Required named parameter 'x-left' not passed So, I think I might be doing something wrong (or there's a bug)) 16:18
jnthn You can't factor out callerid like that. 16:19
It'll bet the location of the infix.
*get
And not of the thing that called it.
PerlJam I figured that :) I just haven't worked out how to fix it yet.
jnthn Doesn't fff need thunking? 16:20
PerlJam also, I'm guessing there's a problem just using calledid anyway if there are multiple ff in the same scope
jnthn ?
jnthn It's global state, per program position, no? 16:21
callerid gives you unique per bytecode location, not unique per scope..
PerlJam ah, then that's good.
TimToady it's still a hack--long term ff wants to be a macro that declares its own state 16:22
all it really needs is a text macro
PerlJam sure, I just wanted to see if I could get there without macros. 16:23
jnthn TimToady: yeahbut masak++ didn't get macros far enough just yet
TimToady also, it won't work right with cloned closures, I suspect
jnthn it's global state, no?
not unique per closure? 16:24
TimToady it's supposed to work like state vars, I think
PerlJam don't rain on my "good enough" parade. we'll get a "perfect" parade when masak is doneish :) 16:24
TimToady admittedly this is less than specced 16:25
but the original discussion on IRC involved state vars
PerlJam anyway, I'm curious why the code I have keeps complaining about a "required 'x-left' parameter" 16:26
PerlJam I thought you needed a ! suffix to make named params required 16:26
jnthn TimToady: Fair enough. I'm not gonna fix it in this hack version though, I'll just wait for macros to be far enough along.
TimToady no problem 16:27
jnthn ok, my teaching is done for the day. Back to hotel...and then maybe finding something spicy to deal with my sore throat... 16:28
bbl
JimmyZ wonders how about irclog.perlgeek.de/perl6/2011-12-03#i_4786939 16:29
dalek ecs: c4882a6 | larry++ | S03-operators.pod:
ff/fff use anon state vars to clone right

  jnthn++ and PerlJam++ for the alert
16:31
TimToady JimmyZ: generally, you wouldn't put cached on a function that is not pure, so it doesn't matter whether its cache is shared if the function always returns the same thing 16:32
ff and fff, on the other hand, are intrinsically impure 16:34
(stateful)
PerlJam JimmyZ: wrap *is* called. 16:36
TimToady wonders which of those JimmyZ wonders... 16:38
PerlJam It looks like he's confused that he never sees "process" output to the screen and so thinks wrap is never called. But wrap is called ... just on the $r inside the sub that immediately goes out of scope. 16:41
TimToady $r is the sub that was passed in, and it should wrap in place, so it should show up in output 16:43
dalek ast: 2652a39 | (Solomon Foster)++ | S32-num/ (2 files):
Refudge for forthcoming Niecza patch.
ecza: b5cc22a | (Solomon Foster)++ | / (3 files):
Properly handle NaN and +-Inf in rounding functions, add Cool.truncate, turn on S32-num/rounders.t.
PerlJam TimToady: shouldn't he need an "is ref" or "is rw" or something for that? 16:45
TimToady he's not assigning to it, he's just calling an object method that happens to be a mutator 16:46
so I doubt this routine can enforce anything on that level 16:47
PerlJam in any case ... wrap really is being called ... :-) 16:49
rakudo: rakudo: sub cached(Routine $r) { my %cache;$r.wrap(-> |$c {say 'process';my $key := $c.gist;%cache.exists($key) ??%cache{$key} !!(%cache{$key} = callsame)}); say $r(1); say $r(7) }; cached sub foo($a) {return 2 * $a;}; say foo(1);say foo(2);
p6eval rakudo 9fd40d: OUTPUT«===SORRY!===␤Confused at line 1, near "rakudo: su"␤»
PerlJam oops
rakudo: sub cached(Routine $r) { my %cache;$r.wrap(-> |$c {say 'process';my $key := $c.gist;%cache.exists($key) ??%cache{$key} !!(%cache{$key} = callsame)}); say $r(1); say $r(7) }; cached sub foo($a) {return 2 * $a;}; say foo(1);say foo(2);
p6eval rakudo 9fd40d: OUTPUT«process␤2␤process␤14␤2␤4␤»
TimToady perl6: my $x = 2; $x //= say "hi" 16:50
p6eval pugs b927740, niecza v12-5-g0c3157b: ( no output )
..rakudo 9fd40d: OUTPUT«hi␤»
JimmyZ jnthn write a trait one, which works
TimToady you can use //= rather than ??!! after nom fixes //=
JimmyZ TimToady: gist.github.com/1423496#file_with+wrap 16:51
TimToady well, assuming 'is cached' only applies to functions returning defined values
JimmyZ it should not work with no any tips 16:53
dalek ast: e993f8d | (Solomon Foster)++ | S32-num/rounders.t:
Add tests to make sure the rounding functions are not cheating.
16:54
colomon I suspect that last push may add some failing tests in Rakudo 16:55
looking at it now...
but it will take a while to rebuild
JimmyZ sleeps 16:57
jnthn TimToady: There's an issue with sub foo(&r) { &r.wrap(...) } 17:10
TimToady: Because when we pass the routine it gets closure semantics, and thus is cloned
TimToady: Meaning we pass a clone that then gets modified.
e.g. even if we replace the do properly of that, as per spec, it's doing it to the clone. 17:11
dalek ast: fbba653 | (Solomon Foster)++ | S32-num/rounders.t:
Fudge for rakudo.
17:12
colomon okay, fixed rakudo's fudging.
all, this is my spare p6advent post draft: perl6advent.wordpress.com/2011/12/0...ng-niecza/ 17:14
errr, perl6advent.wordpress.com/?p=846&am...eview=true
any feedback would be appreciated. and yes, it needs a better name. 17:15
colomon and a last paragraph summing it up. 17:18
jnthn #phasers is tonight, yes? 17:19
jnthn notices he's the only one who preported and is wondering if he got the rong day :)
colomon it is wednesday, I think 17:20
;)
woah, I've actually been doing p6 stuff the last week 17:21
colomon so, is #phasers in 1 minute? 17:29
or is it in two hours? 17:30
colomon is easily confused by UTC
colomon is feeling very lonely on #phasers 17:34
felher colomon: neither link works for me. 17:47
colomon felher: you probably need to be logged into wordpress to successfully preview.
felher colomon: ah, you may be right about that :) 17:48
sorear good * #perl6 18:34
[Coke] My wife made camel-shaped sugar cookies this week without realizing the perl-significance. 18:42
[Coke] I was tempted to send a box to TimToady, but then realized we'd have to add butterfly ones. ;) 18:42
colomon oh, that would be awesome. :) 18:47
dalek kudo/nom: 1022412 | coke++ | t/spectest.data:
track failure modes
19:09
jnthn back 19:27
tadzik back
jnthn and now full of Indisk nom
colorspace <evalbot> bash: rakudo:: command not found ): 19:37
tadzik hm? 19:38
rakudo: say 'command found'
p6eval rakudo 102241: OUTPUT«command found␤»
colorspace oops i was messaging evalbot 19:39
benabik A bash shell in IRC? That's an interesting choice. 19:41
colorspace so im trying to do this: for 1..64 -> $x, $y, $z { $x.say; } but i get an error on the final iteration because % 3 > 0; is there a way DWIM? 19:43
a way to do what i mean, rather** 19:45
benabik nom: for 1..64 -> $x, $y = 0, $z = 0 { $x.say } 19:46
p6eval nom 102241: OUTPUT«1␤4␤7␤10␤13␤16␤19␤22␤25␤28␤31␤34␤37␤40␤43␤46␤49␤52␤55␤58␤61␤64␤»
tadzik oh, I didn't know about that :)
benabik nom: for 1..64 -> $x, $?y, $?z { $x.say }
tadzik benabik++
p6eval nom 102241: OUTPUT«===SORRY!===␤In signature parameter, '$?y', it is illegal to use '?' twigil at line 1, near ", $?z { $x"␤»
tadzik nom: for 1..64 -> $x, $y?, $z? { $x.say } 19:47
p6eval nom 102241: OUTPUT«1␤4␤7␤10␤13␤16␤19␤22␤25␤28␤31␤34␤37␤40␤43␤46␤49␤52␤55␤58␤61␤64␤»
benabik That's what I meant.
tadzik++
tadzik nom: for 1..62 -> $x, $y?, $z? { $x.say }
p6eval nom 102241: OUTPUT«1␤4␤7␤10␤13␤16␤19␤22␤25␤28␤31␤34␤37␤40␤43␤46␤49␤52␤55␤58␤61␤»
tadzik hmm
colorspace ohhh nice
tadzik nom: for 1..62 -> $x, $y = 0, $z = 0 { $x.say }
p6eval nom 102241: OUTPUT«1␤4␤7␤10␤13␤16␤19␤22␤25␤28␤31␤34␤37␤40␤43␤46␤49␤52␤55␤58␤61␤»
tadzik I'm not sure what I expect ;P
benabik colorspace: The bit between -> and { is a signature. So you can use optional and default params.
Named params are not so useful. :-) 19:48
colorspace thanks for the info! perl6 is very fun to play around with
tadzik I'm glad to hear that :) 19:48
[Coke] bah, no readline on feather? 19:57
Util (when the time comes) how do I post my day's article to perl6advent ? 20:14
felher Oh, cool, take doesn't need to have a lexical gather :) 20:16
Util felher: I just looked at that this morning. 20:18
perlcabal.org/syn/S04.html#The_gath...ent_prefix
if a gather lexically contains any take calls, it is marked as lexotic-only, and it will be invisible to a dynamic take.
If the gather contains no take lexically, it by definition cannot be the lexotic target of any take, so it can only harvest dynamic take calls.
felher yeah, that is really cute :) 20:19
Util I wanted to mix lexical and dynamic `take` within one `gather`.
To make it work, just define somthing like:
sub take-dynamic ($item) {take $item} 20:20
and use it in place of the lexical `take`
felher Util: yep, nice one :) 20:21
Util I did not actually try the code; I was just positing an example in my own notes.
dynamic `take` allows for smoother refactoring of complex list-building code. 20:22
felher yeah :) 20:26
colomon "...though armed with mighty compilers and code weapons..." -- Grail, Elizabeth Bear, page 305 20:28
Util colomon: I bet a release manager will choose that as a epigram. 20:38
(or is that epigraph?) 20:39
Oh, it is: perl5.git.perl.org/perl.git/blob/HE...graphs.pod 20:40
moritz nom: my $x = (1, 2, 3); .say for nqp::p6decont($x) 20:53
p6eval nom 102241: OUTPUT«1␤2␤3␤»
moritz jnthn: that's the reason why take [1, 2] flattens
nom: my $x = (1, 2, 3); .say for $x
p6eval nom 102241: OUTPUT«1 2 3␤»
moritz take() calls decont to ensure that no lvalues are returned 20:54
and at the same time kills the "I'm a scalar" flag
moritz -> really sleep
dalek kudo/nom: 64fd762 | jonathan++ | src/Perl6/Grammar.pm:
Add back the custom operator handling as we did it in ng. It needs re-doing, but that'll take the QRegex bootstrap, which - miracles aside - isn't going to be done before the December release. In the meantime, this unregresss the feature.
20:59
tadzik jnthn++ 21:19
jnthn I'll hope @other worry about the spectests for that :) 21:20
dalek atures: 9695c5a | jonathan++ | features.json:
Update nom features.
21:47
jnthn moritz: Example of "combinations of % and :s"? 21:50
dalek p: 73e0060 | jonathan++ | src/QRegex/P6Regex/Actions.nqp:
Add missing setting of ignorecase flag.
21:58
p: 2695eea | jonathan++ | src/QAST/Compiler.nqp:
Implement ignorecase subtype in literal. Well, try to - for some reason it seems to need ICU, which I don't have to hand. :-( Testing and Rakudo version bump welcome from anyone who does.
jnthn sleep & 22:07
tadzik nom: my @a := 1; 22:36
p6eval nom 64fd76: OUTPUT«Type check failed in binding␤ in block <anon> at /tmp/30JSV8LAgZ:1␤ in <anon> at /tmp/30JSV8LAgZ:1␤»
tadzik nom: my $a = 0; { warn "blah"; CATCH { $a++ } }; { warn "blah"; CONTROL { $a++ } }; say $a 22:39
p6eval nom 64fd76: OUTPUT«blah␤blah␤1␤»
sorear good * #perl6 23:02
tadzik hello sorear
colomon \o 23:15
[Coke] sorear: o/ 23:53
sorear decides to de-prioritized grapheme mode for now 23:58
I'll make :codes work more like UTS18