00:03 cdarroch left 00:07 Transformer joined 00:08 _buno_ joined 00:10 _buno_ left, Transformer left 00:16 pencilk joined 00:38 snarkyboojum joined 00:43 envi^home joined
snarkyboojum 33k+ passing tests o/ 00:47
congrats to all the busy Perl 6 hacker types :)
00:49 whiteknight left 01:04 pnate left 01:09 pausenclown left 01:13 pausenclown joined 01:26 skids left, skids joined 01:30 pencilk left 01:33 Util_ joined 01:44 BrowserUk left
Util_ In [S32] Containers.pod, "=head2 Array" contains "=item delete" (method) and "=item :delete" (adverb). 01:45
In contrast, "=head2 Hash" contains only the adverb form of delete. Shouldn't the delete method also be in Hash?
01:47 Util_ is now known as Util 01:49 agentzh joined 01:51 pencilk joined 02:12 [mark] joined
snarkyboojum rakudo: my %hash = { 'perl5' => 'perl6', 'foo' => 'bar' }; my %other; map { %other.push: .key, .value }, %hash; say %other.perl 02:13
p6eval rakudo cde6ab: OUTPUT«{}␤»
snarkyboojum alpha: my %hash = { 'perl5' => 'perl6', 'foo' => 'bar' }; my %other; map { %other.push: .key, .value }, %hash; say %other.perl
p6eval alpha 30e0ed: ( no output )
02:16 Sarten-X left 02:18 snarkyboojum left 02:25 TiMBuS joined 02:26 snarkyboojum joined
snarkyboojum rakudo: my %hash = { "perl5" => "perl6", "foo" => "bar" }; my %other; map { %other.push: .key, .value }, %hash; say %other.perl 02:28
\
p6eval rakudo cde6ab: OUTPUT«{}␤»
snarkyboojum alpha: my %hash = { "perl5" => "perl6", "foo" => "bar" }; my %other; map { %other.push: .key, .value }, %hash; say %other.perl
p6eval alpha 30e0ed: ( no output )
snarkyboojum that returns {"foo" => "bar", "perl5" => "perl6"} locally (using alpha) 02:29
and returns {} locally using current master
what newbie mistake am I making? :)
Util snarkyboojum: where you say: 02:41
map {...}, %hash;
I think you need:
map {...}, %hash.pairs;
Something else might also be wrong; I don't have a current build at the moment.
snarkyboojum rakudo: my %hash = { 'perl5' => 'perl6', 'foo' => 'bar' }; my %other; %other.push: %hash.kv; say %other.perl 02:43
p6eval rakudo cde6ab: OUTPUT«{"foo" => "bar", "perl5" => "perl6"}␤»
02:43 tedv| joined
snarkyboojum that works, and it's neater 02:43
but I would have thought the other way would work as well
Util: yeah - tried that, but it fails on current master as well 02:56
but works on alpha
not sure if things have changed or master is buggy
in that area
Util but if you make %h mean the same as %h.kv in that situation, then don't you close the door on ever using `map` on *lists* of entire hashes/hashrefs?
my @AoH = map {...} ( %h1, %h2, %h3 );
snarkyboojum but I think it quite likely that I am buggy :)
Util (re: "work as well..."
snarkyboojum Util: I'm not sure I understand 02:57
Util snarkyboojum: more on that in a minute; back to your failing code... 02:58
2nd bug: map in void context does not work. Even though it should not be needed, assign the map to a junk hash.
snarkyboojum Util: ah sink context 02:59
03:01 BrowserUk joined
colomon masak++ 03:03
03:04 atomicstack joined
Util snarkyboojum: is anything still unresolved? 03:05
snarkyboojum Util: using map like you suggested works, but I've gone with push and .kv for now 03:06
for loop using .kv works as well
Util snarkyboojum: what are you trying to accomplish?
snarkyboojum rakudo: my %hash = { 'perl5' => 'perl6', 'foo' => 'bar' }; my %other; for %hash.kv -> $k, $v { %other.push: $k, $v }; say %other.perl
p6eval rakudo cde6ab: OUTPUT«{"foo" => "bar", "perl5" => "perl6"}␤»
snarkyboojum Util: just adding one hash to another :) 03:07
Util snarkyboojum: do you require `push` to prevent a duplicate key in hash2 from overlaying the value in hash1? 03:09
snarkyboojum this is interesting, from the spec "However, unlike assignment, when a duplicate key is detected, push coerces the colliding entry's value to an array and pushes the Pair's value onto that array"
03:10 colomon left
snarkyboojum rakudo: my %hash = { 'perl5' => 'perl6', 'foo' => 'bar' }; my %other = { 'perl5' => 'perl5.10'}; %other.push: %hash.kv; say %other.perl 03:11
pretty neat
p6eval rakudo cde6ab: OUTPUT«{"foo" => "bar", "perl5" => ["perl5.10", "perl6"]}␤»
Util snarkyboojum: neat indeed! I just saw the hash push earlier today. 03:16
03:17 JimmyZ joined
snarkyboojum :) 03:18
03:26 pencilk left 03:31 lestrrat is now known as lest_away 03:33 skids left
snarkyboojum perl6 identi.ca client using HTTP::Client (with an enhancement to do basic authentication), and running on current master :) gist.github.com/420530 03:34
and it works :)
03:40 gbacon left
snarkyboojum does carlins come into #perl6? 03:41
phenny: .seen carlins 03:42
.seen carlins
phenny Sorry, I haven't seen carlins around.
snarkyboojum .seen jnthn
phenny snarkyboojum: I last saw jnthn at 2010-05-31 21:02:55 UTC on #perl6
snarkyboojum I guess not
.seen carlin 03:43
phenny Sorry, I haven't seen carlin around.
snarkyboojum anyway carlin++ for http::client :) 03:44
snarkyboojum stops talking to himself and goes foraging for lunch
Util snarkyboojum++ # For real-world Perl 6 code 03:47
Util sleeps; will backscroll for answers to delete() question. 03:48
03:48 Util left 03:56 meppel joined
lue ohai 03:56
03:57 molaf joined 04:00 meppel left, meppl left 04:09 tedv| left 04:12 BrowserUk left 04:21 xinming_ joined 04:25 xinming left
snarkyboojum hailue 04:25
04:31 patspam left 04:34 [mark] left 04:36 xinming_ is now known as xinming 04:43 molaf left, justatheory left 04:50 [mark] joined
lue afk 04:52
04:53 [[mark]] joined 04:57 [mark] left 04:59 [[[mark]]] joined 05:00 [[[mark]]] left 05:02 [[mark]] left, plobsing joined 05:08 redicaps joined 05:18 pnu left, pnu joined 05:19 kaare joined 05:20 kaare is now known as Guest90053 05:22 [mark] joined 05:38 redicaps left
moritz_ good morning 05:51
phenny moritz_: 31 May 22:51Z <pyrimidine> tell moritz_ that there is a partially working .trans implementation (including closures and :d, :s) at gist.github.com/420337, but there are issues with regex name mapping. Also, odd bug with array version mapping (tests with "&nbsp;&lt;&gt;&amp;" string are not parsing).
moritz_ \o/ 05:53
06:02 uniejo joined 06:09 Sarten-X joined 06:10 clsimons joined 06:17 clsimons left 06:20 Su-Shee joined 06:41 gfx joined 07:14 ejs joined
Su-Shee good morning. 07:17
07:19 ejs left 07:20 ejs joined 07:24 eternaleye left 07:31 Ross joined 07:33 alanhaggai left 07:39 eternaleye joined 07:50 alanhaggai joined 07:52 masak joined
masak oh hai, #perl6 07:52
moritz_ oh hai 07:55
Su-Shee hi M & M ;)
eternaleye moritz_: I'm working on .trans now, using unpacking for maximum ease 07:57
moritz_ unpacking?
masak signature unpacking? 07:58
moritz_ I know it's not specced, but I want named arguments to behave just like positional pairs 07:59
$str.trans: :a<b> # just like 'a' => 'b';
but that's an easy addition to any sane implementation, I think 08:00
eternaleye Could be done by adding a slurpy hash and iterationg over .pairs - trivial
Should I?
moritz_ wait a sec
it depends on whether we allow options like /c, /s in Perl 5
that would be done via named arguments => potential clashes 08:01
masak moritz_: not sure I understand your suggestion. if named arguments behave just like positional pairs, does that mean that it's impossible to send a positional pair to a routine? 08:11
moritz_ masak: I was proposing that for .trans only 08:13
masak oh, ok.
I can definitely see that on a sub-to-sub basis, yes. 08:14
there was a period where I stubbornly unified pairs and named arguments on the callee-side. I think I've got over that. never wrote a blog post about the pro and cons, though. 08:15
eternaleye Hmm, rakudo barfs on my first attempt with 'unable to find final }' despite all of them being balanced. Hoping tryfile is clearer. 08:17
Hm, says it's OK
Oh, wait, premature 08:18
moritz_ eternaleye: it probably means it's a parse error before the closing )
eternaleye I didn't notice that the 'ok' message was followed by the path to Test.pm6
moritz_: Probably
08:18 xinming left
eternaleye But if there's an actual error, STD has nice messages 08:19
Nope, it checks out. I'll paste it so people can look
ix.io/10s
08:20 xinming joined
moritz_ uhm 08:21
try less at once 08:22
comment out some of the blocks
eternaleye Okay
moritz_ and see which one causes the parse failure
08:22 plobsing left
moritz_ (and leave out the 'Pair' type constraint before the slurpy... it's probably ignored, or will cause pain) 08:22
masak eternaleye: my guess is that it fails to parse on 'tr/ABC/abc/'. 08:23
that's where the line number says it fails, anyway.
moritz_ oh, right
masak (yay! line numbers!)
jnthn++
eternaleye Thanks masak!
moritz_ and hey, I even wrote that on my blog :-)
08:24 posixninja joined
masak eternaleye: and what moritz_ said. treat carefully. I can tell you from experience that taking small steps helps curb the monster in Rakudo. 08:24
moritz_ "To test it without actually having to recompile Rakudo after each change, I recommend to copy the test that Rakudo can parse (ie the method tests, not the tests for tr///),..."
eternaleye moritz_: I got the first part, but my eyes must have skipped the parens :/
08:25 snarkyboojum left
moritz_ moritz.faui2k3.org/tmp/book.pdf # now with an index, and link in the table of contents 08:27
we should make a release soonish 08:28
eternaleye Hm now it dies with 'too many positional arguments: 4 passed, 3 expected' and any debugging prints in the method are never executed.
moritz_ eek 08:29
it might be interfering with parrot's .trans method
eternaleye: does it stay the same if you add a 'multi' before the method?
masak why is Parrot's .trans method even visible on the Rakudo layer? 08:30
eternaleye Yes
dalek ok: ce53208 | (Ralf Valerien)++ | (2 files):
Implement links and index generation

