»ö« 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.
timotimo is +(collate-same([1, 1, 1, 1, 1, 2, 2, 2])), 2, "sublists work"; 00:00
here i get 10 instead of 2
collate-same should have returned [[1, 1, 1, 1, 1], [2, 2, 2]]
r: [[1, 1, 1, 1, 1], [2, 2, 2]].perl
p6eval rakudo 4eeffc: ( no output )
timotimo r: say [[1, 1, 1, 1, 1], [2, 2, 2]].perl
p6eval rakudo 4eeffc: OUTPUT«[[1, 1, 1, 1, 1], [2, 2, 2]]␤»
timotimo r: say +([[1, 1, 1, 1, 1], [2, 2, 2]])
p6eval rakudo 4eeffc: OUTPUT«2␤»
quietfanatic say collate-same([1, 1, 1, 2, 2, 2]).WHAT
r: say collate-same([1, 1, 1, 2, 2, 2]).WHAT 00:01
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&collate-same' called (line 1)␤»
timotimo sub collate-same(@a) { my $iv; gather { while +@a { $iv = @a[0]; take gather { take @a.shift while (+@a and @a[0] == $iv) } } } }
r: sub collate-same(@a) { my $iv; gather { while +@a { $iv = @a[0]; take gather { take @a.shift while (+@a and @a[0] == $iv) } } } }; say collate-same([1, 1, 1, 2, 2, 2]).WHAT
p6eval rakudo 4eeffc: OUTPUT«List()␤»
quietfanatic hm 00:02
the question is, is it flattening
timotimo yup, that is the question
quietfanatic and does prefix:<+> flatten and what does it flatten.
timotimo well, at least up there + didn't flatten 00:03
quietfanatic Also, [] constructs an Array, not a List
and [] things never flatten
like ever
timotimo ah, ok
r: say +(gather for ^5 { take [$_ xx $_] })
p6eval rakudo 4eeffc: OUTPUT«5␤»
timotimo here it doesn't flatten 00:04
quietfanatic yes
timotimo well, of course, there's [ ] deep in there
quietfanatic becuse you're creating arrays with []
timotimo right
quietfanatic r: sub collate-same(@a) { my $iv; gather { while +@a { $iv = @a[0]; take [gather { take @a.shift while (+@a and @a[0] == $iv) }] } } }; say +collate-same([1, 1, 1, 2, 2, 2])
p6eval rakudo 4eeffc: OUTPUT«2␤»
quietfanatic say +((1, 1, 1).list, (2, 2, 2).list) 00:05
timotimo r: sub collate-same(@a) { my $iv; gather { while +@a { $iv = @a[0]; take gather { take @a.shift while (+@a and @a[0] == $iv) } } } }; sub rle(@a) { my $subs = collate-same(@a); gather for $subs { take [+$_, $_[0]] } }
p6eval rakudo 4eeffc: ( no output )
timotimo oi, no return yet 00:06
quietfanatic r: say +((1, 1, 1).list, (2, 2, 2).list)
p6eval rakudo 4eeffc: OUTPUT«6␤»
timotimo r: sub collate-same(@a) { my $iv; gather { while +@a { $iv = @a[0]; take gather { take @a.shift while (+@a and @a[0] == $iv) } } } }; sub rle(@a) { my $subs = collate-same(@a); gather for $subs { take [+$_, $_[0]] } }; say rle([1, 1, 1, 2, 2, 2]).perl;
p6eval rakudo 4eeffc: OUTPUT«([6, 1],).list␤»
timotimo something in there flattens. probably where i put collate-same(@a) into $subs?
quietfanatic Hm 00:07
00:07 vmspb left
quietfanatic Oh, by the way 00:07
for $var { ... } never flattens $var
$ variables do not flatten either. 00:08
r: sub collate-same(@a) { my $iv; gather { while +@a { $iv = @a[0]; take gather { take @a.shift while (+@a and @a[0] == $iv) } } } }; sub rle(@a) { my $subs = collate-same(@a); gather for @($subs) { take [+$_, $_[0]] } }; say rle([1, 1, 1, 2, 2, 2]).perl;
p6eval rakudo 4eeffc: OUTPUT«([1, 1], [1, 1], [1, 1], [2, 2], [2, 2], [2, 2]).list␤»
00:08 stephenlb left
quietfanatic huh 00:08
yeah, the for is now flattening the nested lists. 00:09
r: sub collate-same(@a) { my $iv; gather { while +@a { $iv = @a[0]; take gather { take @a.shift while (+@a and @a[0] == $iv) } } } }; sub rle(@a) { my $subs = collate-same(@a); gather for $subs.lol { take [+$_, $_[0]] } }; say rle([1, 1, 1, 2, 2, 2]).perl;
p6eval rakudo 4eeffc: OUTPUT«([6, 1, 1, 1, 2, 2, 2],).list␤»
quietfanatic erk!
timotimo whoops :)
quietfanatic I no longer understand anything :)
timotimo i have never understood anything
quietfanatic r: sub collate-same(@a) { my $iv; gather { while +@a { $iv = @a[0]; take gather { take @a.shift while (+@a and @a[0] == $iv) } } } }; sub rle(@a) { my $subs = collate-same(@a); gather for $subs[] { take [+$_, $_[0]] } }; say rle([1, 1, 1, 2, 2, 2]).perl; 00:10
p6eval rakudo 4eeffc: OUTPUT«([1, 1], [1, 1], [1, 1], [2, 2], [2, 2], [2, 2]).list␤»
00:10 stephenlb joined 00:11 spider-mario left
timotimo let's take collate-same out of the equation for now 00:12
r: sub rle(@a) { my $subs = collate-same(@a); gather for $subs[] { take [+$_, $_[0]] } }; say rle([1, 1, 1, 2, 2, 2]).perl
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&collate-same' called (line 1)␤»
timotimo r: sub rle(@a) { my $subs = @a; gather for $subs[] { take [+$_, $_[0]] } }; say rle([[1, 1, 1], [2, 2, 2]]).perl;
p6eval rakudo 4eeffc: OUTPUT«([3, 1], [3, 2]).list␤»
timotimo see, it works now
quietfanatic That's because of your []
You're creating a List of Arrays here
collate-same was creating a List of Lists. 00:13
timotimo right, okay
r: sub rle(@a) { my $subs = @a; gather for $subs[] { take [+$_, $_[0]] } }; say rle([(1, 1, 1), (2, 2, 2])]).perl;
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 2, near "[(1, 1, 1)"␤»
timotimo r: sub rle(@a) { my $subs = @a; gather for $subs[] { take [+$_, $_[0]] } }; say rle([(1, 1, 1), (2, 2, 2)]).perl;
p6eval rakudo 4eeffc: OUTPUT«([1, 1], [1, 1], [1, 1], [2, 2], [2, 2], [2, 2]).list␤»
timotimo so i'll have to figure out how to make a list of arrays in my collate-same
quietfanatic and, while there ought to be ways to make LoLs not flatten, it's apparently really difficult.
timotimo would take (gather {...}).array work?
quietfanatic [gather {...}]
worked when I tried it above 00:14
timotimo ah, neat
cool, taht makes it work completely 00:15
quietfanatic r: sub collate-same(@a) { my $iv; gather { while +@a { $iv = @a[0]; take [gather { take @a.shift while (+@a and @a[0] == $iv) }] } } }; sub rle(@a) { gather for @a { take [+$_, $_[0]] } }; say rle([1, 1, 1, 2, 2]).perl
p6eval rakudo 4eeffc: OUTPUT«([1, 1], [1, 1], [1, 1], [2, 2], [2, 2]).list␤»
quietfanatic er...
oh whoops
r: sub collate-same(@a) { my $iv; gather { while +@a { $iv = @a[0]; take [gather { take @a.shift while (+@a and @a[0] == $iv) }] } } }; sub rle(@a) { gather for collate-same(@a) { take [+$_, $_[0]] } }; say rle([1, 1, 1, 2, 2]).perl
p6eval rakudo 4eeffc: OUTPUT«([3, 1], [2, 2]).list␤» 00:16
quietfanatic there we go
timotimo i suppose a true functional programmer would scoff at my ineptitude
quietfanatic A true functional programmer wouldn't flatten anything ever 00:18
timotimo oh, very much not
lists are always deeply nested trees
unbalanced trees
00:19 thelazydeveloper left
timotimo what are those things called? devolved? like a triangle where all points are on a line would be a devolved triangle? 00:19
quietfanatic very unbalanced :)
degenerate.
timotimo ah, of course
00:20 stephenlb left 00:46 skids joined 00:48 zhutingting joined 00:52 stephenlb joined 00:53 prettyrobots left 01:00 quietfanatic left 01:02 scott___ joined
timotimo huh 01:03
r: my @a = [1, 2, 3, 4, 5]; say @a[0]
p6eval rakudo 4eeffc: OUTPUT«1 2 3 4 5␤»
timotimo so putting an array into a @-sigil'd variable will turn it into a list with the array as its first item?
kurahaupo same as P5? 01:04
colomon r: my @a = 1, 2, 3 , 4, 5; say @a[0]
p6eval rakudo 4eeffc: OUTPUT«1␤»
colomon r: my @a = [1, 2], 3 , 4, 5; say @a[0] 01:05
p6eval rakudo 4eeffc: OUTPUT«1 2␤»
kurahaupo btw what's with the unicode \u2424 at the end of those outputs?
colomon kurahaupo: that's the newline at the end of the say statement
benabik That's the code for N/L
kurahaupo I gathered that was the intent; was just wondering why. (I'm guessing it has something to do with IRC perhaps splitting records on CR and/or LF boundaries) 01:07
(why not something more typical like LF or CR+LF) 01:08
benabik Yes. IRC only has one line messages, so the newline needs to be converted to the Unicode
colomon kurahaupo: it's just an easy way to visualize where the newlines are.
kurahaupo ok, thanks
timotimo kurahaupo: i never did any perl5, so that surprised me
i come from python, which might explain my urge to put [] everywhere i want to have a list
kurahaupo in P5 [...] returns a reference to an anonymous array 01:09
timotimo r: my @a = 1; say @a[0]; say @a[1];
p6eval rakudo 4eeffc: OUTPUT«1␤Any()␤»
timotimo mhm, mhm.
kurahaupo And a scalar can be assigned to an array, making it a single-element array
timotimo uh, what was the string concatenation operator again? 01:11
kurahaupo r: say "a" ~ "b";
p6eval rakudo 4eeffc: OUTPUT«ab␤»
timotimo ah, of course
kurahaupo r: say «a b» X~X «c d»; 01:12
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤Confused␤at /tmp/y2k0S7p2q7:1␤»
kurahaupo is clearly a bit behind on syntax :-(
timotimo no, that's not how you do it, you do X~ 01:13
if you want to cartesian-product-concatenate
r: say <a b c> X~ <1 2>
p6eval rakudo 4eeffc: OUTPUT«a1 a2 b1 b2 c1 c2␤»
kurahaupo This is where the DWIM-auto-dereference starts to do ones head in. 01:22
say ['a','b'] X~ 1 ... 3; 01:23
r: say ['a','b'] X~ 1 ... 3;
p6eval rakudo 4eeffc: OUTPUT«a1 a2 a3 b1 b2 b3␤»
kurahaupo r: say ('a','b') X~ 1 ... 3;
p6eval rakudo 4eeffc: OUTPUT«a1 a2 a3 b1 b2 b3␤»
benabik r: say 'a', 'b' X~ 1..3
p6eval rakudo 4eeffc: OUTPUT«a1 a2 a3 b1 b2 b3␤»
benabik Interesting. ~ is lower than ,
kurahaupo r: @a = ['a','b']; say @a X~ 1 ... 3;
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤Variable @a is not declared␤at /tmp/PeqSkTkxaO:1␤»
kurahaupo r: my @a = ['a','b']; say @a X~ 1 ... 3;
p6eval rakudo 4eeffc: OUTPUT«a b1 a b2 a b3␤»
kurahaupo r: my @a = ['a','b']; say @a[0] X~ 1 ... 3; 01:24
p6eval rakudo 4eeffc: OUTPUT«a1 a2 a3 b1 b2 b3␤»
kurahaupo r: my @a = ['a','b']; say @a[0][0] X~ 1 ... 3;
p6eval rakudo 4eeffc: OUTPUT«a1 a2 a3␤»
benabik Oh!.
kurahaupo argh
timotimo ha! same mistake i did :)
benabik r: my @a = ['a', 'b']; say @a.perl
p6eval rakudo 4eeffc: OUTPUT«Array.new(["a", "b"])␤»
timotimo it's a list with an array as its first argument 01:25
benabik Assignment of array to array is not as expected.
01:25 xinming joined
kurahaupo just remember that [] makes a reference; leave them out if you want the list of elements 01:26
01:32 atrodo left
timotimo flattening and non-flattening kind of makes my head explode right now :| 01:32
(trying the "every combination of length $n from @a problem) 01:34
01:37 Guest51643 left
kurahaupo timotimo: I've been one of the perletariat from way back, but this is making me look more kindly at Python. :-( 01:38
timotimo hah :)
it seems my problems stem from the fact that X, would recurse into substructures or so 01:39
kurahaupo timotimo: would like to continue discussion but I need some lunch (I'm in UTC+12 -- where are you?) 01:40
01:40 zhutingting left
timotimo it's 0340 :) 01:41
UTC+2 i believe
kurahaupo perhaps I should ask "where's your body clock" rather than "where's your local timezone" :-)
geekosaur that doesn;t always work eeither. I know a bunch of people with non-24-hour sleep syndrome 01:42
(occasionally that includes me but it usually takes a trigger to send me into 32-hour mode) 01:43
kurahaupo is envious of those with 28-hour circadian rhythms
timotimo how do i concatenate two arrays? (or in this case a single item to the left of an array) 01:54
things flatten if i really don't want them to and stay structured even though i really, really want them flat :| 01:59
oh, okay. [($_, @a).flat] does the trick ... 02:00
Tene kurahaupo: is yours longer or shorter than 28-hour? 02:01
timotimo i made it! through strange means, but i made i. 02:03
r: multi combinations(@a, $n) { gather for ^+@a { my $elem = @a[$_]; my @others = @a[^$_], @a[$_+1..*]; take [($elem , @($_)).flat] for combinations(@others, $n - 1); } } multi combinations(@a, 1) { return @a; } multi combinations([], $n) { return [] } 02:05
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤Confused␤at /tmp/yrDVM4Nuct:1␤»
timotimo oh, yes
multi combinations(@a, $n) { gather for ^+@a { my $elem = @a[$_]; my @others = @a[^$_], @a[$_+1..*]; take [($elem , @($_)).flat] for combinations(@others, $n - 1); } }; multi combinations(@a, 1) { return @a; }; multi combinations([], $n) { return [] }; say combinations(^4, 2).perl;
r: multi combinations(@a, $n) { gather for ^+@a { my $elem = @a[$_]; my @others = @a[^$_], @a[$_+1..*]; take [($elem , @($_)).flat] for combinations(@others, $n - 1); } }; multi combinations(@a, 1) { return @a; }; multi combinations([], $n) { return [] }; say combinations(^4, 2).perl;
p6eval rakudo 4eeffc: OUTPUT«([0, 1], [0, 2], [0, 3], [1, 0], [1, 2], [1, 3], [2, 0], [2, 1], [2, 3], [3, 0], [3, 1], [3, 2]).list␤»
timotimo r: multi combinations(@a, $n) { gather for ^+@a { my $elem = @a[$_]; my @others = @a[^$_], @a[$_+1..*]; take [($elem , @($_)).flat] for combinations(@others, $n - 1); } }; multi combinations(@a, 1) { return @a; }; multi combinations([], $n) { return [] }; say combinations(^4, 3).perl;
p6eval rakudo 4eeffc: OUTPUT«([0, 1, 2], [0, 1, 3], [0, 2, 1], [0, 2, 3], [0, 3, 1], [0, 3, 2], [1, 0, 2], [1, 0, 3], [1, 2, 0], [1, 2, 3], [1, 3, 0], [1, 3, 2], [2, 0, 1], [2, 0, 3], [2, 1, 0], [2, 1, 3], [2, 3, 0], [2, 3, 1], [3, 0, 1], [3, 0, 2], [3, 1, 0], [3, 1, 2], [3, 2, 0], [3, 2, 1]).…
timotimo i'm not necessarily proud of this, or how perl6 handles this, but i'm sure there's a much simpler approach 02:07
02:11 tanzdebil joined
timotimo the innermost take was expressed with a Z, before, which i thought was nice, but it didn't work at that time and i haven't put it back there yet. that may be something nice for improving this 02:11
tanzdebil so... random parametric roles question, anyone?
timotimo never made one of those 02:13
a bit like "is native("foo.so")?
02:13 orafu left 02:14 orafu joined
tanzdebil so, it's not immediately obvious to me why we can do... 02:16
role Foo[$x] { method foo($t) { say "$x,$t!" } }
but not
role Boo[@x] { method boo($t) { say "{@x.perl},$t!" } } 02:17
timotimo what was the decision behind putting the parameters in [] instead of the more "traditional" ()? 02:18
i can't even paste the first declaration into my rakudo :( 02:20
r: role Foo[$x] { method foo($t) { say "$x,$t!" } }
p6eval rakudo 4eeffc: ( no output )
timotimo seems to be fixed in more recent versions
tanzdebil well it doesn't do anything by itself 02:21
timotimo when i do that, i get Could not instantiate role 'Foo': - Not enough positional parameters passed; got 1 but expected 2 02:22
tanzdebil you need to "does" it, then it breaks
timotimo r: role Foo[$x] { method foo($t) { say "$x,$t!" } }; say Foo;
p6eval rakudo 4eeffc: OUTPUT«None of the parametric role variants for 'Foo' matched the arguments supplied.␤Cannot call '_block1433'; none of these signatures match:␤:(Mu , Mu $x)␤␤ in any specialize at src/gen/Metamodel.pm:1898␤ in <anon> at src/gen/Metamodel.pm:2169␤ in <anon> at src/gen/…
02:22 zhutingting joined
timotimo r: role Foo[$x] { method foo($t) { say "$x,$t!" } }; say &Foo; 02:23
p6eval rakudo 4eeffc: OUTPUT«Nil␤»
tanzdebil lemme construct a working example for the Foo[$x] case ...
timotimo don't bother, i need to leave and get (a lot of) sleep
tanzdebil ok, no prob 02:26
02:37 Psyche^ joined
tanzdebil so here's that fail case, if anyone's awake... 02:40
se v6; role Foo[$x] { method foo($t) { say "$x,$t!" } } class Nifty does Foo[42] {}; Nifty.new().foo(7); role Boo[*@x] { method foo($t) { say "{@x.perl},$t!" } } class Yummy does Boo[<a b c>] {}; Yummy.new().boo(7);
02:40 Patterner left, Psyche^ is now known as Patterner
tanzdebil or rather; 02:40
use v6;
role Foo[$x] { method foo($t) { say "$x,$t!" } }
class Nifty does Foo[42] {}; 02:41
role Boo[*@x] { method foo($t) { say "{@x.perl},$t!" } }
role Boo[*@x] { method foo($t) { say "{@x.perl},$t!" } }
class Yummy does Boo[<a b c>] {};
Yummy.new().boo(7);
give or take a few repeated lines. 02:42
02:42 lue left 02:46 lue joined 02:47 thou left 02:48 kaare_ joined
tanzdebil g'nite all! 03:00
03:04 tanzdebil left
patspam perl6: say (^3).pick(4) 03:30
p6eval rakudo 4eeffc: OUTPUT«1 0 2␤»
..niecza v19-13-g442e075: OUTPUT«1 2 0␤»
03:52 prettyrobots joined 04:27 zhutingting left 04:37 am0c left 04:40 robinsmidsrod left 04:42 robinsmidsrod joined 04:46 thou joined 04:51 xinming left 04:52 xinming joined 05:25 kaleem joined 05:30 birdwindupbird joined 05:56 stephenlb left 05:58 stephenlb joined 06:02 xinming left 06:04 thou left, zhutingting joined 06:15 wtw joined 06:16 am0c joined 06:43 prettyrobots left 06:44 prettyrobots joined 06:48 zby_home left 06:58 birdwindupbird left 06:59 birdwindupbird joined
diakopter hrm 07:06
moritz \o 07:16
jnthn++ # blog
07:18 GlitchMr joined
moritz phenny: ask masak did you push the rakudo and nqp version tags? 07:18
phenny moritz: I'll pass that on when masak is around.
07:21 xinming joined
moritz r: say Date.today - Date.new('1981-09-15') 07:23
p6eval rakudo 4eeffc: OUTPUT«11266␤»
moritz if your dates have a sane format, Date.new parses them for you :-)
jnthn morning, #perl6 07:24
diakopter mostly likes Windows 8 so far 07:25
07:26 SamuraiJack joined
tadzik hello #perl6 07:27
jnthn: nice blog post!
GlitchMr eval
buubot_backup GlitchMr: No output.
GlitchMr perl6: print Date.new
p6eval niecza v19-13-g442e075: OUTPUT«===SORRY!===␤␤Undeclared name:␤ 'Date' used at line 1␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1402 (die @ 5) ␤ at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) ␤ at /home/p…
..rakudo 4eeffc: OUTPUT«2012-12-24»
GlitchMr 2012-12-24?
07:28 hoelzro|away is now known as hoelzro
tadzik christmas! 07:28
GlitchMr But, this default argument is almost useless
moritz that's kinda the point
Date.new is pretty useless
it just says "give me a new Date", without saying which one 07:29
GlitchMr In JavaScript, new Date() returns current time, but I guess that we have "now" for that
moritz so, you get one
07:29 stephenlb left
moritz if you want something more specific, be more specific+# 07:29
s/\W+$// 07:30
GlitchMr What's wrong with exception instead of this useless special case
moritz it used to die, and somebdody complained about that 07:31
so I changed it :-)
GlitchMr Uhmmm... I guess it counts as easter egg 07:32
Except it's Christmas
Not Easter
Also, isn't it day early?
jnthn WAT? Christmas in on the 25th :P 07:33
GlitchMr Or perhaps it's release date, but wrong year 07:34
jnthn moritz, tadzik: Happy you liked it :)
sorear just assumed that the 24th was German christmas :D
moritz well, christmas eve 07:35
GlitchMr ok then
jnthn Yeah, it's Christmas eve in the UK also. But I think in some countries, the 24th is the day all the fun stuff happens. 07:37
GlitchMr github.com/rakudo/rakudo/blob/nom/...m#L451-458 07:38
I guess it's this piece of codew
code*
moritz it is 07:44
07:44 FireFly left, ruoso left 07:46 ruoso joined
jnthn commute & 07:47
GlitchMr Just wondering, is DateTime-local-timezone for internal use? 07:49
I cannot find it in Synopsis 07:50
07:53 FireFly joined 07:56 prettyrobots left
GlitchMr github.com/perl6/roast/blob/master...s.t#L35-36 07:57
what?
Is abs() magical in some way?
tadzik r: say abs(70596).WHAT.gist 07:58
p6eval rakudo 4eeffc: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏Int()' (indicated by ⏏)␤ in method Numeric at src/gen/CORE.setting:9572␤ in sub prefix:<abs> at src/gen/CORE.setting:2327␤ in sub prefix:<abs> at src/gen/CORE.setting:2327␤ …
masak mornings, #perl6.
phenny masak: 07:18Z <moritz> ask masak did you push the rakudo and nqp version tags?
Timbus r: say abs(70596).WHAT
p6eval rakudo 4eeffc: OUTPUT«Parameter '' requires an instance, but a type object was passed␤ in method Bridge at src/gen/CORE.setting:2749␤ in sub infix:<<> at src/gen/CORE.setting:2674␤ in sub prefix:<abs> at src/gen/CORE.setting:2690␤ in block <anon> at /tmp/JssaY41pHr:1␤␤»
GlitchMr prefix:<abs> 07:59
I see...
But, it has parenthesis directly after word
So it should be used as function
Timbus r: say +(1)
p6eval rakudo 4eeffc: OUTPUT«1␤»
Timbus no
masak moritz: had pushed nqp's, not Rakudo's. now fixed. moritz++ for double-checking.
masak-- for forgetting. :/ 08:00
GlitchMr if(1, 2) is call to if() function, so why abs(4) isn't call to abs()
Timbus maybe there is none 08:01
r: say &abs(70596)
p6eval rakudo 4eeffc: OUTPUT«No such method 'Nil' for invocant of type 'Int'␤ in <anon> at src/gen/BOOTSTRAP.pm:799␤ in any <anon> at src/gen/BOOTSTRAP.pm:796␤ in block <anon> at /tmp/3IpnQP3lXS:1␤␤»
GlitchMr perl6: sub abs($a) { 42 }; sub sin($a) { ' :)' }; print abs(10), sin(20) 08:02
p6eval niecza v19-13-g442e075: OUTPUT«Potential difficulties:␤ $a is declared but not used at /tmp/5Q8gYww59J line 1:␤------> sub abs(⏏$a) { 42 }; sub sin($a) { ' :)' }; print␤␤42 :)»
..rakudo 4eeffc: OUTPUT«10 :)»
GlitchMr "42 :)" in Niecza and "10 :)" in Rakudo 08:03
And Niecza seems to do it correctly
Timbus r: sub prefix:<if> (*@a) { say "iffn hell" }; if(1 > 2); 08:04
p6eval rakudo 4eeffc: OUTPUT«iffn hell␤»
GlitchMr n: sub prefix:<if> (*@a) { say "iffn hell" }; if(1 > 2); 08:05
p6eval niecza v19-13-g442e075: OUTPUT«===SORRY!===␤␤Undeclared routine:␤ 'if' used at line 1␤␤Potential difficulties:␤ @a is declared but not used at /tmp/nreyvWcrgX line 1:␤------> sub prefix:<if> (*⏏@a) { say "iffn hell" }; if(1 > 2);␤ &prefix:<if> is d…
GlitchMr It seems that Rakudo has problems with prefixes
Timbus mystery solved iguess 08:06
GlitchMr But still, it should be function call as Perl 6 specification says
perl6: print so(30).WHAT 08:07
p6eval rakudo 4eeffc: OUTPUT«False»
..niecza v19-13-g442e075: OUTPUT«Bool()»
Timbus yyyep. yep pretty broken. 08:08
GlitchMr So, parsing prefixes has higher priority than parsing function calls with ( after them 08:09
Good thing that only prefixes are sleep, abs, not and so 08:11
Why sleep is prefix anyways?
literal prefixes* 08:12
moritz hysterical raisins and all
I want to make abs and sleep normal functions
GlitchMr perl6: print so(1)
p6eval rakudo 4eeffc, niecza v19-13-g442e075: OUTPUT«True» 08:13
GlitchMr I guess that Niecza has "so" function?
perl6: sub so($a) { not $a }; print so(1)
p6eval niecza v19-13-g442e075: OUTPUT«False»
..rakudo 4eeffc: OUTPUT«True»
GlitchMr good
08:15 fhelmberger joined
masak moritz: 08:16
08:16 sergot joined
masak moritz: +1 08:16
sergot hi o/
08:19 fhelmberger left
GlitchMr perl6: say False.Array.Bool 08:19
p6eval niecza v19-13-g442e075: OUTPUT«Unhandled exception: Unable to resolve method Array in type Bool␤ at /tmp/jz5ImVmBdc line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3918 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3919 (module-CORE @ 562) ␤ at /home…
..rakudo 4eeffc: OUTPUT«True␤»
masak sergocie! \o/ 08:23
08:26 fgomez left
masak about 2012-12-24 v. 2012-12-25, just consider it one of those cute "global culture" things, where the rest of us don't just adopt imperialistic US/UK defaults without questioning. 08:27
like ASCII and Unicode ;)
sergot \o/
submethod BUILD starts befor .new or after? 08:29
nr: class A { submethod BUILD { say 'build'; }; method new() { callsame; say 'new'; }; }; A.new 08:31
p6eval rakudo 4eeffc, niecza v19-13-g442e075: OUTPUT«build␤new␤»
sergot My mistake. 08:32
nr: class A { submethod BUILD { say 'build'; }; method new() { say 'new'; callsame;}; }; A.new
p6eval rakudo 4eeffc, niecza v19-13-g442e075: OUTPUT«new␤build␤»
08:35 kaare_ left
sergot n: class A { has $.a; submethod BUILD { say $.a; }; } 08:35
p6eval niecza v19-13-g442e075: OUTPUT«===SORRY!===␤␤Virtual call $.a may not be used on partially constructed object at /tmp/OWn5q3UZ5W line 1:␤------> lass A { has $.a; submethod BUILD { say ⏏$.a; }; }␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/…
tadzik oh, that requires some dirty magic 08:36
it's nothing like Moose
r: class A { has $.a = 7; submethod BUILD(:$!a) { say $!a } }; A.new.a.say # or something like this
p6eval rakudo 4eeffc: OUTPUT«Any()␤Any()␤»
tadzik damn
I never know, I guess writing your own new() is easier than writing your own BUILD 08:37
dalek c/html-search: 1b78322 | (Geoffrey Broadwell)++ | / (2 files):
Add generation of HTML search page from search_template.html; requires jQuery UI
c/html-search: 034fe94 | (Geoffrey Broadwell)++ | search_template.html:
Add a noscript banner to search_template.html
c/html-search: 9bacf67 | (Geoffrey Broadwell)++ | html/ (15 files):
Add jQuery and jQuery UI components needed for new search page
japhb moritz, for your perusal: ^
08:38 bbkr1 joined
japhb Adds a search.html next to index.html that allows quick search of docs with autocomplete, and immediate satisfaction (in-page load of doc). 08:38
Still a work in progress, but should make sense as a PoC.
moritz japhb++ 08:44
japhb And on that note, I think I can finally sleep. :-) 08:46
Let me know if you want any changes before merging it back to master.
moritz good night japhb :-)
japhb And good * to you.
:-) 08:47
&
dalek ast: 39f2806 | moritz++ | S32-list/minmax.t:
[minmax.t] do not rely on abs being a prefix op
08:51
08:57 kurahaupo left
moritz r: say abs(-5) + 1 08:58
p6eval rakudo 4eeffc: OUTPUT«4␤»
moritz that's simply wrong
S03:262
r: say not(0) + 1
p6eval rakudo 4eeffc: OUTPUT«False␤»
moritz r: say (not 0) + 1 08:59
p6eval rakudo 4eeffc: OUTPUT«2␤»
moritz submits rakudobug 09:00
masak o.O 09:01
that's just horrible. 09:02
jnthn kill all the prefixes.
masak death. kill. fire.
moritz jnthn: well, there's a good reason for 'not' and 'so' being prefixes
(low precedence)
jnthn appears from the above there's good reason for them not to be also ;-) 09:03
tadzik :)
moritz jnthn: no, it's a rakudobug
masak r: say not(True) || False
jnthn Oh?
p6eval rakudo 4eeffc: OUTPUT«False␤»
moritz jnthn: if rakudo did it right, there wouldn't be a problem with them being prefixes
jnthn Hm
moritz not(0) should be parsed as a sub, not as a prefix
masak aye.
jnthn how on earth does that work, I wonder... 09:04
dalek ecs: 36ccdac | moritz++ | S03-operators.pod:
kill abs and sleep as prefixes

