perl6-projects.org/ | nopaste: sial.org/pbot/perl6 | evalbot: 'perl6: say 3;' | irclog: irc.pugscode.org/ Set by mncharity on 25 March 2009. |
|||
00:03
Tene_ is now known as Tene
00:47
DemoFreak left
01:02
meppl joined
01:26
nihiliad left
01:28
PhatEddy joined
01:32
PhatEddy left
01:33
PhatEddy joined
|
|||
PhatEddy | rt 64450, recently opened, is spam - if anyone is around to get rid of oit | 01:34 | |
01:36
nihiliad joined,
PhatEddy left
01:39
xinming joined
|
|||
pmichaud | deleted, thanks. | 01:41 | |
01:59
M_o_C left
02:01
ab5tract left
02:03
payload left
02:05
dKingston left,
dKingston joined
02:19
jferrero left
02:23
payload joined,
amoc joined
|
|||
eternaleye | Hi, in Perl 6, how would one go about codifying in a regex "match any of 'a', 'b', or 'c', but match each at most once". Would this be possible without using { ... or fail } constructs, or not? If so, how would one go about checking the condition? | 02:34 | |
s/so/not/ | |||
literal | m:P5/([abc])(?!\1)/ :P | 02:36 | |
02:36
amoc left
|
|||
s1n | literal is cheating :) | 02:37 | |
eternaleye | Yeah, one sec while I nopaste what I have so far | 02:38 | |
dpaste.com/24049/ | |||
The place I'll put what I'm asking for is denoted by the #[ FIXME ] comment | 02:39 | ||
s1n | rakudo: class Foo { ... }; my Foo $f .= new; say "broken" if $f ~~ Does::Not::Exist | ||
p6eval | rakudo 0310a3: OUTPUT«No exception handler and no messagecurrent instr.: 'return' pc 15520 (src/builtins/control.pir:39)» | 02:40 | |
eternaleye | And different ones may occur, so for instance 'abc' would match, but 'abb' | ||
would fail | |||
s1n | eternaleye: just out of curiousity, what are you working on there? | ||
literal | looks like a fronted to Portage, Gentoo's package system | ||
eternaleye | A use flag editor for Paludis, my preferred package manager. | ||
An alternative for Portage | 02:41 | ||
s1n | a palidus conf parser | ||
eternaleye | Basically, flagedit for paludis | ||
s1n | ahh, okay | ||
eternaleye | hence 'flagpal' | ||
s1n a long time gentoo user, since 0.8-pre | |||
jnthn: think that error i uncovered needs _something_ to clarify | 02:42 | ||
eternaleye | Yeah, I started around 2.6.15 (can't remember the year, but I remeber the kernel XD) with Gentoo as my first linux install. | ||
literal only recently switched from Gentoo | 02:43 | ||
I think the kernel version was 2.5.30 or something when I started :) | |||
eternaleye | Nice. | ||
s1n | i don't remember the kernel version that i started, but i was around for the 2.4 - 2.6 switch, gcc 2.8 to 3.0 switch | 02:44 | |
i think 2002 was when i started | |||
literal | hm, probably closer to 2.5.70 | ||
s1n | no, i was ~x86 then, it was definitely 2.4 branch | 02:45 | |
s1n just realized you were making a self reference | |||
literal | :) | ||
pmichaud | there's always / a[bc?|cb?]? | b[ac?|ca?]? | c[ab?|ba?]? / :-) | ||
eternaleye | Heh, I just realized I changed the name of the first grammer in the file but not where the other grammars reference it. Well, sed -i time! | ||
literal | I really like ebuilds | ||
eternaleye | pmichaud: Yes, but there are 5 options, and I'd rather not have a giant combinatorial mess | 02:46 | |
s1n | pmichaud: i think you're missing some '?' there... | ||
eternaleye | Also, each one is several chars long | 02:47 | |
TimToady | well, you don't really want to use a regex for the constraint. <?{ panic if %seen{$x}++ }> is more like it, but I don't know how well rakudo would support that yet. | 02:48 | |
lambdabot | TimToady: You have 1 new message. '/msg lambdabot @messages' to read it. | ||
TimToady | @messages | ||
lambdabot | moritz_ asked 3d 12h 51m 27s ago: S04: while something() -> { ... $^thing ... } # should the arrow be removed here? | ||
TimToady | @clear | 02:49 | |
lambdabot | Messages cleared. | ||
pmichaud | maybe: / [ $<a>=[a] | $<b>=[b] | $<c>=[c] ]* / and then check afterwards that none of $<a>, $<b>, or $<c> are bigger than 1 | ||
TimToady | # again, sigh | ||
that's the other way, yes | |||
and probably gives you the chance to give a good error message | |||
eternaleye | That's probably the best way. Thanks everybody! | 02:50 | |
TimToady | but trying to enforce semantic constraints with syntactic checks is usually suboptimal | ||
It's hard to get a parser to say much more than "Oops, didn't understand that." | 02:51 | ||
eternaleye | So maybe use {*} and check in the action? | ||
TimToady | if you want to prevent _alpha_alpha, sure, that'd be a good way | 02:52 | |
though you shouldn't really need the {*} for a check on the entire rule, since there's one implied on the whole rule anyway. but I don't think rakudo supports that yet | 02:53 | ||
eternaleye | Hm. I'll probably need to do a for @{ $<versionSpec> } and check for each versionSpec in the file. | 02:54 | |
Since there is one versionSpec per packageSpec, and there may be multiple packageSpecs | |||
And I'd really only need {*} for the versionSpec token | 02:55 | ||
pmichaud | correct, rakudo (and PGE) still want explicit {*}. | ||
eternaleye | Although, if I wanted to use an embedded { some_function_that_checks_counts( SOMETHING ) or fail }; what should SOMETHING be? | 03:03 | |
pmichaud | Rakudo doesn't support embedded p6 in regexes yet (coming soon) | ||
eternaleye | So that I could catch the error as the line is being processed, rather than afterwards by traversing $/ | ||
pmichaud | that said, it'd still be based on $/, which would be the current (sub)match | 03:04 | |
eternaleye | pmichaud: That's okay, I'm less concerned with actually _running_ this program ( Vim is enough to make it non-annoying ) than _writing_ it | 03:05 | |
And that makes sense, ( $/ being the submatch ), what I meant by "not traverse $/" was the $/ for TOP | |||
03:08
dKingston left
|
|||
eternaleye | So would this work if Rakudo supported embedding p6 in regexes? dpaste.com/24054/ | 03:17 | |
Ooh, just realized the brackets around the alternation need to be capturing parens. S05++ | 03:26 | ||
TimToady | not necessarily, if you just want to capture strings | ||
eternaleye | Nah, I want a hierarchial arrangement | 03:27 | |
Since I'm looping over the list of repeated matches to the quantified submatch | 03:28 | ||
Er, I think | |||
Or would foofoobar ~~ / $<var> = [foo|bar] / give $/ with $<var>[0,1,2] as ( 'foo', 'foo', 'bar' )? | 03:30 | ||
Er, s/]/]*/ | |||
03:31
meppuru joined
|
|||
eternaleye | Yeah, empirical testing says I need () instead of [] | 03:34 | |
rakudo: 'foofoobar' ~~ / $<var>=(foo|bar)* /; say ~@( $<var> ) | 03:35 | ||
p6eval | rakudo 0310a3: OUTPUT«foo foo bar» | ||
eternaleye | rakudo: 'foofoobar' ~~ / $<var>=[foo|bar[* /; say ~@( $<var> ) | ||
p6eval | rakudo 0310a3: OUTPUT«perl6regex parse error: Quantifier follows nothing in regex at offset 34, found ' 'current instr.: 'parrot;PGE;Perl6Regex;parse_error' pc 10552 (compilers/pge/PGE/Perl6Regex.pir:1323)» | ||
eternaleye | rakudo: 'foofoobar' ~~ / $<var>=[foo|bar]* /; say ~@( $<var> ) | ||
p6eval | rakudo 0310a3: OUTPUT«0» | ||
pmichaud | I'm not certain if @(...) works yet. | 03:37 | |
rakudo: 'foofoobar' ~~ / $<var>=[foo|bar]* /; say $<var>.list.perl; | 03:38 | ||
p6eval | rakudo 0310a3: OUTPUT«[Match.new( # WARNING: this is not working perl code # and for debugging purposes only ast => "foofoobar", text => "foofoobar", from => 0, to => 9,)]» | ||
03:47
meppl left
|
|||
eternaleye | rakudo: 'foofoobar' ~~ / $<var>=(foo|bar)* /; say $<var>.list.perl; | 03:47 | |
p6eval | rakudo 0310a3: OUTPUT«[Match.new( # WARNING: this is not working perl code # and for debugging purposes only ast => "foo", text => "foo", from => 0, to => 3,), Match.new( # WARNING: this is not working perl code # and for debugging purposes only ast => "foo", text => "foo", from => | ||
..3,... | |||
eternaleye | It does seem to work | 03:48 | |
rakudo: 'foofoobar' ~~ / $<var>=(foo|bar)* /; say ~@( $<var> ) | |||
p6eval | rakudo 0310a3: OUTPUT«foo foo bar» | ||
03:50
orafu left,
OuLouFu joined
|
|||
meppuru | good night | 04:19 | |
04:20
meppuru left
|
|||
dalek | kudo: 7dc65fd | pmichaud++ | build/Makefile.in: Re-order Makefile targets into slightly more logical sense. |
04:20 | |
04:34
FurnaceBoy left
04:38
iblechbot joined
|
|||
eternaleye | Oh you have got to be kidding me. | 04:44 | |
I misread the Package Manager Spec. Repeat version suffixes ar not forbidden, eg =foo-bar/baz-0_alpha_alpha is permitted | 04:45 | ||
Oh well, it was worth it anyway since I learned something | |||
04:53
dduncan left
05:06
iblechbot left
05:14
brunoV left,
mfwitten left
05:17
[particle]2 joined
05:21
Patterner left
05:22
meteorjay joined
05:30
Psyche^ joined,
Psyche^ is now known as Patterner
05:32
justatheory left
05:40
[particle]1 left
05:41
davidad joined
06:33
Khisanth left
06:40
Kisu joined
06:44
rgs joined
06:55
barney joined
07:16
nacho left
07:22
[particle]1 joined
|
|||
szabgab | rakudo: class Z { has $.x is rw; }; my $t = Z.new; $t->x(10) | 07:23 | |
p6eval | rakudo 0310a3: OUTPUT«Statement not terminated properly at line 1, near "->x(10)"current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)» | ||
szabgab | rakudo: class Z { has $.x is rw; }; my $t = Z.new; $t.x(10) | ||
sorry | |||
p6eval | rakudo 0310a3: OUTPUT«too many arguments passed (3) - 1 params expectedcurrent instr.: 'parrot;Z;x' pc 177 (EVAL_20:67)» | ||
szabgab | is rw accessor generation not implemented yet ? | ||
or am I using it incorrectly ? | 07:24 | ||
literal | rakudo: class Z { has $.x is rw; }; my $t = Z.new; $t.x = 10; | ||
p6eval | rakudo 0310a3: ( no output ) | ||
szabgab | ah, thanks | 07:25 | |
literal | don't know if that's correct, actually, was just trying it | ||
seems to be, judging from S12 | 07:26 | ||
szabgab | it gest the assignment | ||
where do you see it in S12? | |||
literal | perlcabal.org/syn/S12.html#Attributes | ||
the second test file there has a "$foo.bar = ..." test | 07:27 | ||
szabgab | oh I have forgotten to look at the test files, just looked at the spec | 07:28 | |
07:28
Southen left
07:29
nihiliad left
07:34
[particle]2 left
07:35
DemoFreak joined
07:36
ejs joined
07:42
[particle]1 left,
[particle]1 joined
07:47
[particle]2 joined
07:48
masak joined
|
|||
masak | morning, parrotcamels. | 07:48 | |
moritz_ | oh hai | 07:49 | |
masak is looking at the GSoC proposals | 07:52 | ||
literal | how many are Perl 6-related? | 07:53 | |
masak | nice list of proposals. | ||
moritz_ | indeed | ||
masak | literal: at least three that I can see right away. | ||
moritz_ | literal: four, in the broader sense | 07:54 | |
one is actually parrot | |||
one is yours | |||
one is a november-wiki | |||
and one is smop | |||
literal | ok | ||
masak | right. | ||
didn't include the parrot one in my count. | |||
moritz_ | I find that particularly interesting | 07:55 | |
use llvm's JIT in parrot | |||
pugs_svn | r26093 | masak++ | [u4x/README] s/psi/grok/g | 07:56 | |
r26093 | masak++ | | |||
r26093 | masak++ | Turns out there's already a famous tool named 'psi' out there. On #perl6, we | |||
r26093 | masak++ | settled on 'grok' instead. | |||
07:56
[particle]2 left
|
|||
moritz_ | I had a different idea, but maybe that's too late now | 07:57 | |
literal | idea for what? a name? | ||
moritz_ | I thought 6d might be a good name | ||
masak | it's certainly suggestive. | ||
moritz_ | it stands for Perl 6 docs, but also for the number of dimensions in which the language tries to be orthogonal ;-) | ||
masak | 哈哈 | 07:58 | |
moritz_ | and when somebody wants to port it to Perl 5, there's an obvious name for it | ||
07:58
iblechbot joined
|
|||
masak | moritz_: it's not too late to change. if enough people '+1' the name '6d', we'll simply change it. | 07:58 | |
JIT decisions are the hallmark of the Perl 6 community. | 07:59 | ||
07:59
samdc joined
|
|||
literal | I like it, but I somehow find it off-putting because it starts with a digit (not a valid identifier!) :) | 07:59 | |
masak | I had the same thought. | ||
moritz_ | literal: I think if you implement it, it's your decsion in the end | 08:00 | |
masak | don't know how bad that is, though. | ||
moritz_ | that's a strength, because nobody else uses such names ;-) | ||
for class names you'd have to spell it SixD or so | |||
masak | moritz_: well, there is some game which starts with a digit that always turns up first on the MacPorts module list... | 08:01 | |
moritz_ | ;-) | ||
masak | ah, 2Pong and 4th. | ||
moritz_ | anyway, it's just an idea... feel free to pick it up or discard it | ||
masak | ditto. | 08:02 | |
moritz_ | I like grok as as well | ||
masak | aye. | ||
today I plan to give proto and Web.pm a bit of love. | 08:09 | ||
moritz_ | nice | 08:10 | |
I have to give my computer science students some love :( | |||
not as exciting as Perl 6, but it gets paid | |||
masak | no details. :) | ||
moritz_ | (I have to prepare stuff, not work with them directly on Sunday ;-) | ||
masak | ah. | ||
08:11
[particle]1 left
08:22
|jedai| left
08:23
samdc left
|
|||
moritz_ | rakudo passes 8436 tests. Nice. | 08:25 | |
masak | aye. as pmichaud noted, this is shaping up to be a productive month. | 08:26 | |
literal | wow | 08:36 | |
08:38
[particle]1 joined,
ejs left
09:04
DemoFreak left
09:09
barney left
09:30
PerL_MonK joined
09:39
mikehh left
09:44
pmurias joined
|
|||
pugs_svn | r26094 | pmurias++ | [re-smop] remove accidently commited file | 09:46 | |
09:46
M_o_C joined
10:09
|jedai| joined
|
|||
pugs_svn | r26095 | pmurias++ | [re-smop] ported over Scalar | 10:11 | |
10:13
iblechbot left
10:17
Southen joined
|
|||
jnthn | oh hai | 10:23 | |
pmurias | hi | 10:25 | |
10:31
PerL_MonK left
|
|||
masak | oh hai | 10:40 | |
10:51
namenlos_ left
11:05
agentzh left
11:09
ihrd joined
|
|||
ihrd | hi there | 11:09 | |
rakudo: for [1,2,3] Z ['a','b'] -> $a, $b { say $a, $b } | |||
11:09
agentzh joined
|
|||
p6eval | rakudo 0310a3: OUTPUT«1a2b» | 11:09 | |
ihrd | this works without errors in last rakudo | 11:10 | |
is it right behavior? | |||
moritz_ | looks good to me | ||
ihrd | It is usefull for my propouse, but in previos version it is died with erorr about iteratior | 11:11 | |
moritz_ | I think that zip should truncate to the length of the shorter list | ||
ihrd | rakudo: for [1,2,3] -> $a, $b { say $a, $b } | 11:12 | |
p6eval | rakudo 0310a3: OUTPUT«StopIterationcurrent instr.: '_block14' pc 143 (EVAL_18:59)» | ||
ihrd | aha | ||
masak | :) | ||
there it is :) | |||
moritz_ | it should throw an error, but maybe a more descriptive one ;-) | ||
unless $b is optional, of course | |||
ihrd | yes | ||
I will go to read Z specs, to be sure this is right behavior | 11:13 | ||
masak | rakudo: for 1, 2, 3 Z <a b>, undef xx 1000 -> $a, $b { say $a, $b } | ||
p6eval | rakudo 0310a3: OUTPUT«1a2b3Use of uninitialized value» | ||
moritz_ | either S32/containers, or S03 | ||
the zip() form should do the same as infix:<Z> | 11:15 | ||
the rational behind it is that 1..* Z @array should work | |||
ihrd | you`r right | 11:18 | |
"By default the C<zip> function reads to the end of the shortest list, | |||
but a short list may always be extended arbitrarily by putting C<*> | |||
after the final value, which replicates the final value as many times | |||
as necessary." | |||
masak | nice. | ||
bet it's not implemented yet, though. | |||
ihrd | ups. this special <*> behavoir NIY | ||
and it is change my dispatcher logic when it is implemented :( | 11:19 | ||
masak | one word: workaround. | 11:20 | |
and leave a RAKUDO comment. :) | |||
ihrd | and I will send rakudobug with hope some one implemented this soon | 11:22 | |
11:23
xinming left,
xinming joined
11:25
barney joined
11:27
[particle]2 joined,
[particle]2 left
11:28
[particle]2 joined
|
|||
szabgab | rakudo: class A { method f() {say "A"}}; class B is A {method f() {say "B"; self.f()}}; my $x=A.new; $x.f; | 11:29 | |
p6eval | rakudo 0310a3: OUTPUT«A» | ||
szabgab | how can I call the same method in SUPER ? | ||
I thought WALK should do that but AFAIK it is not yet implemented | 11:30 | ||
any other way ? | |||
masak | szabgab: yes. | ||
I saw it the other day. | |||
don't remember exactly, but ruoso did it. | |||
szabgab: found it. irclog.perlgeek.de/perl6/2009-04-02#i_1033479 | 11:36 | ||
szabgab | thanks | 11:37 | |
masak | np. | ||
I need to memorize that one too. :) it's useful. | |||
szabgab | rakudo: class A { submethod f() {say "A"}}; class B is A {submethod f() {say "B"; self.f()}}; my $x=A.new; $x.f; | 11:38 | |
p6eval | rakudo 0310a3: OUTPUT«A» | ||
szabgab | rakudo: class A { submethod f() {say "A"}}; class B is A {submethod f() {say "B"; self.f()}}; my $x=B.new; $x.f; | ||
masak | infinite loop. | ||
forgot to warn you about that. | |||
that's actually the expected behaviour. | |||
szabgab | oh , infinite loops I can write alone :-) | ||
masak | indeed. | ||
and this one will probably blow the stack, too. | 11:39 | ||
szabgab | rakudo: class A { submethod f() {say "A"}}; class B is A {submethod f() {say "B"; self.f()}}; A.HOW; | ||
oh, killed it :-) | 11:40 | ||
I'll stand in the corner now for a while, sorry | |||
masak | it'll probably be back. | ||
it's just a bit busy at the moment. | |||
moritz_ | why should that loop? | ||
rakudo: say 2 | 11:41 | ||
masak | moritz_: B.f calling itself? | ||
moritz_ | ah, right | ||
11:41
p6eval left,
p6eval joined
11:42
[particle]1 left
|
|||
moritz_ | on my machine such a thing says "maximum recursion depth exceeded" after a few moments | 11:42 | |
less than a second, actually | |||
rakudo: say "alive" | |||
p6eval | rakudo 0310a3: OUTPUT«alive» | ||
masak | \o/ | ||
11:43
c9s_ left
|
|||
szabgab | oh I am glad it is back | 11:44 | |
pugs_svn | r26096 | moritz++ | [evalbot] saner CPU limit; remove kp6 | ||
moritz_ | rakudo: sub f { f() }; f() | 11:45 | |
szabgab | but I still don't see how can I call the parent | ||
p6eval | rakudo 0310a3: OUTPUT«maximum recursion depth exceededcurrent instr.: 'parrot;Signature;params' pc 3355 (src/classes/Signature.pir:179)» | ||
moritz_ | setrlimit++ | ||
submethods aren't designed to be callable from the child | 11:46 | ||
masak | oh, I totally missed that they were submethods! | ||
szabgab | I tried it with regulare method and that did not work either | ||
masak | szabgab: what moritz_ said. | ||
submethods have 'self', like methods, but are invisible from the outside, like nonexported subs. | 11:47 | ||
szabgab | rakudo: class A { method f() {say "A"}}; class B is A {method f() {say "B"; }}; my $x=B.new; $x.f; | ||
p6eval | rakudo 0310a3: OUTPUT«B» | ||
moritz_ | rakudo: class A { method m { say "A" } }; class B is A { method m { say "B"; self.SUPER::m() } }; B.new.m | ||
p6eval | rakudo 0310a3: OUTPUT«BCould not locate a method 'SUPER::m' to invoke on class 'B'.current instr.: 'die' pc 15853 (src/builtins/control.pir:204)» | ||
szabgab | but if I add self.f() it will recurse again | ||
masak | I'm afraid ruoso's trick is the only one that works right now. | 11:48 | |
moritz_ | do we have a TODO ticket? | ||
szabgab | I think the keyword is WALK here | ||
masak | moritz_: dunno. | ||
11:48
barney left
|
|||
szabgab | I don't see that in the linked IRC log | 11:49 | |
jnthn | I guess eventually we should have $x.SUPER::foo or similar working. | ||
masak | szabgab: I mean the exact line I linked to. | 11:50 | |
11:50
[particle]1 joined
|
|||
szabgab | rakudo: class A { submethod foo { say 1 } }; class B is A { submethod foo { say 2 } }; my $b = B.new; A.HOW.dispatch($b,'foo'); | 11:50 | |
p6eval | rakudo 0310a3: OUTPUT«1» | ||
masak | aye, that one. | ||
that's a bit magical. | 11:51 | ||
szabgab | rakudo: class A { submethod foo { say 1 } }; class B is A { submethod foo { say 2 } }; my $b = B.new; foo(); | ||
p6eval | rakudo 0310a3: OUTPUT«Could not find non-existent sub foocurrent instr.: '_block14' pc 82 (EVAL_20:43)» | ||
szabgab | rakudo: class A { submethod foo { say 1 } }; class B is A { submethod foo { say 2 } }; my $b = B.new; $b.foo(); | ||
p6eval | rakudo 0310a3: OUTPUT«2» | ||
masak | both the fact that you can call A's foo on a B object, and the fact that you can see submethods for the outside. :) | ||
szabgab | rakudo: class A { submethod foo { say 1 } }; class B is A { submethod foo { say 2; A.HOW.dispatch(self,'foo') } }; my $b = B.new; $b.foo(); | ||
p6eval | rakudo 0310a3: OUTPUT«21» | ||
jnthn | Being able to call submethods is fine. | ||
AFAIUTS. | 11:52 | ||
moritz_ | shouldn't dispatch be a method in the meta class? | ||
ie $obj.^dispatch? | |||
jnthn | It just won't look at any in a parent class. | ||
szabgab | how can I get the name of the current method and the current class within the method ? | ||
jnthn | $obj.^dispatch(...) is just sugar for $obj.HOW.dispatch($obj, ...) | ||
szabgab | rakudo: class A { submethod foo { say 1 } }; class B is A { submethod foo { say self.WHAT; say 2; A.HOW.dispatch(self,'foo') } }; my $b = B.new; $b.foo(); | 11:53 | |
p6eval | rakudo 0310a3: OUTPUT«B21» | ||
moritz_ | jnthn: ah, right | ||
masak | moritz_: wouldn't $obj.^dispatch be the same as $obj.HOW.dispatch ? | ||
oh, you already said that. :P | |||
szabgab | rakudo: class A { submethod foo { say 1 } }; class B is A { submethod foo { say self.ISA; say 2; A.HOW.dispatch(self,'foo') } }; my $b = B.new; $b.foo(); | ||
11:53
[particle]2 left
|
|||
p6eval | rakudo 0310a3: OUTPUT«Could not locate a method 'ISA' to invoke on class 'B'.current instr.: 'die' pc 15853 (src/builtins/control.pir:204)» | 11:53 | |
jnthn | masak: It's not the same, because note where it also sticks $obj | ||
masak | oh, right. | ||
I remember now. | |||
jnthn has managed to injure his knee and can't go for a nice walk. :-( | 11:54 | ||
On the up side, I might get some code and (ooh, shock) my NPW slides done... | |||
masak | I've started procrastinating my slides early this time. | 11:55 | |
szabgab | rakudo: class A { submethod foo { say 1 } }; class B is A { submethod foo { say 2; A.HOW.dispatch(self,'foo') } }; my $b = B.new; $b.foo(); | ||
p6eval | rakudo 0310a3: OUTPUT«21» | ||
szabgab | rakudo: class A { method foo { say 1 } }; class B is A { method foo { say 2; A.HOW.dispatch(self,'foo') } }; my $b = B.new; $b.foo(); | ||
p6eval | rakudo 0310a3: OUTPUT«21» | ||
masak | szabgab: there you go. | ||
szabgab | so this works on methods as well | 11:56 | |
masak | aye. | ||
jnthn also has his email pile to deal with | |||
12:02
Southen left
|
|||
eiro | pastebin.com/m9ca91b2 | 12:05 | |
buubot | eiro: The paste m9ca91b2 has been copied to erxz.com/pb/16830 | ||
eiro | il compiles, but when i run perl6, it eat all my cpu and doesnothing :( | 12:06 | |
12:06
meteorjay left
|
|||
eiro | so i wonder to myself: how to debug now ? | 12:06 | |
12:06
iblechbot joined
|
|||
eiro | read the pir ? | 12:06 | |
masak | eiro: if I were you, I would start with the smallest possible grammar, and make it do the right thing. | 12:09 | |
then build it up piece by piece. | |||
moritz_ | that's good advice; grammars are hard to get right with top down approach | ||
eiro | masak, that was what i expected : a good stragetgy | 12:10 | |
strategy! thanks | |||
masak | good luck! | ||
moritz_ | the best stragey is to use split() ;-) | ||
eiro | thanks | ||
moritz_, :-)) | 12:11 | ||
moritz_ | eiro: but if you want to use grammars... beware that rule { ... } implies whitespaces | ||
eiro: if you don't want that, use a token (non-backtracking) or a regex (backtracking) | |||
[^:]+ doesn't do what you think | 12:12 | ||
<-[:]> would be a negated character class | |||
matchiing everything but : | |||
rakudo: say ?("abc" ~~ m/^<-[:]>*$/) | |||
p6eval | rakudo 0310a3: OUTPUT«1» | ||
moritz_ | rakudo: say ?("a:bc" ~~ m/^<-[:]>*$/) | ||
p6eval | rakudo 0310a3: OUTPUT«0» | ||
moritz_ | [...] are non-capturing groups, ^ is an anchor (start of string) | 12:13 | |
and : is a non-backtracking assertion | |||
so [^:] is something very obscure ;-) | |||
masak | no, it's just a non-capturing group with a start-of-line and a colon in it. | 12:14 | |
nothing obscure about it. :) | |||
sorry, start-of-string. | |||
moritz_ | so what is the meaning of a colon after an assertion? | 12:15 | |
it's redundant, I think | |||
masak | oh, right. it needs to be quoted to be a literal colon. | ||
maybe it should even be an error in its unquoted form? | 12:17 | ||
masak senses a rakudobug... | |||
moritz_ | no, because : has a meaning | ||
14:13 <@moritz_> and : is a non-backtracking assertion | |||
"assertion" is probably the wrong word | |||
masak | hm. right. | 12:18 | |
rakudo: say "foo" ~~ /[^:]/ | |||
p6eval | rakudo 0310a3: OUTPUT«» | ||
masak | how come that one doesn't match? | ||
moritz_ | it does match | ||
masak | oh. | 12:19 | |
moritz_ | but captures a zero-length string | ||
rakudo: say ?("foo" ~~ /[^:]/) | |||
p6eval | rakudo 0310a3: OUTPUT«1» | ||
masak | my bug hunting senses are thrown off today. | ||
eiro | oh ... ok! | 12:20 | |
i'll try to fix | |||
pmurias | ruoso: how should it i specify in a %method signature that a given param is pre-FETCH'ed? | 12:23 | |
ruoso | hi pmurias | 12:30 | |
pmurias, that's what it usually is | |||
:($foo) means it is fetched | |||
pmurias | ruoso: hi | 12:31 | |
ruoso | :($foo is ref) means otherwise | 12:32 | |
I'm still unsure about wich is the difference between is ref and is rw | |||
pmurias | i'm not sure how converting to a lvalue would look like | 12:33 | |
moritz_ | sub f($x is rw) { $x = 3 }; sub g($x is ref) { $x = 3 }; f(@a[0]) # no autoviv g(@a[0]) # autovivication | ||
(I think so, not 100% sure though) | 12:34 | ||
ruoso | yes... is rw tries to turn it into a lvalue | ||
is ref doesn't | |||
pmurias, I think "is rw" will work with a bare value | 12:35 | ||
rakudo: sub f($x is rw) {say $x}; f(3); | |||
p6eval | rakudo 0310a3: OUTPUT«3» | ||
ruoso | rakudo: sub f($x is rw) {say $x++}; f(3); | 12:36 | |
p6eval | rakudo 0310a3: OUTPUT«3» | ||
12:36
davidad left
|
|||
ruoso | rakudo: sub f($x is ref) {say $x++}; f(3); | 12:36 | |
p6eval | rakudo 0310a3: OUTPUT«Cannot assign to readonly variable.current instr.: 'die' pc 15853 (src/builtins/control.pir:204)» | ||
ruoso | which means that it actually needs a way to figure out if it's enclosed in a container or not... | 12:37 | |
in the "is rw" case, that is | |||
eiro | it doesn't match but it ends correctly .. that's my step of the day... thanks all, go with my children | ||
12:38
meppl joined
|
|||
ruoso | pmurias, but I guess that for the purposes of the RI DSL, we can have only bare "$x" and "$x is ref" | 12:39 | |
pmurias | ruoso: maybe a CONTAINER method could work, which would wrap the object in a container if nessesary | ||
maybe LVALUE would be a better name | 12:41 | ||
ruoso | but how to detect if ther is a container already? | ||
moritz_, are you aware how rakudo does it? | |||
pmurias | a container knows if it's a container and would return itself, values would wrap themself up in a Scalar | ||
ruoso | ah... | 12:42 | |
I see what you mean | |||
hmm... | |||
12:42
xinming left
|
|||
moritz_ | ruoso: I don't think rakudo does it all (ie the ref/rw distinction) | 12:42 | |
ruoso | moritz_, it does... see p6eval above | 12:43 | |
pmurias, well... maybe it is an interesting way of doing it | |||
and it also allows the object to decide which type of container it wants | 12:44 | ||
pmurias, yes... I'm convinced... that can be done that way... | 12:46 | ||
pmurias is looking how rakudo does it | |||
ruoso later & | 12:47 | ||
12:55
payload left
|
|||
jnthn | I don't *think* Rakudo knows much about is ref just yet | 12:58 | |
is rw we should be getting right | |||
I guess maybe we'll have to so some check that we have a container passed in... | |||
Maybe something to check during the sig binding or something. | |||
ruoso | jnthn, but how do you figure out it is a container? | 13:01 | |
jnthn | I guess look at the type of thingy it is. | 13:02 | |
Not sure if there's a standard way of something saying "btw I'm a container" | 13:03 | ||
Probably needs to be if one isn't spec'd. | |||
pmurias | ruoso: the LVALUE method would be sort of an lvalue context | ||
ruoso | I don't think it is spec'd | ||
yes | |||
that's why I think it fits in the model | 13:04 | ||
13:04
Southen joined
|
|||
jnthn | hmmm | 13:10 | |
.can('STORE') ? | |||
13:14
c9s_ joined
13:18
Southen left
13:20
nihiliad joined
|
|||
pmurias | jnthn: everything can STORE in smop | 13:21 | |
jnthn | 3.can(STORE)? | ||
pmurias | but some things die during STORE with an immutable error message | 13:22 | |
jnthn | Ah. That approach won't work for smop then. | 13:23 | |
It may cut it for Rakudo, though I don't think we're exposing STORE much just yet... | |||
13:25
Kisu left,
Kisu joined
13:27
Southen joined
|
|||
masak | oh no, that won't do. that won't do at all. | 13:33 | |
jnthn | masak: Huh? | 13:34 | |
masak | mberends++ does cool things in the create-new-project script, but it also introduces increased coupling between projects and proto. | ||
specifically, that script creates a Configure.p6 which defers to a module included in proto. | 13:35 | ||
making proto a necessary (and undeclared) dependency -- kind of the antithesis of what proto should be. | 13:36 | ||
jnthn | Ah. | ||
masak | but I realise it's a tricky problem. | ||
it's better to do it a little wrong in the beginning. :) | 13:37 | ||
13:37
DemoFreak joined
|
|||
masak | at least if the alternative is spending an eternity in an ivory tower. | 13:37 | |
jnthn | "Works but needs improvements" is probably better than "doesn't exist" :-) | ||
masak | exactly. | ||
jnthn | Plus getting stuff spot on first time is, well, hard. | ||
masak | it's more than hard. it's a superpower. | 13:38 | |
I'll add an XXX comment and move on for now. | |||
13:41
Khisanth joined
13:42
araujo joined
|
|||
jnthn | .oO( sometimes it's easy to mistake a couple of lines of IRC for spam subjects ) |
13:43 | |
masak | 哈哈 | 13:49 | |
13:49
DJ-DONGDOT joined
|
|||
masak | jnthn: and I haven't even told you about the cheap meds and university diplomas yet. :) | 13:51 | |
someone should do memetic studies on the different Perl 6 projects on github. ideas are forming and "borrowed" into other projects. not just source code, but also the config and make files. | 13:53 | ||
13:53
xinming joined
|
|||
jnthn | Hopefully the good ideas are the ones being borrowed. :-) | 13:54 | |
masak | time will tell, but yes, that's the idea. | ||
they are "good" in the sense that the author has a goal, and deserts her own solution for one from another project that she feels has greater fitness. | 13:58 | ||
it's author-driven evolution. | |||
jnthn glares at the bruise on his hand that is making typing marginally more painful today | 14:03 | ||
Turns out not noticing a step, tripping and falling over isn't a great idea... | 14:04 | ||
masak | ouch. be careful, we need you. | ||
14:04
payload joined
|
|||
masak | g'ah! foiled again by the Makefile format's insane whitespace policies! | 14:05 | |
jnthn | There is a slightly amusing irony in that after managing all through the icy winter - where there were amples chances to slip - that I managed not to, and instead did so on pretty much the first day of the year where we had t-shirt weather. | 14:06 | |
Oh? You put spaces instead of tabs? | |||
Guess what? My make program doesn't complain about that. :-| | |||
masak | good for you. :P | 14:07 | |
mine just fails mysteriously. | 14:08 | ||
jnthn | It's only good until I push my changes. ;-) | ||
14:08
jan_ left
|
|||
dukeleto | mornin' | 14:14 | |
14:15
xinming left
|
|||
masak | Matt-W, mberends, moritz_: I've just adapted Druid to build under proto. The configure and make files contain all manner of subtle differences from create-new-project in proto, all of which I would like to discuss at some point. | 14:17 | |
actually, I should probably make a list of those differences. | |||
masak does that | |||
here: github.com/masak/druid/commit/9c33a...819a4aeb22 | 14:26 | ||
14:30
xinming joined
14:32
|jedai| left
14:37
xinming left,
xinming joined
|
|||
pmichaud | good morning #perl6 | 14:37 | |
masak | hi pm | 14:38 | |
s1n | good morning | 14:45 | |
14:46
pmurias left
|
|||
s1n | oo question: i want to define some class members in a derived class as early as possible. what's the best way to go about that? overload CREATE? | 14:50 | |
jnthn | Probably BUILD... | 14:51 | |
s1n | what's the difference? | ||
masak | jnthn: but they were class members... | ||
jnthn | oh | ||
class members | |||
Just assign to them? | |||
s1n | yeah, i did a has $.blah | ||
jnthn: where? | |||
jnthn | Oh, those aren't class members, they're instance members. | ||
masak | I'd also guess just assign to them. top of the class def. | ||
jnthn | has $.answer = 42; | 14:52 | |
s1n | perl6 has class level members as well? | ||
jnthn | my $.answer = 42; | ||
Well, really they're lexicals but write a . and the compiler throws in a bonus accessor method. ;-) | |||
s1n | i.e. with java, tacking 'static' defines the member on the instance of the class versus the instance | ||
masak | rakudo: class A { my $.foo = 42 }; class B is A { $.foo = 7 } | 14:53 | |
p6eval | rakudo 0310a3: OUTPUT«Lexical 'self' not foundcurrent instr.: 'parrot;B;_block30' pc 177 (EVAL_19:78)» | ||
s1n | heh | ||
masak | jnthn: should that work? :) | ||
pmichaud | no. | ||
There's no $.foo in scope. | |||
masak | right. makes sense. | ||
the error is a bit strange, though. | |||
s1n | rakudo: class A { has $.foo = 42 }; class B is A { my $.foo = 7 }; say $B.foo | 14:54 | |
p6eval | rakudo 0310a3: OUTPUT«Scope not found for PAST::Var '$B' in current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:102)» | ||
masak | maybe simply disallow $.foo-like vars outside of methods-level blocks? | ||
s1n | err i can never get that last accessor right, what did i do wrong there? | ||
masak | s1n: B.foo | ||
s1n | should i have used :: instead of .? | ||
jnthn | Hmm. Wasn't there some speculation that we'd make self be the proto-object inside the class body at some point... | 14:55 | |
s1n | rakudo: class A { has $.foo = 42 }; class B is A { my $.foo = 7 }; say B.foo | ||
masak | jnthn: I think so. it might even have been I who suggested it. | ||
pmichaud | jnthn: perhaps, but since the proto doesn't really exist yet... | ||
p6eval | rakudo 0310a3: OUTPUT«7» | ||
pmichaud | (in rakudo, at least) | ||
s1n | pmichaud: is that the proper way? | ||
jnthn | pmichaud: Ah, yes, that is a slight issue. ;-) | ||
masak | don't remember when. oh yes, it was because one might want to do 'my $.foo = $.bar + 2' | ||
jnthn | Oh, I think that has a different solution. | 14:56 | |
(the RHS is a closure with self defined) | |||
pmichaud | s1n: it's proper depending on what you want to do | ||
masak | jnthn: ah. | ||
pmichaud | jnthn: note 'my' | ||
no closure with 'my' | |||
just with 'has' | |||
masak | :) | ||
s1n | pmichaud: set the inherited members as early as possible | ||
jnthn | Oh, yes. | ||
pmichaud | s1n: what you wrote above creates a new member, not set the member of A | 14:57 | |
14:57
jan_ joined
|
|||
jnthn | Aye. I think Rakudo is giving the correct answer there. | 14:57 | |
s1n | pmichaud: okay, how do i do what i want? in a CREATE? | ||
pmichaud | I suspect override method new. | 14:58 | |
14:58
brunoV joined
|
|||
pmichaud | (note that I know how to do that part yet either.) | 14:58 | |
s/note/not/ | 14:59 | ||
s1n | so we have BUILD, CREATE, and new methods that all are involved in a class defining what to do during construction? | ||
pmichaud | CREATE does the creation of the object | ||
BUILD says how to initialize the object for a given class | |||
new indicates how to build an object when requested by a client | |||
i.e., new calls (through some layers) CREATE and BUILD | 15:00 | ||
s1n | new and BUILD sound very similar | ||
pmichaud | BUILD only does it for a single class | ||
not for the entire hierarchy | |||
s1n | i don't follow | ||
pmichaud | if I have class A and class B is A, then B's BUILD submethod would identify how to initialize the members of B. It would not indicate how to initialize the members of A. | ||
s1n | that's kinda goofy, why would that be a feature of the language? | 15:01 | |
why not simplify it down to just the new? | |||
when i inherit a class, i generally want to initialize the whole mess... | 15:02 | ||
masak | s1n: new and BUILD fill different niches. | ||
s1n: you override the one you need to. | |||
s1n | masak: yeah i get that but generally, i'll just overload new and do whatever i want | ||
masak | s1n: no, overloading new is only for those times when overloading BUILD isn't enough. | 15:03 | |
...if I understood it correctly. | |||
pmichaud | by having a separate BUILD and new, a class can indicate how it should be initialized without having to worry about calling the .new's of its parent classes. | ||
s1n | masak: yes, but it just seems easier to _always_ overload new and use it as i see fit | ||
masak | s1n: it isn't. | ||
pmichaud | indeed, calling the .new's of its parent classes would be wrong, because those would create new objects instead of initializing the existing instance | 15:04 | |
s1n | pmichaud: do you have to call the .new of the entire hierarchy? | ||
masak | BUILD does a subpart of what new does. | ||
pmichaud | s1n: the default .new calls all of the BUILDs for you | ||
s1n | can i call the default .new? | ||
i.e. like java's super()? | |||
or in c++ | 15:05 | ||
pmichaud | you probably don't want to call super.new, though, because that would create new objects. Not initialize the existing one. | ||
15:06
Psyche^ joined
|
|||
s1n | oh i was thinking wrong | 15:06 | |
i mean, can i call the default .new for my class? that will basically call all the BUILD methods and then i can do what i need? | |||
so if i overload .new, is the original still available? | |||
pmichaud | yes, probably as Object.new or Object::new or something like that. I'm not certain of the syntax. | 15:07 | |
tbh, I haven't really thought much about how this stuff gets used -- I've just implemented whatever the spec says :-) | |||
afk for a bit | 15:08 | ||
15:08
ihrd left
|
|||
s1n | basically, i'm trying to see if i can work around having to think about new versus BUILD | 15:08 | |
jnthn recommends going to the pub instead ;-) | |||
masak | proto now tries to clone a private repo before it tries the public one. | 15:09 | |
jnthn | s1n: Generally, new is probably what you want to change to control the external interface of how an object instantiation looks. | ||
As in, what does creating an object of that type look like. What values should be initailizable? With named or with psotional params? All those things. | 15:10 | ||
masak | now there's nothing stopping me from dogfooding proto for all my projects. | ||
jnthn | Whereas if you just want to do setting defaults but it's more complex than you can do on the has $.x = ... line, BUILD is probably the place. | ||
s1n | hmmm this is interesting, i don't really recall anything similar to other languages | 15:11 | |
i.e. in java/c++, you just overload your constructor to change it's external interface | |||
whereas perl6 made 2 methods: one to just init itself, and a set to define the constructors | 15:12 | ||
15:12
dKingston joined
|
|||
jnthn | s1n: Aye, it's different. | 15:12 | |
s1n | out of curiousity, why was this adopted? i can't really do much with a proto after BUILD anyways, right? | 15:13 | |
jnthn | Might be partly to do with the separation of representation and metaclass stuff. | 15:15 | |
p6l is perhaps more the place to ask though, for a language design perspective. | 15:16 | ||
masak | yes, it must have to do with Perl 6 being OO methodology agnostic. | ||
s1n | i'm just curious, i'm still having trouble grasping perl6's OO model (or lack thereof) | 15:17 | |
masak | it has less of a lack thereof than Perl 5. :) | ||
s1n | which doesn't say much :) | ||
masak | indeed. | ||
15:19
Patterner left,
Psyche^ is now known as Patterner
|
|||
s1n | rakudo: class Foo { has $.yay }; class Bar is Foo { method BUILD { self.yay = "yay"; }}; my Bar $y .= new; say $y.yay | 15:22 | |
p6eval | rakudo 0310a3: OUTPUT«too many arguments passed (3) - 1 params expectedcurrent instr.: 'parrot;Bar;BUILD' pc 242 (EVAL_20:94)» | 15:23 | |
s1n | what am i doing wrong there? | ||
$y.yay isn't calling the autogenerated method? | |||
masak | s1n: for one, you didn't declare $.yay as rw. | 15:24 | |
but also, I don't know if 'self.yay = ...' works. | |||
I'd have written '$!yay = ...' | |||
s1n | rakudo: class Foo { has $.yay }; class Bar is Foo { method BUILD { self.yay = "yay"; }}; my Bar $y .= new; | 15:25 | |
p6eval | rakudo 0310a3: OUTPUT«too many arguments passed (3) - 1 params expectedcurrent instr.: 'parrot;Bar;BUILD' pc 216 (EVAL_20:91)» | ||
masak | s1n: ah. the problem is in the parameters to BUILD. | ||
you're not supplying any. | |||
s1n checks the spec again | 15:26 | ||
masak | Rakudo doesn't implement the spec right now, I'm afraid. | ||
there's an RT ticket about it. | |||
but supply two parameters and you'll be fine. | |||
s1n | two? what are they? | 15:27 | |
masak | prototype and new object, I think. | 15:29 | |
let's see if I can dig up the discussion about this from a few days ago. | |||
ah. one object. | 15:31 | ||
irclog.perlgeek.de/perl6/2009-04-02#i_1033380 | |||
one parameter. the other one is the invocant. | |||
s1n | does it have to be defined as a submethod? | ||
masak | that's the idea, at least. | ||
I don't think it has to, though. | |||
not sure. | 15:32 | ||
s1n | rakudo: class A { has $.foo is rw; submethod BUILD($obj) { $obj.foo = 7 } }; A.new | 15:33 | |
p6eval | rakudo 0310a3: OUTPUT«Null PMC access in getprop()current instr.: 'infix:=' pc 14068 (src/builtins/assign.pir:21)» | ||
s1n | what does that error mean? | ||
masak | that things have gotten worse since Friday. :) | ||
15:34
plash joined
|
|||
masak | sorry, Thursday. | 15:34 | |
15:34
amoc joined,
DJ-DONGDOT left
|
|||
masak | s1n: that error, and related ones, made me use 'new' for the time being, instead of 'BUILD'. | 15:35 | |
rt.perl.org/rt3/Ticket/Display.html?id=64386 | 15:36 | ||
pmichaud | yes, BUILD needs to be a submethod. | 15:40 | |
Otherwise it gets inherited. | |||
masak | but is it a convention, or is it enforced? | 15:41 | |
pmichaud | well, things can break if you do it as a method. | ||
for example: | |||
masak | so, it's a convention. | ||
s1n | if it's required, shouldn't it be a runtime error? | ||
pmichaud | class A { method BUILD { ... } }; class B is A { ... }; # oops! | ||
s1n | or even a compile error | ||
pmichaud | B ends up inheriting A's build. | 15:42 | |
instead of inheriting Object's BUILD, which is what B will need in order to instantiate its attributes. | |||
15:42
|jedai| joined
|
|||
masak | pmichaud: aye. | 15:42 | |
jnthn | Don't forget that bless fits into this picture somewhere too. | 15:43 | |
pmichaud | and yes, Rakudo needs to be updated to follow the (corrected) spec. The version of BUILD that I wrote (the one Rakudo currently has) was taken from the sm0p guidelines. | 15:44 | |
and the spec has since evolved differently. | |||
masak | aha. so that's what happened. | ||
well, the Druid sources are already rid of their init() method workarounds. | 15:45 | ||
they are using new() right now, and will move over to BUILD as soon as that's possible. | |||
15:45
|jedai| is now known as jedai
|
|||
jnthn | Maybe something to review on my Rakudo day next week. | 15:45 | |
Or Oslo. ;-) | |||
15:46
PhatEddy joined
|
|||
masak really looks forward to NPW | 15:46 | ||
pmichaud | same here. | ||
jnthn | Me too! | ||
pmichaud | I'm glad I have lots of days there. | ||
jnthn | Yeah, same. | ||
Glad hackathon is 3 days not 2. | 15:47 | ||
pmichaud | glad I went ahead and extended my trip for the 3-day hackathon instead of just 2. | ||
jnthn | Yes. :-) | ||
pmichaud: How up to date is the ROADMAP at the moment? | 15:48 | ||
Is it on your things to review list, or was it recently reviewed, or is it a little old but still pretty much stands? | |||
pmichaud | it's on my things to review list. | 15:49 | |
jnthn | Updated: 2008-08-16 - suggests either the first or third of those. :-) | ||
Ok. | |||
pmichaud | If not before NPW, then on the Wednesday before NPW | ||
jnthn | Isn't that before NPW either way? ;-) | 15:50 | |
masak | jnthn: don't complain! :P | ||
pmichaud | Well, I could say I'll do it in May, which is before NPW '10 | 15:51 | |
jnthn | ;-) | ||
OK. I'm sort of pondering, what to work on next. | 15:52 | ||
Actually, looking through this current ROADMAP, I'm kinda taken by how much of it we've actually achieved. | |||
masak | (both of you)++ | 15:53 | |
pmichaud | jnthn: have you finished the queue of RT tickets I assigned to you? ;-) | ||
15:53
mib_0gaypc joined
|
|||
jnthn | pmichaud: Not all. Some are hard. :-P | 15:54 | |
mib_0gaypc | rakudo: say "hello" | ||
p6eval | rakudo 0310a3: OUTPUT«hello» | ||
pmichaud wonders if he should put an easter egg in rakudo so that when it's run from p6eval it goes "Look, I'm tired of saying 'hello' all the time." | |||
mib_0gaypc | rakudo: (1..Inf)[*-1] | ||
p6eval | rakudo 0310a3: OUTPUT«elements() not implemented in class 'Range'current instr.: 'postcircumfix:[ ]' pc 5020 (src/classes/Positional.pir:138)» | ||
pmichaud | rakudo doesn't support infinite ranges yet. | ||
masak | pmichaud: :D | ||
jnthn | ...and when it does, getting the last element of it may not be too performant. ;-) | 15:55 | |
masak | rakudo: say (1..8)[*-1] | ||
jnthn | Well, I guess we can hand back Inf. | ||
p6eval | rakudo 0310a3: OUTPUT«elements() not implemented in class 'Range'current instr.: 'postcircumfix:[ ]' pc 5020 (src/classes/Positional.pir:138)» | ||
masak submits rakudobug | |||
mib_0gaypc | this is szabgab, showing off in class :-) | ||
masak | hi, class! | 15:56 | |
jnthn | Didn't we have another ticket field on postcircumfix recently? | ||
jnthn needs to be in that code in the next couple of days anyways... | |||
PhatEddy | yes | ||
pmichaud | Range doesn't understand Positional yet. | ||
masak | jnthn: we have tickets on everything. :) | ||
jnthn | Ah, yes, I guess Range will want its own implementation of Positional. | 15:57 | |
mib_0gaypc | rakudo: class A { method f() {say "hi"}}; my $x = A.new; $x.f | ||
p6eval | rakudo 0310a3: OUTPUT«hi» | ||
mib_0gaypc | rakudo: class A { method f() {say "hi"}}; my $x = A.new; $x.WHAT | ||
p6eval | rakudo 0310a3: ( no output ) | ||
jnthn | mib_0gaypc: Need .say on the end there. :-) | 15:58 | |
mib_0gaypc | rakudo: class A { method f() {say "hi"}}; my $x = A.new; $x.WHAT.say | ||
p6eval | rakudo 0310a3: OUTPUT«A» | ||
15:58
aindilis left
15:59
Psyche^ joined
|
|||
PhatEddy | ticket is rt 57790 and my patch for the range case gives "Use of uninitialized value <NL>Method 'postcircumfix:[ ]' not found for invocant of class 'Range' " which seems close ... | 15:59 | |
s/for/in/ | |||
16:00
ejs joined
16:04
davidad joined
|
|||
dalek | kudo: 078012a | pmichaud++ | docs/spectest-progress.csv: spectest-progress.csv update: 349 files, 8436 passing, 0 failing |
16:05 | |
jnthn | 8,436...and still over two weeks of development time until the next release. :-) | 16:07 | |
16:08
Southen left
16:09
alester joined
|
|||
masak idly wonders when we'll run out of tests to pass | 16:10 | ||
16:11
masak left
|
|||
pmichaud | I've been working on analyzing the remainder of the test suite. | 16:11 | |
(as part of updating the roadmap) | 16:12 | ||
jnthn | *nod* | ||
pmichaud | it'll be a blog post, and part of my presentation. | ||
jnthn | However, some things that should be on the roadmap we just don't have tests for. | ||
pmichaud | Yes. | ||
jnthn points at S09. | |||
16:12
amoc left
|
|||
pmichaud | but when looking at the grey area of the charts, I'd like to know what we're not attempting and why. | 16:13 | |
jnthn | I know we could win a 3-figure number by being able to pass positionals as nameds. | ||
pmichaud | for example, there's approximately ~2k tests having to do with Unicode features where we need some additional work in Parrot | ||
(primarily character properties) | |||
16:14
frzntoz joined
|
|||
jnthn | Is that something you'd look to delegate? | 16:14 | |
Or that you expect to put in yourself? | |||
pmichaud | if there's someone available to delegate it to, sure. | ||
at the moment it's going to need some design decisions made first... probably from allison. | |||
jnthn | OK. | ||
There may be people in #parrot we can rope in to helping with that. | 16:15 | ||
pmichaud | for example: "Given a character, how do we decide if that character has the unicode X property" | ||
16:15
Patterner left,
Psyche^ is now known as Patterner
|
|||
pmichaud | where X might be any of "L", "Lu", "Ll", "M", "Z", "Latin", "Cyrillic", etc. | 16:15 | |
jnthn | I'm guessing the answers is "use the Parrot API for doing such things which in turn goes and asks ICU" | ||
pmichaud | yes, but there's no Parrot API for such things. | 16:16 | |
at least, not yet. | |||
jnthn | OK. So it's (a) design an API (b) implement it in Parrot (c) use it from Rakudo. | ||
pmichaud | correct. | ||
(b) is really easy (unless the API chooses to make it hard) | 16:17 | ||
jnthn | Yeah, I was figuring that while I don't know enough to do (a) well, once it's done (b) is probably mostly donkey work. | ||
But I think we have a non-zero chance of getting someone other than us to do that bit too. | 16:18 | ||
pmichaud | well, since it would ultimately be interfacing with PGE, I wouldn't mind doing that bit of work. But the API is the blocker. | ||
jnthn | Ah, OK. | 16:19 | |
pmichaud | i.e., it's already taken us longer to talk about it than it would likely be for me to implement it :-) | ||
jnthn | It sounds like a relatively easy-ish way to win 2,000 tests though. | ||
pmichaud | it would also be good to have autoloaded methods for it as well. | 16:20 | |
jnthn | autoloaded methods? | ||
pmichaud | well, in S05, we have <isLu>, <isLetter>, <isM>, <isPs>, etc. | ||
there's a _bunch_ of these. | |||
but they're not common. Instead of creating all of the methods for each property up front, it might be better to create them on-demand. | 16:21 | ||
jnthn | Hmm. | ||
jnthn glances at CANDO is S1 | |||
*S12 | |||
16:22
justatheory joined
|
|||
jnthn | Ah, the details are in S10. | 16:23 | |
16:24
c9s_ left
|
|||
pmichaud | anyway, I'm more curious how to do it from a Parrot level. | 16:24 | |
jnthn | Ah. I'm less sure about that. | 16:25 | |
Override find_method is one way... | 16:26 | ||
pmichaud | yes, although overriding find_method in PIR sounds expensive :-) | ||
we _really_ are going to need some way to make those calls less expensive. | |||
jnthn | Ah, true. | ||
16:27
c9s_ joined
|
|||
s1n | jnthn: (reading back) if you want something to do, i'd actually like to see namespaces (package/module) working better (i had problems the other day) i'd do it myself, but i need some sort of guiding. if you want to either work that or show me how to find my way around, that'd be great: | 16:27 | |
jnthn | What aspects of them are you finding lacking? | ||
s1n | lemme check the logs... | 16:28 | |
jnthn | (I know a bunch of stuff is not done, but knowing what you're running into would help me prioritise a bit...) | ||
s1n | irclog.perlgeek.de/perl6/2009-04-02#i_1032140 | 16:29 | |
i tried that so i resorted in working around it | |||
i just renamed the class: 'class Foo::Bar {...}' | |||
i tried looking at actions.pm but i don't really know NQP well enough and not really sure what of the package_declaration (iirc) is broken | 16:30 | ||
jnthn | We are somewhat handling nested namespaces. | ||
rakudo: use v6; package Foo { class Bar { method baz { say "baz"; } }; Bar.baz; } | 16:31 | ||
p6eval | rakudo 0310a3: OUTPUT«Null PMC access in can()current instr.: '!dispatch_method' pc 17110 (src/builtins/guts.pir:104)» | ||
s1n | also, this BUILD thing, i'm having a hard time using it correctly | ||
jnthn | Ugh. | ||
s1n | yeah, so that's something i want to use now | ||
jnthn | Aye. | ||
OK, I'll pop them on my task list. | |||
s1n | i can work around it, but it's kinda kludgy | 16:32 | |
at the very least, maybe you could show me around and help me fix it | |||
pmichaud | I think part of the issue is that we don't have a clean way to do a nested namespace search -- i.e., converting 'Bar' into 'Foo::Bar' | ||
16:32
justatheory left
|
|||
s1n | best way to learn is to do, but i don't know how to do yet :) | 16:32 | |
jnthn | pmichaud: Yes, that's for sure part of it. | 16:33 | |
I should check what *should* work too. I mean, is Foo::Bar inside a package Foo actually meant to mean the equivalent in the otuer scope of Foo::Bar or Foo::Foo::Bar. | 16:34 | ||
Anyway, afk for a bit. | 16:36 | ||
pmichaud | jnthn: I've never quite understood that one either. | ||
16:36
cspencer joined
|
|||
pmichaud | I know it came up recently. | 16:36 | |
it's one of the reasons why 'is also' was changed to 'augment' | 16:37 | ||
s1n | i'd like to help, if anyone is willing to help me :/ | ||
dog_training& | |||
16:43
drbean left,
drbean joined
16:44
mib_0gaypc left
16:48
justatheory joined
16:49
ab5tract joined
16:57
Southen joined
17:00
rabbits77 joined
17:01
plash left,
justatheory_ joined
17:12
justatheory__ joined,
agentzh left,
mberends joined
17:16
justatheory left
17:22
justatheory_ left
17:23
jferrero joined
17:24
dKingston left
17:25
dKingston joined
17:27
Southen left
17:43
davidad left
17:44
rabbits77 left
17:47
eternaleye left
18:10
c9s_ left
18:15
Southen joined
18:16
PhatEddy left
18:18
davidad joined
18:28
ejs left
18:30
mfwitten joined
18:37
eternaleye joined
18:38
ejs joined
18:42
mfwitten_ joined
18:52
ejs1 joined
18:55
rindolf joined,
ejs left
18:57
rindolf left,
rindolf joined
18:58
rindolf left
18:59
mfwitten left,
payload1 joined
19:05
szabgab joined,
rindolf joined
|
|||
rindolf | Hi all. | 19:05 | |
19:06
payload1 left,
payload1 joined
19:16
payload left
19:19
cspencer left
19:20
mfwitten_ left
19:24
payload1 left,
payload joined
19:25
alester left
19:45
ab5tract left
19:46
justatheory__ left
19:51
wolverian joined
19:55
pmurias joined
|
|||
pmurias | jnthn: not having a STORE instead of die'ing with a helpfull message might be a better choice | 19:55 | |
jnthn | pmurias: I guess it means you could use that as a heuristic for "is it a container"... | 20:05 | |
I just didn't see things that couldn't store having a store method, but I guess we have fairly different underlying architectures. | 20:06 | ||
ruoso | jnthn, pmurias, the thing is that for SMOP, can is considerably more expensive... | 20:09 | |
so, having LVALUE as a coercion is better... | |||
and it has the benefit that is not the signature that choose the container, but the object itself | 20:10 | ||
ruoso later & | |||
20:26
sri_kraih joined
20:32
mberends left
20:38
justatheory joined
20:39
dKingston left
20:40
ejs1 left
20:43
sri_kraih_ left
21:02
Helios left
21:03
M_o_C left
|
|||
pugs_svn | r26097 | pmurias++ | [re-smop] started rewritting the s1p hash, the Lexical Prelude is constructed | 21:06 | |
21:21
Helios joined
21:22
justatheory left
21:34
rindolf left
21:41
Southen left
21:43
nekobaka joined
21:46
daemon joined
22:02
cspencer joined
22:06
cognominal left
22:09
daemon left
22:10
daemon joined
22:11
Southen joined
22:19
pdc joined
22:21
dKingston joined
22:24
pmurias left
22:32
Southen left
22:38
frzntoz left
22:40
Southen joined
22:44
payload left
22:56
FurnaceBoy joined
23:00
plash joined
|
|||
pdc | compared to Python, is it unfair to say that Perl is better suited to writing utility scripts, rather than full applications? If not, why don't I see more apps written in perl? Does Perl6 change this at all? | 23:01 | |
literal | Perl 6 is more "disciplined" by default, which might make it more suitable for that. | 23:04 | |
And has a very good object model, though Perl 5 also gained a similarly good one (Moose) recently | 23:05 | ||
23:07
payload joined
|
|||
pdc | I am torn between learning Perl or Python to go alongside C. Python appealed to me because it seems like it would allow me to do everything I can do in C, in half the time. Which would be really handy sometimes. But Perl 6 has some very nice features and a new version should get rid of the 'perl is dying' mentality. Python does seem more geared for full apps, though | 23:08 | |
literal | But I think being well-suited to write utility scripts doesn't necessarily have to negatively affect a language's usefulness in large applications | ||
I don't think you'd be able to do everything you can in C, in half the time, in Perl 6 right now. Maybe in a couple of years... | 23:09 | ||
pdc | Python is very big on the desktop now (GTK+ apps, etc). Perl doesn't seem to even have a presence in the area | ||
literal | Perl 5 would definitely work for that. | ||
Yeah, I've noticed that. | 23:10 | ||
Perl has all the stuff necessary, though. Bindings, etc. | |||
moritz_ | pdc: yes, perl bidings for graphic widgets have traditionally been weak... except for Tk, which looks like 1982 still | ||
pdc | hehe | 23:11 | |
literal | The Wx and GTK+ are in good shape, as far as I know... | ||
+bindings | |||
pdc | oh really? That's good to know | ||
literal | Here's one recent Perl application in Wx, for example: padre.perlide.org/wiki/Screenshots | 23:12 | |
moritz_ | literal: yes, Wx is rather hard to build | ||
literal | moritz_: is that any different when using it from Python? | 23:13 | |
moritz_ | literal: dunno | 23:14 | |
wolverian | the Gtk+ bindings are fine | ||
pdc | and when perl 6 is released, will the majority of Perl programmers move on to 6 (as far as the community is aware)? So we can also expect CPAN to fast gain modules targetted at Perl 6, bindings, documentation, etc? | ||
literal | I doubt it | ||
pdc | oh! | ||
literal | Perl 5 is still the most useful programming language out there, as far as I know :) | ||
But slowly and surely, they will probably switch, because Perl 6 is awesome. | 23:15 | ||
moritz_ | well, I do expect adaption rate to grow | ||
23:16
jferrero left
|
|||
pdc | Perl 6 does indeed look awesome. and I think I will opt for Perl rather than Python | 23:16 | |
23:17
iblechbot left
|
|||
pdc | I presume learning Perl 5 isn't a bad precursor to learning Perl 6? | 23:17 | |
literal | quite the opposite | ||
Perl 6 is still Perl :) | 23:18 | ||
pdc | I said "isn't a bad" | ||
so I'm right? | |||
wolverian | the two are not mutually exclusive, either, though naturally starting with one is probably better. | ||
literal | yeah, it's a good precursor | ||
pdc | hehe ok | ||
great | |||
well that's all my major questions answered. I hear that Perl people were nice guys :) | 23:19 | ||
unlike ##c ! | |||
wolverian | we _were_ nice? :( | ||
literal | hehe | ||
23:20
nekobaka left
|
|||
pdc | I look forward to making unreadable Perl soon, then. As soon as my studies are completed in a few weeks | 23:20 | |
wolverian | yay! | ||
literal | pdc: what sort of stuff programs do you (intend to) write? | ||
-stuff | |||
wolverian | bookmark learn.perl.org | 23:21 | |
pdc | literal: I'm not sure, tbh. I'm looking for a second language to go with my C. So it will be anything and everything. I want it to be a scripting language so I have something to complement C | 23:22 | |
literal | ok | 23:23 | |
pdc | Python, as I said, seemed like a great lang for rapid software development. Python, I'm sure, can fullfil that to a large extent | ||
literal | Perl's best asset, which I think no other language can match (still), is CPAN | ||
wolverian | absolutely. | ||
pdc | it seems strange to me that a collection of unofficial, non-quality-assured code is so important. I'm sure I will come to love it | 23:24 | |
nb: I don't really know CPAN. I may have got those aspects of it very wrong | 23:25 | ||
wolverian | it's just pragmatic. | ||
literal | its quality is assured through reuse and testing | ||
wolverian | and reviews. :) | ||
literal | the CPAN Testers are great, all the modules on CPAN are tested architectures, operating systems, and Perl versions, if you ship tests with your modules | 23:26 | |
tested on* | |||
I don't think other languages' code repositories do this | |||
moritz_ | pdc: well, there are about 17k modules on CPAN. Even if 90% of them are crap, there are nearly 2k of awesome modules remaining ;-) | 23:27 | |
pdc | oh wow you're suggesting that 90% of CPAN possible isn't good? :) | ||
s/possible/possibly/ | |||
moritz_ | pdc: 90% of all software is crap ;-) | 23:28 | |
(personal opinion only) | 23:29 | ||
23:29
Tene left
|
|||
literal | pdc: the archive on this blog might be of interest to you -> modernperlbooks.com/ | 23:29 | |
moritz_ -> bed | |||
pdc | good night moritz_ | 23:30 | |
literal: bookmarked, thanks | |||
literal | it's not really about Perl books, though :) | 23:31 | |
pdc | and thank you for all your answers and thought. I look forward to getting started on Perl 5 in a few weeks | ||
literal | feel free to bug me if you've got more questions | ||
pdc | thanks. I will no doubt idle here and in #perl anyhow | 23:33 | |
literal | cool | ||
23:56
DemoFreak left
|