eternaleye Multi has no effect
s/M/m/
moritz_ eternaleye: then for now re-name the method to .trans2 (and also change the tests)
eternaleye Okay 08:31
moritz_ we'll investigate later what's the problem and how to fix it
eternaleye Ewww, parrot leakage: 'Method 'trans2' not found for invocant of class 'Perl6Str'' 08:32
I really like signature unpacking in when clauses though. REALLY nice. 08:34
mathw I've yet to use it, but I think it's awesome
It's almost like being a Haskell programmer again 08:35
moritz_ eternaleye: when I rename the method to trans2, it's called just fine (though it gives a Null PMC access) 08:38
08:38 dakkar joined
eternaleye Although, it's probably tidier to use Pair[Array,Str] than Pair ( Array $key, Str $value ) 08:38
moritz_: Hmm, maybe my rakudo is old 08:39
moritz_ eternaleye: that would make a difference
eternaleye: I highly recommend to upgrade to latest rakudo development version... those new stack traces make life much easier
eternaleye moritz_: running configure.pl now. I had a git checkout, it was just old 08:40
Since I didn't want to wait for it to build before I started hacking :3
moritz_ :-)
mathw unfortunately rakudo's moving so fast that you really do have to be up to date 08:41
moritz_ fortunately it's moving so fast that it's well worth being up to date :-)
eternaleye moritz_: Thoughts on which phrasing for the when clauses? One is smaller, one is more explicit 08:42
moritz_ eternaleye: I don't think Pair[Array, Str] works 08:43
because Pair is not a parametric type
eternaleye Huh, thought it was for some reason 08:44
moritz_ rakudo: my ($key, $value); given a => 3 { when :( Pair ( Str $key, $value ) ) { say $key } } } 08:45
p6eval rakudo cde6ab: OUTPUT«===SORRY!===␤Confused at line 11, near "}"␤»
moritz_ rakudo: my ($key, $value); given a => 3 { when :( Pair ( Str $key, $value ) ) { say $key } }
p6eval rakudo cde6ab: ( no output )
08:46 clintongormley joined
mathw moritz_: oh yes, moving fast is, ultimately, good 08:47
especially when it gets us Perl 6 stack traces!
moritz_ eternaleye: actually on latest parrot it seems to work with naming it 'trans' too, no 'trans2' rename required
eternaleye moritz_: cool, thanks 08:48
rakudo: given a => 3 { when :( Pair ( Str $key, $value ) ) { say $key } } 08:49
p6eval rakudo cde6ab: OUTPUT«===SORRY!===␤Symbol '$key' not predeclared in <anonymous>␤»
eternaleye Hm
rakudo: given a => 3 { when :( Pair ( Str :key, :value ) ) { say $key } }
p6eval rakudo cde6ab: OUTPUT«===SORRY!===␤traits specified as colon pairs not yet understood at line 11, near ", :value )"␤»
eternaleye rakudo: given a => 3 { when :( Pair ( Str :key($), :value($) ) ) { say $key } } 08:50
p6eval rakudo cde6ab: OUTPUT«===SORRY!===␤Symbol '$key' not predeclared in <anonymous>␤»
eternaleye rakudo: given a => 3 { when :( Pair ( Str :key($), :value($) ) ) { say 'Yep!' } }
p6eval rakudo cde6ab: ( no output )
eternaleye rakudo: given a => 3 { when :( Pair ( Str :key($), :value($) ) ) { say .key } }
p6eval rakudo cde6ab: ( no output )
eternaleye rakudo: given a => 3 { when :( Pair ( Str $key, $value ) ) { say .key } } 08:51
p6eval rakudo cde6ab: ( no output )
moritz_ rakudo: multi sub a( Pair (Str $key, $value)) { say "$key: $value" }; a 'a' => 3 08:54
p6eval rakudo cde6ab: OUTPUT«No applicable candidates found to dispatch to for 'a'. Available candidates are:␤:(Pair (Str $key, Mu $value))␤␤ in main program body at line 11:/tmp/UiUR01Vab6␤»
moritz_ rakudo: multi sub a( Pair ($key, $value)) { say "$key: $value" }; a 'a' => 3
p6eval rakudo cde6ab: OUTPUT«No applicable candidates found to dispatch to for 'a'. Available candidates are:␤:(Pair (Mu $key, Mu $value))␤␤ in main program body at line 11:/tmp/380MIbFT8J␤»
moritz_ what's wrong?
eternaleye rakudo: multi sub a( Pair (Str $key, $value)) { say "$key: $value" }; a( 'a' => 3 )
p6eval rakudo cde6ab: OUTPUT«No applicable candidates found to dispatch to for 'a'. Available candidates are:␤:(Pair (Str $key, Mu $value))␤␤ in main program body at line 11:/tmp/uVPdxzydYG␤»
moritz_ rakudo: say ('a' => 3).key
p6eval rakudo cde6ab: OUTPUT«a␤»
moritz_ rakudo: say ('a' => 3).value
p6eval rakudo cde6ab: OUTPUT«3␤» 08:55
moritz_ jnthn: bug? (the dispatch above)
or moritzbug? :-)
masak looks like a rakudobug. 09:04
eternaleye The null PMC access is in the first when clause 09:13
Oh, it had a line number. I added debugging prints, and _then_ I notice that. 09:14
masak rakudo: grammar G { regex TOP { ^ [\{ <foo> \}]* $ }; regex foo { \[+ || \[+ \]+ } }; say ?G.parse(q<{[[}>); say ?G.parse(q<{[[]]}>) 09:20
p6eval rakudo cde6ab: OUTPUT«1␤0␤»
masak it's this bug: rt.perl.org/rt3/Ticket/Display.html?id=73608 09:21
moritz_ agreed
masak it's currently impacting Form.pm. 09:22
moritz_ in this easy example it's simple to work around 09:23
but probably not in the general case
masak would be quite fun to fix, I think. has bkeeler or someone else attempted it and found it hard? 09:26
moritz_ I know of no such attempt
masak good. then it might actually be doable :)
09:30 Lorn left, Lorn joined 09:32 christine left 09:41 christine joined 09:57 frettled joined
frettled Hiho. 09:57
moritz_ helo 09:58
masak ehlo 09:59
syn syn ack ack
frettled I have one of my probably stupid questions again. 10:00
It's about object-oriented programming :D 10:01
moritz_ shoot
masak question.shoot
moritz_ frettled.shoot(question)
mathw $frettled.ask($question, :of($hash-perl6)); 10:02
frettled In Simula, great mother of OOP, there is a piece of semantic sugar called INSPECT, which essentially creates a block to avoid dotting your way into an object chain.
masak Frettled.new(:OO<curious)).shoo...t;OO>))
frettled heh
mathw masak: now it's starting to look like Java
moritz_ like 'given' in Perl 6
masak mathw: I blame $day-job interference :)
frettled: also en.wikipedia.org/wiki/Law_of_Demeter 10:03
moritz_ hey, we could wait until frettled++ actually asked his question :-)
frettled Heh
mathw yeah that might be good 10:04
masak where's the fun in that? :)
mathw well it's distracting me from being angry, so...
masak if frettled cared about his question, he'd have asked it already :P
frettled So, let's say that you have an object reference vehicle, which holds a reference to car, which holds a reference to van, and you want to call van's drive() subroutine. 10:05
You typically do: vehicle.car.van.drive();
In Simula, we'd write:
(pseudo-codish)
INSPECT vehicle.car.van DO
BEGIN
drive;
masak that's given.
frettled END;
masak as moritz_++ said.
moritz_ given $vehicle.car.van { .drive }; 10:06
frettled Thanks :)
masak or even .drive given $vehicle.car.van;
frettled The question was stupid, but the answer was easy. Phew.
I'll lunch on that! 10:07
moritz_ masak: if it's just one statement, there's no need to use given at all
masak moritz_: s/statement/use of $_/
moritz_ except for poetry, maybe
10:08 agentzh left
masak the old Temporal.pm had a nice line which showed this. 10:09
return sprintf '%04d-%02d-%02d', .year, .month, .day given self;
(except mberends++ thought that this was too terse and wrote it with the block form instead :) 10:10
moritz_ return sprintf '%04d-%02d-%02d', $.year, $.month, $.day; # not bad either
masak troo
10:10 alanhaggai left
masak I'm nuking the buf branch on github now, and creating a new one which branches off of today's master. downstreamers, you have been warned. 10:12
jnthn morning 10:13
masak jnthn! \o/
jnthn masak! \o/
mathw jnthn!
jnthn Hur står det till? 10:14
mathw masak++ nailed down my problem with Form.pm to a known bug! Isn't he great!
jnthn o/ mathw
Yay!
masak++
Which bug?
masak rt.perl.org/rt3/Ticket/Display.html?id=73608
moritz_ backtracking
into named rules
jnthn Eww. 10:15
masak & # sushi! 10:16
jnthn Eww. ;-)
10:25 ejs left
cognominal \o 10:27
jnthn o/ 10:29
10:29 ejs joined 10:32 pmurias joined 10:36 Ross left 10:38 ejs left 10:39 azert0x joined 10:40 snarkyboojum joined 10:42 JimmyZ left 10:43 ejs joined 10:53 colomon joined 11:06 gbacon joined 11:34 saaki is now known as Arroz
masak CFP for YAPC::EU ends in two weeks. who else here is planning to be a speaker at YAPC::EU in Pisa? 11:53
11:59 pmurias left 12:01 snarkyboojum left 12:05 bluescreen joined, bluescreen is now known as Guest45088 12:10 takadonet joined
takadonet morning all 12:10
masak takadonet: \o 12:12
12:13 gbacon left
mberends masak: oh, yes, I'd better find a YAPC:EU talk topic. proto, maybe. 12:14
masak oh wow.
mberends (at least it would not be a talk about "failure") 12:15
masak :)
mberends yes, I like. The Perl 6 ecosystem, I mean. 12:16
12:16 snarkyboojum joined
jnthn masak: I submitted already two talks for the YAPC::EU 12:16
masak: I'll be there from Monday
masak: Leaving Saturday
12:16 proller left
mathw mathw sighs and wonders again if he can manage to go 12:16
masak good to know. I'll look into tickets soon.