they live on as normal subroutines
09:05
09:11 mucker joined 09:12 zhutingting left
GlitchMr So, parrot compilation uses 101% of CPU for me... 09:15
ok
09:18 daxim joined
Timbus squeezing out every last hertz. 09:19
parrot is so good, it actually speeds your processor up 1% to compile it that tiny fraction faster. 09:20
masak as a result, after ten hours of intense computation, your CPU is actually 6 minutes in the future. 09:28
huf without an undelay circuit, that's fairly useless
GlitchMr PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5584 glitchmr 20 0 889m 810m 3932 R 101 13.7 1:44.51 perl6
Or perhaps top is lying for me 09:29
masak probably just a rounding error.
09:30 sporous left
GlitchMr Most likely yes 09:30
09:30 sporous joined
tadzik heh, looks like I didn't contribute to Tallinn 09:30
:|
jnthn Fun fact: when looking for hotels there, I tried to find one with many floors, so I could make a pun about us staying in a tall inn :) 09:33
masak tadzik: don't worry, you'll be in next month's contributor list ;)
GlitchMr Perhaps I should port perldoc.perl.org/Text/Abbrev.html for fun :P 09:35
dalek ast: 3a41ccc | Coleoid++ | S05- (7 files):
Fix all currently broken smartlinks to S05
09:36
ast: 726f78c | Coleoid++ | S05-modifier/ignoremark.t:
Add test for long spelling of :ignoremark
ast: 25c7944 | Coleoid++ | S (3 files):
Merge branch 'master' of github.com/perl6/roast
09:38 kaare_ joined
tadzik GlitchMr: yeah, that'd be cool 09:39
masak +1
tadzik maybe with a more PErl6-ish interface
GlitchMr Yeah 09:40
More Perl6ish interface would be returning hash instead of taking hash or glob
tadzik aye
GlitchMr # got: 'ab ab a ab bc bc b bc' 09:56
# expected: 'a ab ab ab b bc bc bc'
I wanted to compare hashes 09:57
tadzik sort them first 09:58
GlitchMr ok, is_approx worked
tadzik maybe is_deeply does that automagically
GlitchMr Oh, wait... is_approx is for number
s
tadzik aye 09:59
GlitchMr Yes, is_deeply seems to work
Thanks
10:01 Woodi left 10:07 scott___ left 10:09 pochi left
masak is_deeply++ 10:09
tadzik . o O ( is_deeplier )
10:18 crab2313 joined
sjn . o O ( is_deepity ) 10:18
10:20 telex joined
dalek osystem: 14669c5 | GlitchMr++ | META.list:
Add Text::Abbrev
10:27
GlitchMr Hopefully it will work 10:28
colomon n: say abs(-5) + 1
p6eval niecza v19-13-g442e075: OUTPUT«6␤»
colomon n: say abs -5 + 1
p6eval niecza v19-13-g442e075: OUTPUT«4␤»
tadzik GlitchMr++ 10:31
did you test it on rakudo too?
GlitchMr Yes
resolve stage failed for Text::Abbrev: Project Text::Abbrev not found in the ecosystem 10:32
I guess it's caching
tadzik you probably need to wait for feather.perl6.nl:3000 to update 10:33
or I can give it a kick if you want to
GlitchMr ok then
Well, after all it's repository on GitHub 10:34
It's not repository hosted by feather
tadzik the modules list on feather updates hourly
GlitchMr Powered by Dancer 1.3002
heh, Perl 6
And it seem slow (sadly)
seems*
tadzik does it? 10:35
10:35 muixirt joined
GlitchMr feather.perl6.nl:3000 is somewhat slow 10:35
But well, it runs on Perl 6
tadzik it doesn't
muixirt hi there
GlitchMr So why I have got Perl 6 error? 10:36
tadzik but it is slow indeed, wonder why
I have no idea :)
GlitchMr feather.perl6.nl:3000/module/Acme;Meow gives error
Perl 6 error!
Oh wait, it's Perl 5
Weird 10:37
Perl 5 should be way faster than Perl 6
muixirt what are these long strings beginning with something like 'AQAAAEAAAAADAAAAWAAAAAMAA' in the compiler output? 10:38
moritz muixirt: base64-encoded, binary serialized objects
10:40 Woodi joined
tadzik GlitchMr: okay, I see it 10:40
let me look into it
okay fixed
and feather.perl6.nl:3000/module/Text;Abbrev is there too
moritz tadzik++
muixirt moritz: I was curious why files like CORE.setting.pbc consist so many 0x41 bytes (19%) 10:41
GlitchMr resolve stage failed for Text::Abbrev: Project Text::Abbrev not found in the ecosystem
Weird
tadzik GlitchMr: try panda update
GlitchMr "Acme::Abbrev not found"
tadzik it needs to re-fetch the full projects.json
I never taught it to use the /module/Foo;Bar syntax 10:42
wasn't that Text::Abbrev? :)
GlitchMr tadzik: paste.uk.to/c2bb2f1b
I guess it's ok
tadzik cool 10:43
GlitchMr Of course 6 tests because you should test your module :)
tadzik of course :)
muixirt moritz: and these binary serialized objects are mostly 0x00 bytes, hmm... 10:51
arnsholt jnthn: ping? 10:52
jnthn arnsholt: pong 10:55
arnsholt Just figured it out (I think) 10:58
Sorry to bother
OTOH, I think I know why argument marshaling in callbacks doesn't work \o/ 10:59
A new question though: To stash away the type object of a thing, I use .WHAT, right? 11:00
Nm, again. Since it's a parameter object, I just want .type 11:01
tadzik .^type maybe 11:02
moritz no, it's Paramater.type 11:03
GlitchMr modules.perl6.org/
jnthn .type for parameters
GlitchMr Why certain modules have - in name instead of ::
tadzik because people named them that
it's discouraged 11:04
but I didn't yet figure out a better name for Text-Tabs-Wrap for example
because it has both Text::Tabs and Text::Wrap
so Text::Tabs::Wrap doesn't make sens
GlitchMr Why those modules aren't separate then 11:05
tadzik ask the author
daxim flussence, it's you.
separate them, you need not slavishly adhere to era 5 mistakes 11:06
GlitchMr Text::Wrap depends on Text::Wrap, but Panda can handle dependencies 11:07
s/on Text::Wrap/on Text::Tabs/
moritz GlitchMr: please stop talking bullshit
GlitchMr Unless it cannot?
masak tadzik: overheard in the kitchen of masak: "что это? cheese?" -- "Yes, sir." :) 11:08
tadzik :D
GlitchMr: it can, but it's not the case
it's the distribution maintainer's choice how to organize stuf 11:09
Woodi .
GlitchMr hmmm... yeah 11:10
dalek c: af791a4 | moritz++ | lib/Parameter.pod:
start docs for Parameter
11:10 JimmyZ joined
daxim www.plat-forms.org/platforms-2012-rev-2 # interested in competing writing web applications? 11:12
arnsholt Ow. Zavolaj just tried to free a stack allocated string ^_^ 11:15
JimmyZ \o 11:17
GlitchMr I still end making things like $a<b> when I want %a<b>
11:17 crab2313 left
GlitchMr Heh, that's what happens after you program in Perl 5 11:18
JimmyZ r: my $a := { a => 'b', c => 'd' }; say $a<a>;
p6eval rakudo 4eeffc: OUTPUT«b␤»
JimmyZ r: my $a ::= { a => 'b', c => 'd' }; say $a<b>;
p6eval rakudo 4eeffc: OUTPUT«Any()␤»
11:21 Woodi left
GlitchMr Unable to parse header, couldn't find final ']' 11:23
ok, now I have to understand what this error means
dalek p/dyncall-callbacks: 3a126fd | (Arne Skjærholt)++ | / (4 files):
Initial callback handling.

