pugscode.org/ planetsix.perl.org/ | nopaste: sial.org/pbot/perl6 | evalbot: perl6: say 3; (or rakudo:, pugs:, elf:, etc) | irclog: irc.pugscode.org/ | ~315 days 'til Xmas
Set by mncharity on 8 February 2009.
00:03 Tene_ left 00:04 meppl left 00:07 icwiener joined 00:08 DemoFreak left 00:13 hanekomu_ left 00:21 AzureStone joined 00:27 icwiener left 00:40 skids joined 00:56 blackxxxer joined
blackxxxer is anyone active in here? 00:56
00:58 blackxxxer left 01:04 s1n1 joined, s1n1 left 01:06 alc joined 01:07 wknight8111 joined 01:22 shinobi-cl joined 01:24 shinobi-cl left 01:51 wknight8111 left 01:55 eternaleye joined 02:00 alester joined
alester evening all 02:01
Tomorrow starts The Great Rakudo.org Overhaul
mikehh and pray tell what does that do? 02:03
alester Gives us a new rakudo.org 02:06
mikehh Ah? 02:07
02:21 frew joined 02:23 c9s_mv joined 02:51 PZt joined 02:55 justatheory left 03:03 eternaleye left 03:06 icwiener joined 03:08 eternaleye joined 03:14 Limbic_Region left 03:33 ab5tract joined 03:37 eternaleye left 03:51 alester left, eternaleye joined 04:21 eternaleye left 04:33 eternaleye joined 04:34 frew left, frew joined
frew perl6: sub foo($bar) { $bar } 04:35
p6eval pugs: No output (you need to produce output to STDOUT)
..rakudo b2e7ac: OUTPUT«Class 'Perl6MultiSub' not found␤current instr.: 'parrot;Perl6Role;!add_variant' pc 2645 (src/classes/Role.pir:42)␤»
..elf 25313: RESULT«undef␤»
frew perl6: sub foo($bar) { say $bar }; foo('bar') 04:36
p6eval pugs: No output (you need to produce output to STDOUT)
..rakudo b2e7ac: OUTPUT«Class 'Perl6MultiSub' not found␤current instr.: 'parrot;Perl6Role;!add_variant' pc 2645 (src/classes/Role.pir:42)␤»
..elf 25313: OUTPUT«bar␤»
frew perl6: sub foo (Scalar $bar) { say $bar }; foo('bar')
p6eval pugs: No output (you need to produce output to STDOUT)
..rakudo b2e7ac: OUTPUT«Class 'Perl6MultiSub' not found␤current instr.: 'parrot;Perl6Role;!add_variant' pc 2645 (src/classes/Role.pir:42)␤»
..elf 25313: OUTPUT«bar␤»
frew anyone here know of a good resource to learn about how to do stuff with method attributes in perl5? 04:38
I am trying to read the source of CAP::AutoRunMode, but it's got a lot of deep magic...
04:42 eternaleye_ joined, eternaleye left, iblechbot joined 05:10 iblechbot left 05:19 jhuni joined 05:20 frew left 05:37 Tene_ joined 05:41 ab5tract left 05:43 justatheory joined 05:48 Tene left 05:58 jhuni left 06:18 justatheory left 06:21 kanru joined 06:23 wilx left 06:41 araujo left 06:53 ashizawa joined 07:09 icwiener left 07:12 DemoFreak joined, stephenlb left 07:18 spooneybarger joined
c9s_mv perl6: sub foo ( Scalar $bar ) { say $bar }; foo('bar'); 07:24
p6eval pugs: No output (you need to produce output to STDOUT)
..rakudo b2e7ac: OUTPUT«Class 'Perl6MultiSub' not found␤current instr.: 'parrot;Perl6Role;!add_variant' pc 2645 (src/classes/Role.pir:42)␤»
..elf 25313: OUTPUT«bar␤»
07:35 kate21de joined 07:45 iblechbot joined 08:04 [particle] joined 08:21 [particle]1 left 08:23 M_o_C joined 08:24 AzureStone_ joined 08:27 AzureStone left, jan_ left, drbean_ left, SamB left, jeremiah left, mdxi left, zev left, Cyrus left, Helios left, dmpk2k left, go|dfish left, awwaiid left, jjore left, nipotan left, Cyrus___ joined 08:28 AzureStone joined, jan_ joined, drbean_ joined, SamB joined, jeremiah joined, go|dfish joined, Helios joined, mdxi joined, dmpk2k joined, nipotan joined, zev joined, awwaiid joined, jjore joined 08:30 AzureStone left 08:33 ejs joined 08:42 riffraff joined
riffraff hi 08:43
moritz_ hi riffraff 08:44
08:47 mberends left 08:50 ludan joined 08:53 hanekomu joined
bacek hi there 08:55
moritz_ rakudo: 1629 / 60 08:57
p6eval rakudo b2e7ac: OUTPUT«Class 'Perl6MultiSub' not found␤current instr.: 'parrot;Perl6Role;!add_variant' pc 2645 (src/classes/Role.pir:42)␤»
moritz_ elf: 1629 / 60
p6eval elf 25313: RESULT«27.15␤»
bacek ouch. 08:58
09:10 elmex left, elmex joined 09:25 M_o_C left 09:34 ejs left 09:40 kate21de left 10:05 ejs joined 10:15 sri_kraih joined 10:16 ejs1 joined 10:23 go|dfish left 10:25 ejs left
jnthn morning all! 10:25
Rakudo day it is.
moritz_ good morning jnthn
that's good news 10:26
jnthn Aye, I didn't have one last week since I had someone visiting, plus was partly in Bulgaria. So, two this week. :-)
Matt-W hurrah for Rakudo Day 10:29
I've just got Day of Three Meetings
But I should ask here as there are clever people who might know - Can anybody recommend any theoretical work on multithreaded programming? 10:30
moritz_ multithreaded, or concurrent in general? 10:31
Matt-W well general might be useful, but I'm particularly focussed on the kind of thing you can do with POSIX or Windows threads (this is for work) 10:32
moritz_ sorry, can't help you with that
Matt-W no problem, I'm sure I can find something 10:33
jnthn Most of what I know - but it's not really detailed stuff in terms of implementation, but rather best practices - I put in a talk I gave a while ago...
Matt-W jnthn: that could still be useful
Anything that can help me avoid making more thread soup 10:34
jnthn The best thing about the talk is that the first slide contains pictures of yaks.
Ah, here: www.jnthn.net/papers/2007-fpw-paral...slides.pdf
10:35 M_o_C joined
Matt-W If pictures of yaks are your highlight, does that really recommend it? 10:36
jnthn It's a really good photo. 10:38
;-)
10:39 Ehtyar left
Matt-W heh it is nice 10:39
jnthn Tibet FTW.
jeremiah Yaks FTW 10:40
"Parallel New World" <- Good title.
Matt-W yaks ftw indeed 10:44
thread soup ftl
you try to eat it, but it keeps blocking on a guy in a restaurant in New Zealand's use of the pepper grinder 10:45
jeremiah Mmmm soup. 10:48
jnthn Mmmm. I haz Ukrainian train tickets ordered. :-) 10:49
10:49 anatolybogatyrev joined 10:52 sri_kraih left 10:53 anatolybogatyrev is now known as Gangl
Gangl Hi, how can i do in Perl6 like that in Perl 5: "perl -ne 'print if (/^1[0-9]+ +K/)' list.txt"? 10:53
jnthn For now I don't think - at least in Rakudo anyway - we have a -n or equivalent. 10:55
moritz_ Gangl: do you mean today in rakudo, or in general in Perl 6 once it's finished?
Gangl in Rakudo 10:56
moritz_ I fear you have to open the file manually 10:57
some something along these lines:
for @*ARGV -> $f { my $h = open $f; for =$h { .say if m/1\d+ " "+K/ }} 10:58
Gangl thanks 11:00
moritz_ note that spaces aren't significant in Perl 6 regexes, so /\d+ +/ won't work 11:01
jnthn for use lines function?
moritz_ so you either have to quote the space, or use \s or something 11:02
jnthn for @*ARGV -> $f { for lines($f) { ... } }
moritz_ rakudo: say lines('README')
p6eval rakudo b2e7ac: OUTPUT«./parrot: error while loading shared libraries: libparrot.so.0.9.0: cannot open shared object file: No such file or directory␤»
moritz_ sighs
such demonstrations are much more impressive when they work :/ 11:03
11:03 philsf joined
moritz_ rakudo: say lines('README') 11:07
p6eval rakudo b2e7ac: OUTPUT«Class 'Perl6MultiSub' not found␤current instr.: 'parrot;Perl6Role;!add_variant' pc 2645 (src/classes/Role.pir:42)␤»
moritz_ anybody want to take over maintainance of p6eval? :/ 11:11
11:15 M_o_C left, M_o_C joined 11:30 alc left 11:37 alexn_org joined 11:40 Gangl left 11:42 kane_ joined 11:48 pmurias joined 11:50 meppl joined 11:52 araujo joined
jnthn In the smartmatch table we have: 11:57
Any .foo method truth ?X i.e. ?.foo
If we do $x ~~ .foo, is that basically like ?$x.foo or ?$_.foo ? 11:58
11:58 kane__ left
jnthn The top of the table reads 11:59
$_ X Type of Match Implied Match if (given $_)
Which leads me to think that we take $_ to be the LHS of the smartmatch
Rather than whatever $_ is.
And ignoring the LHS, which would seem odd.
Thoughts?
Matt-W I've never quite understood that smartmatch table
and surely we can't be ignoring the LHS, if it implies that then I really really hope it's wrong 12:00
jnthn (Masak seemed to think we would "irrelavent" ~~ .foo would not call .foo on "irrelavent" but whatever was in $_.)
Matt-W hmm
jnthn But I'm thinking...huh...why'd we do that...
Matt-W I would immediately suspect that it calls $_.foo and smartmatches the result of that against the LHS of ~~
jnthn In a given...when then $_ *is* the LHS.
12:01 alexn_org left
Matt-W but in a given...when, you'd want when .foo { } to be $_.foo == true and do { } 12:01
jnthn If it did that it wouldn't be a special syntactic form.
Matt-W hmmmm 12:02
jnthn I think the spec must mean $x ~~ .meth is the same as ?$x.meth
Matt-W that would be consistent
jnthn It seems strange spec'ing a construct that ignores the LHS!
Matt-W yes
what I suggested would be horrible, in hindsight 12:03
jnthn Of course, in a when .meth { } then you *would* get a call on $_ thanks to the when
Matt-W well, maybe
yes but that's only because when is like if ($_ ~~ <blah>) { }
so no special tricks
jnthn Yes.
12:04 jan_ left
Matt-W I do sometimes get confused as to what saying ".meth" will do in any given place 12:04
jnthn That implies maybe that when has to be aware of the special syntactic forms, though? 12:05
12:05 jan_ joined
Matt-W hmm 12:06
jnthn rakudo: given 42 { when .sign { say "yes" } }
p6eval rakudo b2e7ac: OUTPUT«./parrot: error while loading shared libraries: libparrot.so.0.9.0: cannot open shared object file: No such file or directory␤»
Matt-W damn
that's really inconvenient
12:06 pmurias left
jnthn Like, I suspect 12:07
given "hai" { when .chars { say "yes" } }
That should say "yes"
Because $_.chars is 3, which is true in boolean context
Matt-W because "hai".chars is true
jnthn But in Rakudo at the moment, it doesn't.
Matt-W that is exactly what I'd expect to happen
what does it do?
jnthn Invokes .chars and then smart-matches 3 against the string "hai" ("hai" as the LHS)! 12:08
Which is what I mean by, when having to know about these things too.
Matt-W ouch
see I'm still sort of thinking that $x ~~ .chars should do $_.chars and smartmatch the result against $x 12:09
jnthn Well, that's what it's doing there.
Matt-W but as you say, when you apply that to given...when it looks wrong
I hate these things you can argue either way
jnthn Right. My first reading of the smart-match table was that it should do $x.chars rather than $_.chars.ACCEPTS($x)
Well, ?$x.chars 12:10
Where $x here is the LHS.
Matt-W but if it behaves like that, you can't use given...when to do quick checks against predicate methods on an object 12:11
12:12 BinGOs left
jnthn You can, because the LHS of ~~ is $_ 12:12
given "hai" { when .chars { say "yes" } }
Here, when .chars will do ?$_.chars and if it's true run the block.
I think this is what's intended - so you *can* do predicate checks. 12:13
Matt-W mmm
it makes sense there
what if you say $_ = "hai"; say "yes" if $_ ~~ .chars; 12:14
12:15 BinGOs joined
jnthn It would call $_.chars 12:15
Aha
Matt-W so $_.chars.ACCEPTS($_)
jnthn You must be able to do predicate tests with when like that because S03 explicitly gives an example.
given $boolean {
when .true {...}
when .not {...}
}
There we clearly want the block to run if ?$_.ture rather than if $_ ~~ $_.true 12:16
Matt-W so do we have a difference in behaviour between when and ~~
12:16 masak joined
jnthn No 12:16
I'm just saying when needs to know that the .foo form is special too.
Ah, here's the trouble-causer who filed the initial ticket. ;-)
Matt-W I'm confused 12:17
masak jnthn: good day. :) 12:18
lambdabot masak: You have 1 new message. '/msg lambdabot @messages' to read it.
masak @massage
lambdabot moritz_ said 13h 42m 23s ago: I've changed the evalbot setup a bit; parrot and rakudo are built in ~/parrot and is rsync'ed to ~/built-parrot if successful
jnthn masak: We're discussing rt.perl.org/rt3/Public/Bug/Display.html?id=60258
masak oh, nice.
jnthn masak: Yes, but I think your expectations in the ticket are wrong.
(But Rakudo at present is *also* wrong.) 12:19
masak :)
jnthn class A { method alwaystrue { return 1 } }; given A.new {
say "irrelevant" ~~ .alwaystrue }
masak my expectations were based on S03, it seems.
are you saying I read S03 wrong? or that S03 is wrong?
jnthn I think we understand S03 differently. ;-)
masak ah.
the intricacies of interpretation. :)
Matt-W I've lost track of what jnthn is advocating to be correct 12:20
jnthn So the result Rakudo gives is certainly wrong.
At the moment.
masak backlogs
jnthn Because it calls .alwaystrue on $_ and then smart-matches what that returns against "irrelevant"
However, I think that what it should be doing is ?("irrelevant".alwaystrue) 12:21
masak (I agree, yaks FTW)
jnthn Rather than ignoring the LHS (why would an operator do that?) and calling $_.alwaystrue 12:22
Notice that if we take that definition, then in a given/when block, the LHS *is* $_ so this definition still gives what you want.
Matt-W the trouble is that it looks like you mean "irrelevant" ~~ $_.alwaystrue
jnthn Matt-W: Right, but S03 seems to say otherwise. 12:23
Plus if that's true, then the following cannot work:
given $boolean {
when .true {...}
when .not {...}
}
Matt-W so it means you have to remember that the RHS of ~~ has a sort-of-topic of the LHS
I agree that it needs to work in when, I just hate what it ends up looking like in the ~~ form
jnthn That's exactly what I'm thinking it means. 12:24
Matt-W and I'm going to hope that nobody ever, ever does that
ever
because it will be misread
jnthn Aye, I see what you're getting at.
But, since they'd probably write $lhs.foo rather than $lhs ~~ .foo anyway...
Matt-W but avoiding that would destroy the equivalence between when and ~~ 12:25
and yes, they probably will
especially if they don't want me to come and throw rotten tomatoes at them
I guess we have to allow the possibility for people to write horrible things to get the power to write lovely things :)
You've convinced me, and I'm now going to go and indulge my stomach's demands for something to digest 12:26
lunch &
masak with great power comes great rotten tomatoes. 12:28
12:29 cognominal left
jnthn masak: Any concurrence with me on S03? ;-) 12:31
(Disagreement is fine too, in which case we can ask The List.)
masak I'm not giving the issue 100% attention right now... 12:35
I'm in the middle of some translation work.
jnthn OK, no worries. :-) 12:36
masak I'll get back to you.
12:36 iblechbot left
masak in the meantime, maybe reply to the ticket and cc p6c? 12:36
jnthn Will do
In the meantime, I'll apply the patch that I think is right. But it does factor stuff into one place so it's going to be easy to change if the answer comes back different. And it's closer to right than what we do now. 12:37
masak 好的. er, I mean, "good". 12:38
jnthn Is "bra" really Swedish for "good"?
masak aye, it really is.
for being so small, it's quite an inflexible word.
jnthn Same in English. ;-) 12:39
(Of course, with it's English meaning...)
masak the Swedish version is worse.
there's no definite form, for one.
jnthn Huffmanization doesn't always quite work.
masak which makes people say things like 'den bra-iga boken'... 12:40
...which I suppose works, but it's not formal enough by far to appear in print.
moritz_ the problem in human language is that you don't only need huffmanization, but also redundancy for error corrections 12:42
12:42 r0bby left
masak moritz_: I'm thinking a lot about that these days. 12:43
Mandarin has its redundancy in different places that the Indo-European langs.
some would say the Mandarin system is objectively better. I'm not sure I agree, but I can certainly, um, sympathize with that viewpoint. 12:44
dalek kudo: 19c0210 | jnthn++ | src/parser/grammar.pg:
Add better error message for else blocks on unless - a copy/paste from STD.pm.
12:49
kudo: 74d73d9 | jnthn++ | src/parser/actions.pm:
Refactor handling of smart-match so we can implement the special syntactic forms, and add the .foo special form.
12:50
12:50 kanru left
jnthn moritz_: Is it still OK to assign you tickets that need tests? 12:50
If you're snowed under, I can write them myself. (Don't need them right now...) 12:51
12:52 meteorjay joined
moritz_ jnthn: it's OK, but it'll take some time these days 12:52
jnthn moritz_: OK, done that, thanks. 12:55
Also cc'd p6l into my response to the ticket.
If it stays quiet or is confirmed correct, I'll do .[...] and .{...} etc in the near future too, since it'll be the same answer for those. 12:56
13:13 timbunce joined 13:20 skids left 13:25 timbunce left, ashizawa left 13:29 kanru joined
Matt-W wishes he knew enough about Rakudo's innards to understand what jnthn++'s patch is doing 13:30
meeting &
13:31 M_o_C left 13:34 cognominal joined
pugs_svn r25314 | jnthn++ | Add tests for is copy in use with arrays and hashes. 13:38
dalek kudo: 6059ad9 | jnthn++ | src/classes/Signature.pir:
Fix is copy trait for arrays and hashes. Resolves RT#60966.
moritz_ jnthn: I hope you know that 'is copy' is also broken for scalars? 13:39
(or at least was last I tried to ran man-or-boy.t)
jnthn moritz_: No, though I ain't entirely surprised. 13:40
Is there a smaller test case?
moritz_: man or boy tests all pass here, it appears? 13:41
moritz_ jnthn: don't know...
jnthn moritz_: Yup, passes here.
Shall I add it back to spectest.data?
moritz_ jnthn: ah, that might have been your ++ and -- fix then 13:42
jnthn: yes, please
it was using ++ on a "is copy" parameter
don't know which of them was broken
jnthn Ah.
Not sure.
Anyway, it passes now.
13:43 masak left
moritz_ each time I forget to 'make clean' in Rakudo, I get error:imcc:syntax error, unexpected VAR, expecting '(' ('sub') 13:43
dalek kudo: 3e1a5e8 | jnthn++ | t/spectest.data:
integration/man-or-boy.t now passes again due to @recent_fix.pick, add it back to spectest.data.
13:45
13:47 braceta joined
moritz_ I've opened a ticket about that man-or-boy thingy, will try to find it 13:50
jnthn Oh, to find which issue it was? 13:51
OK
moritz_ to close it
jnthn Oh, I see. 13:53
moritz_ rt.perl.org/rt3/Ticket/Display.html?id=61982 don't know if it's 100% closable, will investigate later today 13:54
jnthn Looking at 13:55
$locator = method { self.<here> }
$obj.$locator # $obj<here>
Does this imply that the default topic in a method is $_ always?
erm
is self, I meant?
S12 isn't too clear, or I can't find the bit that is clear on that...
moritz_ I think it used to be $_ === self, but that was abandoned 13:56
jnthn: but I don't see where $_ is involved in your example above
jnthn oh 13:57
Yes
$locator = { .<here> }
$obj.$locator # $obj<here>
Oh, hmm
The spec says these two.
moritz_ there { ... } just is a closure with one parameter
jnthn masak tried method { .<here> }
moritz_ that's assigned to $_
just like for 1..2 { .say }
jnthn Right. 13:58
But method { .<here> } isn't spec'd.
moritz_ ask TimToady, or reject it :-)
rakudo: my $fh = open("README"); my $res = try { $fh.perl} ; say "alive" 13:59
p6eval rakudo b2e7ac: OUTPUT«Class 'Perl6MultiSub' not found␤current instr.: 'parrot;Perl6Role;!add_variant' pc 2645 (src/classes/Role.pir:42)␤»
jnthn @tell TimToady Do methods get self in $_ by default? Spec doesn't say so, so I'm guessing not - if that's the case, I get to reject a ticket. ;-) 14:00
lambdabot Consider it noted.
14:03 chid joined, chid left 14:07 Southen joined 14:08 magnarjg left 14:15 philsf left
jnthn rakudo: my $x = {}; say $x.WHAT 14:21
p6eval rakudo b2e7ac: OUTPUT«Class 'Perl6MultiSub' not found␤current instr.: 'parrot;Perl6Role;!add_variant' pc 2645 (src/classes/Role.pir:42)␤»
14:33 skids joined
jnthn std: class A { method x { say "OH HAI" } }; my $c = class is A {}; $c.x 14:35
p6eval std 25314: OUTPUT«############# PARSE FAILED #############␤Malformed "class" declaration␤Unable to parse class definition␤Malformed method definition at /tmp/iiLuS9F4Tb line 1:␤------> class A { method x { say "OH HAI" } }; my $c = class is A {}; $c.x␤ expecting blockoid␤FAILED 14:36
..00...
jnthn @tell TimToady Should anonymous classes be able to inherit from stuff? If so, can they do class is Foo { ... } - at the moment STD.pm parsefails that (takes is to be the name of the class...)
lambdabot Consider it noted.
dalek kudo: 9a5c690 | jnthn++ | src/parser/actions.pm:
Fix NULL PMC accesses in various cases where we have empty blocks. Resolves RT#61034.
14:51
15:18 Tene joined 15:25 alester joined 15:31 Tene_ left 15:44 hercynium joined 15:46 M_o_C joined 15:48 jan_ left 15:52 jan_ joined
TimToady jnthn: methods do not get $_ := self by default, but you can always declare ($_:) in the sig 15:53
lambdabot TimToady: You have 2 new messages. '/msg lambdabot @messages' to read them.
15:53 eternaleye_ left
TimToady .foo is a special form in any smart match, like anything known to return boolean 15:53
and ~~ actually topicalizes the left side, so the right side sees the left side as $_ 15:54
15:54 Exodist joined, iblechbot joined
jnthn TimToady: OK, I'll reject the ticket and remove the test that assume $_ := self 15:55
TimToady: And thanks for the clarification on $x ~~ .foo being basicaly ?$x.foo (provided I understood correctly!) 15:56
TimToady so "foo" ~~ .bar means ?{ .bar }("foo"), basically
jnthn Oh? 15:57
jnthn is confused
TimToady well, same as you wrote, but it really does bind $_
or maybe { ?.bar } is more accurate
jnthn Ah, I see 15:58
Matt-W I don't :(
jnthn I mis-parsed what was going on there.
TimToady "foo" ~~ $_ eq "foo" is true
or more explicitly "foo" ~~ ?($_ eq "foo") is true
so it really has to set $_ 15:59
still thinking about class is, but that'll take coffee...
Matt-W I get that $_ on the rhs is the lhs
I don't quite get what happens with .bar on the rhs 16:00
jnthn TimToady: OK. One easier one maybe...
say "foofoofoo".subst("foo", "bar", :x(4))
It cannot do 4 replacements, but should the result be an exception, the original string, or a fail?
moritz_ or is the :x(4) just a limit?
so it tries as many as possible, but at most 4?
16:01 Gangl joined
jnthn oh, found it in the spec 16:01
moritz_ I guess there are a lot of tests for that which I wrote while mis-understanding the spec :/ 16:02
jnthn moritz_: I'm still trying to grok the spec. ;-)
except that the string is unchanged unless all four matches are found. 16:03
Matt-W home & 16:04
ruoso I wonder what is the difficulty rakudo is having with the binding operator... 16:07
as pmichaud stated in a mail to p6l
TimToady see discussion above 16:14
.foo is considered 1-ary on right side of ~~, so is evaluated for truth 16:15
16:15 justatheory joined
ruoso TimToady, it looks like you were talking to me... but I can't see the relation between the above discussion and binding 16:19
jnthn ruoso: I think it was to pmichaud, but discussion is over on parrot :-) 16:20
16:22 Tene_ joined 16:23 stephenlb joined
ruoso jnthn, Ok, I'll assume that discussion didn't raise anything that could affect SMOP 16:25
jnthn ruoso: It's about $x ~~.foo 16:26
Not binding.
:-)
ruoso ah
16:27 ludan left 16:28 ejs1 left 16:32 hanekomu_ joined 16:34 Tene left
TimToady we, except that ~~ implicitly binds $_ 16:35
16:39 rindolf joined
pmichaud the problem with binding is that Parrot doesn't make it easy to pass containers around. 16:44
especially containers inside of aggregates
16:45 hanekomu left
jnthn pmichaud: I had to implement for doing that kinda thing in .Net a kinda array-element-referencey kinda PMC. 16:45
pmichaud jnthn: yes, I'm thinking that we'll be doing it with proxies 16:46
the difficult thing is recognizing when we want a proxy and when we don't.
jnthn Aye. 16:47
It was easy in .Net. :-|
pmichaud: Is the Rakudo spectests graph updates broken for now, since we moved to git? 16:48
pmichaud jnthn: yes -- I have to update my scripts a bit. 16:49
jnthn OK, no hurry.
(On my part.)
pmichaud git doesn't appear to have a convenient "get a copy of the repo as of date x/y/z" feature.
jnthn Ouch.
TimToady sounds like Parrot wants Captures, or something like that
pmichaud even Captures (at least as I've been thinking of them) doesn't seem to quite solve the problem. 16:50
PerlJam pm: upgrading to git 1.6.1 didn't help? 16:55
pugs_svn r25315 | jnthn++ | [t/spec] Unfudge a couple of tests for Rakudo. 16:58
r25316 | jnthn++ | [t/spec] Remove test that doesn't conform to The Spec.
dalek kudo: 01811bf | jnthn++ | src/builtins/any-str.pir:
Fix :x($n) in subst where $n is greater than the number of matches we can do. Resolves RT#61204.
16:59
17:01 nihiliad joined
jnthn pmichaud: When do you think you'll have time to work on prelude stuff? 17:04
pmichaud s/prelude/setting/ 17:09
very soon.
probably this next week.
PerlJam: no, upgrading didn't help. 17:10
jnthn pmichaud: OK, great! 17:12
17:13 ejs joined 17:19 Exodist left 17:20 maerzhase1 joined 17:24 Exodist joined 17:27 icwiener joined
pugs_svn r25317 | jnthn++ | [t/spec] Tests for smart-matching where we have a couple of *s following each other. 17:36
dalek kudo: daa2eea | jnthn++ | src/classes/List.pir:
Fix Array smart-matching when two Whatevers were written one after the other. Resolves RT#61452.
jnthn TimToady: In the smartmartching table we have: 17:39
Array Array arrays are comparable $_ 􏿽xAB===􏿽xBB X (dwims * wildcards!)
and
Any Array lists are comparable @$_ 􏿽xAB===􏿽xBB X
Should the second one also dwim?
TimToady sure, it's exactly the same, just with a coercion to Array, so calls the same .ACCEPTS 17:44
it's always rhs.ACCEPTS(lhs) 17:45
jnthn OK, that simplifies things. :-) 17:46
TimToady (modulo the special synactic forms)
((which this isn't one o'))
17:46 pmurias joined
pugs_svn r25318 | jnthn++ | [t/spec] Couple more smart-matching on array tests. 17:54
dalek kudo: f7b4b86 | jnthn++ | src/classes/List.pir:
Correct smartmatching Array on RHS when LHS is non-array and we co-erce it; turns out it should DWIM too. Resolves RT#61454.
pmurias ruoso: hi
lambdabot pmurias: You have 1 new message. '/msg lambdabot @messages' to read it.
17:57 Exodist left
pmurias ruoso: where should the lowlevel multi variants (&infix:<+>:(int,int)) and the like be defined? 17:57
17:57 Exodist joined, silug joined 17:59 abra joined, abra left 18:00 abra joined 18:14 riffraff left 18:16 hanekomu_ left 18:23 schmalbe joined 18:37 Psyche^ joined 18:50 Patterner left, Psyche^ is now known as Patterner 18:55 abra left
dalek kudo: 0f87695 | jnthn++ | src/parser/actions.pm:
Improvements to subtypes: anonymous ones can now handle something to smart-match against rather than a block (resolves RT#61654) and enforce read-onlyness on the thing we're testing unless it's decalred otherwise (resolves RT#61776).
19:02
19:02 pmurias left
ruoso pmichaud, in SMOP we're using the context of 'bvalue' 19:02
@tell pmurias &infix:<+>:(int,int) could be defined in SMOP prelude directly 19:03
lambdabot Consider it noted.
moritz_ jnthn: in git land it's common to use a short summary on the first line of the commit message, then one blank line, and then the rest of the message
ruoso pmichaud, bvalue is a variable in a context where it can be used as the container or you can use it as item, which resolved the actual value
moritz_ jnthn: some tools show only the first line, so it's good to stick to that convention 19:04
jnthn moritz_: Heh, I write all my -m stuff at the command line rather than having an editor configured. ;-)
ruoso pmichaud, we use that to make hash subject to binding... so postcircumfix:<{ }> really returns only a bvalue, which will only do the actual lookup when that is used as an item
moritz_ jnthn: not a vim fanboy? ;-) 19:05
jnthn Oddly, no. :-P
pugs_svn r25319 | jnthn++ | [t/spec] Some more tests for subtypes, covering a couple of recently resolved RT tickets.
ruoso pmichaud, but the bvalue implements BIND, which replaces the container in the target object 19:07
jnthn OK, finally the Rakudo ticket queue is down to "only" 250 tickets. 19:08
moritz_ should $a ~~ .b($c) call $a.b($c) ? 19:09
ruoso moritz_, actually, AFAICS, it should ($_ := $a).b($c)
moritz_ ruoso: for my test writing that's close enough ;-) 19:10
ruoso but... does that affect $_ for the end of the scope? or just for the term in the rvalue of ~~ 19:11
jnthn ruoso: It shouldn't affect it to the end of the scope.
A better re-write is { .b($c) }($a)
ruoso yeah...
sounds sane 19:12
but, can that be understood sintatically?
jnthn The $x ~~ .foo can be, which is what we need to re-write, I believe. 19:14
(And I don't re-write and re-parse, I just make different AST.)
ruoso good.. so no run-time magic... it's basically a macro...
jnthn I need to tweak it to really look at syntax rather than AST though. 19:15
ruoso jnthn, but indeed, I'm not sure it really needs to be a real macro... I think transforming the AST should be ok
jnthn Aye.
Well, I guess, whatever the compiler implementor finds easiest. ;-) 19:16
moritz_ jnthn: nopaste.snit.ch/15611 4 of these 6 tests fail... 19:17
jnthn: did I do something very wrong?
jnthn is ($t ~~ .b: 3), 15, '$obj ~~ .method: arg calls the method'; 19:18
That one I'm not sure would work yet...
ooh
moritz_ but the first two also fail 19:19
jnthn No, those tests are wrong.
Any .foo method truth ?X i.e. ?.foo
So it puts it in boolean context
moritz_ ok
jnthn So you can't test you get a certain return value, just true or false.
pugs_svn r25320 | moritz++ | [t/spec] smartmatch tests for $obj ~~ .method (RT #60258) 19:22
19:23 maerzhase1 left
jnthn moritz++ :-) 19:25
19:26 cognominal left
jnthn gives moritz another one 19:26
19:26 ejs left
pugs_svn r25321 | moritz++ | [t/spec] tests for RT #61034 19:30
jnthn std: sub List::a {}
p6eval std 25320: OUTPUT«ok 00:02 33m␤»
jnthn omg I didn't eat yet 19:31
19:34 maerzhase joined
pugs_svn r25322 | moritz++ | test for RT #62196, smartmatch in a class 19:34
moritz_ this commit added the 100th test to smartmatch.t ;-)
19:37 cognominal joined
jnthn Nice! 19:37
moritz_ jnthn: do you have slides on multi dispatch somewhere? I'd like to get some "inspiration" for an article that I write
jnthn Sure 19:38
www.jnthn.net/articles.shtml
See talk slides Theres More Than One Way To Dispatch It
moritz_ thanks
jnthn Wow. We're down to 246 tickets.
moritz_ jnthn++, tickets-- ;-) 19:39
I like your paper/scissor/stone example 19:41
are there other nice, simple problems that can be solved by multi dispatch? 19:45
rakudo: multi f($x where 0) { 1 }; multi f($x) { X * f($x-1) }; say f(4)
p6eval rakudo b2e7ac: OUTPUT«Class 'Perl6MultiSub' not found␤current instr.: 'parrot;Perl6Role;!add_variant' pc 2645 (src/classes/Role.pir:42)␤»
moritz_ rakudo: multi f($x where 0) { 1 }; multi f($x) { X * f($x-1) }; say f(4) 19:48
p6eval rakudo b2e7ac: OUTPUT«Statement not terminated properly at line 1, near "f($x-1) };"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
moritz_ rakudo: multi f($x where 0) { 1 }; multi f($x) { $x * f($x-1) }; say f(4)
p6eval rakudo b2e7ac: OUTPUT«maximum recursion depth exceeded␤current instr.: 'parrot;P6object;HOW' pc 54 (runtime/parrot/library/P6object.pir:96)␤»
moritz_ rakudo: multi f($x where 0) { 1 }; multi f($x) { say $x; $x * f($x-1) }; say f(4)
it works locally here 19:50
rodi +/quit 19:51
oops, sorry :-\ 19:52
19:52 rodi left
jnthn fail 19:52
moritz_ +/quit is "quit from as many servers as possible, but at least one" ;-)
p6eval rakudo b2e7ac:
..OUTPUT«4␤3␤2␤1␤0␤-1␤-2␤-3␤-4␤-5␤-6␤-7␤-8␤-9␤-10␤-11␤-12␤-13␤-14␤-15␤-16␤-17␤-18␤-19␤-20␤-21␤-22␤-23␤-24␤-25␤-26␤-27␤-28␤-29␤-30␤-31␤-32␤-33␤-34␤-35␤-36␤-37␤-38␤-39␤-40␤-41␤-42␤-43␤-44␤-45␤-46␤-47␤-48␤-49␤-50␤-51␤-52␤-53␤-54␤-55␤-56␤-57␤-58␤-59␤-60␤-61␤-62␤-63␤-64␤-65␤-66␤-67␤-68􏿽xE2􏿽x90
diakopter urgh
moritz_ that totally freaked out my irssi 19:55
jnthn Same!
jnthn distracted for a while - cooking/eating 19:57
19:59 Gangl left 20:01 nihiliad left 20:06 cognominal left
TimToady probably truncated the U+2424 ␤ in the middle 20:08
20:08 Gangl joined
moritz_ good explanation 20:09
TimToady rakudo: print .chr for 0xf000..0xf100 20:13
p6eval rakudo b2e7ac: OUTPUT«Class 'Perl6MultiSub' not found␤current instr.: 'parrot;Perl6Role;!add_variant' pc 2645 (src/classes/Role.pir:42)␤»
TimToady rakudo: print chr($_) for 0xf000..0xf100
p6eval rakudo b2e7ac: OUTPUT«Class 'Perl6MultiSub' not found␤current instr.: 'parrot;Perl6Role;!add_variant' pc 2645 (src/classes/Role.pir:42)␤»
moritz_ currently rakudo on evalbot is really broken
TimToady pugs: print .chr for 0xf000..0xf100 20:14
p6eval pugs: No output (you need to produce output to STDOUT)
TimToady pugs: say .chr for 0xf000..0xf100
p6eval pugs: No output (you need to produce output to STDOUT)
moritz_ my attempts to fix this by rsync'ing a built parrot + rakudo to a new location also failed
because parrot looks in the old dir for libraries 20:15
TimToady pugs: for 0xf000..0xf100 -> $c { say chr($c) }
p6eval pugs: No output (you need to produce output to STDOUT)
moritz_ pugs: say 1
p6eval pugs: No output (you need to produce output to STDOUT)
TimToady oopsie
moritz_ sighs
most likely ghc got oom-killed during build
I'll try to rebuild it once more, and then disable the cron job until we see another commit to pugs 20:17
20:20 nihiliad joined 20:23 mberends joined
moritz_ pugs: say "alive" 20:27
p6eval pugs: OUTPUT«alive␤»
20:28 justatheory left 20:37 maerzhase left
Tene_ rakudo: say "undead" 20:41
p6eval rakudo b2e7ac: OUTPUT«Class 'Perl6MultiSub' not found␤current instr.: 'parrot;Perl6Role;!add_variant' pc 2645 (src/classes/Role.pir:42)␤»
Tene_ Nice. :)
wolverian TimToady: as - is allowed in names, should MONKEY_PATCHING and other such be MONKEY-PATCHING instead? 20:44
20:53 schmalbe left 20:58 charsbar left, charsbar_ joined
TimToady _ is harder to type :) 20:58
pugs: print .chr for 0xf000..0xf100 20:59
p6eval pugs: OUTPUT«
TimToady rakudo: print .chr for 0xf000..0xf100
p6eval rakudo b2e7ac: OUTPUT«Class 'Perl6MultiSub' not found␤current instr.: 'parrot;Perl6Role;!add_variant' pc 2645 (src/classes/Role.pir:42)␤»
jnthn is back from eating and a nice walk in the snow 21:03
ruoso I think I realized how to break the circularity in Perl 6 type-system bootstrap... 21:06
I just need a way to re-bind some basic types 21:07
meaning
Array starts as being the lowlevel C implementation
but at some point I redefine it as the high-level
but this is not the same as "is instead" 21:08
jnthn class Array is instead { ... } ?
ruoso because "is instead" modify the Array class
21:08 braceta left
ruoso I just want something different to be referenced by the "Array" name 21:08
jnthn Ah
ruoso meaning that stuff that resolved "Array" as the old value, keep that as it is 21:09
jnthn Then it's just changing the entry in the namespace? Or copying over the location where the previous Array class is stored...or something.
ruoso just changing the entry in the namespace
jnthn Sounds quite easy. :-)
ruoso so, if Multi was first defined with a very low level RoleHOW 21:10
and the punned class has very few features
I can re-define it later, after I have a complete RoleHOW and a complete ClassHOW
so I get a different punned class
jnthn Sounds workable.
ruoso but it would be nice to have a Perl 6 construct to replace the symbol 21:11
since all this types are going to be written in Perl 6 itself 21:12
(because I actually need it, not because I want to be fancy)
jnthn Just binding, isn't it?
Well, you've always the option of a magic internals call. ;-)
ruoso jnthn, the problem is that "magic internals" will have to make a huge effort to provide the semantics
so it's easier to have a Perl 6 compiler doing that 21:13
jnthn I don't quite see why replacing a symbol in the namespace is tricky, but I don't understand sm0p guts well enough to really know.
ruoso jnthn, smop is fine... 21:14
but I don't want a Perl 6 first-stage-compiler
I mean
I don't want to have a custom compiler for the prelude
so I'd like to use STD Perl 6 to do that re-definition
jnthn Doesn't ::Array := $new_definition_of_array; work? 21:15
Or similar...that won't quite work
TimToady ::= more likely
jnthn *nod*
TimToady or it's substituting in a new CORE
ruoso both in the CORE package and in the prelude 21:16
TimToady CORE *is* the prelude
now called the setting, btw
because it's not just before
any lexical scope can say "freeze me to a new setting" to be used in place of CORE 21:17
ruoso so I can assume CORE is the outer of the outermost scope
TimToady that's how -n and -p probably work
yes, but it sound's like you want BOOT:: outside of that :) 21:18
s/'//
ruoso this confusing of lexical scopes and packages is getting me dizzy
TimToady or maybe TURTLE:: or something :)
this has nothing to do with packages
21:19 iblechbot left
TimToady GLOBAL has almost nothing in it except user-defined packages 21:19
ruoso right... CORE is a pseudo-package
TimToady CORE is the outermost lexical scope
and almost all built-in types are CORE:: packages, not GLOBAL::
ruoso so CORE is a pseudo-package, as CALLER
that makes it clearer 21:20
TimToady when you say Int it finds CORE::Int unless an inner lexical scope overrides
see recent changes to S02
ruoso cool
I had seen it before, but missed the "pseudo-package" part 21:21
TimToady maybe we define CORE as implementation independent, and outside that is IMPLCORE or some such for bootstrapping, that is implementation dependent 21:22
I dunno, not sure that solves anything...
ruoso I'm not sure that it needs the definition...
because CORE is just something you do a lookup ok
s/ok/on/
TimToady but I'd like to keep implementation specifics out of the standard setting
ruoso it doesn't matter how many outer scopes it has
we just know that at some point we name "this is the standard CORE" 21:23
TimToady CORE may well have scopes outer to it, but maybe it just hides them all under CORE
ruoso since CORE is a pseudo-package
that already happens in CALLER
I call it "flattened lexical scope" 21:24
(as in "there's a type with that name in SMOP")
(ok, not that name exactly, but you got it)
dalek kudo: 1ac6625 | jnthn++ | src/builtins/io.pir:
Implement prompt built-in.
ruoso TimToady, what would be really cool would be to have a runtime way to say: "The current lexical scope should be taken as CORE from now on" 21:25
TimToady that's called eval
:)
ruoso hm?
TimToady SETTING is what you're thinking of
see S02 21:26
ruoso It would be if I was a regular user ;)
but I'm writing the CORE itself ;)
so I need to re-define it after each step
jnthn moritz_: I just implemented prompt and closed the ticket then thought....ah...test...
moritz_: But what is status/planning for testing IO stuff like that?
moritz_ jnthn: stuck in the planning and experimenting phase :( 21:28
TimToady commuting &
jnthn moritz_: OK. 21:29
moritz_ jnthn: just assign it to me for now 21:30
ruoso trying to find a way to put another turtle under the elephant foot
moritz_ pities the turtles
jnthn moritz_: Given. 21:31
ruoso wonder if "class CORE::Array {...}" is sane for that matter 21:32
std: class CORE::Array {...} 21:33
p6eval std 25322: OUTPUT«ok 00:02 33m␤»
21:37 pmurias joined
ruoso now I just need a carefull planning of each stage of the bootstrap, realizing which types are going to be replaced from low-level to high-level and each types are going to be re-initted to use the features of the higher-level types... 21:38
pmurias, hi
pmurias, I think we are on time to sanitize the lexical prelude, and make a bootstrap timeline (not in the sense of development, but in the sense of actual loading of types) 21:40
pmurias ruoso: hi
lambdabot pmurias: You have 1 new message. '/msg lambdabot @messages' to read it.
pmurias ruoso: one think that bothers me with the replace Array with a better Array scheme, is won't the old version behave different? 21:42
ruoso yes, but in the end we should be able to re-init all visible types in a way that the old version disappears from the user 21:43
i.e. bootstrap
that's why we need the timeline 21:45
pmurias ah, got it
21:46 Gangl left
ruoso were we can have the types implemented in C in red, the one implemented in Perl 6, but still depending on C types in black, and the boostrapped types in blue... 21:46
21:46 Gangl joined
ruoso thinks in a very wide SVG file 21:46
21:46 Gangl left
moritz_ ruoso: or dot/neato 21:47
very handy for graphs/trees
21:47 Gangl joined
pmurias bootstrapped time are the ones only needed at class creation time? 21:47
s/time/types/
ruoso bootstrapped are those who no longer see any lowlevel type during its initialization 21:48
any lowlevel type or any high-level type that yet depends on a low-level type
21:49 M_o_C left
ruoso commute & 21:49
ruoso will backlog &
21:49 ruoso left 21:51 cognominal joined 21:52 pmurias left
dalek kudo: 7175fd0 | jnthn++ | src/ (2 files):
Allow 'inheritance' from a role (puns the role into a class and inherits from the pun).
21:58
21:59 meppl left 22:09 r0bby joined 22:17 kate21de joined 22:19 kate21de left 22:25 skids left 22:30 kate21de joined 22:37 Whiteknight joined 22:47 lambdabot left
dalek kudo: a0a3902 | jnthn++ | src/parser/actions.pm:
Check for $x ~~ .foo is syntactic and should thus be done on the parse three, not the PAST tree (pmichaud++ for input).
22:47
jnthn OK, that's me done for the day. 22:48
Report: use.perl.org/~JonathanWorthington/journal/38475
22:49 lambdabot joined 22:50 hercynium left 23:11 iblechbot joined 23:13 alester left, hanekomu joined 23:16 skids joined 23:37 rindolf left 23:39 kate21de left, kate21de joined 23:43 kate21de left 23:48 Limbic_Region joined 23:55 hanekomu left