It works, but it'll leak memory since all the information needed to handle a callback is recreated (and allocated on the heap) on each call without ever being freed.
GlitchMr oh, it's from Config::INI
tadzik oh, someone uses Config::INI :)
GlitchMr It's probably because of keys like [a\b] 11:24
token header { ^^ \h* '[' ~ ']' $<text>=[\w | \h]+ \h* <.eol>+ } 11:26
What is ~?
sergot nom: my $a = <1 2 3>; say $a.WHAT;
p6eval rakudo 4eeffc: OUTPUT«Parcel()␤»
sergot nom: my $a := <1 2 3>; say $a.WHAT;
p6eval rakudo 4eeffc: OUTPUT«Parcel()␤»
GlitchMr "The ~ operator is a helper for matching nested subrules with a specific terminator as the goal. It is designed to be placed between an opening and closing bracket, like so:"
oh, I see
11:27 cotto left, Woodi joined, cotto joined
GlitchMr [\w | \h]+ 11:28
So, valid INI keys can only have \w or \h (space)
I guess I shouldn't even attempt to make complex tree structures in INI 11:29
tadzik it's probably not the right tool for the job 11:30
GlitchMr Heh, I still would like to have INI instead of JSON 11:31
And YAML module doesn't seem to work on newest Rakudo
tadzik yeah
I don't think INI is suitable for tree structures 11:32
GlitchMr I would like to have something like paste.uk.to/a1f10a05 11:33
tadzik how about a dot?
Freenode.8ball
maybe look how weechat handles that, it uses some ini on steroids for its configuration 11:34
GlitchMr Unable to parse header, couldn't find final ']'
arnsholt jnthn: If you get a chance to look at my new branch that'd be great. I've got basic tests passing in Zavolaj, but there might be things I've overlooked
tadzik I don't mind adding some steroids to Config::INI if you need that
meh
GlitchMr I could use _, but it would be ugly 11:35
tadzik GlitchMr: don't hesitate to open a ticket in Config::INI for that
11:36 muixirt left
GlitchMr I guess I will use space instead 11:36
But still, I will make ticket
perl6: for 1 .. 3 -> $var { when 2 { print "2!" } } 11:38
p6eval niecza v19-13-g442e075: OUTPUT«Potential difficulties:␤ $var is declared but not used at /tmp/_ImoXHpmGf line 1:␤------> for 1 .. 3 -> ⏏$var { when 2 { print "2!" } }␤␤Use of uninitialized value in numeric context␤ at /home/p6eval/niecza/lib/CORE.setting line 1263 (…
..rakudo 4eeffc: OUTPUT«use of uninitialized variable $a of type Any in numeric context in block <anon> at /tmp/15jBZ4Q057:1␤␤use of uninitialized variable $a of type Any in numeric context in block <anon> at /tmp/15jBZ4Q057:1␤␤use of uninitialized variable $a of type Any in numeric con…
GlitchMr perl6: for 1 .. 3 -> my $var { when 2 { print "2!" } }
p6eval niecza v19-13-g442e075: OUTPUT«===SORRY!===␤␤In parameter declaration, typename 'my' must be predeclared (or marked as declarative with :: prefix) at /tmp/a1Gvo__wpH line 1:␤------> for 1 .. 3 -> my⏏ $var { when 2 { print "2!" } }␤␤Parse failed␤␤»… 11:39
..rakudo 4eeffc: OUTPUT«===SORRY!===␤Invalid typename in parameter declaration at line 2, near " $var { wh"␤»
GlitchMr perl6: for 1 .. 3 { when 2 { print "2!" } } 11:40
p6eval rakudo 4eeffc, niecza v19-13-g442e075: OUTPUT«2!»
colomon phenny: tell sorear Can you give me a quick overview of unidata / UCD.cs? I'm still thinking of trying to implement titlecase and maybe fc, but I'm finding the code kind of opaque... 11:42
phenny colomon: I'll pass that on when sorear is around.
11:48 sergot1 joined 11:49 sergot left 11:53 Woodi left, kaare_ left
GlitchMr I miss config files from my old bot: github.com/GlitchMr/YIBot/blob/mas...ple.coffee 11:53
11:53 sergot1 left
GlitchMr But well, whatever 11:54
11:57 Woodi joined, sergot joined
GlitchMr I guess I need good config format before doing anything 11:59
or screw it, let's go around the problem 12:01
12:06 sivoais left 12:08 Coleoid left 12:09 MayDaniel joined 12:11 sirrobert joined 12:17 daniel-s_ joined
daniel-s_ hi everyone 12:17
12:17 Woodi left, JimmyZ left
daniel-s_ I just wanted to say sorry about something 12:18
about a year ago I was going to contribute to the perl6 book
12:18 robinsmidsrod left
daniel-s_ ...but I basically couldn't figure out perl6 without documentation... and I couldn't write the documentation... well, you get where I'm going with this 12:18
masak bootstrapping issues.
daniel-s_ lol, yep 12:19
daxim camelia forgives you
12:19 JimmyZ joined
masak no need to apologize even. let's just learn from that and make it better for the next volunteer. 12:20
daniel-s_ although, I have to say that the regular expressions and grammar is much nicer in perl6 than other things I have been using recently
masak of course :) there are good ideas in there, that's why we like the language ;)
12:21 robinsmidsrod joined
sirrobert class A { has $.s is rw; method f () {$.s = "foo"; say self.^attributes[0];}}; A.new.f; 12:24
r: class A { has $.s is rw; method f () {$.s = "foo"; say self.^attributes[0];}}; A.new.f;
p6eval rakudo 4eeffc: OUTPUT«$!s␤»
sirrobert in that case, how do I *modify* $!s from within the method? 12:25
now that I can get my grubby little hands on it
tadzik $!s = 5 for example :)
sirrobert if I don't know the name in advance 12:26
if I just got it through self.^attributes[0]
jnthn .set_value
Or .get_value and then use assignment, I guess
sirrobert jnthn: ahhh, thanks (searching online =)
12:27 MayDaniel left
sirrobert perfecto -- thanks. 12:29
jnthn pzh 12:31
12:33 Woodi joined 12:38 cosimo left 12:41 cosimo joined
sergot nom: class A { has $.a = 1; submethod BUILD { say $.a } }; 12:45
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤Virtual call $.a may not be used on partially constructed objects␤at /tmp/Tvm7D8Fw17:1␤»
sirrobert you have to give the build method parameters after the name of the attributes
the object doesn't exist yet during the BUILD process.
masak sergot: $!a 12:46
sergot nom: class A { has $.a = 1; submethod BUILD($!a) { say $!a } }; A.new(a<b>) 12:47
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&a' called (line 1)␤»
sergot nom: class A { has $.a = 1; submethod BUILD($!a) { say $!a } }; A.new(:a<b>)
p6eval rakudo 4eeffc: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤ in submethod BUILD at /tmp/P2IjReDVlH:1␤ in method BUILDALL at src/gen/CORE.setting:625␤ in method bless at src/gen/CORE.setting:610␤ in method new at src/gen/CORE.setting:595␤ in block <anon> at /…
sirrobert maybe I was wrong... =)
sergot nom: class A { has $!a = 1; submethod BUILD($!a) { say $!a } }; A.new(:a<b>)
p6eval rakudo 4eeffc: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤ in submethod BUILD at /tmp/dV0isJooPB:1␤ in method BUILDALL at src/gen/CORE.setting:625␤ in method bless at src/gen/CORE.setting:610␤ in method new at src/gen/CORE.setting:595␤ in block <anon> at /…
jnthn :$!a
BUILD wants named params 12:48
sergot nom: class A { has $!a = 1; submethod BUILD(:$!a) { say $!a } }; A.new(:a<b>)
p6eval rakudo 4eeffc: OUTPUT«b␤»
sergot \o/
masak \o/
sergot: you can leave the 'has $.a' and it will still work. 12:49
sergot jnthn++ masak++ sirrobert++
Thanks
masak depends if you want and accessor generated or not.
12:51 JimmyZ_ joined
arnsholt jnthn: Is there some header I should include to get the Pointer PMC functions? 12:51
jnthn arnsholt: Do you not just use set_pointer and get_pointer vtable methods? 12:52
arnsholt Oh, those are VTABLEs
Right. That'll do it, probably
12:53 JimmyZ left, JimmyZ_ is now known as JimmyZ
tadzik nom: class A { has $!a = 1; submethod BUILD(:$!a) { say $!a } }; A.new() 12:58
p6eval rakudo 4eeffc: OUTPUT«Any()␤»
tadzik there
this I don't understand
masak what don't you understand about it? 12:59
please be specific about the nature of your confusion, or the confusion will just build and spread, like a virus. :)
arnsholt jnthn: BTW, how do I make sure my Parrot hash doesn't get GCed, when the only place it's reachable from is nqp_dyncall.ops?
tadzik why does it work for arguments from new, but not for default values
masak tadzik: because BUILD containing the attribute overrides the default?
tadzik I don't know, I'm the one asking :) 13:00
masak well, I'm fairly sure that's the reason.
tadzik nom: class A { has Int:D $!a = 1; submethod BUILD(:$!a) { say $!a } }; A.new() # hmm
p6eval rakudo 4eeffc: OUTPUT«Type check failed in assignment to '$!a'; expected 'Int' but got 'Any'␤ in submethod BUILD at /tmp/gqjP6gejy0:1␤ in method BUILDALL at src/gen/CORE.setting:625␤ in method bless at src/gen/CORE.setting:610␤ in method new at src/gen/CORE.setting:595␤ in block <a…
13:01 bluescreen10 joined
jnthn arnsholt: You can register the it as a GC root 13:01
arnsholt: I think that's done with some things near the top of nqp.ops
arnsholt Spiffy. 13:02
13:02 skids left
dalek p/dyncall-callbacks: 0897370 | (Arne Skjærholt)++ | src/ops/nqp_dyncall.ops:
Add caching of callback handling data.
13:10
sirrobert huh. Are hash keys reliably ordered? 13:18
r: my %h = {a => 1, c => 3, b => 2}; for %h.keys -> $k { say "$k: %h{$k}" } 13:19
p6eval rakudo 4eeffc: OUTPUT«a: 1␤c: 3␤b: 2␤»
colomon sirrobert: might be in practice, but if so it's a dodgy implementation detail. do not rely on it.
n: my %h = {a => 1, c => 3, b => 2}; for %h.keys -> $k { say "$k: %h{$k}" }
sirrobert ok, thanks. my habit from p5 was to assume unordered; just noticed it coming out
p6eval niecza v19-13-g442e075: OUTPUT«a: 1␤c: 3␤b: 2␤»
masak at least for small hashes on Parrot, they're ordered. but what colomon said.
sirrobert thanks 13:20
masak rn: my %h = 'a'..'z' Z=> 1..*; .say for .keys
p6eval niecza v19-13-g442e075: OUTPUT«Potential difficulties:␤ %h is declared but not used at /tmp/nwWdW_ULTH line 1:␤------> my ⏏%h = 'a'..'z' Z=> 1..*; .say for .keys␤␤0␤»
..rakudo 4eeffc: OUTPUT«0␤»
masak rn: my %h = 'a'..'z' Z=> 1..*; .say for %h.keys
p6eval niecza v19-13-g442e075: OUTPUT«z␤y␤x␤w␤v␤u␤t␤s␤r␤q␤a␤b␤c␤d␤e␤f␤g␤h␤i␤j␤k␤l␤m␤n␤o␤p␤»
..rakudo 4eeffc: OUTPUT«a␤b␤c␤d␤e␤f␤g␤h␤i␤j␤k␤l␤m␤n␤o␤p␤q␤r␤s␤t␤u␤v␤w␤x␤y␤z␤»
sirrobert What does that Z-> 1..* syntax mean? 13:21
13:21 birdwindupbird left
masak sirrobert: Z<op> does <op> pairwise for two lists. 13:21
sirrobert ohh cool
masak rn: .say for 1, 2, 3 Z+ 100, 200, 300
p6eval rakudo 4eeffc, niecza v19-13-g442e075: OUTPUT«101␤202␤303␤»
sirrobert that's crazy cool
hey, that reminds me... how do I do a general reduce operation? like [+] but for a general bit o' code 13:22
[{...}]
I searched for it, but couldn't find what I was looking for.
colomon nr: say reduce(* + * + 2, 1, 2, 3, 4) 13:23
p6eval rakudo 4eeffc, niecza v19-13-g442e075: OUTPUT«16␤»
sirrobert ah
great! thanks 13:24
(both)
colomon not sure if all the possible variations are implemented on both rakudo and niecza.
sirrobert all the possible variations of what?
colomon n: sub blue($a, $b) { $a + $b + 2 }; say [[&blue]] 1, 2, 3, 4 13:25
p6eval niecza v19-13-g442e075: OUTPUT«16␤»
colomon R: sub blue($a, $b) { $a + $b + 2 }; say [[&blue]] 1, 2, 3, 4
r: sub blue($a, $b) { $a + $b + 2 }; say [[&blue]] 1, 2, 3, 4
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤Unable to parse infixish, couldn't find final ']' at line 2, near "blue]] 1, "␤»
sirrobert hm
colomon yeah, that approach is niecza-only for now. 13:26
sirrobert ok =)
thanks, that's super helpful.
colomon if blue is a sub that takes two arguments, [&blue] is that sub as an infix operator, so you can use the [ ] meta-op reduce on it.
though it's probably clearer to just use the reduce sub in this case, IMO. 13:27
sirrobert yeah. A large bit of our code uses some complexish reductions
any syntax will do for now
masak I'd go with reduce &blue, even with the new syntax present. 13:28
[[ ]] looks weird to me.
sirrobert are keys and values of a hash garaunteed to be in the same order? 13:29
that is, correlating order 13:30
colomon er.... no? 13:32
sirrobert ok =)
13:34 SamuraiJack left
timotimo hm. Date.new should return the date the interpreter was started on, so people who don't read the docs will think it returns "today" when they try it in the repl, but when they run long-running programs, they get unexpected values 13:34
13:36 SamuraiJack joined
masak it doesn't return "today" on the REPL either. 13:37
returning the date the interpreter was started on doesn't feel less arbitrary (or less prone to bugs) than returning date of next Christmas.
and, well, people *do* ask a lot about when Perl 6 is going to be released :) 13:38
r: say Date.new
p6eval rakudo 4eeffc: OUTPUT«2012-12-24␤»
sirrobert ahhh... clean tests =) 13:39
timotimo :D 13:40
GlitchMr I guess that Date.new will be removed when Rakudo will implement whole spec
13:42 jaldhar left
sirrobert gonna go watch batman. more code later =) 13:43
13:46 birdwindupbird joined
masak r: say sqrt(-1) x 8, ", Batman!" 13:47
p6eval rakudo 4eeffc: OUTPUT«NaNNaNNaNNaNNaNNaNNaNNaN, Batman!␤»
13:49 masak left
colomon :p 13:49
13:51 seldon joined, kaleem left
GlitchMr I guess I shouldn't depend on Date.new return date of Christmas? 13:51
13:53 sivoais joined, sivoais left 13:54 sivoais joined
moritz not until it's specced 13:54
13:55 masak joined
masak , it turns out, sucks at irssi 13:56
colomon Until official p6 release, the date is Christmas Eve? 13:58
jnthn colomon: No, some Europeans just have funny ideas when Christmas is :P 14:05
masak at least in .se and .de, Christmas falls on Christmas Eve.
colomon bizarre. 14:06
;)
GlitchMr Just wondering, is it possible to make custom pragmas in Perl 6? 14:08
flussence good <?= gmstrftime() ?>, *
14:08 PacoAir joined
arnsholt jnthn: While cleaning up warnings in NQP code I'm familiar with, there are a couple of get_storage_spec functions that return specs with garbage values for spec.bits 14:09
Do you have a preference on whether I should set them to 0 or sizeof(void *) * 8? 14:10
14:18 yvesago left 14:19 prettyrobots joined 14:20 fgomez joined
tadzik r: my $a = 'git://foo'; $a ~~ s[git://][]; say $a 14:21
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<[ ]>, couldn't find final ']' at line 2, near "git://][ht"␤»
tadzik r: my $a = 'git://foo'; $a ~~ s|git://||; say $a
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤Confused␤at /tmp/imjTmn3ngf:1␤»
tadzik r: my $a = 'git://foo'; $a ~~ s/'git://'/''/; say $a 14:23
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤Confused␤at /tmp/5oFCSSc1pD:1␤»
[Coke] ews at Date.new==xmas 14:26
masak [Coke]: I think 'Mu' is a silly name for 'Object'. 14:31
[Coke]: and I don't like the new semantics of » hypers.
[Coke]: and I think it's a bad idea to provide non-Latin-1 quote delimiters without an ASCII fallback. 14:33
your complaint is about a harmless frivolous unspec'd implementation-specific non-feature. :) 14:34
tadzik is it the moment when I say "I don't like BUILD"? :P
masak yes :)
14:34 SamuraiJack left, SamuraiJack joined
moritz "Mu" was from a time where we expected to use it in a lot of places where we meant "undef" 14:36
and it turns out that doesn't happen in many places
[Coke] masak: I agree with your #1 and #3. 14:37
(I don't know anything about your #2, though.)
moritz because we don't use ~~ undef
and because we use 'Any' in most places
[Coke] figures out why pugs sported failures... it's au++'s fault! ;) (when I do the build, I run "make" in Pugs. if the cabal setup changes, it aborts make and tells you to reconfig.) 14:38
[Coke] will just have to keep an eye on that for now.
jnthn arnsholt: sizeof(void *) * 8
arnsholt: It only really makes sense to use that value for inlining things, but it's better that it's not chunk. 14:39
er, junk
moritz GlitchMr: lib/lib.pm6 in rakudo is a custom pragma
14:40 zhutingting joined
arnsholt jnthn: Makes sense, yeah 14:41
GlitchMr Well, but lib.pm6 ignores scopes 14:42
pmichaud good morning, #perl6 14:47
phenny pmichaud: 18 Jul 02:39Z <[Coke]> tell pmichaud the problem with not upgrading parrot as soon as possible is that we're less likely to notice when it's broken.
14:47 mucker left
jnthn morning, Pm! :) 14:47
masak pmichaud! \o/
pmichaud [Coke]: We can start maintaining "minimum Parrot required" and "recommended Parrot" versions 14:49
arnsholt jnthn: Speaking of warnings, there're a bunch of "dereferencing type-punned pointer" thingies. Not something we need to worry about, right?
14:50 wtw left 14:54 daniel-s_ left 14:55 prammer left 14:56 prammer joined, prammer left 14:57 prammer joined
pmichaud Sometimes I worry that when I say something in the channel, it goes quiet all of a sudden. 14:59
14:59 thou joined
JimmyZ \o/ 14:59
masak \o/ 15:00
cognominal_ pmichaud, many people listen and do not talk or read the logs
moritz pmichaud: that's just statistical noise 15:01
pmichaud moritz: I notice it a lot. :) 15:02
jnthn arnsholt: Probably not :)
JimmyZ pmichaud: I have the same feelling sometimes
pmichaud I guess I often tend to say things as people are finishing up a thread :-) 15:03
GlitchMr karma glitchmr 15:04
aloha glitchmr has karma of 5.
15:07 nodmonkey joined
moritz r: say :(::T ::S $x).parameters[0].type_captures.perl 15:10
p6eval rakudo 4eeffc: OUTPUT«use of uninitialized value of type Mu in string context in any <anon> at src/gen/BOOTSTRAP.pm:104␤␤use of uninitialized value of type Mu in string context in any <anon> at src/gen/BOOTSTRAP.pm:104␤␤===SORRY!===␤error:imcc:Sub '11_1342797029.34056' not found␤␤ in …
moritz bug!
r: say :(::T $x).parameters[0].type_captures.perl
p6eval rakudo 4eeffc: OUTPUT«use of uninitialized value of type Mu in string context in any <anon> at src/gen/BOOTSTRAP.pm:104␤␤use of uninitialized value of type Mu in string context in any <anon> at src/gen/BOOTSTRAP.pm:104␤␤===SORRY!===␤error:imcc:Sub '11_1342797055.49862' not found␤␤ in …
moritz r: say :(::T $x) 15:11
p6eval rakudo 4eeffc: OUTPUT«use of uninitialized value of type Mu in string context in any <anon> at src/gen/BOOTSTRAP.pm:104␤␤use of uninitialized value of type Mu in string context in any <anon> at src/gen/BOOTSTRAP.pm:104␤␤===SORRY!===␤error:imcc:Sub '11_1342797064.24714' not found␤␤ in …
moritz r: :(::T $x)
p6eval rakudo 4eeffc: OUTPUT«use of uninitialized value of type Mu in string context in any <anon> at src/gen/BOOTSTRAP.pm:104␤␤use of uninitialized value of type Mu in string context in any <anon> at src/gen/BOOTSTRAP.pm:104␤␤===SORRY!===␤error:imcc:Sub '11_1342797070.34498' not found␤␤ in …
moritz r: sub f(::T ::U $x) { }; say &f.signature.params[0].type_captures.perl
p6eval rakudo 4eeffc: OUTPUT«Array.new("T", "U")␤»
moritz submits rakudobug 15:12
15:14 birdwindupbird left
dalek c: cd5c790 | moritz++ | lib/Parameter.pod:
more Parameter docs
15:14
moritz 787 15:16
sorry
15:24 bbkr1 left, domidumont left 15:25 kaare_ joined 15:27 thelazydeveloper joined 15:30 tanzdebil joined
tanzdebil moin, moin! 15:30
masak tanzdebil: hi there! 15:31
15:33 nodmonkey left
pmichaud masak++ # compiler release, thanks! 15:36
masak you're welcome.
15:36 tanzdebil left
masak raises his tea cup for many releases to come 15:36
pmichaud I'm still planning to do next week's Star release. 15:37
moritz pmichaud: I'll write some deprecation notice about the IO subsystem 15:43
pmichaud: also since the feedback from users on managing changes has been very sparse, I'd suggest to add a note to the announceme 15:45
that calls people to comment
pmichaud +1 15:46
15:49 leprevost joined 15:57 JimmyZ left 15:58 hoelzro is now known as hoelzro|away
jnthn r: :($sig, $literals, $we-hasn't-em) # I think 15:59
p6eval rakudo 4eeffc: ( no output )
jnthn oh...maybe we kinda do :) 16:00
Must just be about typevars then
flussence random question! how can I introspect a sub/method to get its arity?
masak r: say (my sub ($a, $b) {}).arity 16:01
p6eval rakudo 4eeffc: OUTPUT«2␤»
jnthn r: sub foo($a) { }; say &foo.arity
p6eval rakudo 4eeffc: OUTPUT«1␤»
flussence (more specifically, I have an object and I just want to grep its methods that take no args)
masak r: say (my sub ($a, $b?) {})."$_"() for <arity count>
p6eval rakudo 4eeffc: OUTPUT«1␤2␤»
jnthn .^methods.grep(*.arity == 0)>>.name # or so 16:02
masak oh that's nice.
flussence I was looking through Method.^methods and I must've missed that. oh well.
jnthn r: say Int.^methods.grep(*.arity == 0)>>.name
p6eval rakudo 4eeffc: OUTPUT«␤»
jnthn r: say Int.^methods.grep(*.arity == 1)>>.name
p6eval rakudo 4eeffc: OUTPUT«Int Num Rat FatRat abs Bridge chr sqrt floor round ceiling sign conj rand sin asin cos acos tan atan atan2 sec asec cosec acosec cotan acotan sinh asinh cosh acosh tanh atanh sech asech cosech acosech cotanh acotanh cis Complex log exp truncate isNaN Real log10 suc…
masak flussence: but note the difference between .arity and .count above.
jnthn Note that the invocant contributes to the arity.
masak flussence: make sure you're using the one you want.
jnthn So you really want == 1
timotimo r: say $_.name, $_.arity, $_.count for Int.^methods 16:05
p6eval rakudo 4eeffc: OUTPUT«Int11␤Num11␤Rat12␤FatRat12␤abs11␤Bridge11␤chr11␤sqrt11␤base22␤floor11␤round11␤ceiling11␤sign1Inf␤conj11␤rand11␤sin11␤asin11␤cos11␤acos11␤tan11␤atan11␤atan21Inf␤sec11␤asec11␤cosec11␤acosec11␤cotan11␤acotan11␤sinh11␤asinh11␤cosh11␤acosh11␤tanh11␤atanh11␤sech11␤asech1…
japhb moritz, any objection to merging the html-search branch of doc?
timotimo how come the count of atan2 is infinity?
16:06 tanzdebil joined
tanzdebil (sorry, dropping in and out) 16:06
anyway, I've got a little parametric roles question, if anyone's up for that
basically, it seems that we can parametrize on one (or more) variables which are scalar-like, but not on anything array-like, at present (4.4.0). 16:07
ie. we can do "role Foo[$x]" but not "role Foo[@x]", or $@x if that matters.
correct?
jnthn Hm, I'd epect role Foo[@x] to work 16:09
pmichaud me to
*too
it just puts a Positional constraint on the parameter
16:10 muixirt joined
jnthn r: role Foo[@x] { } 16:10
p6eval rakudo 4eeffc: ( no output )
jnthn r: role Foo[@x] { }; class C does Foo[[1,2,3]] { }
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤Cannot use '[1,2,3]' as an argument to a parametric role as its value is not known at compile time at line 2, near " { }"␤»
jnthn Ah.
pmichaud r: role XYZ[@a] { }; class ABC does XYZ[Array] { }; say ABC.WHAT;
p6eval rakudo 4eeffc: OUTPUT«ABC()␤»
jnthn r: role Foo[@x] { }; class C does Foo[(constant @ = [1,2,3])] { }
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤Can only use get_who on a SixModelObject␤»
jnthn eek, that's probably an error reporting fail 16:11
r: role Foo[@x] { }; constant @foo = [1,2,3]; class C does Foo[@foo] { }
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤Cannot use '@foo' as an argument to a parametric role as its value is not known at compile time at line 2, near " { }"␤»
jnthn hmmm.
tanzdebil well the declaration works, but it's the "does" that breaks.
jnthn yEAH
*Yeah
pmichaud r: role Foo[@x]; my $x = 5 but Role[(1,2,3)];
muixirt is the compiler released?
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&Role' called (line 1)␤»
tanzdebil yup, Foo[<abc>] is where it breaks. 16:12
pmichaud r: role Foo[@x]; my $x = 5 but Foo[(1,2,3)];
p6eval rakudo 4eeffc: ( no output )
pmichaud r: role Foo[@x]; my $x = 5 but Foo[(1,2,3)]; say $x;
p6eval rakudo 4eeffc: ( no output )
pmichaud well, note that <abc> isn't a Positional.
jnthn pmichaud: { }, not ;
pmichaud: You didn't actually use the role there.
pmichaud r: role Foo[@x] { }; my $x = 5 but Foo[(1,2,3)]; say $x;
p6eval rakudo 4eeffc: OUTPUT«5␤»
pmichaud r: role Foo[@x] { }; my $x = 5 but Foo[(1,2,3)]; say $x ~~ Foo
p6eval rakudo 4eeffc: OUTPUT«True␤»
tanzdebil okay, lemme give that a try... 16:13
jnthn Yeah, it's not a role problem per se, more a "what's considered constant at compile time" one.
Well, s/constant/known/
pmichaud r: role Foo[@x] { method ttt { @x } }; my $x = 5 but Foo[(1,2,3)]; say $x.ttt
p6eval rakudo 4eeffc: OUTPUT«1 2 3␤»
masak timotimo: I have no idea.
pmichaud looks like it works to me :-)
masak r: say &atan2.arity
p6eval rakudo 4eeffc: OUTPUT«0␤»
pmichaud r: role Foo[@x] { method ttt { @x } }; my $x = 5 but Foo[<abc>]; say $x.ttt
p6eval rakudo 4eeffc: OUTPUT«None of the parametric role variants for 'Foo' matched the arguments supplied.␤Cannot call '_block1433'; none of these signatures match:␤:(Mu , @x)␤␤ in any specialize at src/gen/Metamodel.pm:1898␤ in any specialize at src/gen/Metamodel.pm:1556␤ in <anon> at src… 16:14
timotimo r: say Int.atan2.arity
p6eval rakudo 4eeffc: OUTPUT«Parameter '' requires an instance, but a type object was passed␤ in method Bridge at src/gen/CORE.setting:2749␤ in method atan2 at src/gen/CORE.setting:2586␤ in block <anon> at /tmp/vtp8Us3s5T:1␤␤»
masak r: say Int.find_method('atan2').arity
p6eval rakudo 4eeffc: OUTPUT«No such method 'find_method' for invocant of type 'Int'␤ in block <anon> at /tmp/5hpMlBEmG4:1␤␤»
timotimo r: say &Int.atan2.arity
p6eval rakudo 4eeffc: OUTPUT«use of uninitialized value of type Nil in numeric context in block <anon> at /tmp/jOExmQzD9b:1␤␤No such method 'arity' for invocant of type 'Num'␤ in block <anon> at /tmp/jOExmQzD9b:1␤␤»
masak r: say Int.^find_method('atan2').arity
p6eval rakudo 4eeffc: OUTPUT«1␤»
timotimo ah.
masak r: say Int.^find_method('atan2').count
p6eval rakudo 4eeffc: OUTPUT«Inf␤»
masak r: say &atan2.count
p6eval rakudo 4eeffc: OUTPUT«Inf␤»
16:14 alvis joined
masak seems a bit much. 16:14
jnthn pmichaud: It's trying to use the role with compile time composition that's at issue, it seems, since there's not a way to pass one.
16:14 rsimoes left
jnthn pmichaud: Part of the issue is knowing what we know... :) 16:15
masak r: say atan2(1, 2, 3, 4, 'a bunch of molasses', 'twin waterfalls', Pair.new)
p6eval rakudo 4eeffc: OUTPUT«Cannot call 'atan2'; none of these signatures match:␤:(Num:D $a, Num:D $b = { ... })␤:(Real \$a, Real \$b)␤:(\$a, \$b)␤␤ in block <anon> at /tmp/tRaksyAgng:1␤␤»
pmichaud jnthn: sure, but the basic question of "can we do 'role Foo[@x] { ... }'?" is answered "Yes."
jnthn pmichaud: Yes, true. :)
pmichaud i.e., the parameter isn't limited to being a scalar.
jnthn Right.
pmichaud proto sub atan(|$) {*} 16:16
jnthn pmichaud: For the upcoming Star, do you want me to spend some tuits on the Windows setup thing?
pmichaud jnthn: I was planning to do that if needed, but you can also if you like.
jnthn pmichaud: Or are you gonna be in a tuitful situation in the next days?
pmichaud: Well, it's really if you hvae time or not :)
pmichaud: I'd really like it to happen and can put tuits on it, but equally I can get toqast pushed along too :)
pmichaud e.g., if you feel strongly that it really needs to be MSVC+Active instead of Strawberry :-)
I'm committed to make it happen, I expect to have tuits. 16:17
jnthn pmichaud: I don't feel it needs to be, I just know that if it's me that does it we probably get that. ;-)
masak pmichaud: yes, but many subs have that proto, and don't have a count of Inf.
jnthn pmichaud: OK, I leave it with you then; lemme know if you need any input/testing/help etc.
masak proto sub ceiling(|$) { * }
pmichaud jnthn: +1
jnthn r: say &ceiling.count
p6eval rakudo 4eeffc: OUTPUT«Inf␤»
masak r: say &ceiling.count
p6eval rakudo 4eeffc: OUTPUT«Inf␤» 16:18
pmichaud r: say &ceiling.count
p6eval rakudo 4eeffc: OUTPUT«Inf␤»
masak hm.
or maybe they all do. :/
pmichaud To fix that, change the |$ to a $
masak aye.
pmichaud ...but that means that all instances of multi &atan can only ever have one argument.
(which perhaps is fine... that's just the resulting implication)
flussence r: class Foo { method new(Str $a, Str $b?) {...}; submethod BUILD(Str :$a, Str :$b?) {...}; method bar { ... } }; say Foo.^methods(:local).grep(*.count == 1) 16:19
p6eval rakudo 4eeffc: OUTPUT«BUILD bar␤»
flussence named params mess me up a bit...
16:21 PacoAir_ joined
jnthn *.signature.params == 1 # may cut it 16:21
flussence == 2 seems to work, that doesn't seem right though :S
dalek ar: 1034038 | pmichaud++ | skel/docs/announce/2012.07:
Add draft announcement for 2012.07.
16:22
pmichaud the invocant is one of the parameters.
jnthn oh, yes
16:22 snearch joined
masak beer outside & 16:22
jnthn beer &
pmichaud thus BUILD can take at most one positional; the invocant
all: feel free to update the 2012.07 star announcement with stuff
16:23 PacoAir_ left, PacoAir_ joined
flussence I can understand the Foo.bar(Foo) part, but not where it's getting a second one from... 16:23
pmichaud ...second one? 16:24
flussence r: class Foo { method new(Str $a, Str $b?) {...}; submethod BUILD(Str :$a, Str :$b?) {...}; method bar { ... } }; say Foo.^methods(:local).grep(*.signature.params == 2)
p6eval rakudo 4eeffc: OUTPUT«bar␤»
16:24 PacoAir_ left, PacoAir left
pmichaud methods have an implicit slurpy hash, I think. 16:25
flussence oh, ok.
16:25 drbean left
tanzdebil patrick: yes, that example you fed to the bot -- "role Foo[@x] { method ttt { @x } }; my $x = 5 but Foo[(1,2,3)]; say $x.ttt" -- was what I was trying to do, basically. 16:25
pmichaud r: class Foo { method bar { ... } }; say Foo.^methods(:local).grep(*.signature.params == 2).[0]
p6eval rakudo 4eeffc: OUTPUT«bar␤»
pmichaud r: class Foo { method bar { ... } }; say Foo.^methods(:local).grep(*.signature.params == 2).[0].perl
p6eval rakudo 4eeffc: OUTPUT«method bar(Foo , Mu *%_) { ... }␤»
pmichaud flussence: there ya go
flussence it's still == 2 if I define it as "method bar()", is that supposed to happen? 16:26
pmichaud yes, methods always get the slurpy hash.
flussence ok then
pmichaud note that .params.Numeric is not always related to .count or .arity :)
16:27 drbean joined
pmichaud I'm afk, lunch and errands 16:28
16:28 MayDaniel joined
sergot Failed to load libpcre again... 16:28
Only for me? :)
16:29 prettyrobots left, PacoAir joined 16:36 tanzdebil left 16:37 tanzdebil joined
tanzdebil back again... 16:38
moritz japhb: no objections
japhb: i haven't looked at in detail
japhb: but I think it's fine
tanzdebil jnthn, patrick: so yeah, the @x needs to be a constant, got that. 16:39
but it seems to work only in the "but" case, but not in the "does" case. right?
that's what I was experiencing (sorry, could have been more clear).
16:39 MayDaniel left
moritz tanzdebil: what code are you talking about? 16:40
moritz misses context
tanzdebil moritz: this was from a few minutes back...
r: role Foo[@x] { method ttt { @x } }; class Bar does Foo[(1,2,3)]; my $x = Bar.new; say $x.ttt 16:43
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤Cannot use '(1,2,3)' as an argument to a parametric role as its value is not known at compile time at line 2, near "; my $x ="␤»
moritz ah
I guess it should simply evaluate the expression
tanzdebil r: role Foo[@x] { method ttt { @x } }; my $x = 5 but Foo[(1,2,3)]; say $x.ttt
p6eval rakudo 4eeffc: OUTPUT«1 2 3␤»
tanzdebil so that's the issue. 16:44
moritz instead of looking at whether it's known
tanzdebil: yes, 'but' is run time here
I might know how to fix that
tanzdebil but the (1,2,3) looks a lot like a compile time constant :)
moritz it does :-) 16:45
but it compiles to infix:<,>(1, 2, 3)
tanzdebil so is there another way to present it?
16:46 MayDaniel joined
moritz r: role Foo[@x] { method ttt { @x } }; class A does Foo[ BEGIN { 1, 2, 3 }] { } 16:46
p6eval rakudo 4eeffc: ( no output )
moritz r: role Foo[@x] { method ttt { @x } }; class A does Foo[ BEGIN { 1, 2, 3 }] { }; say A.new.tt
p6eval rakudo 4eeffc: OUTPUT«No such method 'tt' for invocant of type 'A'␤ in block <anon> at /tmp/lbk7G0NGPl:1␤␤»
moritz r: role Foo[@x] { method ttt { @x } }; class A does Foo[ BEGIN { 1, 2, 3 }] { }; say A.new.ttt
p6eval rakudo 4eeffc: OUTPUT«1 2 3␤»
tanzdebil righty, then. 16:47
moritz that's a workaround really
it should just work
tanzdebil but at least something.
...and will save me from committing a somewhat more awkward hack. so thanks, everyone! 16:49
16:50 zhutingting left
tanzdebil ...but does (1,2,3) really need to be compiled, then? 16:50
moritz well, role-into-class composition is at compile time 16:51
so whatever you write in there is evaluated at compile time
tanzdebil which is cool
moritz suppose you wrote
tanzdebil right
moritz my ($a, $b) = (1, 2);
tanzdebil well, yeah, that's obviously an expression.
moritz class A is Foo[($a, 2, $b)] { } 16:52
tanzdebil the trick is that (1,2,3) doesn't "look" like an expr.
moritz right
but our constant folder is not smart enough to detect that :(
tanzdebil but then maybe I'm not looking at it right
fair enough. not a complaint, but just a thought.
moritz so I'd argue that it's better to simply always evalute the stuff in there at compile time
*evaluate
which wasn't possible at the time this code was written
thou o/ 17:02
17:03 tanzdebil left, Chillance joined
thou is there a de-facto modern perl logging module? 17:04
(that i can steal API from) 17:05
tadzik .u circle 17:06
phenny U+25CB WHITE CIRCLE (○)
17:07 tanzdebil joined
tanzdebil (back after a 10 min drop) 17:07
arnsholt Good thing I didn't push my warnings cleanups. Apparently I brokeded something 17:11
17:12 huf left
arnsholt Any git ninja tricks for amending commits in the middle of a history? 17:13
daxim git rebase --interactive
when in the editor, change the word pick to e 17:14
arnsholt Thanks! 17:15
daxim I do that a dozen times a day because like all humans I am made out of 80% fail
the usual history-munging caveat applies: this is only safe to do on unpublished commits 17:16
17:18 mucker joined, mucker left 17:19 ChibaPet left 17:20 mucker joined, mucker left
arnsholt Durr. I'm an absolute moron 17:20
17:21 mucker joined
tadzik tjs.azalayah.net/web/index.html \o/ 17:21
mpo with emmentaler test results
17:24 nodmonkey joined
arnsholt The problem: I changed a bunch of "return foo" in a switch to retval = foo and return retval at the end 17:24
What I didn't do was to put in the breaks >.< 17:25
tadzik :)
arnsholt daxim++ # rebase --interactive
daxim paste.scsys.co.uk/203154 # you might be interested in my .gitconfig 17:27
arnsholt Cool, thanks 17:30
tadzik tjs.azalayah.net/web/index.html now with nice onmouseover tooltips 17:33
rurban daxim: ri for rebase --interactive? I have rb for rebase and rbc, rbi 17:36
17:37 tanzdebil left
daxim precious precious keystrokes 17:41
tadzik heh, I didn't alias commit to ci, because I'd rather not commit stuff accidentally or without consideration 17:42
imagine having git checkouf -f master; git clean -fdx aliased to some short keystroke. Life in fear :)
17:44 crab2313 joined 17:47 takadonet joined
takadonet hey all 17:47
tadzik hey takadonet
takadonet look time no see 17:48
flussence o/
17:50 daxim left
dalek c: 1b78322 | (Geoffrey Broadwell)++ | / (2 files):
Add generation of HTML search page from search_template.html; requires jQuery UI
17:53
c: 034fe94 | (Geoffrey Broadwell)++ | search_template.html:
Add a noscript banner to search_template.html
c: 9bacf67 | (Geoffrey Broadwell)++ | html/ (15 files):
Add jQuery and jQuery UI components needed for new search page
c: 3e6a6a7 | (Geoffrey Broadwell)++ | / (17 files):
Merge branch 'html-search'
japhb moritz, can you htmlify and sync to doc.perl6.org? I doubt I have the permissions ... 17:54
Or does it happen automatically?
sorear good * #perl6 17:55
phenny sorear: 11:42Z <colomon> tell sorear Can you give me a quick overview of unidata / UCD.cs? I'm still thinking of trying to implement titlecase and maybe fc, but I'm finding the code kind of opaque...
sorear colomon: around? 17:56
17:59 silug joined 18:02 vlixes joined 18:04 pupoque joined 18:07 nodmonkey left
colomon sorear: am now 18:07
sorear: need to run to the grocery soon, but can talk for a few minutes if you've got the time. 18:08
sorear unifile: an ad-hoc archive of processed densely-coded unicode tables 18:09
18:09 vmspb joined
colomon sorear: did you create it? 18:09
sorear yes
colomon has found the tables for case folding and case changing and downloaded them.... 18:10
sorear sorear/multi-language-ucd contains a perl script that generates unifile from the Unicode 6.1 data tables
colomon oooo
sorear afair unifile already contains all of the machine readable data from 6.1
colomon that's on your github?
sorear yes 18:11
colomon just cloned it. :)
sorear so it looks like we have a 'Property' class which stores the inflated data tables 18:12
call DataSet.GetTable("moo") to pull out the table "moo" and inflate it 18:13
colomon what are those tables? I see "na", "na1", and "JSN"? 18:16
18:16 pupoque left
colomon na is named aliases? 18:17
sorear the tables which represent properties are named after the short names in PropertyAliases.txt
Name, Unicode_1_Name, Jamo_Short_Name
n: say "\c[HANGUL SYLLABLE GEUL]" # JSN is used for this 18:18
p6eval niecza v19-13-g442e075: OUTPUT«글␤»
colomon I see
sorear I think named aliases is just NamedAlias or so 18:19
colomon So if I say DataSet.GetTable("Cased") I will have a table of all the cased letters?
sorear yes
formatted as a LimitedProperty object with values Y and N 18:20
you may also find use for string properties like tc (Titlecase_Mapping) 18:21
colomon oooo, yes, that sounds very true
sorear if you haven't read the relevant sections of the unicode spec, I recommend doing so; the interfaces you are playing with are quite low level
colomon is it available online? I think I've only read summaries. 18:22
sorear yes 18:23
colomon so if I do GetTable("tc"), I get a StringProperty? If I look up a codepoint using it, will I get another codepoint?
(it being the StringProperty)
errr, guess it will be a string encoding that codepoint? 18:24
sorear you might get more than one codepoint.
colomon: is unicode.org down for you too? 18:25
sirrobert What's the name of the thing where you can create a custom type that wraps two other types? (e.g. StrInt to accept either Str or Int)
colomon hmmm... but all of them representing a single "answer", right?
sorear: looks like.
sorear when it comes back up, the file you want is www.unicode.org/versions/Unicode6.1.0/ch03.pdf 18:26
sirrobert: Union types.
sirrobert ah, thanks
colomon sorear: thank you
sorear case mapping can get a bit fiddly with things like ß and the Greek terminal and medial sigmas 18:27
18:27 vlixes left
colomon hopefully that will be enough to get me started out in the wilderness next week. If not, I may have to see if I can get an internet connection in the middle of nowhere. 18:27
sorear: understood.
moritz japhb: will resync, just a moment... 18:32
sirrobert Ok... google is being a jerk =) Can anyone help me out with some syntax for defining a union type type for, say, Bool and Str?
moritz subset BoolStr of Cool where any(Str, Bool); # should work 18:33
sorear union types are entirely conjectural at this point, they aren't really in the spec 18:34
moritz #C#
sirrobert moritz: Thanks; what's "Cool" ?
sorear: noted =)
moritz sorry, ronja speaking :-)
sirrobert: doc.perl6.org/type/Cool
flussence is there any difference in this case between that and Mu?
colomon sorear++ # gotta run buy noodles for evening potluck now.... 18:36
18:36 mucker left
sorear
.oO( ronja thinks we should move to ##csharp? )
18:38
18:40 atrodo joined
timotimo is the periodic table of operators still up to date? it's from 2009, did nothing in it change? 18:48
r: ?^9 18:51
p6eval rakudo 4eeffc: ( no output )
timotimo r: say ?^9
p6eval rakudo 4eeffc: OUTPUT«False␤»
18:51 bbkr left
timotimo r: say !9 18:51
p6eval rakudo 4eeffc: OUTPUT«False␤»
timotimo what's the big difference between the two?
sorear r: say !(True | False)
p6eval rakudo 4eeffc: OUTPUT«False␤»
sorear r: say ?^(True | False)
p6eval rakudo 4eeffc: OUTPUT«False␤»
sorear n: say ?^(True | False) 18:52
p6eval niecza v19-13-g442e075: OUTPUT«any(Bool::False, Bool::True)␤»
sorear n: say !(True | False)
p6eval niecza v19-13-g442e075: OUTPUT«False␤»
timotimo ah, it doesn't evaluate junctions, is that it?
"doesn't force bool context" perhaps?
sorear it behaves differently with junctons in niecza
timotimo oh, Rop, that's fun 18:57
moritz japhb: oh, and if you give me a public ssh key of yours, I can try to set up permissions for you to sync doc.perl6.org too 19:00
GlitchMr ?^ is for consistency as far I know 19:03
It's boolean not, just like !
? means boolean, and ^ (as prefix) means not 19:04
Unless it's upto operator
moritz r: say Num ~~ Cool 19:05
p6eval rakudo 4eeffc: OUTPUT«True␤»
moritz r: say CORE::.keys 19:06
p6eval rakudo 4eeffc: OUTPUT«&infix:<does> EXPORTHOW &COMP_EXCEPTION Pod Set Nil &THROW &set Baggy &postfix:<i> &RETURN-PARCEL &MAKE_REGEX AST CallFrame &bag Version &METAOP_HYPER &return-rw &return &METAOP_HYPER_POSTFIX &trait_mod:<will> &min &take-rw &infix:<max> &METAOP_HYPER_PREFIX &take &…
moritz r: say CORE::.grep(!*.defined).grep(*.isa(Cool)) 19:07
p6eval rakudo 4eeffc: OUTPUT«␤»
19:07 spaceships joined
moritz r: say CORE::.grep(!*.defined). 19:07
p6eval rakudo 4eeffc: OUTPUT«===SORRY!===␤Confused␤at /tmp/RLOmUAZJDp:1␤»
moritz r: say CORE::.grep(!*.defined)
p6eval rakudo 4eeffc: OUTPUT«␤»
moritz r: say CORE::[0].WHAT
p6eval rakudo 4eeffc: OUTPUT«PseudoStash()␤»
moritz r: say CORE::.keys.perl
p6eval rakudo 4eeffc: OUTPUT«("\&infix:<does>", "EXPORTHOW", "\&COMP_EXCEPTION", "Pod", "Set", "Nil", "\&THROW", "\&set", "Baggy", "\&postfix:<i>", "\&RETURN-PARCEL", "\&MAKE_REGEX", "AST", "CallFrame", "\&bag", "Version", "\&METAOP_HYPER", "\&return-rw", "\&return", "\&METAOP_HYPER_POSTFIX", … 19:08
moritz r: say CORE::.grep({!.value.defined && .value ~~ Cool})>>.key
p6eval rakudo 4eeffc: OUTPUT«␤»
moritz r: say CORE::.grep({!.value.defined})
p6eval rakudo 4eeffc: OUTPUT«␤»
19:09 robinsmidsrod left
moritz r: say CORE::.pairs[^10].perl 19:10
p6eval rakudo 4eeffc: OUTPUT«("\&infix:<does>" => 3, "EXPORTHOW" => 39, "\&COMP_EXCEPTION" => 43, "Pod" => 47, "Set" => 51, "Nil" => 87, "\&THROW" => 91, "\&set" => 119, "Baggy" => 127, "\&postfix:<i>" => 143)␤»
moritz what are those numbers?
19:11 skids joined
flussence maybe it's possible something horrible is happening and pointer offsets are leaking out... 19:13
moritz probably indexes, not pointers 19:14
but still LTA I'd guess
19:14 robinsmidsrod joined
moritz nqp::bindattr($stash, EnumMap, '$!storage', 19:15
pir::getattribute__PPs($ctx, 'lex_pad'));
seems like it stores the lexpad directly
r: say CORE::.keys.grep(/^<[A..Z]>/).map( { ::($_) } ).grep(Cool); 19:17
p6eval rakudo 4eeffc: OUTPUT«No type check cache and no type_check method in meta-object␤ in method reify at src/gen/CORE.setting:4953␤ in method reify at src/gen/CORE.setting:4964␤ in method reify at src/gen/CORE.setting:5055␤ in method reify at src/gen/CORE.setting:4964␤ in method reify…
moritz now WTF am I doing wrong this time :( 19:18
r: say ::('LazyScalar')
p6eval rakudo 4eeffc: OUTPUT«LazyScalar()␤» 19:19
19:19 GlitchMr left 19:21 SamuraiJack left
colomon sorear: unicode.org back up now. 19:22
moritz r: say Date ~~ Cool 19:23
p6eval rakudo 4eeffc: OUTPUT«False␤»
19:24 japhb_ joined
sorear colomon: yay! 19:24
colomon sorear: any words of wisdom on breaking up C# strings into codepoints? 19:25
moritz japhb++ # doc.perl6.org/search
japhb_ moritz, Glad you like it. :-) 19:26
Thanks for doing the sync, btw.
dalek kudo/nom: b15d33b | moritz++ | src/core/Parameter.pm:
expose sub signatures of a Parameter
sorear colomon: C# strings are encoded in UTF-16. look at codes and ord in Builtins 19:28
colomon sorear: ah, the classic MS approach. 19:31
sorear here and I thought it was because Java did it that way and C# started as a Java clone 19:32
colomon sorear: nope, MS C/C++ work the same way 19:33
benabik wide chars were fairly stand for a little while. 19:36
And once MS did it that way, it has to do it that way forever.
colomon as I understand it, these days wchar_t is 16 bit on MS and 32 bit on unix-y stuff, meaning they are completely non-standard. :( 19:38
colomon has to have portable Unicode handling C++ code. 19:39
benabik Huh. I thought it as 16 in ISO C++ 19:40
Oh. No, it's unspecified like every other type in C. :-/ 19:41
sorear I thiiink there's a spec requirement that wchar_t should be for a fixed width encoding of the native character set 19:42
which means that on Unicode platforms it ought to have at least 21 bits
benabik The only requirement is that conversions from char to wchar_t is done via zero-extension. Nothing else, so it can be a low as 8n 19:44
*8b
19:44 benabik left, benabik joined
benabik ref: unicode.org/versions/Unicode4.0.0/ch05.pdf - 5.2, page 109 19:45
[Coke] +# 07/20/2012 - rakudo++ (22935); niecza (89.76%); pugs (40.13%) 19:47
19:49 huf joined
[Coke] p: say "asdf".flip 19:49
p6eval pugs: OUTPUT«*** No such method in class Str: "&flip"␤ at /tmp/kiPX93Ado8 line 1, column 5 - line 2, column 1␤»
[Coke] p: say 40.13/89.76 19:50
p6eval pugs: OUTPUT«0.4470811051693404634581105169340463458111␤»
[Coke] aims for pugs running 50% of niecza's tests. ;)
who runs p6eval?
timotimo [Coke]: you mean "until next week"? 19:51
sorear [Coke]: moritz and me 19:52
flussence
.oO( shouldn't "asdf".flip return "ɟpsɐ"? )
19:53
benabik flussence: I think that's .rotate 19:54
[Coke] sorear: can you rebuild pugs?
tadzik that's .backflip
timotimo what about .barrelroll? 19:55
sorear [Coke]: probably, limited clue how.
timotimo Cool.barrelroll :)
moritz I thought you could roll [Coke] barrels :-) 20:00
sorear [Coke]: I'm about to install GHC on feather3! No wonder pugs wouldn't build
moritz sorear: don't install stuff on feather3
sorear: we build all the compilers for p6eval on feather1, and rsync the results over to feather3 20:01
sorear moritz: I'm listening
ok, found the real pugs build 20:03
20:04 prettyrobots joined
sorear yeah I have no clue how to get this to work. 20:08
cabal dep issues.
20:10 fridim_ joined
[Coke] probably needs "cabal update; cabal configure" 20:11
moritz and maybe rm -rf ~/.cabal/
dalek c: 12a4b7c | moritz++ | lib/Cool.pod:
[Cool] list of classes that inherit from Cool
20:12
c: 91f904f | moritz++ | sync:
[sync] log in as p6doc user
20:15 birdwindupbird joined 20:18 atrodo left 20:20 prettyrobots left
moritz anybody else want permissions on feather2 to resync the doc.perl6.org HTML files? 20:21
you need rakudo and Pod::To::HTML for that, and rsync
masak evening, #perl6
moritz and /msg me your public SSH key
\o masak
masak oh! jnthn and I should've been on #cqrs-perl6 today... we did a bunch of nice CQRS work on our hackathon.
sorear evening masak 20:22
masak well, next time.
we're still learning stuff and being amazed at how applicable all this is.
20:23 dpuu joined
sorear cabal: Couldn't read cabal file "HUnit/1.2.5.0/HUnit.cabal" 20:23
this is after rm -rf and update
i'm not going to spend any more time on this 20:24
benabik cabal--
dpuu Question about laziness. Using rakudo 12:06, I tried: perl6 -e '.say for gather { my $x = 1; for 1..10 { take $x++; sleep 1 } }'
it sleeps 10 seconds and then prints values 1 .. 10
tadzik I think for is not lazy enough 20:25
(yet)
dpuu My understanding of laziness was to get one value per second
tadzik it ought to be
dpuu I also tried (...)>>.say
masak yeah, don't do that one.
dpuu Also waits 10 seconds, but emits in random order
masak right.
>> un-preserves execution order. 20:26
20:26 takadonet left
masak in Rakudo, it messes the order up intentionally. 20:26
dpuu OK, I can understand that. It's intended for parallelism, afterall.
masak correct. 20:27
sorear dpuu: I suspect that using "take" inside "for" will not work well because "for" uses gather/take internally 20:31
masak r: take 10 20:33
p6eval rakudo b15d33: OUTPUT«take without gather␤ in block <anon> at src/gen/CORE.setting:335␤ in block <anon> at src/gen/CORE.setting:384␤ in block <anon> at /tmp/3ScXU750Rv:1␤␤»
moritz sorear: I don't think it does, in rakudo
dpuu It seemed to work from a perspective of functionality -- seems that the magic of lexical scoping worked.
masak r: for ^10 { take 10 }
p6eval rakudo b15d33: OUTPUT«take without gather␤ in block <anon> at src/gen/CORE.setting:335␤ in block <anon> at src/gen/CORE.setting:384␤ in block <anon> at /tmp/3qUXkVUUF0:1␤␤»
moritz sorear: 'for' uses MapIter under the hood, and gather/take use GatherIter
masak I really don't think `for` should be intercepting `take` in any implementation.
that just feels... wrong.
likewise, it feels wrong for `map` and `grep` to intercept it. 20:34
moritz aye
[Coke] pugs: say "what?" 20:35
p6eval pugs: OUTPUT«what?␤»
[Coke] sorear: thanks for trying. I know it's a PITA.
20:35 bluescreen10 left 20:39 vmspb left
colomon masak: +1 20:40
20:43 prettyrobots joined
masak I think I'm fine nowadays with the arguments for `map` and `grep` intercepting `next` et al. 20:48
but `take` feels like it just becomes less useful if it ends up inside some `map` and `grep` machinery.
sorear masak: it _shouldn't_ 20:50
masak oh, good.
sorear take is specced to bind to the lexically enclosing gather if there is one in preference to any dynamic gather
20:51 snearch left
masak oh, right. 20:52
and that was because I kvetched about this once before... :) 20:53
[Coke] gist.github.com/3153152
masak r: my @values = 5, 10 ... 30; $_ /= 2 when * > 10 for @values; say @values 20:54
p6eval rakudo b15d33: OUTPUT«5 10 7.5 10 12.5 15␤»
masak \o/
[Coke]: could you tell them that back? :)
there's already a way to do that in Perl 6, and it's less special-cased than the proposed 'whenever' way. 20:56
oh, I don't even need the * there, I think.
r: my @values = 5, 10 ... 30; $_ /= 2 when $_ > 10 for @values; say @values
p6eval rakudo b15d33: OUTPUT«5 10 7.5 10 12.5 15␤»
masak right.
flussence r: my @values := 5, 10 ... *; say @values[^15].grep(* > 10) »/» 2 20:57
p6eval rakudo b15d33: OUTPUT«7.5 10 12.5 15 17.5 20 22.5 25 27.5 30 32.5 35 37.5␤»
colomon is still not really comfortable with grep and map intercepting next, etc.
masak well, there are arguments both ways. 20:58
20:58 birdwindupbird left
masak but the argument for is basically that the `map`/`for` equivalence does run that deep. 20:59
[Coke] masak++ # thanks 21:02
they suggest "it" as a synonym for $_. :) 21:03
flussence
.oO( I've noticed most of the one-liners I write here are mostly-FP. maybe it's a sign I should go learn haskell... )
geekosaur 1liners and fp tend to go together... 21:04
masak FP is more than just lack of side effects, though. :) 21:05
21:06 seldon left
jnthn evening :) 21:07
masak jnthn! \o/
21:08 erkan left
benabik You can even do FP with side effects, although that's much easier in SML than Haskell. 21:09
(well, where side effects == mutable state)
masak aye. 21:10
sorear flussence: you should also learn J and/or K 21:11
[Coke] J/K
sorear curiously, neither of these languages has anythig to do with JK flip flops
masak I agree about learning one of those.
sorear Which one? 21:12
benabik Huh. Never heard of those.
masak either one. 21:13
geekosaur J I know of (and may even remember a little of). K? *hits google*
sorear "and don't confuse K with Lazy K"
masak sorear: the person I know (hakank) who dabbles in them seems to go back and forth between them regularly.
[Coke] J is ASCIIAPL, neh? 21:14
[Coke] wonders if his apl-on-parrot project still even compiles. 21:15
masak there's only one way to find out.
sorear J is more like APL 2
masak how so? 21:16
sorear Ken Iverson created APL. then, he created J to address a couple problems in APL: the character set issue, but also things like improving higher-order functions support 21:17
geekosaur K seems more ASCII-APL-ish, if I can believe the wikipedia article. J evolves various APL concepts, K seems to be more conservative in that respect
sorear (the current lead developer of J is Ken's son Eric Iverson. This amuses me for some reason.) 21:18
21:18 Rakudo09 joined 21:21 Rakudo09 left 21:22 dpuu left 21:36 crab2313 left 21:41 crab2313 joined 21:46 broquaint left 21:48 adam7504 joined 21:50 UncleFester6 joined
UncleFester6 BTW the issue with for and laziness is also addressed in RT 112716 21:52
21:52 broquaint joined 21:54 thrn joined
flussence UncleFester6: did you see the backlog? That compile error is a parrot GC problem, and there's at least 3 of us getting it now 21:54
sergot good night o/ 21:56
22:01 sergot left 22:04 kaare_ left
UncleFester6 flussence: just backlogged. Yes I noted that the problem seemed to happen in low memory environments - notebooks and netbooks. I don't know much about GCs but will take a look. 22:05
22:05 prettyrobots left 22:07 adam7504 left
thou is there a setlocale() call already available in rakudo? Or is a Locale.pm using NativeCall the right way to go, just for that one function? 22:08
btw, for my previous question, i think it makes most sense to do something similar to Log::Any, and implement a simple Log::Any::Adapter to $*ERR as a starting point 22:09
masak loul, I blougged! \o/ strangelyconsistent.org/blog/july-2...the-basket
thou (after doing some reading, and this nice blog: blogs.perl.org/users/steven_haryant...works.html )
masak again, I challenge people to break my game in ways I didn't anticipate. 22:11
I now have 109 tests for the game, all of which pass.
I probably need lots more tests.
22:13 adam7504 joined
moritz sysadmin question for feather2: is there a way to restrict user accounts to only allow rsync-over-ssh? 22:14
ie I have a user 'p6doc' which owns /var/www/doc.perl6.org and I want to restrict that user to not allow "normal" logins, just rsync
masak oh, oh, I read that somewhere about half a year ago... 22:15
here: troy.jdmz.net/rsync/index.html 22:16
22:17 whiteknight joined, whiteknight is now known as Guest20632
thou masak: on strangelyconsistent.org/blog/july-1...om-the-car the link to "be revealed when we open it" goes to the wrong commit 22:18
22:19 muixirt left
thou should be: github.com/masak/crypt/commit/d570...dbad236db6 22:19
lue masak: may I recommend some synonyms, such as 'x' for 'examine' and single letters for the compass directions and up and down? 22:21
masak thou: thank you, will fix. 22:23
lue: absolutely.
lue: are you willing to send pull requests?
if not, I'll simply get to them before the month is over.
lue Sure, I'll go fork in just a minute (I've thought of a couple of silly extra scenery objects just playing the game as well) 22:24
22:25 adam7504_ joined 22:26 pochi joined
moritz masak++ # troy.jdmz.net/rsync/index.html 22:26
I never knew about the extra syntax for .authorized_keys
masak \o/
22:27 prettyrobots joined, adam7504_ left, adam7504 left, prettyrobots left, fridim_ left
thou masak: one thing that i keep wishing for is a cleaner (um, what does that mean, though?) way to do stuff like github.com/masak/crypt/commit/a309...aad#L0R497 ; something like the Maybe monad for error handling, so I don't need to do explicit if ... { return True if ...; } return False; 22:29
masak hm, I don't really see now why I wrote it that way. 22:30
probably an artifact of copy/paste.
the middle condition there is useless. 22:32
masak patches
thou masak, another one that bugs me is: github.com/masak/crypt/blob/a309ab...crypt#L508 not that i have an idea how to improve it at the moment 22:33
seems like autovivification should be happening there
masak oh, probably. 22:34
I'll try that out and see if I get any warnings.
thou++
thou if not, then a python-esque getWithDefault($key, $default_value) is cleaner
masak no, we can't have that, can we? :P 22:35
moritz seems like %!exit_aliases{$!player_location}{$direction} // $direction should do, no?
thou well, not that python invented it, but that's where i tend to have to use it the most...
i'd like it to
moritz autovivifcation never happens through read-only accesses
thou thanks, autovivification is not what i want, i just want that to work w/o warnings or errors 22:36
masak and it does.
committing.
thou: github.com/masak/crypt/commit/3c8d...304708c8bd github.com/masak/crypt/commit/72cc...126619c63a 22:37
thou++
thou cool
masak here at crypt enterprises, we value customer feedback. 22:38
thou that second one in particular is a lot more fun to read 22:39
masak :) 22:40
I have this thing where sometimes I'm stuck in the workarounds of 2008.
I should probably take a Perl 6 course at some point :P
thou carl, while i'm on it, the other thing that bugs me is calling !apply_and_return() all the time. i keep hoping for some refactor that calls that automatically. iirc it even got left out at one time when needed, and caused a bug. 22:42
22:42 crab2313 left
moritz 00:38 < masak> here at crypt enterprises, we value customer feedback 22:43
ok, i want more cryptography, given the name :-)
masak hehe :)
moritz: I value your feedback :P
moritz at least rot-128 the save files or so :-) 22:44
thou uh-oh, did i open up the peanut gallery?
masak thou: yes, I'm on the lookout for such a change too. thing is, it has advantages and disadvantages.
moritz masak: was that a polite way to say no? :-)
masak moritz: no :)
moritz: I'll think about it.
mostly I'm just recreating last year's game right now. 22:45
but it would be foolish to ban actual improvements.
I recommend playing last year's version (on beijing) and reading the walls everywhere.
or just reading the description file straight off. 22:46
(last year's)
22:48 fgomez left, fgomez joined
cognominal_ jnthn++ # blogging 22:50
lue r: for ^10 { when 2 { say "2" }; when 5 { say "5"};}; 22:51
p6eval rakudo b15d33: OUTPUT«2␤5␤»
lue :)
thou masak: still on my code review kick, i think DirectionAliased should make use of opposite(); i know it might mean rooting around in %!exits{.room}, and assuming rooms are already connected, or some other cruftiness; or refactoring just putting aliases directly into the TwoRoomsConnected 22:54
feel free to tell me to stop :-)
22:54 UncleFester6 left
masak no, this is interesting. 22:55
lue is currently coding up a generic "synonym expansion" sub in crypt
masak thou: I can see the argument for making DirectionAliased bidirectional, but I actually consider it a feature that it's not. 22:56
thou i am sad you had to de-`handle`d methods in Crypt::Game; i was hoping the solution would involve finding a way to unpack the |$c param
masak thou: basically, "in" and "out" are not primary directions. they don't point anywhere in particular.
thou but they are in %opposites :-) 22:57
masak thou: I'm sad about that too. I don't understand well enough why the signatures can not be preserved through `handles`.
thou: hm, what are they doing in %opposites? that seems wrong. 22:58
thou take 'em out!
masak on it.
gone. 22:59
lue masak: can the player check what he's carrying yet? (the "inventory" command) 23:01
masak no, not yet. 23:02
though most of the mechanics for enabling that are in place one way or another.
the container model is mostly in place, for example.
23:03 thrn left
lue So I won't include the "i" synonym yet. 23:03
masak is curious to see what solution lue ends up with 23:04
lue: have you looked at last year's solution for that?
you might find it enlightening. 23:05
lue uh, no :) /me looks
masak github.com/masak/crypt/commits/2011 23:06
or github.com/masak/crypt/tree/2011 , rather. 23:07
moritz jnthn: I've tried moritz.faui2k3.org/tmp/role-sig.patch to make 'does Foo[(1, 2, 3)]' work, but now I get ./perl6 -e 'role Foo[@x] {method x() { say @x.perl }; class C does Foo[(1, 2, 3)] { }; C.new.x' => None of the parametric role variants for 'Foo' matched the arguments supplied. Cannot call ''; none of these signatures match: (and then a newline, and nothing more)
rerunning witih --ll-exception, that's from nqp;Perl6;Metamodel;ParametricRoleGroupHOW;specialize 23:08
could it be that specialize doesn't like reference types or something? 23:09
lue masak: I made a hash like that for the directions, but the others are essentially hard-coded in my expand_cmd sub (although I was thinking of replacing it all with a general "here's what to expand" hash) 23:11
lue in fact does just such a generalization
thou ok, i'm off for the weekend. have fun, #perl6 23:12
23:12 Vlavv left, kurahaupo joined 23:13 Coleoid joined
masak thou: \o 23:14
23:14 MayDaniel left
moritz r: role A[$x] { }; class C does A[1+1] { } 23:16
p6eval rakudo b15d33: OUTPUT«===SORRY!===␤Cannot use '1+1' as an argument to a parametric role as its value is not known at compile time at line 2, near " { }"␤»
moritz that one works locally
23:22 Vlavv joined
moritz jnthn: never mind, I was just being stupid :-) 23:24
forgot a curly, so the role was still open, and it didn't like that 23:25
23:26 kurahaupo left
dalek kudo/nom: 81328c3 | moritz++ | src/Perl6/World.pm:
evaluate argument list for compile time role application instead of whining that it is not known

  tanzdebil++ for bringing it to my attention
23:27
moritz sleep&
23:29 cognominal joined 23:30 cognominal_ left 23:35 fgomez left
lue masak: pull requested. Now I'll just add some stuff to the game that I feel like adding to it ("clouds" scenery object, etc.) 23:37
23:37 thou left
lue oh, one thing I think you'd like to fix masak is that I can't touch (or even examine!) the fire that blocks my path. 23:38
sorear $ examine fire 23:39
The fire is emitting thermal radiation which makes it painful to look at. You do not get a good look at it.
$ pick up firs 23:40
With what, your bare hands?
$ catch fire
OK.
lue suddenly thinks of the "escape" command you can type in the old Hitchhiker's Guide text game
sorear what does it do? 23:41
23:41 kurahaupo joined
lue >escape 23:41
You are so keen on escape that you literally leap through the fabric of the space-time continuum. You wake up in a shack on tenth-century
Earth. A dressing gown, a toothbrush, and a flathead axe lie by your bed. Before you have a chance to move, Mongol hordes sweep magnificently
across the plains of central Asia. They knock down your shack and burn the remains with you inside. You lose interest in the rest of the game.
masak ;) 23:42
moritz sorear: invoce the HCF opcode? .-)
masak lue: I'll have a look at the pull request tomorrow. going to bed now. 23:43
lue alright, goodnight masak o/
.oO(> catch fire \nIgnoring all warning, you successfully bathe yourself in one of man's greatest discoveries\n***You have died***)
23:44
masak 'night, #perl6 23:45
23:46 fgomez joined 23:59 user_5450 joined