»ö« | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, alpha:, pugs:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend! Set by moritz_ on 25 June 2010. |
|||
pmichaud1 | is the ordering of candidates in Perl6MultiSub significant? | 00:02 | |
00:05
sftp left
|
|||
jnthn | pmichaud1: No | 00:05 | |
pmichaud1: (more) | |||
00:06
Juerd_ joined
|
|||
jnthn | The ordering that they're passed to set_candidates is not, and the order of the RPA it populates is not. | 00:06 | |
It sorts them on the first dispatch. | |||
But even that doesn't touch said RPA. | |||
00:06
cono left
|
|||
pmichaud1 | would it be hugely painful to convert the candidates RPA into a hash...? ;-) | 00:06 | |
jnthn | Not if there's a way to get all the values out | ||
To sort them | |||
After the sorting the dispatcher doesn't care about that RPA. | 00:07 | ||
pmichaud1 | well, it'd just be an iterator :-) | ||
jnthn | Anyway, likely not a problem to do that, just more code to fix up ;-) | 00:08 | |
pmichaud1 | I'm just thinking a hash keyed by subid might be simpler than searching through a list for matches. :-) | ||
jnthn | Yes. | ||
00:09
Schwern joined
00:10
Juerd_ left
|
|||
jnthn | I think it's getting towards sleep time here. :-) | 00:11 | |
pmichaud1 | enjoy sleep | ||
more hackathon tomorrow? | |||
jnthn | Any last questions while I snooze? :-) | ||
Oh yes | |||
pmichaud1 | \o/ | ||
jnthn | Much of Sunday too | ||
pmichaud1 | hopefully we'll have shiny new closures working. | ||
jnthn | Tomorrow is hacking, probably a nice walk at some point, and hopefully some good noms too :-) | ||
pmichaud1 | I _really_ wish to be there. :) | 00:12 | |
jnthn | Awww. :-) | ||
We have to have some hackathon here some day :-) | |||
And...Pisa in a month. ;-) | |||
pmichaud1 | okay, afk for me for a bit | 00:13 | |
jnthn | OK, night o/ | ||
pmichaud1 | oh, one last q | 00:14 | |
is there a significant difference between set_candidates and incorporate_candidates? | |||
I'm guessing that if set_candidates returns a new Perl6MultiSub based on an existing one, that's really the same as "incorporate_candidates" is doing. | 00:15 | ||
afk | 00:16 | ||
00:22
eternaleye left
00:43
clintongormley left
01:03
pmichaud1 left
01:06
lest_away is now known as lestrrat
|
|||
dalek | ecza: 93ff19c | sorear++ | (2 files): Refactor closure translation |
01:06 | |
niecza: 89a3f9a | sorear++ | Niecza/Actions.pm: | |||
niecza: Implement translation for bare blocks | |||
sorear | dalek? I pushed more than that | 01:07 | |
diakopter | it must've gotten floodblocked | ||
sorear | an IRC client can send 1 line every 2 seconds, at least | 01:08 | |
01:08
sorear sets mode: +v dalek
|
|||
diakopter | dalek is broken such that it usually sends the first 3 lines within 1 second | 01:08 | |
01:11
patspam left
|
|||
ingy | \o/ | 01:18 | |
My TestML.pm6 parser is fulling passing it's first tests!! | 01:19 | ||
ingy heads off to a track practice | |||
01:23
Trashlord left
01:24
meppl left
|
|||
sorear | Niecza has classes again | 01:25 | |
(but dalek is still silent...) | 01:26 | ||
01:29
dalek left
|
|||
lue | what would you call a document detailing all of the classes, methods, etc. in the src/ folder ( for the benefit of new contributers of course :) ) ? | 01:29 | |
01:29
dalek joined
01:31
Trashlord joined
|
|||
sorear | lue: ROADMAP | 01:32 | |
the file currently with that name should be renamed TIMELINE | |||
lue | hm, hadn't thought of that. | 01:33 | |
I thought 'API', but the more I read exactly what an API _is_, the more it seems like that's the spec. | 01:34 | ||
01:41
Chillance left
01:47
isBEKaml joined,
plobsing joined
02:00
eternaleye joined
02:21
japhb joined
02:26
wmiksss1 joined
|
|||
sorear | jnthn: ping | 02:28 | |
(or anyone else who groks lexical classes) | |||
TimToady | whaddya wanna know? | 02:31 | |
phenny | TimToady: 02 Jul 21:18Z <sorear> ask TimToady What does sub &* {} mean? | ||
sorear | A few things | 02:32 | |
1. | |||
sub x { my class Foo {} } # How many times is Foo composed? | |||
TimToady | only once, I think, same as package evaluation time | 02:34 | |
in that sense a class is just a package | |||
sub &* {} isn't anything, but sub &*foo is a dynamically scoped sub name, that must be called as &*foo() | 02:38 | ||
sorear | sub x($a) { my class Foo { method y { $a } } } # What happens here? | ||
std: sub &* {} #buglet? | |||
p6eval | std 31531: OUTPUT«ok 00:01 110m» | ||
TimToady | I dont' know how it's parsing it, offhand | ||
sorear | $<sigil>=['&''*'?]? <deflongname>? | 02:39 | |
STD.pm6 +2022 | |||
[ $<sigil>=['&''*'?] <deflongname>? | <deflongname> ]? | 02:40 | ||
TimToady | probably a holdover from when * was global | ||
it's violating the usual rule that twigils require a following \w | |||
sorear | I see | 02:41 | |
so what of my second class query? | |||
colomon | loliblogged: justrakudoit.wordpress.com/2010/07/...f-the-map/ | ||
sorear | sub x($a) { my ::Y := $a; my class Foo does Y { } } # Here, have a third | 02:42 | |
TimToady | somehow that $a has to clone, but maybe it's the entry to x() that does it | ||
that won't work | |||
Y has to be known at compile time | |||
composition must happen at compile time | 02:43 | ||
whole point of the traits paper... | |||
so perhaps package/module/class blocks are transparent to the when-to-clone choice | 02:44 | ||
so the method's block gets cloned on entry to x, perhaps, if that makes sense | 02:45 | ||
sorear | But if ::T were bound in a BEGIN, it would work? | ||
TimToady | presumably | ||
sorear | How about: my class Foo {}; sub x($a) { augment class Foo {} } #4 | 02:46 | |
TimToady | the augment is also compile time | ||
declarator, not exectuble statement | |||
sorear | Legal to put in a sub? | ||
How about: my class Foo {}; sub x($a) { augment class Foo { method y { $a }} } #5 | 02:47 | ||
TimToady | sure, but kinda like putting a BEGIN block there | ||
sorear | Aha. (Cancel 5) | ||
don't cancel 5 actually | |||
I'm guessing Foo::y will never be cloned? | |||
TimToady | though, actually, the block of the augment doesn't run until the sub is called, i suspect | ||
sorear | and so will always return undef? | 02:48 | |
How about: sub x($a) { my class Foo { method y { $a } }; BEGIN { Foo.new.y } } #6 | |||
TimToady | it's not a BEGIN exactly, since package blocks run like normal code, even though the declaration they declare happens at compile time | ||
in the same sense that in Perl 5, package foo; knows the name 'foo' at compile time, but runs the code in it whenever the normal execution would happen | 02:50 | ||
sorear | hmm | 02:52 | |
TimToady | looking at #6 now... | 02:53 | |
but my brane glazes over; short sleep rations here last night... | 02:54 | ||
sorear | #5 I think should work kind of like our subs do | 02:55 | |
since it's the same sort of thing; a more-visible declarator inside a lexical scope | |||
02:57
TiMBuS joined
|
|||
TimToady | it knows $a is a lexical in a sub that should clone, yes | 02:58 | |
but augment isn't creating anything new on its own | |||
except the method, of course | 02:59 | ||
#6 should parse fine because the typeness of Foo is known by the BEGIN block | |||
however, the .y will fail | 03:00 | ||
I think | |||
or perhaps you only get the protopad's $a | |||
sorear | my $a; my $b; sub c { my class D { }; $a = D; $b = sub { augment class D { } } }; c; $b(); c; $b(); #7. Does the final call to $b have any effect? This is a question of how distinct multiple instantiations of D are. | 03:01 | |
TimToady | I can see an argument for cloning D there | 03:03 | |
but if we drive it so far that everything has to be decided at run time, we've probably pushed it too far | 03:04 | ||
there's probably some kind of purist position there that we're going to avoid | |||
in the interestests of being able to make some guaratees to the compiler | |||
not sure where the exact boundary is though | 03:05 | ||
certainly if we arrange to clone D there, then anything in the augment has to follow along | |||
and I suppose if we do clone D, then 'state D' would avoid cloning in some cases | 03:06 | ||
state class D, rather | |||
sorear | I think I have a consistant mental model here | 03:07 | |
it clones D, but in a very shallow way | |||
TimToady | we do support virtual names to some extent | 03:08 | |
sorear | in particular the typology of the system is completely static | ||
a runtime notion of 'D' consists of the single 'D' protodescriptor + enough OUTER::s for all methods | 03:09 | ||
TimToady | so an anonymous class is still a single class regardless of how it's used | ||
sorear | augment BEGINs by augmenting the protodescriptor and runs by setting an OUTER:: | ||
"an anonymous class is still a single class regardless of how it's used" elaborate? | 03:10 | ||
TimToady | $x = class { method x {...} }; $x.new.WHAT # same for any instance of $x anywhere | ||
sorear | what about sub a($y) { class { method x { $y } } }; a(1).new.WHAT === a(2).new.WHAT | 03:12 | |
I hope False | |||
TimToady | that's an our class | ||
did you mean 'my'? | |||
sorear | that's an anon class | ||
TimToady | with our, the only thing lexical is the name | 03:13 | |
sorear | it doesn't have a name, how can it be our | ||
TimToady | oh, right, told you I was tired... | ||
so yes, that's running a different class {} | 03:14 | ||
sorear | ok | ||
then your statement about anon classes doesn't conflict with my mental model | |||
TimToady | you probably shouldn't be comparing with my mental model assuming it's coherent at the moment :) | 03:15 | |
sorear | anything else to add before afk? | ||
TimToady | it sounds like you're on the right track, I think | ||
sorear | pmichaud++ for suggesting walks around the neighborhood as a way to understand things | ||
TimToady | but I could be wrong :) | ||
sorear | it works very well for me | ||
TimToady | my son Aron likes to figure out quantum physics and black holes that way | 03:16 | |
but I should go sleep | |||
sorear | 'night | ||
TimToady | zzzzzzzzzzzzzzzzzzz | 03:17 | |
03:24
ash_ left
03:42
isBEKaml left
03:47
jaldhar joined
03:48
frettled joined
|
|||
pragma_ | please, no inspiration from ruby. | 03:50 | |
03:56
isBEKaml joined
|
|||
tylercurtis | pragma_: None at all? | 03:57 | |
sorear | S06 has 3333 lines... | 04:04 | |
isBEKaml | And, S03 has the greatest line count at 5076. :) #obviously... | 04:08 | |
04:13
Guest83880 left
|
|||
sorear | Hmm, I can't find the rules for sub foo { our sub bar { } } | 04:25 | |
I thought they were in S06, but no luck | |||
I'll just add my version of the rules to S06 | |||
04:27
kfo joined
|
|||
sorear | ahah, found it | 04:28 | |
04:29
isBEKaml left
04:30
kfo_ left
04:37
skids left
|
|||
pugssvn | r31532 | sorear++ | [S04] Clarify interaction of lexical classes and packages with members after discussion with TimToady | 04:39 | |
04:45
isBEKaml joined
|
|||
tylercurtis | rakudo: use MONKEY_TYPING; augment class Mu { method kilo () { self * 1000; }; method mega () { self.kilo.kilo; }; }; say 5.kilo; say 5.mega; | 04:47 | |
p6eval | rakudo 7017d2: OUTPUT«5000Method 'kilo' not found for invocant of class 'Integer' in 'Mu::mega' at line 11:/tmp/K7PmVfKGg6 in main program body at line 11:/tmp/K7PmVfKGg6» | ||
tylercurtis | rakudo: use MONKEY_TYPING; augment class Mu { method kilo () { self * 1000; }; method mega () { self.kilo.kilo; }; }; say 5.kilo; say 5.kilo.kilo; # Why does 5 * 1000 not have the kilo method? | 04:48 | |
p6eval | rakudo 7017d2: OUTPUT«5000Method 'kilo' not found for invocant of class 'Integer' in main program body at line 11:/tmp/8iyMLlIAcB» | ||
tylercurtis | rakudo: use MONKEY_TYPING; augment class Mu { method kilo () { self * 1000; }; method mega () { self.kilo.kilo; }; }; say 5.kilo; say (5*1000).kilo # doesn't seem to work either | 04:49 | |
p6eval | rakudo 7017d2: OUTPUT«5000Method 'kilo' not found for invocant of class 'Integer' in main program body at line 11:/tmp/Vlp4KcnrPe» | ||
04:49
ruoso left
|
|||
frew | masak++ # excellent blog post | 04:51 | |
rakudo: say * ~ ' ' ~ * for <a b c d>; | 05:02 | ||
p6eval | rakudo 7017d2: OUTPUT«_block54_block54_block54_block54» | ||
frew | rakudo: say * for <a b c d>; | 05:04 | |
p6eval | rakudo 7017d2: OUTPUT«!whatever_dispatch_helper!whatever_dispatch_helper!whatever_dispatch_helper!whatever_dispatch_helper» | ||
frew | haha | ||
map * * * for <a b c d>; | |||
rakudo: map * * * for <a b c d>; | |||
p6eval | rakudo 7017d2: ( no output ) | ||
frew | rakudo: say map * * * for <a b c d>; | 05:05 | |
p6eval | rakudo 7017d2: OUTPUT«» | ||
frew | rakudo: say map * + 1 for <a b c d>; | 05:06 | |
p6eval | rakudo 7017d2: OUTPUT«» | ||
frew | rakudo: say map * + 1, <a b c d>; | ||
p6eval | rakudo 7017d2: OUTPUT«1111» | ||
frew | rakudo: say map * ~ 1, <a b c d>; | ||
p6eval | rakudo 7017d2: OUTPUT«a1b1c1d1» | ||
frew | rakudo: say map * * *, <a b c d>; | ||
p6eval | rakudo 7017d2: OUTPUT«00» | ||
frew | wow | ||
it worked EXACTLY HOW IT HOGUHT | 05:07 | ||
awesome | |||
tylercurtis | * * * is kinda confusing, I think. | 05:08 | |
rakudo: say map {$^a * $^b}, <a b c d>; | 05:09 | ||
p6eval | rakudo 7017d2: OUTPUT«00» | ||
tylercurtis | or even... | ||
rakudo: say map &infix:<*>, <a b c d> | |||
p6eval | rakudo 7017d2: ( no output ) | ||
tylercurtis | or no. | ||
05:21
ashleydev left
05:30
justatheory left
05:37
envi^home left
|
|||
frew | Trashlord: but the fact that it wokrs is awesome | 05:41 | |
tylercurtis | frew: I think your tab-completion didn't work quite properly, there. If you think that's an awesome aspect of *, I have the perfect link for you. Just let me find it. | 05:45 | |
frew | correct :-) | 05:46 | |
tylercurtis: is it the recent blog post about * ? | |||
tylercurtis: it's not the * * * that's awesome, it's that p6 was consistent about it | |||
that's pretty excellent | |||
tylercurtis | frew: No. It's a wonderful little bit of obfuscated code that I saw somewhere, possibly moritz_'s blog, that really takes advantage of Perl 6's consistency about it. | 05:47 | |
frew | rakudo: say map * ** 2, 1..5; | ||
p6eval | rakudo 7017d2: OUTPUT«1491625» | ||
frew | ... | 05:48 | |
rakudo: say map * ** * * * 1..9 | |||
p6eval | rakudo 7017d2: OUTPUT«===SORRY!===Confused at line 11, near "say map * "» | ||
frew | heh | ||
oh well | |||
say map (* * *) ** * 1..9; | |||
rakudo: say map (* * *) ** * 1..9; | 05:49 | ||
tylercurtis | rakudo: say map * ** * * *, 1..9; | ||
p6eval | rakudo 7017d2: OUTPUT«===SORRY!===Confused at line 11, near "say map (*"» | ||
rakudo 7017d2: ( no output ) | |||
tylercurtis | Anyway, I found it: perlgeek.de/blog-en/perl-6/starry-obfu.html | 05:50 | |
With an explanation here: perlgeek.de/blog-en/perl-6/dissecti...-obfu.html | |||
frew: although it appears that when that was written, Whatever would only ever create a unary function. | 05:55 | ||
06:09
constant left
06:10
constant joined,
constant left,
constant joined
06:32
isBEKaml left
|
|||
ingy | hola | 06:32 | |
tylercurtis | Hi. | ||
ingy | :) | ||
frew | rakudo: say map * * * ** * 1..9; | 06:36 | |
p6eval | rakudo 7017d2: OUTPUT«===SORRY!===Confused at line 11, near "say map * "» | ||
frew | rakudo: say map * * * ** 2 1..9; | 06:37 | |
p6eval | rakudo 7017d2: OUTPUT«===SORRY!===Confused at line 11, near "say map * "» | ||
tylercurtis | rakudo: say map * * * ** 2, 1..9; | ||
p6eval | rakudo 7017d2: ( no output ) | ||
frew | rakudo: say map * * * ** *, 1..9; | 06:38 | |
p6eval | rakudo 7017d2: ( no output ) | ||
frew | rakudo: say map * * * + *, 1..9; | ||
p6eval | rakudo 7017d2: ( no output ) | ||
frew | rakudo: say (map * * * + *, 1..9).perl; | ||
p6eval | rakudo 7017d2: OUTPUT«Method 'Num' not found for invocant of class 'WhateverCode' in 'Cool::Numeric' at line 1585:CORE.setting in 'Cool::Numeric' at line 1586:CORE.setting in 'infix:<+>' at line 5890:CORE.setting in <anon> at line 11:/tmp/GTogSKuL_r in 'Any::join' at line 1 in | ||
..'List::perl' a… | |||
tylercurtis | rakudo: say (* * * + *)(1, 2, 3) | 06:43 | |
p6eval | rakudo 7017d2: OUTPUT«Too many positional parameters passed; got 3 but expected 1 in <anon> at line 1:/tmp/WAipoCrfdO in main program body at line 11:/tmp/WAipoCrfdO» | ||
tylercurtis | rakudo: say (* * * + *)(1) | ||
p6eval | rakudo 7017d2: OUTPUT«Method 'Num' not found for invocant of class 'WhateverCode' in 'Cool::Numeric' at line 1585:CORE.setting in 'Cool::Numeric' at line 1586:CORE.setting in 'infix:<+>' at line 5890:CORE.setting in <anon> at line 11:/tmp/J7C_hDpWyG in main program body at line | ||
..11:/tmp/J7C_hDp… | |||
mathw | phenny: tell masak Awesome blog post! | 06:47 | |
phenny | mathw: I'll pass that on when masak is around. | ||
06:51
eternaleye left
06:52
f joined
|
|||
f | where | 06:53 | |
hello | |||
06:55
f left
07:11
Su-Shee joined
|
|||
frew | rakudo: 240*8 | 07:15 | |
p6eval | rakudo 7017d2: ( no output ) | ||
frew | rakudo: say 240*8 | 07:16 | |
p6eval | rakudo 7017d2: OUTPUT«1920» | ||
07:21
cono joined
07:51
Ross joined
08:05
agentzh joined
08:19
masak joined
|
|||
masak | lol I woke up | 08:19 | |
phenny | masak: 06:47Z <mathw> tell masak Awesome blog post! | ||
masak | thanks :) | ||
08:23
isBEKaml joined
|
|||
masak | std: state class D { } | 08:27 | |
p6eval | std 31532: OUTPUT«ok 00:01 110m» | ||
08:28
zamolxes left,
patch joined,
f00li5h joined,
zamolxes joined
|
|||
isBEKaml | masak: as always, great post! I have a question about '*'. Do they allow callables to be taken as params? | 08:36 | |
callables might be taken as blocks that are to be executed on satisfying some conditions.. | |||
masak | rakudo: my $a = *.assuming(4); say $a(* + 38) | 08:37 | |
p6eval | rakudo 7017d2: OUTPUT«assuming_helper» | ||
isBEKaml | rakudo: map * for <foo bar baz duck> | ||
p6eval | rakudo 7017d2: OUTPUT«No candidates found to invoke in 'map' at line 1564:CORE.setting in main program body at line 11:/tmp/go0yQ8s0Sr» | ||
tylercurtis | rakudo: (*.(5)).(&say)) # not really sure if the dotty form is right. | ||
p6eval | rakudo 7017d2: OUTPUT«===SORRY!===Confused at line 11, near ") # not re"» | ||
masak | rakudo: my $a = *.assuming(4); say $a(* + 38)() | ||
p6eval | rakudo 7017d2: OUTPUT«42» | ||
masak | \o/ | ||
isBEKaml: that what you meant? | |||
tylercurtis | (*(5))(&say) | ||
rakudo: (*(5))(&say) | |||
p6eval | rakudo 7017d2: OUTPUT«5» | 08:38 | |
masak | TimToady: would it make sense to have a special case for map/grep of *, for people who expect the 'identity transform' to be spelled that way? | ||
isBEKaml | tylercurtis showed a weird form of a callable.. :) | ||
Though I recognise &prefix to indicate a block.. | 08:39 | ||
08:39
azert0x joined,
azert0x left,
azert0x joined,
azert0x left
|
|||
tylercurtis | rakudo: my &funcall := *(*); funcall(&say, 5) | 08:39 | |
p6eval | rakudo 7017d2: OUTPUT«:= binding of variables not yet implemented in 'infix:<:=>' at line 601:CORE.setting in main program body at line 11:/tmp/ZPm0qPWgwh» | ||
08:40
azert0x joined
|
|||
tylercurtis | rakudo: my &funcall = *(*); funcall(&say, 5) | 08:40 | |
p6eval | rakudo 7017d2: OUTPUT«Too many positional parameters passed; got 2 but expected 1 in <anon> at line 1:/tmp/KLj0thrrzG in main program body at line 11:/tmp/KLj0thrrzG» | ||
tylercurtis | I write too much NQP. | ||
rakudo: my &funcall = *(5); funcall(&say) | |||
p6eval | rakudo 7017d2: OUTPUT«5» | ||
isBEKaml | tylercurtis: this is more close to what I have in mind. It would be nice if we can do that by inlining conditional statements. | ||
08:41
azert0x left
|
|||
isBEKaml | not the above, the one before. | 08:41 | |
masak | "inlining conditional statements"? | ||
08:42
azert0x joined
|
|||
isBEKaml | masak: More like, execute this block only if it satisfied certain criteria. funcall(&callable, params_callable) if (condition); | 08:42 | |
08:43
azert0x left
|
|||
isBEKaml | masak: by inlining, funcall(&callable, params_to_callable if (condition_satisfied) ); | 08:43 | |
there, it's inside the funcall. | 08:44 | ||
tylercurtis | Part of me wants to complain that if I saw that without seeing the example of what you'd want it to mean immediately before it, I'd have no clue what it did. On the other hand, that's also true of a lot of wonderful features of Perl 6. | 08:46 | |
isBEKaml | tylercurtis: that's right. Eg in point, I kind of understand map/grep, but I don't really fully understand it though I use it regularly in another FP language I use(Scala) | 08:48 | |
tylercurtis | masak: Would you be willing to describe the current format of SIC to me sometime if I'm not able to sufficiently figure it out by reading the source of Yapsi? | ||
masak | tylercurtis: oh, absolutely. | ||
isBEKaml | masak: I had wanted to ask you about if-else block in Yapsi. it doesn't seem to work the way I see it. Can you explain if you have any other syntax in mind? | 08:49 | |
masak | isBEKaml: what doesn't work? | ||
./yapsi -e 'if 42 { say 5 } else { say 3 }' | 08:50 | ||
5 | |||
isBEKaml | yapsi -e 'my $foo = 42; if($foo > 50) {say "hie"; } else { say "no"; }; ' | ||
Could not parse | |||
tylercurtis | masak: thanks. I'm working on a top-secret not-very-good-idea project(that will probably stop being top-secret around the point words appear on the screen) involving it. | ||
masak | isBEKaml: ah, infix:<< > >> not implemented yet. | ||
isBEKaml: also, you'd need a space after 'if' and before the (optional) paren. | |||
isBEKaml | masak: ah, expression evaluation isn't in yet.. :) | 08:51 | |
masak | tylercurtis: interesting :) | ||
isBEKaml: there's only two operators for far. ++$a and --$a | |||
isBEKaml: holding off on the rest pending the implementation of subs. | |||
08:52
Juerd left,
Juerd joined
|
|||
isBEKaml | masak: 3 weeks ago, I was thinking about how I'd do if-else blocks (hit on the expression evaluation thingy, thought of taking it up later). But then $DAYJOB took me up. :( | 08:53 | |
masak: ok, back to question. How do we best go about implementing expr evaluation (I'm totally new to compilers/parsers, remember? ) | 08:55 | ||
tylercurtis | masak: of course, I'm also working on my GSoC, a library for unit-correct calculation(which is partially blocking on an apparent Rakudo bugs), translating Notation as a Tool of Thought from APL to Perl 6, my social life, and probably some other stuff(eventually I might find time to work on my potential Javascript compiler again, although now that I've written some Perl 6, I don't think I could stand to modify the parser to understand semicolon elision) | ||
no guarantees that it'll be even at that point anytime soon. | |||
masak | isBEKaml: best way is probably to hook in STD, which mostly solved the whole parsing issue. | ||
isBEKaml: then we can focus on traversing the parse tree and building useful structures out of it. | 08:56 | ||
isBEKaml | masak: how do we do that? And, STD can emit AST? | 08:57 | |
masak | tylercurtis: I liked the APL notes you had on PerlMonks. they were well-researched and generally an interesting read. | ||
isBEKaml | masak: nm the first question(exercise for me, will read the source) | ||
masak | isBEKaml: the "how" is a good question. I'm open for ideas. as far as I know, STD only produces a parse tree, no AST. | ||
tylercurtis | masak: thanks. hopefully I'll manage to get around to doing the same for the rest of the paper at some point. | 08:58 | |
isBEKaml | masak: [noobish] err, what's the difference between parse tree and AST? | 08:59 | |
masak | isBEKaml: I just found out a couple weeks ago. :) I used to think they were the same. | ||
isBEKaml: briefly, a parse tree is closer to the source text in its structure. an AST is closer to the semantics. or something. | 09:00 | ||
knowledgeable people on this channel will probably have a better explanation. :) | |||
tylercurtis | isBEKaml: AST's are generally massaged to be more convenient to generate code from/optimize/what-have-you. Whereas the parse tree is just exactly the tree of grammar rules that parsed the code. | ||
masak | right. | ||
sorear | isBEKaml: the parse tree directly corresponds to the physical structure of the code | ||
the PAST is a language-independant structure; it looks exactly the same whether you're running perl6 --target=past, or lua, or go, or python, or anything else | 09:01 | ||
masak | things like, you can put the while/until condition in a 'repeat' loop either before or after the block. the AST would abstract away that insignificant difference. | ||
sorear | it's not correct to talk about "STD doesn't generate AST" | 09:02 | |
because the parse /is/ an AST | |||
masak | oh? | ||
sorear | the "parse" / "past" distinction is 100% a Parrot invention | ||
because Parrot is supposed to run multiple languages, y'see | |||
they needed to separate language-specific trees from non-language-specific ones | 09:03 | ||
masak | sorear: I've been considering adopting PAST wholesale for Yapsi. do you think that's a good idea? | ||
sorear | AST is a pretty general technical term | ||
masak: No. Anything which can run 100% of PAST is a Parrot clone | |||
masak | huh. | 09:04 | |
sorear | both PAST and Rakudo-Parse are kinds of AST | ||
09:04
envi^home joined
|
|||
sorear | STD generates its own parse-oriented AST; it also has an 'Actions' module which generates a slightly nicer AST | 09:04 | |
viv uses Actions for historical reasons, but I recommend you don't; I've wasted more time chasing Actions bugs than Actions has saved me :( | 09:05 | ||
tylercurtis | sorear: Python(at least CPython) also has a distinction between the parse tree and the AST. | ||
isBEKaml | uhh, let me get this straight - parse trees are for compilation phase, ASTs are more towards runtime phase (optimize,inline, do-whatever). | ||
masak | isBEKaml: correct. except sorear is saying both kinds are known as ASTs. | 09:06 | |
isBEKaml | sorear? | ||
masak | oh wait. no, it's not a compile/runtime distinction. | ||
sorear | isBEKaml: a normal compiler breathes ASTs (the technical term); it uses them in almost every phase, and has several different kinds of them | ||
however, every compiler has its own idiosyncratic set of names for various AST flavors | |||
Rakudo uses three - 'parse', 'past', and 'post' | 09:07 | ||
masak | right. inside a compiler, it's mostly trees of different kinds. the frontend converts text->tree and the backend tree->text. | ||
sorear | My use of AST is probably not completely standard either | 09:08 | |
isBEKaml | masak: I'm confused by your use of tree->text. I'd have thought tree->some_other_form_for_another_layer_of_compiler. | ||
given how we have different forms of trees for Parrot alone. | 09:09 | ||
masak | well, I've gotten the impression that "Abstract" in AST means that it's somehow more separated from its textual form. | ||
isBEKaml: sure, but I meant that eventually, some serializer will spit back out text, or a binary blob. | 09:10 | ||
I cloned a templating engine for Web.pm that worked in much the same way. it's called Hitomi, and was a clone of Python's Genshi. internally, everything is lazy streams of XML-ish nodes, but it consumes and produces text externally. | 09:12 | ||
isBEKaml | I don't get the full picture (though I guess it's better than what it was y'day ). I think I'll "get" it when I do something on Yapsi/read some compiler book. (I don't want to read "Dragon" book, it's too dense for me :( ) | 09:13 | |
masak | getting one's hands dirty sure helps for me, though I'm hardly an expert. | 09:14 | |
writing GGE (a grammar engine) was loads of fun. | |||
isBEKaml | masak: yes, I'd have guess most compilers have layers on layers built into them and the mental model is never clear. :/ | ||
pugssvn | r31533 | sorear++ | [S12] Clarify phasing of lexical classes | ||
sorear | I've never seen "Dragon" book | ||
do a search for "Let's Build a Compiler" | 09:15 | ||
masak | sorear: en.wikipedia.org/wiki/Dragon_Book_(...r_science) | ||
sorear | it's a ~20-part series of tutorials written in the 80s which walks you through writing most of a Pascal compiler to mc68k machine code in Pascal | ||
*excellent* read | 09:16 | ||
tylercurtis | Good night, folks. | ||
sorear | I was like, 14 when I read them. made perfect sense even then. | ||
masak | tylercurtis: 'night! | ||
isBEKaml | tylercurtis: G'night! | 09:17 | |
sorear | is isBEKaml a new yapsi recruit? | ||
masak | yes. :) isBEKaml++ | ||
sorear now understands the "class" statement well enough to implement it in niecza | 09:18 | ||
masak | isBEKaml: have you found doc/LOLHALP yet? | ||
isBEKaml | masak: yes. :) | ||
sorear: partly because learning about compilers has been on my TODO list for way too long... :) | |||
09:19
tylercurtis left
|
|||
masak | isBEKaml: yesterday, I tried to fix a design flaw that'll bite us if it isn't fixed early. it can be illustrated with this script: `my $a = 3; while --$a { say my $b; $b = 42 }` | 09:19 | |
isBEKaml: try running that in Yapsi. | |||
sorear | Was there no sixperl call on 6/24? | 09:20 | |
6/23 | |||
09:20
sorear sets mode: +o masak
|
|||
isBEKaml | masak: Any() ? | 09:21 | |
masak | where does this 'sixperl' moniker come from? it confuses me every time I see it. | ||
isBEKaml: yeah. that means "not assigned to yet". | |||
isBEKaml | sixperl? I haven't seen that before. | ||
masak | rakudo: say my $a | ||
p6eval | rakudo 7017d2: OUTPUT«Any()» | ||
isBEKaml | masak: shouldn't it throw some exception in the saycall? my $b? | 09:22 | |
rakudo: say my $b | |||
p6eval | rakudo 7017d2: OUTPUT«Any()» | ||
isBEKaml | pfft. | 09:23 | |
masak | :) | ||
isBEKaml: declarations are just expressions. | |||
isBEKaml: no, the issue is that in the second iteration, $b is 42. | |||
09:23
skangas joined
|
|||
isBEKaml | masak: ah, I see.. #don't know how I missed it :( | 09:24 | |
find-vars? | |||
masak | find-vars is working fine. | 09:25 | |
there's a deeper issue at work. Yapsi doesn't get a fresh lexpad for each new iteration. it should. | |||
sorear out | |||
09:25
azert0x joined
|
|||
isBEKaml | masak: one more thing I noticed in my cursory reading of the source. the block expressions always treated in 'main' scope. this is expected? | 09:26 | |
masak | not quite sure what you mean. | 09:27 | |
isBEKaml | will come back after looking at the source more closer. | ||
masak | right now, all the block names are prefixed 'main', but that's just convention. | ||
jnthn | oh lol I can be concious too | 09:30 | |
isBEKaml | I see, so that's just naming convention... | 09:31 | |
masak | isBEKaml: yes. yesterday, trying to solve the above issue, I briefly toyed with the idea of just naming the blocks 'block0', 'block1', etc. | 09:32 | |
jnthn | phenny: tell pmichaud that incorporate_candidates is primarily used for the situation where we have multis from outer scopes and need to add those. Please keep it separate as we'll need it to also be able to sort or tie-break on outerness one day. | 09:34 | |
phenny | jnthn: I'll pass that on when pmichaud is around. | ||
masak | isBEKaml: right now, Yapsi cheats quite intolerably, actually, and derives block outer/inner relationships by virtue of whether one is a prefix of the other. that won't fly in the long run, so I should probably go ahead and start by factoring away that. | 09:35 | |
isBEKaml | masak: I didn't quite see that. I was totally glazed out when I saw those sicify parts :D | 09:37 | |
masak | yeah. I should probably add some comments in those areas. | ||
isBEKaml | or add a doc that explains the SIC model | 09:38 | |
masak | that'd be nice, too. | ||
basically though, this is the way the compiler works: program text --[grammar]--> $/ --[find-vars]--> $/ --[sicify]--> SIC. | 09:39 | ||
the find-vars step makes sure that any use of a variable $a is always preceded by a declaration 'my $a'. | 09:40 | ||
the sicify step serializes the $/ tree into actual instructions. | |||
isBEKaml | I see.. | 09:42 | |
09:46
agentzh left
|
|||
jnthn sips coffee and waits for awakeness to come about | 09:47 | ||
masak | both find-vars and sicify mix traversal code and actual things-they-do. I've been thinking of ways to separate traversal and the interesting stuff. | 09:49 | |
09:52
plobsing left
09:55
tadzik joined
|
|||
masak | there's an spj paper about not having to write a lot of traversal code manually. it's called "Scrap Your Boilerplate" -- research.microsoft.com/en-us/um/peo...ap/hmap.ps | 09:55 | |
I don't think all of the Haskell tricks are applicable to languages like Perl 6, but it definitely gives hints of better ways to do things. | 09:56 | ||
the other day I did a proof-of-concept auto-traverser using Match.caps. that seemed to be a very viable approach. | |||
so there are definitely better ways to do it than Yapsi's current approach. | 09:57 | ||
sorear, TimToady: CursorBase.pmc:L1852 seems to expect a $PERL6LIB variable to be set. the README doesn't mention this at all. | 10:01 | ||
isBEKaml | masak: I'll look into it and see if I can come up with something. (No guarantees, though) ;) | ||
masak | isBEKaml: nice. best of luck. | ||
ah; it all works fine if $PERL6LIB is unset. | 10:02 | ||
did anyone ever figure out whence the "Deep recursion" warnings came? | 10:03 | ||
10:03
masonkramer left,
masonkramer joined
|
|||
isBEKaml | masak: With what I have taken up, I think I'll need it. :) | 10:04 | |
masak | isBEKaml: relax, many of us here are amateurs. there are certainly knowledgeable people with credentials too (especially in the "core group"), but most of us manage to contribute stuff without a CS major. :) | 10:06 | |
10:07
zed_ joined
|
|||
masak | ooh, viv output is kinda cute nowadays :) | 10:07 | |
isBEKaml | masak: No, I meant my $DAYJOB. Last few weeks have been especially hectic. lots of luck enough to have time to yapsi yapsi. | 10:08 | |
masak | ah. well, I've yet to meet someone who says "oh, I wish I had *less* time available to do the things I want rather than the things I need to do!" :) | ||
std: package Foo {}; my $*Foo::bar | 10:09 | ||
p6eval | std 31533: OUTPUT«ok 00:01 111m» | ||
masak | rakudo: package Foo {}; my $*Foo::bar = 42; say $*Foo::bar | 10:10 | |
p6eval | rakudo 7017d2: OUTPUT«Cannot assign to readonly value in '&infix:<=>' at line 1 in main program body at line 11:/tmp/pSglJZ4wt1» | ||
10:10
zed_ left
10:12
zed_ joined
|
|||
masak | 637 new/open/stalled bugs in RT. 367 (58%) by some fellow named masak. :P | 10:14 | |
jnthn | How far to the 1000th? ;-) | 10:15 | |
masak | it takes a while to check. I think I'm in the 800s. | ||
jnthn | gaaaah...it's too early for metamodel hacking... | ||
isBEKaml | how long did he take to the 500th? double that! | ||
masak | :) | ||
isBEKaml | no halve it! :D | ||
masak | isBEKaml: on average, it's one new ticket a day. I've been at it since mid-2008. | ||
isBEKaml | masak: I still remember the twigil bug that we accidentally stumbled upon. :) | 10:16 | |
masak | which one was that? | 10:17 | |
10:17
zed_ left
|
|||
isBEKaml | don't know the RT number. something around my $^a passing rakudo. | 10:17 | |
that's when I really understood what twigils were and how they were meant to be auto-vivifying themselves. | 10:19 | ||
masak | nice. | 10:28 | |
I don't remember it at all. | |||
"auto-vivifying" is probably a misnomer in this case, but yeah. | 10:29 | ||
since 2008-05-07, I've submitted 914 RT tickets. | 10:31 | ||
isBEKaml: ah, found it: rt.perl.org/rt3/Ticket/Display.html?id=75264 | 10:33 | ||
isBEKaml | masak: yes. :) | 10:35 | |
jnthn | phenny: tell pmichaud currently every P6object has an attribute it almost certainly never uses (addattribute $P0, '%!properties') - can we toss it? | 10:37 | |
phenny | jnthn: I'll pass that on when pmichaud is around. | ||
10:38
synth left
|
|||
jnthn | rakudo: role R { method foo { ... } }; class C {}; (C.new does R).^methods(:local)>>.name>>.say; | 11:05 | |
p6eval | rakudo 7017d2: OUTPUT«foo» | ||
masak | rakudo: sink 42 | 11:06 | |
p6eval | rakudo 7017d2: OUTPUT«Could not find sub &sink in main program body at line 11:/tmp/fKMAo1F8Hv» | ||
masak | huh? what did github.com/rakudo/rakudo/commit/233...1fd06817f3 add if the above doesn't work? | 11:07 | |
colomon | masak: is p6eval behind again? | 11:08 | |
> sink (1..10).map({.say}) | 11:09 | ||
1 | |||
masak | it claims to be on the latest commit. | ||
colomon | 2 | ||
3 | |||
etc | |||
it also claimed to be latest commit last time it was a couple of days behind. | |||
masak | it shouldn't claim that. | ||
isBEKaml | 7017d2 -> latest commit? | ||
masak | yes. | ||
it should claim to be on the commit it's on :P | |||
isBEKaml | "claim", yes. :D | 11:10 | |
masak | that would be much more helpful. | ||
isBEKaml | mine at 7df2c2 shows the same output as colomon's did. | 11:12 | |
that's assuming mine is older than what p6eval shows. | |||
must be since I built this a couple of days ago. | 11:13 | ||
11:14
rv2733 joined
|
|||
colomon | masak: as I'm going away for a week in about fifteen minutes, and I haven't accomplished this yet, I'm charging you with worrying about the complete wrongness of en.wikipedia.org/wiki/Perl_6#Gather | 11:15 | |
masak | OH NOES | ||
colomon: ok, task accepted. thanks for the heads-up. | |||
colomon | masak++ | ||
masak | colomon: have a nice away. | ||
colomon | masak: have a nice hackathon! | ||
jnthn | colomon: Enjoy your away :-) | ||
isBEKaml | colomon: enjoy your vacation! :) | 11:16 | |
11:17
pmurias joined
|
|||
pmurias | TimToady: ping | 11:17 | |
isBEKaml | masak: disregard what I said above. that particular commit was made on Jun 26. :| | ||
masak | rakudo: my @squares = gather for 0..Inf { take $_ * $_ }; say @squares[5] | 11:18 | |
p6eval | rakudo 7017d2: ( no output ) | ||
jnthn | rakudo: my @suqares = map * * *, 0..Inf; say @squares[3]; | ||
p6eval | rakudo 7017d2: OUTPUT«===SORRY!===Symbol '@squares' not predeclared in <anonymous> (/tmp/s5raMgb1eH:11)» | ||
jnthn | rakudo: my @squares = map * * *, 0..Inf; say @squares[3]; | ||
p6eval | rakudo 7017d2: ( no output ) | ||
masak | rakudo: say (map * * *, 0..Inf)[3] | 11:19 | |
p6eval | rakudo 7017d2: OUTPUT«42» | ||
masak | 42!? | ||
oh. | |||
*lol* | |||
tadzik | The answer to life, the universe and everything :) | ||
isBEKaml | lol | ||
tadzik | Even rakudo knows | ||
masak | Rakudo++ | 11:20 | |
I thought I'd be getting 9 or something... | |||
...but 42 is actually correct! | |||
jnthn | Wow! :-) | ||
isBEKaml | now we know what the question is! :D | 11:21 | |
tadzik | :D | ||
\o/ | |||
colomon | errr... the problem with the example is that you cannot assign a not-known-infinite (but really infinite) list to a @ variable by = | ||
masak | isBEKaml: ssh! it's rumored that if anyone ever finds out, the universe will reboot. | 11:22 | |
colomon: right, that's the "mostly eager" thing, I guess. | |||
isBEKaml | masak: oh, wait. I didn't tell anyone. <Looks behind warily... > | ||
jnthn | Shouldn't we assume infinite unless we know otherwise? | ||
Or does that get us into other kinds of trouble? | 11:23 | ||
colomon | jnthn: IMO yes, but neither the spec nor pmichaud agrees, and I assume they have a good reason that I just don't understand. | 11:24 | |
masak | I suppose it has to do with people's expectations when they do array assignment. | 11:26 | |
11:28
timbunce joined
11:39
mmcleric joined
|
|||
masak | couldn't we have a 'given for'? | 11:42 | |
std: sub isprime() {}; given for 2, 3, 5, 6, 7 { when isprime($_) { ... }; default { die "OH NOES!" } } | 11:44 | ||
p6eval | std 31533: OUTPUT«===SORRY!===Undeclared routine: 'for' used at line 1Check failedFAILED 00:01 116m» | ||
jnthn | for by default already topicalizes if you don't have an argument. | 11:45 | |
masak | d'oh! | ||
once again, Perl 6 is already as awesome as I would like it to be. | 11:46 | ||
jnthn | rakudo: for 1,2,3 { when 2 { say "oo"; }; default { say "n" } } | ||
p6eval | rakudo 7017d2: OUTPUT«noon» | ||
11:47
colomon left
|
|||
masak | rakudo: for 1..3 { when * % 2 { say "oo" }; when * %% 2 { say "n" } } | 11:47 | |
p6eval | rakudo 7017d2: OUTPUT«===SORRY!===Unable to parse blockoid, couldn't find final '}' at line 11» | ||
masak | rakudo: my $a = * % 2; say $a(5) | 11:48 | |
p6eval | rakudo 7017d2: OUTPUT«1» | ||
masak | rakudo: my $a = * %% 2; say $a(5) | ||
p6eval | rakudo 7017d2: OUTPUT«===SORRY!===Confused at line 11, near "my $a = * "» | ||
masak submits rakudobug | |||
rakudo: say 5 %% 2 | |||
p6eval | rakudo 7017d2: OUTPUT«===SORRY!===Confused at line 11, near "say 5 %% 2"» | ||
masak | oh. | ||
out-of-date p6eval. | 11:49 | ||
isBEKaml | is 5 %% 2 == 0? | 11:50 | |
isn't it 1? | |||
masak | isBEKaml: no, that's 5 % 2 :) | 11:51 | |
isBEKaml | D'oh! %% checks for divisibility while % is modulo. :( | 11:53 | |
11:53
meppl joined
|
|||
masak | correct. | 11:53 | |
11:59
snuff joined
12:13
pragma_ joined
12:14
pragma_ is now known as Guest76215
12:15
clintongormley joined,
sftp joined
12:22
timbunce left
12:24
rv2733 left
12:52
pmichaud joined
|
|||
pmichaud | good morning, #perl6 | 12:53 | |
phenny | pmichaud: 09:34Z <jnthn> tell pmichaud that incorporate_candidates is primarily used for the situation where we have multis from outer scopes and need to add those. Please keep it separate as we'll need it to also be able to sort or tie-break on outerness one day. | ||
pmichaud: 10:37Z <jnthn> tell pmichaud currently every P6object has an attribute it almost certainly never uses (addattribute $P0, '%!properties') - can we toss it? | |||
pmichaud | jnthn: I'm fine with tossing %!properties | 12:54 | |
12:54
M_o_C joined
|
|||
pmichaud | might need a deprecation cycle for it. | 12:55 | |
jnthn | pmichaud: ping | 13:08 | |
pmichaud | jnthn: pong | ||
jnthn | pmichaud: I've hit on a...nasty. | ||
rakudo: class Foo { }; say Foo.WHAT | |||
p6eval | rakudo 7017d2: OUTPUT«Foo()» | ||
jnthn | rakudo: class Foo { }; say Foo.HOW.WHAT | ||
p6eval | rakudo 7017d2: OUTPUT«Foo()» | ||
jnthn | rakudo: class Foo { }; say ClassHOW.WHAT | 13:09 | |
p6eval | rakudo 7017d2: OUTPUT«ClassHOW()» | ||
jnthn | rakudo: class Foo { }; say Foo.HOW ~~ ClassHOW | ||
p6eval | rakudo 7017d2: OUTPUT«1» | ||
jnthn | rakudo: class Foo { }; say Foo.HOW ~~ Foo | ||
p6eval | rakudo 7017d2: OUTPUT«1» | ||
jnthn | pmichaud: Basically Foo.HOW.WHAT giving back Foo rathr than ClassHOW is really bad. | ||
*rather | |||
pmichaud: The underlying issue I'm trying to deal with is that at the moment we can't mix into a metaclass | 13:10 | ||
Which means than doing various package traits neatly is a no-go | |||
pmichaud | looking. | 13:12 | |
jnthn | pmichaud: I has a P6object patch to change that. | ||
pmichaud: It also let me remove an Evil Hack in ClassHOW.pir | |||
We're a few S12 spectests down but not many and hopefully easily fixed. | 13:13 | ||
pmichaud | can I see the patch? ;-) | ||
jnthn | Which one? P6object? | ||
pmichaud | yes | ||
jnthn | it removes more than it adds ;-) | ||
pasting | |||
gist.github.com/462559 | 13:14 | ||
pmichaud: ^ | |||
pmichaud | do the p6object tests pass with the patch? | ||
jnthn | Yes | ||
Well, all the Parrot tests pass, I'm sure it runs p6object tests within that. | 13:15 | ||
yes | |||
just ran them independently too | |||
All pass. | |||
pmichaud | I'm just thinking to make sure we're not likely to break something else somewhere. | 13:16 | |
jnthn | *nod* | ||
pmichaud | I think I'm fine with the p6object patch. | 13:18 | |
jnthn | pmichaud: spectested - the only places we break is in S12-introspection | ||
Which I bet is because I relied on those semantics. | 13:19 | ||
pmichaud: OK, thanks. | |||
pmichaud | well, I'm more worried about what we break outside of rakudo :-) | ||
jnthn | *nod* | ||
pmichaud | but we'll call it a bug | ||
jnthn | Yes, it feels just wrong ituitively to me | ||
Metaclasses shouldn't be special - they're just classes. :-) | 13:20 | ||
masak | +1 | 13:21 | |
pmichaud | I've managed to redo multisub handling, now I'm just chasing down errors that it exposes | ||
jnthn | pmichaud++ \o/ | 13:22 | |
pmichaud | (can't even get "make test" to run atm, though) | ||
jnthn | That's not so surprising given how much core functionality depends on multis. ;-) | ||
pmichaud | the new code is much more straightforward | ||
for one, there's a lot less special-casing between lexical and package multisubs | 13:23 | ||
masak | pmichaud: it might please you to know that pls now has a failing test which will pass as soon as Rakudo does closure cloning right. :) | ||
pmichaud | the new code also handles: | ||
my $x = our multi sub abc(Int $y) { ... }; | |||
which installs a candidate in &abc but sets $x to be only the specific candidate. | 13:24 | ||
jnthn | Oh nice | ||
That'll fix a ticket. :-) | |||
I hadn't been looking forward to fixing that. ;-) | |||
pmichaud | it's simple, now. :) | 13:25 | |
well, assuming I can get the darn compiler to run again. :-) | |||
the problem with having so much in the setting is that once the setting doesn't compile properly, you're pretty much stuck. :-| | 13:26 | ||
masak | Perl 7 will have a minimal setting. :) | ||
pmichaud | Null PMC access in find_method('!select') | 13:27 | |
jnthn | oh sh... | ||
pmichaud | that's where I'm stuck now. | ||
jnthn | Well, that means a role is hosed somewhere. :-| | ||
pmichaud: Turn off Perl 6 backtraces and paste me the PIR backtrace, please. | |||
pmichaud | gist.github.com/462567 | 13:28 | |
jnthn | ewwwww | 13:29 | |
pmichaud | fwiw, I did not touch any of the perl6multisub code except to add a new method. | ||
jnthn | I guess Parcel is declared as does Positional? | ||
pmichaud | it is. | ||
jnthn | OK | ||
That may be the first time in the setting we actually call "does" | 13:30 | ||
If so, it is also the first time we try to do a multi-dispatch to trait_mod:<does> | |||
Which in turn may be the first time we try to do a multi-dispatch. | |||
pmichaud | I'm curious as to what is calling .perl, too. :) | ||
jnthn | er, so am I | ||
Oh | |||
pmichaud | I didn't change anything for multi-methods | ||
jnthn | One good guess | ||
pmichaud | (yet) | ||
jnthn | (traits are multi subs. our'd multi subs.) | ||
pmichaud | ohhhhhhhhh | 13:31 | |
jnthn | Is that a type check fails | ||
See src/core/traits.pm | |||
masak | pmichaud: #73034 is now officially the new #58392. :) | ||
jnthn | Or the dispatch fails | ||
And .perl is called in trying to make an error. | |||
pmichaud | okay | ||
jnthn | pmichaud: I don't know if I pushed this yet, but I noticed a fail in traits.pm where some things that shoulda been makred "our" were not | 13:32 | |
As in, some candidates were marked that and other were not | |||
I committed by maybe didn't push that | |||
Anyway, one other thing to do is to run the stage-1 compiler | |||
pmichaud | looks like everything in traits.pm is 'our' | ||
jnthn | Oh, OK | ||
I think I musta introduced and then fixed a fail of my own yesterday then. | |||
pmichaud | stage-1 compiler doesn't get very far, it depends on stuff from the setting. | 13:33 | |
jnthn | If you run the stage-1 compiler and try to write a couple of our-scoped multis... | ||
Oh? | |||
You can't even start it | |||
? | |||
pmichaud | I can start it | ||
I can compile to PIR | |||
13:33
timbunce joined
|
|||
pmichaud | but some things don't run | 13:33 | |
jnthn | *nod* | ||
pmichaud | e.g., $*ARGFILES | ||
jnthn | Not entirley surprising | ||
Check the PIR though | |||
For an our-scoped multi | |||
And make sure it's what you expected there. | |||
pmichaud | okay, will do that. | ||
jnthn | I very much suspect it's a trait dispatch gone rong though. | 13:34 | |
masak | rakudo: say "UR DOIN IT ", 'gnor'.uc.flip | 13:36 | |
p6eval | rakudo 7017d2: OUTPUT«UR DOIN IT RONG» | ||
masak | rakudo: say "UR DOIN IT ", 'gnor'.comb.sort.join.flip | ||
p6eval | rakudo 7017d2: OUTPUT«UR DOIN IT rong» | ||
pmichaud | aha, I has a fail. | ||
jnthn++ | |||
masak | rakudo: say "UR DOIN IT ", 'gnor'.comb.sort.join.uc.flip | ||
p6eval | rakudo 7017d2: OUTPUT«UR DOIN IT RONG» | 13:37 | |
13:38
hercynium left
|
|||
masak | rakudo: say "UR DOIN IT ", 'please ignore most of the contents of this string'.comb[8..11].sort.join.uc.flip | 13:38 | |
p6eval | rakudo 7017d2: OUTPUT«UR DOIN IT RONG» | ||
masak | :) | ||
jnthn GNORs on a stroopwafel | |||
tadzik | wow :) | 13:40 | |
pmichaud | jnthn: so, what I ultimately ended up doing was to create Perl6MultiSub.merge_candidates | 13:41 | |
it merges the candidates from another Perl6MultiSub, but skips any duplicates (by subid) | |||
jnthn | pmichaud: +1 | 13:42 | |
pmichaud: I'll glance over it post-commit | |||
pmichaud | so for our-scoped multis in a block, we create a Perl6MultiSub for the our-scoped multis in the the blcok | ||
jnthn | pmichaud: YOu left incorporate_candidates as a separate method? | ||
pmichaud | then we do .merge_candidates based on the existing package-scoped Perl6MultiSub | 13:43 | |
jnthn | pmichaud: That is, you haven't conflated "update the candidates" with "add these candidates from an outer scope"? | ||
pmichaud | and store the result back into the package (as well as a lexical) | ||
jnthn | +1 on the approach for packages | ||
pmichaud | well, I use merge_candidates also for "add from outer scope" | ||
jnthn | erm | 13:44 | |
For lexical multis? | |||
pmichaud | Yes | ||
jnthn | oh no | ||
I said plesae don't do that. | |||
pmichaud | it doesn't change anything. | ||
jnthn | I know it doesn't *now* | ||
But later | 13:45 | ||
multi foo() { }; { multi foo() { }; foo() } | |||
That's meant to work | |||
At some point | |||
Because we will want to tie-break on scope depth | |||
And I had incorporate_candidates separate as my "here's where I'll make that work" hook. | 13:46 | ||
I probably shoulda explained that better yesterday. | |||
pmichaud | I understand. It's trivially easy to fix. | ||
I did not eliminate incorporate_candidates. | |||
jnthn | OK. :-) | 13:47 | |
pmichaud | I'm not using it for lexical multis at the moment, but that can be fixed. | ||
We can also fix merge_candidates so that it understands scoping. | |||
so I went with the "keep common-looking-things-the-same" approach for now, knowing we can change it easily. | 13:48 | ||
jnthn | OK | 13:49 | |
I'm not sure if merge_candidates needs to...I'll have to see the code. | |||
Anyway, OK, we can fix it later I guess. | |||
pmichaud | okay, my codegen is definitely not quite right | 13:52 | |
need a break then will fix | |||
masak | 'break' in Perl 6 is now called 'succeed'. sounds a lot more positive. :) | ||
jnthn looks forward to this evening's curry succeed | 13:56 | ||
pmurias | TimToady: why does setting $ALL->{'UNIT'} also set $ALL->{'MY:file<MildewCORE.setting>'}? | 13:59 | |
jnthn spectests the bunch of meta changes | 14:01 | ||
14:04
skids joined
|
|||
pmichaud | aha, found it...(I think) | 14:09 | |
since our multi sub .... has both a block and package component, can't use $symbol<multi> for both. :-) | |||
jnthn | Ah. | 14:10 | |
14:11
JimmyZ joined
|
|||
pmichaud | so it was never generating the .loadinit | 14:11 | |
masak | 卓明亮! \o/ | ||
JimmyZ | 麦高!下午好! | ||
pmichaud | yay! "make test" runs again! | ||
JimmyZ | O(∩_∩)O哈哈~ | 14:12 | |
14:12
Guest76215 left,
Guest76215 joined,
Guest76215 is now known as pragma_
|
|||
pmichaud | yay! The test I was failing now passes! | 14:13 | |
jnthn | \o/ | ||
pmichaud optimistically runs "make spectest" | |||
masak | JimmyZ: 很高兴见到你 | ||
JimmyZ | masak: 我也一样,(*^__^*) 嘻嘻…… | 14:14 | |
masak: Does Yaspi have roadmap? | 14:15 | ||
masak | JimmyZ: a small one, in the README. | ||
jnthn | pmichaud: In other news, my broked introspection tests pass too ;-) | ||
pmichaud | so far, no failz in spectest. | ||
jnthn | :-) | 14:16 | |
Same here | |||
Down to S15 now | |||
er, S16 | |||
Which means all the interesting tests have passed | |||
;-) | |||
JimmyZ | masak: good | ||
pmichaud | I'm only up to S04 | 14:17 | |
one smartmatch failure | |||
jnthn | aw | ||
pmichaud | (which I'll likely regress on for today) | 14:18 | |
pugssvn | r31534 | pmurias++ | [CursorBase] work around nasty bug in Storable | ||
jnthn | pmichaud: +1 | 14:19 | |
pmichaud | RT #72048 | 14:20 | |
(is the one I'm failing) | |||
14:21
ashleydev joined
|
|||
jnthn | pmichaud: :S | 14:22 | |
pmichaud | yeah, getting some S12 fails now | ||
jnthn | Yes, I very much doubt that test can be failed in isolation. | 14:23 | |
pmichaud | I'm likely to need some help debugging the role failures. | 14:25 | |
jnthn | pmichaud: S14 tests may be informative. | ||
I suspected so. ;-) | |||
pmichaud | yes, they are. | ||
I'll commit and push. | |||
jnthn | Feel free to paste details | ||
My spectest run is nearly done | |||
After that I can switch branches and help out | |||
pmichaud | pushed. | 14:27 | |
jnthn | branch name? | ||
pmichaud | I should also probably try mergine with master, since some fixes / changes have been made since I created the branch. | ||
*merge | 14:28 | ||
jnthn | OK | ||
wait for me to push | |||
pmichaud | will wait. | ||
jnthn | I hope there'll be no conflicts. I suspect you've not touched meta-model stuff really | ||
If you have a paste of which test files fail, I'd be curious to see it | |||
particularly S14 | |||
pmichaud | still waiting for the spectests | ||
the only S14 that failes is parameterized-basic.t | 14:29 | ||
*fails | |||
jnthn | oh | ||
And the S12 ones? Are we talking many or few? | |||
pmichaud | neither a lot nor a little | ||
jnthn | ok | ||
pmichaud | looks like five test files | ||
jnthn | ok | ||
pmichaud | (don't know how many tests in each yet) | ||
ah, I bet I know the problem. | 14:30 | ||
jnthn is in trig test purgatory | |||
pmichaud: If the parametric roles tests fail that's not too surprising. | |||
pmichaud: They do tricks with closure-ish stuff | 14:31 | ||
pmichaud | looks like I'm getting a Code object that has an incomplete Sub | ||
jnthn | Line cloning the Methods per parameterization so they capture the right type parameter | ||
Ah | |||
*Like | |||
pmichaud | like, perhaps, a Sub without a lazysig or llsig | ||
jnthn | Oh | ||
oh oh oh | |||
Could it be to do with generic sigs? | |||
pmichaud | what's a "generic sig"? ;-) | 14:32 | |
jnthn | (::T $x, T $y) style stuff | ||
Where the T here is a thunk | |||
pmichaud | oh, yes, it could be that the thunking isn't thunked | ||
looking | |||
jnthn | Features in the S14 one you fail | ||
pmichaud | gist.github.com/462610 # my test failure summary | 14:35 | |
jnthn | t/spec/S06-multi/proto.rakudo # hmm | ||
hmm...hard to spot an easy pattern in those S12 ones just from the test names | 14:36 | ||
pmichaud | oh, I'm also getting | ||
jnthn | t/spec/S12-introspection/methods.t is a very odd one to fail | ||
pmichaud | Multiple declarations of lexical '&bar' | ||
that's... interesting. | |||
jnthn | hm | 14:37 | |
t/spec/S12-introspection/methods.t doesn't do much clever besides declare methods and introspect them | |||
Could make it easy to spot the fail | |||
masak | rakudo: class A { method foo() { return rand() < .5 } }; class B is A { method foo() { my $result = callsame; say $result ?? "success" !! "failure" } }; B.new.foo for ^5 | ||
p6eval | rakudo 7017d2: OUTPUT«===SORRY!===Unsupported use of rand(); in Perl 6 please use rand at line 11, near "() < .5 } "» | ||
masak | rakudo: class A { method foo() { return rand < .5 } }; class B is A { method foo() { my $result = callsame; say $result ?? "success" !! "failure" } }; B.new.foo for ^5 | ||
p6eval | rakudo 7017d2: OUTPUT«failuresuccessfailurefailuresuccess» | ||
masak | \o/ | 14:38 | |
pmichaud | I think I'm not detecting proto properly. | ||
or.... hmm. | |||
masak | "Pls is less prototyping... and more pleasing." -- jnthn++ :) | 14:39 | |
pmichaud | yes, I'm failing to detect "sub after proto" | 14:40 | |
jnthn | ah | 14:41 | |
isBEKaml | masak: callsame akin to super() ? | ||
jnthn | along those lines | 14:42 | |
but better ;-) | |||
masak | rakudo: class A { method foo { say "original foo" } }; role Mixin { method foo { say "before!"; callsame; say "after!" } }; (A.new but Mixin).foo | ||
p6eval | rakudo 7017d2: OUTPUT«before!original fooafter!» | ||
masak | jnthn++++++++++ | ||
this is so cool! | |||
pmichaud | testing proto fix | ||
isBEKaml | class but role? # I really need to get my head around to reading the spec.. ;) | 14:44 | |
pmichaud | proto fix may also explain some of the operator-related fails. | ||
masak | isBEKaml: actually, object but role. A.new is an instance. | 14:45 | |
arnsholt | masak: pong? | ||
isBEKaml | rakudo: role Foo { method do_what { say "I'm doing it!" } }; class Bar does Foo { method do_what { say "me? "; callsame; say "me again? "; } }; Bar.new.do_what; | 14:46 | |
p6eval | rakudo 7017d2: OUTPUT«me? me again? » | ||
masak | arnsholt: did you see spinclad's comment in the backlog about the sorting of paths in ufo? | ||
isBEKaml | No? | ||
rakudo: role Foo { method do_what { say "I'm doing it!" } }; class Bar does Foo { method do_what { say "me? "; callsame; say "me again? "; } }; (Bar.new but Foo).do_what; | 14:47 | ||
p6eval | rakudo 7017d2: OUTPUT«Could not find sub &say in 'do_what' at line 11:/tmp/MGtYyzKBaY in main program body at line 11:/tmp/MGtYyzKBaY» | ||
masak | isBEKaml: as to the first one... | ||
isBEKaml: the method in the class shadows the one in the role. | |||
isBEKaml: so there's nothing to 'nextsame' to. | |||
pmichaud | jnthn: pushed fix for protos | ||
re-spectesting. | |||
jnthn | pmichaud: pushed stuff in master | 14:48 | |
masak | isBEKaml: second one: &say in roles is a well-known (and irritating) bug. | ||
arnsholt | masak: No, i didn't. Was it aroun your ping? | ||
masak | arnsholt: hold on, I'll find it for you. | ||
irclog.perlgeek.de/perl6/2010-07-02#i_2506626 | |||
isBEKaml | the second one made me go wtf? | 14:49 | |
arnsholt | Cheers | ||
pmichaud | masak: I'm wondering if my latest fixes will help the &say bug. | ||
jnthn | pmichaud: so am I ;-) | ||
masak | tentative \o/ | ||
isBEKaml | \o/ #hopefully | ||
pmichaud | it seems plausible, at least. | ||
S14-roles/parameterized-basic.t still fails for me | 14:50 | ||
jnthn | It doesn't have a sinlge proto | ||
So it wasn't going to be that. | |||
arnsholt | masak: D'oh. That's a very good point | ||
isBEKaml | rakudo: role Foo { method do_what { say "I'm doing it!" } }; class Bar does Foo { method do_what { say "me? "; nextsame; say "me again? "; } }; (Bar.new).do_what; | ||
p6eval | rakudo 7017d2: OUTPUT«me? me again? » | ||
masak | arnsholt: care to draft up a fix? | ||
jnthn | isBEKaml: That is correct | 14:51 | |
dalek | kudo: ffe80d7 | jonathan++ | src/ (2 files): Re-implement is default trait for multis. |
||
kudo: 5954d61 | jonathan++ | t/spectest.data: Turn on S12-methods/default-trait.t. This means that S12 is no longer the |
|||
kudo: 9551482 | jonathan++ | src/ (2 files): First cut of starting to get 'is hidden' do work again. Not a complete |
|||
kudo: f509251 | jonathan++ | src/metamodel/ClassHOW.pir: Rip out old hidden implementation. |
|||
jnthn | awww...it missed patches! | ||
isBEKaml | masak: I see what you meant. | 14:52 | |
arnsholt | masak: I'll look into it | ||
Just have to update my laptop Rakudo first | |||
masak | \o/ | 14:53 | |
pmurias | phenny: help | 14:58 | |
phenny | pmurias: Hi, I'm a bot. Say ".commands" to me in private for a list of my commands, or see inamidst.com/phenny/ for more general details. My owner is sbp. | ||
masak | rakudo: { my $a; our sub foo() { $a } } | ||
p6eval | rakudo 7017d2: OUTPUT«===SORRY!===Symbol '$a' not predeclared in foo (/tmp/1J_da4PFWo:11)» | ||
masak | bug or feature? | ||
jnthn | "feature" ;-) | ||
pmurias | isn't phenny responsible for tell? | ||
masak | grrrr... | 14:59 | |
jnthn | (not really) | ||
masak submits rakudofeature | |||
jnthn | I think that should work. | ||
phenny: tell pmurias yes I am | |||
phenny | jnthn: I'll pass that on when pmurias is around. | ||
pmichaud | ah, found it, I think. | ||
jnthn digs into the next bit of trying to get mixing into metaclasses straightened out | 15:00 | ||
pmichaud: btw, I was very happy to remove a "it worked but I never quite understood why" hack from ClassHOW after that P6object fix. :-) | |||
pmichaud | jnthn: \o/ | ||
JimmyZ | rakudo: { my $a = 'hi'; sub foo() { $a; }; } | 15:02 | |
p6eval | rakudo 7017d2: ( no output ) | 15:03 | |
JimmyZ | masak: it's different? | ||
masak | JimmyZ: yes, because subs are 'my'-scoped per default. | ||
JimmyZ | rakudo: { my $a = 'hi'; our sub foo() { $a; }; } | 15:04 | |
p6eval | rakudo 7017d2: OUTPUT«===SORRY!===Symbol '$a' not predeclared in foo (/tmp/HUTRCYgA_r:11)» | ||
jnthn | That one is likely fixed in pmichaud++'s branch | ||
masak | :) | 15:05 | |
isBEKaml | rakudo: my $a="hi"; our sub foo() { $a; } | ||
p6eval | rakudo 7017d2: ( no output ) | ||
masak | note that you're not printing anything :) | ||
JimmyZ | std: { my $a = 'hi'; our sub foo() { $a; }; } | ||
isBEKaml | the only thing different from yours is the block _not_ surrounding it. | ||
p6eval | std 31534: OUTPUT«ok 00:01 115m» | ||
JimmyZ | oh bug? | 15:06 | |
isBEKaml | I'd assume __main__ | ||
pmichaud | > { my $a = 'hi'; our sub foo() { $a } }; say foo(); | ||
hi | |||
masak | isBEKaml: yes. the block was necessary to produce the bug. | ||
pmichaud: \o/ | |||
pmichaud | ohhhhhhhh | 15:07 | |
is *that* why we've had that bug?!? | |||
(I'm surprised that fails in current rakudo. Now I understand why.) | |||
isBEKaml | rakudo: say {my $a="hi"; our sub foo() { $a }; }; # crazy, let's see... | 15:08 | |
p6eval | rakudo 7017d2: OUTPUT«===SORRY!===Symbol '$a' not predeclared in foo (/tmp/AAcF8ALfk8:11)» | ||
isBEKaml | Ah, expected bug. :) | ||
JimmyZ | rakudo: say {my $a="hi"; sub foo() { $a }; }; | ||
p6eval | rakudo 7017d2: OUTPUT«_block46» | ||
arnsholt | masak: Eh, right. I think I found the bug | 15:09 | |
JimmyZ | std: say {my $a="hi"; sub foo() { $a }; }(); # and crazy too. | ||
p6eval | std 31534: OUTPUT«ok 00:01 113m» | ||
JimmyZ | rakduo: say {my $a="hi"; sub foo() { $a }; }(); # and crazy too, sorry this one | ||
arnsholt | Change $cur to $prev in the string output to the Makefile, and it works for sorear++'s example >.> | 15:10 | |
JimmyZ | bad, second typo | ||
jnthn | rakudo: say {my $a="hi"; sub foo() { $a }; }(); | ||
isBEKaml | rakudo: say {my $a="hi"; sub foo() { $a }; }.(); # crazy _ JimmyZ | ||
p6eval | rakudo 7017d2: OUTPUT«foo» | ||
isBEKaml | :D | ||
but foo for the whole block surrounding foo() ? | 15:11 | ||
masak | rakudo: say {my $a="hi"; sub foo() { $a }; }.().() | ||
p6eval | rakudo 7017d2: OUTPUT«hi» | 15:12 | |
masak | :P | ||
masak goes away and leaves it to others to explain that :) | |||
isBEKaml | extend .() to what we get as foo. But why do we get foo() for the whole block surrounding sub foo() ? | ||
masak | arnsholt: sorear's example? do you mean spinclad? | 15:13 | |
arnsholt | spinclad++ indeed | ||
My brane si highly defective when it comes to names | |||
masak | arnsholt: I'll see if I find it obvious what you mean if I look at the code. | ||
arnsholt | Line 161 of ufo. First occurence of $cur (inside a string) -> $prev | 15:14 | |
Stupid, really. If the previous dir is not a prefix of the current, you should output the -previous- one, not the -current- one | 15:15 | ||
masak | I think I found it. but it's not line 161 here :) | ||
arnsholt | A big fat brainfart, essentially | ||
Line 161 in HEAD at least =) | |||
masak | arnsholt: does that help entirely, though? we still don't special-treat slashes in any way, and it seems we should... | ||
masak heads to github just to be sure | 15:16 | ||
arnsholt | Sorry! | ||
Line 160 | |||
masak | we are now in agreement. | ||
arnsholt | I had a debug say in my code | ||
15:17
ashleydev left
|
|||
masak | consider the files 'foo/A.pm' and 'football/B.pm'. the corresponding dirs are 'foo' and 'football' (sans slashes). | 15:18 | |
one is a prefix of the other. | |||
arnsholt | Yeah, I was just thinking of that | ||
masak | that's what spinclad said. | ||
15:18
ashleydev joined
|
|||
arnsholt | But if you modify directory-of to leave the trailing / that should fix it | 15:19 | |
masak | it would. | ||
suddenly it feels risky *not* to have tests for this :) | |||
15:20
ashleydev left
|
|||
arnsholt | Yeah, tests might be a good idea =) | 15:20 | |
15:21
ashleydev joined
|
|||
pmichaud | jnthn: seems like 'of' and 'returns' isn't working on method introspection for me. | 15:22 | |
jnthn | hm | ||
rakudo: sub foo() of Int { }; say &foo.of | |||
p6eval | rakudo 7017d2: OUTPUT«Int()» | ||
jnthn | (just checking) | ||
pmichaud: Is that your ownly failure? | 15:23 | ||
pmichaud: If not, I suspect another failure is at the root of this one | |||
pmichaud | > sub foo() of Int { }; say &foo.of; | ||
Mu() | |||
jnthn | our multi trait_mod:<returns>(Routine $r, Mu \$type) { $r does Callable[$type]; | ||
} | |||
pmichaud | feels like the same problem with S14-roles/parameterized-basic.t | ||
jnthn | Right | 15:24 | |
pmichaud | or at leas related. | ||
*least | |||
jnthn | Yes | ||
I suspect fixing the S14 one will fix that | |||
pmichaud | any suggestions on how to find the S14 problem? | ||
15:25
tylercurtis joined
|
|||
pmichaud | oh, wait. | 15:25 | |
jnthn | pmichaud: Can you paste me the full test output? | ||
(easier to see what/how it fails that way) | |||
pmichaud | gist.github.com/462633 | ||
I'm going to look at the role constructor | 15:26 | ||
(in actions.pm) | |||
I bet I changed something there. | |||
so that the signature isn't being applied. | |||
jnthn | youch | 15:27 | |
Yes | |||
15:27
eternaleye joined
|
|||
jnthn | pm | 15:27 | |
oh | |||
pmichaud: You're making it into the role body | |||
Then it's failing in the signature binding | |||
Almost certainly | 15:28 | ||
pmichaud | right | ||
jnthn | That points to a thunk perhaps | ||
pmichaud | because the signature isn't being attached, likely. | ||
jnthn | Right | ||
pmichaud | I'm guessing | ||
jnthn | But I suspect it's not the role constructor that's the problem | ||
pmichaud | $package.signature($<def_module_name>[0]<signature>[0].ast); | ||
$package.signature_text(~$<def_module_name>[0]<signature>[0]); | |||
jnthn | But rather thunks | ||
Becuase we make it into the role body | |||
Which means we used the signautre | |||
15:28
cotto joined
|
|||
jnthn | pmichaud: Try these in the REPL: | 15:28 | |
role Foo[$x] { }; Foo[42].new | 15:29 | ||
role Foo[::T] { }; Foo[Int].new | |||
role Foo[::T, T] { }; Foo[Int, Int].new | |||
If (or which) of those fail could be informative. | |||
masak | rakudo: enum A <b c d>; sub foo(A $x) {}; foo(b) | ||
p6eval | rakudo 7017d2: OUTPUT«Nominal type check failed for parameter '$x'; expected {"b" => 0, "c" => 1, "d" => 2} but got Int instead in 'foo' at line 11:/tmp/Lq80n6PjTg in main program body at line 11:/tmp/Lq80n6PjTg» | ||
masak | ok, so there are three things wrong here. | ||
jnthn | RT'd already | ||
pmichaud | > role Foo[::T] { }; Foo[Int].new | ||
Ambiguous dispatch to multi '_block29'. Ambiguous candidates had signatures: | |||
:(Mu $x) | |||
:(Mu ::T ) | |||
jnthn | oh | ||
pmichaud | the first one worked. | ||
jnthn | try each one alone ;-) | ||
masak | jnthn: I suspected that, but I couldn't find it. | ||
pmichaud | oh. | ||
jnthn | Or Foo1, Foo2, Foo3 | ||
15:30
justatheory joined
|
|||
masak | submitting just in case. people with finding skillz can merge. | 15:30 | |
(1) I'm sending in a role, it should accept the parameter. no error. | |||
pmichaud | jnthn: all three succeeded. | ||
masak | (2) it stringifies the enum in the error message | ||
(3) it reports the unnamed parameter as ''. can probably do better. | 15:31 | ||
jnthn | pmichaud: hmmm :-) | ||
15:32
timbunce left
|
|||
masak | ah, rt.perl.org/rt3/Ticket/Display.html?id=75370 | 15:32 | |
jnthn | pmichaud: OK, I guess it's the boring task of bisecting the test file then. :-( | 15:33 | |
To see which chunk of it explodes | |||
masak | ok, this one alone, then: | ||
rakudo: sub foo(Str) {}; foo 42 | |||
p6eval | rakudo 7017d2: OUTPUT«Nominal type check failed for parameter ''; expected Str but got Int instead in 'foo' at line 11:/tmp/QAMDSHJxvP in main program body at line 11:/tmp/QAMDSHJxvP» | ||
masak submits rakudobug | |||
jnthn | pmichaud: OOC | 15:34 | |
role Foo[::T] { method bar(T $x) { } }; Foo[Int].bar(42); | |||
rakudo: role Foo[::T] { method bar(T $x) { } }; Foo[Int].bar(42); | 15:35 | ||
p6eval | rakudo 7017d2: ( no output ) | ||
jnthn | rakudo: role Foo[::T] { method bar(T $x) { } }; Foo[Int].bar(4/2); | ||
p6eval | rakudo 7017d2: OUTPUT«Constraint type check failed for parameter '$x' in 'bar' at line 11:/tmp/VoCXJqQCqb in main program body at line 11:/tmp/VoCXJqQCqb» | ||
15:35
justatheory left
|
|||
pmichaud | > role Foo[::T] { method bar(T $x) { } }; Foo[Int].bar(4/2); | 15:36 | |
Constraint type check failed for parameter '$x' | |||
jnthn | :-( | ||
Well, it's not that then. | |||
Must be somehing mroe subtle | |||
pmichaud | anyway, I'm pretty certain the problem is that a signature or lazy sig isn't being attached. | ||
so, I can debug that. | 15:37 | ||
jnthn | I suggest removing chunks of the S14 test until you find the chunk you have to remove to make the bug happen | ||
It may well become very obvious where to look then. | |||
pmichaud | aha! | 15:38 | |
Important clue: | |||
called from Sub 'perl6;CEven;!class_init_79' pc 11965 (EVAL_1:0) (t/spec/S14-roles/parameterized-basic.rakudo:120) | |||
looks like the problem is in the CEven role. :-) | |||
er, class. | 15:39 | ||
jnthn | oooh! | ||
pmichaud | anyway, bisected. :-) | ||
jnthn | role MD_block[Int $x where { $x % 2 == 0 }] { | ||
method what { 'even' }; | |||
} | |||
That's the role it composes | |||
pmichaud | right | ||
jnthn | I'll bet it's that "where" block that is missing it's siggy | ||
pmichaud | yes. | ||
jnthn is happy we know where the problem may lie | 15:40 | ||
pmichaud | aha | ||
jnthn | (that'll probably resolve other issues too) | ||
pmichaud | my $lazy_name := make_lazy_sig_block($expr<past_block>); | ||
make_lazy_sig_block probably doesn't do anything useful. | |||
jnthn | ah | ||
pmichaud | (the other block code no longer uses it) | 15:41 | |
so, this is the code that confused me earlier. | |||
I'm guessing we have to force the signature to lazy evaluation? | |||
because if $expr is already a block, it seems like its signature would have already been applied. | 15:42 | ||
jnthn | I seem to remember that had to be lazy always, yes | ||
pmichaud | I wonder if it now works for me to make all signatures lazy. | 15:43 | |
(It didn't earlier.) | |||
jnthn | Maybe | ||
I think that particular one really needs to be though | |||
pmichaud | so yes, the likely problem is that pblock's don't have lazy signature generation | 15:44 | |
nor typenames | 15:45 | ||
hmmmm | |||
jnthn | The time for strolling and nomming approaches. | 15:46 | |
masak | mmm, nom. | 15:53 | |
std: sub foo(A | B $x) {} | 15:54 | ||
p6eval | std 31534: OUTPUT«===SORRY!===In parameter declaration, typename 'A' must be predeclared (or marked as declarative with :: prefix) at /tmp/zu0AqXJyrD line 1:------> sub foo(A⏏ | B $x) {}Parse failedFAILED 00:01 112m» | 15:55 | |
masak | std: sub foo(Str | Int $x) {} | ||
p6eval | std 31534: OUTPUT«===SORRY!===Unable to parse signature at /tmp/o_2NjCLpGd line 1:------> sub foo⏏(Str | Int $x) {}Couldn't find final ')'; gave up at /tmp/o_2NjCLpGd line 1:------> sub foo(Str ⏏| Int $x) {} expecting any of: | ||
..constrain… | |||
masak | there's another way the Wikipedia article on Perl 6 lags behind. | ||
we do such things with subtypes now. | |||
jnthn | Let's go for noms! | 15:56 | |
15:56
masak left
|
|||
jnthn | \o/ o/ | 15:56 | |
16:06
JimmyZ left
16:11
JimmyZ joined
|
|||
lue | y o hai o/ | 16:18 | |
16:21
mmcleric left
16:37
ashleydev left
|
|||
arnsholt | phenny: tell masak gist.github.com/462687 fixes both the previous/current (d'oh) bug in my unique dirs patch, and the more subtle foo/footbal thing | 16:44 | |
phenny | arnsholt: I'll pass that on when masak is around. | ||
16:44
M_o_C left
16:49
JimmyZ left
16:57
JimmyZ joined
16:58
isBEKaml left
17:12
eternaleye_ joined,
eternaleye left
17:29
snuff_ joined
17:31
snuff left
17:43
Ross left,
Ross joined
17:44
JimmyZ left
17:46
mmcleric joined
18:14
skangas left
18:16
TiMBuS left
|
|||
tylercurtis | Is there a way to lexically disable :sigspace within a regex? | 18:34 | |
pmichaud | :sigspace(0) | ||
or :!sigspace | |||
tylercurtis | Thanks. | ||
pmichaud | (I think NQP might only understand the first. I know it understands at least one.) | ||
Ross | brb | 18:36 | |
18:37
M_o_C joined
18:40
songmaster joined
18:42
Ross left
18:47
envi^home left
18:48
supernovus joined,
M_o_C left
18:49
Ross joined,
Ross left,
Ross joined,
sftp left
18:52
sftp joined
|
|||
sorear | phenny: tell masak that the "Deep recursion" warnings come from Moose; CORE.setting defines a lot of operators, each operator results in defining a new child grammar, and Moose generates warnings if you nest classes more than 100 deep. #moose says "WONTFIX - your code is broken if you're inheriting that deeply". | 19:01 | |
phenny | sorear: I'll pass that on when masak is around. | ||
19:04
cono left
|
|||
sorear | good morning #perl6 | 19:05 | |
tylercurtis | Good morning, sorear. | ||
19:06
cono joined
|
|||
tylercurtis | Does Rakudo support heredocs? | 19:06 | |
19:07
supernovus left
19:20
dalek left
|
|||
sorear | tias? | 19:24 | |
19:25
sorear sets mode: +oov szabgab pmichaud pugssvn,
pugssvn left
19:36
Ross left
19:40
skids left
19:41
skids joined
|
|||
ingy | pmichaud: you about? | 19:43 | |
19:44
PerlJam left
19:46
cotto left,
PZt left
19:47
Juerd left
|
|||
ingy just realized the Test.pm is not OO. It has no Test::Builder equiv. | 19:50 | ||
I think I'm gonna need that to get TestML working | 19:51 | ||
so I guess I will create it. | |||
Actually I probably don't need it. | 19:54 | ||
19:55
masonkramer left
|
|||
ingy | anyone know what this means? -> 'if $number_of_tests ~~ ::Whatever' | 20:00 | |
jnthn | ingy: Checking if $number_of_tests contains something of type Whatever | ||
e.g. * | |||
I guess it's what handles when you write plan *; | 20:01 | ||
20:01
sawyer_ joined
|
|||
ingy | jnthn: so Test::plan(*) == no_plan ? | 20:01 | |
jnthn | Right. | 20:02 | |
ingy | thx! | ||
20:02
pugssvn joined
|
|||
jnthn summons masak | 20:06 | ||
20:06
masak joined
|
|||
jnthn | \o/ | 20:06 | |
masak | \o/ | ||
phenny | masak: 16:44Z <arnsholt> tell masak gist.github.com/462687 fixes both the previous/current (d'oh) bug in my unique dirs patch, and the more subtle foo/footbal thing | ||
masak: 19:01Z <sorear> tell masak that the "Deep recursion" warnings come from Moose; CORE.setting defines a lot of operators, each operator results in defining a new child grammar, and Moose generates warnings if you nest classes more than 100 deep. #moose says "WONTFIX - your code is broken if you're inheriting that deeply". | |||
masak | sorear: *lol* | 20:07 | |
sorear: I remember you mentioning the 100-level limit, but I didn't think you had an actual use case for it. | |||
20:07
Ross joined
|
|||
masak | arnsholt: thanks, will review. | 20:07 | |
20:08
pugssvn left,
skids left
|
|||
mmcleric | hello | 20:09 | |
phenny | mmcleric: 29 Jun 22:38Z <jnthn> tell mmcleric Thanks for the whatevercode patch - bit too tired to review it tonight, but will give it a proper look tomorrow. :-) | ||
jnthn | o/ | ||
mmcleric | jnthn: i guess you still didn't looked at it? :) | ||
jnthn | erm | ||
jnthn hides | |||
;-) | |||
Not yet | |||
mmcleric | ok... how about some new task, then? :) | 20:10 | |
20:11
skids joined
20:12
pugssvn joined
|
|||
jnthn | mmcleric: Hmm...not a bad idea. ;-) Let me think. :-) | 20:13 | |
mmcleric: Looking at your patch | 20:14 | ||
if pir::exists($last, 'returns') { | |||
That line feels...weird | |||
I'm a little surprised it works... | 20:15 | ||
mmcleric | are you looking at version with comments? :) | ||
jnthn | Yes | ||
From github.com/berekuk/rakudo/commit/41...9077205b02 | |||
mmcleric | yep | ||
20:15
dalek joined
|
|||
mmcleric | so, as i said there, i tried to keep ast tree clean from useless nodes | 20:15 | |
jnthn | Yes, the idea is good, but checking it that was is...creative. :-) | ||
Did | |||
if $last.returns() { ... } not do it? | 20:16 | ||
The exists check will be fragile, I expect. | |||
masak | std: my $a; return 42 unless($a) | ||
mmcleric | maybe, but not arity - arity can be zero | ||
p6eval | std 31534: OUTPUT«===SORRY!===Two terms in a row at /tmp/ETNeUoAqvo line 1:------> my $a; return 42 ⏏unless($a) expecting any of: bracketed infix infix or meta-infix statement modifier loop statement_mod_condParse failedFAILED 00:01 114m» | ||
jnthn | Since it relies on there being a hash underneath the PAST::Node which their kinda needin't be. I'm surprised it works at all. | ||
20:16
PerlJam joined
|
|||
masak | rakudo: sub foo { my $a; return 42 unless($a) } | 20:16 | |
p6eval | rakudo d27eb3: OUTPUT«Null PMC access in isa_pmc()current instr.: 'parrot;P6protoobject;ACCEPTS' pc 1376 (runtime/parrot/library/P6object.pir:803)» | ||
masak | \o/ | ||
masak submits rakudobug | 20:17 | ||
jnthn | if pir::defined($node.arity) { ... } is probably better then | ||
mmcleric | jnthn: i see | ||
20:17
supernovus joined
|
|||
jnthn | doing pir::exists on a PAST::Node feels kinda wrong though. | 20:17 | |
masak | rakudo: my $a; return 42 unless($a) | ||
p6eval | rakudo d27eb3: OUTPUT«Null PMC access in isa_pmc()current instr.: 'parrot;P6protoobject;ACCEPTS' pc 1376 (runtime/parrot/library/P6object.pir:803)» | ||
masak | rakudo: return 1 unless(1) | ||
p6eval | rakudo d27eb3: OUTPUT«Null PMC access in isa_pmc()current instr.: 'parrot;P6protoobject;ACCEPTS' pc 1376 (runtime/parrot/library/P6object.pir:803)» | ||
masak | rakudo: say "OH HAI" | 20:18 | |
p6eval | rakudo d27eb3: OUTPUT«Null PMC access in isa_pmc()current instr.: 'parrot;P6protoobject;ACCEPTS' pc 1376 (runtime/parrot/library/P6object.pir:803)» | ||
masak | oh :( | ||
mmcleric | also, i remember pmichaud saying that this part of code should be moved from sym<( )> to method semilist | ||
jnthn | That sounds sensible. If pmichaud felt so then I can completely go with that. | 20:19 | |
In the next bit: :arity($inv.arity) | 20:20 | ||
20:20
dalek left
|
|||
jnthn | I see why you've added that but I don't quite get why it fixes those chains. | 20:20 | |
20:23
rv2733 joined
20:24
plobsing joined
20:26
pmichaud_ joined
|
|||
jnthn | pmichaud_: lol I'm back... | 20:26 | |
pmichaud_: Any luck on the where bug? | |||
pmichaud_ | yes, mostly bad. | 20:27 | |
we're going to have to significantly re-think Code, I fear. | 20:28 | ||
or, at least, I am. | |||
mmcleric | jnthn: without that part, arity was wrong... i don't remember exact ast tree, sorry | 20:29 | |
although it looks normal to me - if we propagate returns, why not arity too? | |||
pmichaud_ | all of the block-oriented nodes get a significant rework in the llsig branch, fwiw | ||
(speaking of .arity and .returns, that is) | 20:30 | ||
jnthn | pmichaud_: Yeah, I'm looking at mmcleric++'s patch and figuring if I apply it there *will* be merge conflicts. (I won't.) | ||
(Until after the dust settles from your merge.) | |||
pmichaud_ | yes, that patch will likely need to wait. | ||
20:30
dalek joined
|
|||
jnthn | mmcleric: Anyways, the overall logic of the patch makes sense. | 20:32 | |
The arity propagation bothered me a little at first glance, but makes sense to me now I see what it's going. | |||
*doing | |||
pmichaud_ | jnthn: I need to come up with a way to distinguish a static Code object from a dynamic one. | ||
jnthn | mmcleric: As pmichaud++ is refactoring a bunch of stuff at the moment, though, it's a bad time to try and get it in right now. But it's the right direction. | 20:33 | |
20:33
masak left
|
|||
jnthn | pmichaud_: OK, background? | 20:33 | |
20:33
Ross left
|
|||
jnthn | pmichaud_: What's the actual problem you've hit on? | 20:33 | |
pmichaud_ | let's look at the following: | ||
20:34
Juerd joined
|
|||
pmichaud_ | my sub abc() of Int { ... } | 20:34 | |
supernovus | Hmm... I have come across an interesting problem. Augmenting a class that does a role that defines an attribute causes 'bad things' to happen. | ||
pmichaud_ | my $x = &abc; | ||
mmcleric | jnthn: great :) so, i'll move propagation to semilist and wait until your merge, and then rebase, right? | ||
jnthn | supernovus: The role has little to do with it | 20:35 | |
supernovus: Anything that adds an attribute in an augment will cause bad things to happen. | |||
supernovus: We need a good error for it. | |||
pmichaud_ | the "of Int" has to apply to a 'static' Code object -- a Code object that is forever associated with the static sub. | ||
jnthn | mmcleric: Yes, good plan. | ||
pmichaud_ | the thing that gets assigned to &x has to be a "dynamic" Code object -- it has to represent the state of the closure at the point the assignment is performed. | ||
supernovus | jnthn: That's the thing, the augment isn't adding an attribute, just a method. | ||
rakudo: role F { has Int $.boo = 1; }; class B does F {}; use MONKEY_TYPING; augment class B { method sush { say 'hi' } }; my $b = B.new; $b.sush; | 20:36 | ||
p6eval | rakudo d27eb3: OUTPUT«Null PMC access in isa_pmc()current instr.: 'parrot;P6protoobject;ACCEPTS' pc 1376 (runtime/parrot/library/P6object.pir:803)» | ||
jnthn | supernovus: I don't get it - you just send the augment composed a role with an attribute? | ||
Oh, I see | 20:37 | ||
Hmm, awkward. | |||
File Rakudo bug | |||
supernovus | that's not the error message I got over here | ||
Attribute '$!boo' already exists in the class, but a role also wishes to compose it | |||
jnthn | oh...wait, p6eval is broken | ||
pmichaud_: Traits should be applied once, yes. | |||
pmichaud_ | jnthn: the problem is, that traits are reflected in a Code object. | 20:38 | |
jnthn | pmichaud_: That's...probably part of why we cloned one thing instead of .new'd before... | ||
pmichaud_ | yeah | ||
I was hoping to avoid actual cloning, but it may not be possible. | |||
jnthn | Though it completely didn't occur to me when you said it yesterday. :-( | ||
Re-applying the traits all the time just won't fly though. | 20:39 | ||
pmichaud_ | agreed. | ||
jnthn | It's semantically wrong. | ||
I can't think of a good way to separate the dynamic and static aspects here really either. | 20:40 | ||
Or at least, not a clean one. | |||
pmichaud_ | well, I'm wondering to what degree Parrot's underlying model may be wrong, and if that's coloring our perception. | ||
i.e,. the idea that we clone a (static) sub to capture a context seems/feels really out of place | 20:41 | ||
jnthn | Well, it's the lexicals we really care about more than the sub, I guess | 20:42 | |
But the sub references the lexicals. | |||
pmichaud_ | so, here's an example. | 20:43 | |
let's suppose I have | |||
{ my sub abc() { ... }; &abc but something if (0,1).pick; } | 20:44 | ||
am I modifying the static Code object or a lexical copy? | |||
jnthn | but will *always* clone | ||
The interesting case is "does" | |||
pmichaud_ | okay, does, then. | 20:45 | |
{ my sub abc() { ... }; &abc does something if (0,1).pick; } | |||
pmurias | sorear: re the 100 limit would flattening the inheritance chain manually work? | ||
phenny | pmurias: 14:59Z <jnthn> tell pmurias yes I am | ||
jnthn | Right, that's the interesting question. | ||
pmichaud_: For traits it doesn't maybe come up because they are "compile time" application so those would apply to the static thing. | 20:46 | ||
pmichaud_: This case, OTOH, is a decidedly *runtime* mixin. | |||
pmichaud_ | but what's "the static thing" in this instance? | ||
jnthn | In my mental model, it was "the sub we initially store, and that every other instnace is a clone from" | 20:47 | |
Kind of analogous to the proto-lexpad idea. | |||
pmichaud_ | where "sub we initially store" ends up with a Code object that becomes its "static copy"? | ||
i.e., for every block (with traits) we have to at loadinit create a Code object for it? | 20:48 | ||
jnthn | I guess my (maybe bad) assumption here is that we create one Code object, apply the traits to it, and everything else is either an alias to or a clone of that. | ||
pmichaud_ | alias to doesn't work because we have to make copies to capture closures | ||
"clone of" is nasty because we have to know exactly when we're making copies | 20:49 | ||
jnthn | In the current model, don't we currently assume that we always need a copy though? | 20:50 | |
pmichaud_ | the current model of what? | ||
(the current model is broken :-) | |||
supernovus | Bug submitted. I'll find a workaround for a loadable DateTime::strftime until it is resolved. | ||
jnthn | In your current implementation you do Code.new at every entry to a block for the things within it, iiuc? | ||
pmichaud_ | that's not really a copy, though. | ||
well, I guess it is. | |||
okay, yes -- I create a copy upon entry to each block. | 20:51 | ||
jnthn | Right, so if you just clone every time you currently new...? | ||
It's no more costly in terms of the number of objects we end up making, and there's no more to have to know iiuc. | |||
pmichaud_ | it's somewhat more costly at startup (more) | ||
or, we have to have something that is really smart about creating code instances | 20:52 | ||
probably the latter | |||
jnthn | How much more costly though? | ||
pmichaud_ | well, you were wanting to avoid having a loadinit for every block, iirc :-) | ||
jnthn | I mean, the cost of not having working closures is pretty high too. ;-) | 20:53 | |
pmichaud_ | I'd like to lazily create the Code objects | ||
jnthn | OK | ||
jnthn thinks | |||
pmichaud_ | but yes, I see where you're coming from and I think that can work. | ||
jnthn | What if we were to have a scheme where: | ||
pmichaud_ | really what I want to have happen is to have everything tied to the Parrot sub. | 20:54 | |
jnthn | 1) First time we call Code.new it builds a new object and labels the Parrot sub with that object | ||
2) Next time around it sees "oh, we have our 'static' code object already, so I'll just clone that" | |||
pmichaud_ | so I don't want to be calling Code.new, because that's the wrong place. | ||
jnthn | Code.gimme ;-) | ||
20:54
PZt joined
|
|||
jnthn | OK, but I think the idea holds | 20:54 | |
pmichaud_ | yeah | ||
jnthn | We attach to the Parrot sub first time around, and clone from that the following times | 20:55 | |
And the first time - for anything that has traits - will be in a :load :init | |||
And for anything without traits I guess it doesn't matter. | |||
pmichaud_ | it gets tricky with our-scoped subs | ||
because they have to be initialized at loadinit also. | |||
(but then rebuilt in the block, and replaced) | |||
so in some sense what I really want is Sub.get_Code(....) | 20:56 | ||
where get_Code does the object building and returning | 20:57 | ||
and cloning | |||
or something like taht. | |||
jnthn | *nod* | ||
pmichaud_ | anyway, I agree with your basic premise, I just need to map it out. | ||
thanks. | |||
jnthn | Sure, I'm not sure of the best formulation | ||
pmichaud_ | well, I'm very happy with the current factorization, so it should be easy to get to there from here. | ||
jnthn | :-) | ||
pmichaud_ | I have a feeling this will work out to be even cleaner. | 20:58 | |
actually, I think I may start from an assumption that all blocks get a Code object at :loadinit, and then figure out how to optimize out the :loadinits | 20:59 | ||
jnthn | OK | 21:01 | |
21:03
mncharity_ joined
|
|||
pmurias | mncharity_: hi | 21:05 | |
21:06
pmichaud_ left
21:07
sundar joined
21:10
masak joined
|
|||
masak | mncharity_: hi! | 21:13 | |
21:14
sundar left,
sundar joined
|
|||
mncharity_ | Hi :) | 21:15 | |
mncharity_ dusting elf... | 21:18 | ||
21:18
supernovus_ joined
|
|||
mncharity_ | (job search;) | 21:19 | |
21:19
supernovus left,
supernovus_ is now known as supernovus
21:27
rv2733 left
|
|||
pmichaud | jnthn: okay, I think I figured it out. | 21:33 | |
essentially, we'll have two functions on Parrot subs. get_code will return the static Code object, get_closure will return a clone of that object and the current closure sub | 21:34 | ||
static compile-time thingies will work on the get_code object, while runtime bindings will be done using the get_closure object | |||
blocks and subs that don't require any compile-time traits and attributes will delay creating their Code object and sigs until a closure is actually needed | 21:36 | ||
immediate blocks will have the Code objects optimized out completely | |||
(but we can still get to them or generate one lazily if needed) | |||
pugssvn | r31535 | putter++ | misc/elf/README: One of the "two small errors" fixed by r26238, perhaps wasn't an error. | 21:39 | |
r31535 | (/usr/bin/env will find elf_h if <pathtopugs>/misc/elf is added to PATH) | |||
supernovus | masak: I moved DateTime::strftime from Temporal into a loadable module. I had to change how to add the strftime method to your DateTime object due to a bug (reported), but it does work. | ||
jnthn | pmichaud: OK, sounds sane on first reading. | ||
pmichaud | yeah, it seems very clean. | ||
jnthn | pmichaud: I wonder if we can build on that to do the static lexpad vs dynamic lexpad things in the future too | 21:40 | |
pmichaud | and it exactly models what we're looking for, so that we can easily distinguish the static code representation from a dynamic one. | ||
jnthn: perhaps so. | |||
jnthn | Sounds like it's heading in the same direction we want ot push that. | ||
*to | |||
masak | supernovus: cool. | 21:42 | |
pugssvn | r31536 | putter++ | misc/STD_red/README - Update ruby 1.9 install notes. | ||
21:44
Su-Shee left
|
|||
supernovus | masak: Along with a few other refactors of Date and Temporal. I'll send a [PATCH] soon. | 21:44 | |
masak | supernovus: thanks. | ||
cognominal | jnthn, this one is for you : pastie.org/1029601 # not golfed yet, but I think it should not. It is a good way to stress your dispatch engine. | 21:51 | |
21:54
pmurias left
|
|||
cognominal | hum, the first line has one } too much :( | 21:55 | |
jnthn | cognominal: erm | 21:57 | |
Does your build work at all? | |||
cognominal | anyway it blows up before reaching it. | ||
rakudo: multi method subtree(@a, @path, Range $r?, Bool :$mod?) { subtree( @a[@path.unshift], $r, $mod) } | |||
p6eval | rakudo d27eb3: OUTPUT«Null PMC access in isa_pmc()current instr.: 'parrot;P6protoobject;ACCEPTS' pc 1376 (runtime/parrot/library/P6object.pir:803)» | ||
jnthn | rakudo: oh no | 21:58 | |
p6eval | rakudo d27eb3: OUTPUT«Null PMC access in isa_pmc()current instr.: 'parrot;P6protoobject;ACCEPTS' pc 1376 (runtime/parrot/library/P6object.pir:803)» | ||
cognominal | ?? | ||
21:58
sorear sets mode: +o masak
|
|||
masak | "Bit like sticking a fork in your own face to protest the media's preoccupation with conventional beauty." -- Wikipedians discuss Camelia at en.wikipedia.org/wiki/Talk:Perl_6 | 21:59 | |
jnthn | cognominal: The rakudo build seems busted :-S | ||
cognominal | is the current build broken? | ||
21:59
sorear sets mode: +v pugssvn
|
|||
jnthn | head builds for me :-S | 21:59 | |
21:59
sorear sets mode: +v dalek
|
|||
pmichaud | make verify parrot version? | 21:59 | |
s/make/maybe/ | |||
jnthn | yeah | ||
cognominal | hum, I probably forgot to do a make install | ||
jnthn | Should be 47972 | ||
cognominal | now I get a more sensible message : Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespace | 22:01 | |
I should have used multi subs. | 22:02 | ||
pugssvn | r31537 | putter++ | [elf_h] Makefile - Don't run regression tests by default. | 22:04 | |
masak | arnsholt: applied; pushed. thanks! | ||
22:06
bjarneh joined
|
|||
pugssvn | r31538 | putter++ | [elfish] Improve README's. | 22:08 | |
22:09
Dfaure joined
|
|||
pugssvn | r31539 | putter++ | elfish/on_lisp - Minor steps towards supporting additional cl implementations. | 22:09 | |
tylercurtis | Can you forward-declare types in Perl 6? e.g., if Foo had a Bar attribute, but I wanted them both in the same file with Foo first, could I do "class Foo { has ::Bar $.bar; } class Bar { }" or something like that? | 22:13 | |
jnthn | or class Bar { ... } before it | ||
That just "stubs" it | |||
And you fill in the declaration later | |||
masak | wonder how Perl 6 would fare in this golfing contest: stackoverflow.com/questions/3169051...ency-chart | 22:14 | |
it's interesting to see that Perl and Ruby basically tie. | |||
Perl 5, that is. | |||
22:14
skids left
|
|||
masak | I'm not 100% sure Perl 6 would beat Perl 5, but I'm prepared to be proven wrong. :) | 22:14 | |
tylercurtis | And either of those would have the same semantics as just having Bar before Foo? Thanks. | ||
cognominal | jnthn, I corrected the many errors. And now I hit the dispatcher. | ||
Ambiguous dispatch to multi 'subtree'. Ambiguous candidates had signatures: | |||
:(@a, @path, Range $r?, Bool :mod($mod)) | |||
:(@a, Positional (), Range $r) | |||
masak | oh, and I laughed at "Java [...] 743 chars" :) | 22:15 | |
cognominal | I would think the second signature would be more specific | ||
mncharity_ | (ah well, elfparse build broken - a task for a hypothetical 'nother time.) | ||
jnthn | cognominal: You perhaps need to make that named parameter required | 22:16 | |
Do make the dispatcher distinguish them | 22:17 | ||
*To | |||
cognominal | I need to read the dispatch rules... | 22:18 | |
sorear feels that P6 mainly improves over P5 in programming-in-the-large | 22:19 | ||
mncharity_ looking forward to Star. | |||
jnthn | cognominal: Well the think to remember is that beyond being constraining, the dispatcher doesn't care about named arguments. | ||
Making one required forces it to be constrainty. | 22:20 | ||
mncharity_ | g'night pmurias, masak, all. & | ||
masak | mncharity_: 'night! | ||
22:20
mncharity_ left
22:25
Dfaure left
22:27
skids joined
|
|||
cognominal | rakudo: multi sub f(@p, Range $r?, Bool :$mod ) { say 1 }; multi sub f([], Range $r) { say 2 }; f([], 1..2); | 22:29 | |
p6eval | rakudo d27eb3: OUTPUT«Null PMC access in isa_pmc()current instr.: 'parrot;P6protoobject;ACCEPTS' pc 1376 (runtime/parrot/library/P6object.pir:803)» | ||
cognominal | arf, p6eval is broken | ||
masak | yes, it is. | 22:30 | |
cognominal | jnthn, with the Bool :$mod parameter, there is an anbirguity | ||
pmichaud | jnthn: ping | ||
cognominal | without it, there is not | ||
*ambiguity! | |||
sounds fishy to me. | 22:31 | ||
jnthn | cognominal: I'm not convinced it's wrong. named parameters don't partcicipate in multi dispatch. | 22:32 | |
pmichaud: pong | |||
cognominal: Only as constraints | |||
pmichaud | okay, now I need some guidance through the install_method code. | ||
jnthn | cognominal: And an optional named parameter doesn't contrain much... | 22:33 | |
install_method? | |||
Are we in Actions.pm? :-) | |||
pmichaud | yes. | ||
jnthn | Ah yes. This arose out of my dislike of epic duplication between method_def and regex_def... | 22:34 | |
pmichaud | well, really I need to understand method_def | 22:35 | |
I can then fix up regex_def | |||
jnthn | Anyway, this routine does up to 3 things | ||
1) It always adds it to the current package's method table. | |||
2) It maybe adds it to the lexpad and/or package depending on if it's my or our | |||
3) It keeps track of multi stuff | 22:36 | ||
Basically, Perl6::Compiler::Package keeps track of all the methods | |||
It later generates the PAST that calls add_method on the metaclass | 22:37 | ||
pmichaud | which component ends up "owning" the method? | ||
jnthn | The %table is the methods table from a Perl6::Compiler::Package instance | ||
pmichaud | i.e., which one ends up with the actual PAST::Block node? | ||
jnthn | If anything should "own" it, it's this one. | ||
pmichaud | okay. | ||
jnthn | oh wait | ||
No, that doesn't | |||
The $code parameter is actually | 22:38 | ||
my $code := create_code_object(PAST::Val.new(:value($past)), 'Regex', 0, $sig_setup_block); | |||
Note that PAST::Val | |||
pmichaud | right | ||
jnthn | So the PAST::Block goes into the PAST tree "in place" as it were | ||
pmichaud | where? | 22:39 | |
jnthn | And the meta-class just gets a reference to it | ||
pmichaud | the PAST::Val node won't do it. | ||
jnthn | Wherever the method_def was | ||
pmichaud | it has to be pushed into the block somewhere, or returned | ||
jnthn | That is, in the block the method was written in. | ||
It is returned | |||
sorear | Is elf being ressurrected? | ||
jnthn | Last line of method_def is make $past; | ||
pmichaud | okay. | ||
jnthn | The PAST::Block ends up directly inside the containing block | 22:40 | |
(so it has it's outer correct) | |||
sorear | phenny: tell TimToady Just to clarify my question from earlier: I only want to rename the Perl 5 modules in STD. STD.pm6 will be unaltered; viv will contain code to remap STD, Cursor, etc -> Perl6::* (like it already remaps so many renamed Perl6 functions) | ||
pmichaud | okay. | ||
phenny | sorear: I'll pass that on when TimToady is around. | ||
pmichaud | so, does the code object that goes into the method table want to be a static code or a dynamic one? | 22:41 | |
I'm guessing static -- I'm guessing the method table is processed at :load :init time? | 22:42 | ||
masak | std: === SORRY? === | ||
p6eval | std 31539: OUTPUT«===SORRY!===Preceding context expects a term, but found infix === instead at /tmp/3yUX07O8hU line 1:------> <BOL>⏏=== SORRY? ===Parse failedFAILED 00:01 111m» | ||
jnthn | (:load :init) depends - not if it's an anonymous class | 22:43 | |
Or a lexical one | |||
But I guess static too | |||
Almost certainly so | |||
pmichaud | okay, so here's a really awful question. | 22:44 | |
jnthn | Because then roles will want to create dynamic versions of it. | ||
jnthn slurps his beer harder in anticipation | |||
pmichaud | class XYZ { our $foo; method foo() { say $foo } }; | ||
actually, worse: | |||
class XYZ { our $foo = 5; method foo() { say $foo } }; | |||
jnthn | oh... :-/ | 22:45 | |
Would we end up with a problem there? | |||
I guess yes | |||
pmichaud | well, if we use the static foo() (:load :init), it exists before the class block has executed. | ||
jnthn ownders what it does today | |||
Right, the thing is | |||
The meta-stuff happens at begin time | 22:46 | ||
But the actuall running of the block happens later | |||
pmichaud | rakudo: class XYZ { our $foo = 5; method foo() { say $foo } }; XYZ.new.foo; | ||
p6eval | rakudo d27eb3: OUTPUT«Null PMC access in isa_pmc()current instr.: 'parrot;P6protoobject;ACCEPTS' pc 1376 (runtime/parrot/library/P6object.pir:803)» | ||
jnthn | heh | ||
I didn't think we'd get it right today | |||
22:46
songmaster left
|
|||
pmichaud | rakudo: class XYZ { our $foo = 5; method abc() { say $foo } }; XYZ.new.abc; | 22:46 | |
p6eval | rakudo d27eb3: OUTPUT«Null PMC access in isa_pmc()current instr.: 'parrot;P6protoobject;ACCEPTS' pc 1376 (runtime/parrot/library/P6object.pir:803)» | ||
jnthn looks to see if the bug submitter next to him is poised...but actually he's distracted and not watching the channel ;-) | 22:47 | ||
pmichaud | okay... I can leave it static for now, but that's an issue we'll want to address. | ||
jnthn | pmichaud: I'm not sure if that can work. | ||
I mean, it shoulnd NPMCA | |||
*shouldn't | |||
22:47
supernovus left
|
|||
pmichaud | is there a reason the methods have to be installed at BEGIN time? | 22:48 | |
could it happen at the beginning of the class block? | |||
or do we have to worrya bout.... nm | |||
jnthn | No | ||
Unless you think we can do *everything* at the start of the class block | |||
pmichaud | class XYZ { ... }; XYZ.new.abc; class XYZ { method abc() ... } | ||
jnthn | If you didn't install the methods, you can't compose the class | ||
cognominal | jnthn, I submitted my problem as #76372 feel free to close it if it is not a bug. | 22:49 | |
pmichaud | this looks like a variation on the 'our' stuff we discussed last night. It seems like a method has to be installed once when the class is composed, and then again when the class block is entered. | 22:50 | |
jnthn | It feels like we're missing something here. But I don't know what. :S | ||
Re-installing methods in the metaclass feels really weird though | 22:51 | ||
And worse, if it's an our method it'd need to be re-installed in 3 places. | |||
(package, lexpad, metaclass) | |||
cognominal is hitting S06 again | 22:52 | ||
jnthn | It's not a punch bag! :P | 22:53 | |
pmichaud | one difference between methods and our subs is that we expect the enclosing block to only be executed once. | 22:55 | |
(maybe more than once in the case of roles, though.) | 22:56 | ||
jnthn | Yes | ||
Well, many times for roles | |||
But for roles we explicitly *have* to clone and re-capture the methods. | |||
Always | |||
In fact, for a role we do do that re-installation today!! | |||
pmichaud | right | ||
anyway, I'm going to leave it as static for now and let you think about that one. | 22:57 | ||
jnthn | OK | 23:01 | |
.oO( oh no I have to think?! ) |
|||
pmichaud | either that or drink beer :-) | ||
both seem to work. | |||
jnthn | I'm currently drinking a very very nice beer :-) | 23:02 | |
[Coke] *only* has guiness in the house atm. | |||
23:03
mmcleric left
|
|||
pmichaud very optimistically types "make" | 23:03 | ||
pmichaud abandons that plan. | 23:04 | ||
okay, this latest code change was definitely too great a leap. | 23:05 | ||
let me get back to something that passes a fair number of spectests and start from there. | |||
masak | here's what pls looks like right now. comments welcome: gist.github.com/462912 | 23:06 | |
sorear | it looks like cpanminus | 23:07 | |
also a wee bit like yum | |||
23:09
takadonet joined
|
|||
takadonet | hey everyone | 23:09 | |
masak | sorear: I've used yum, years ago. never used (or even seen the output of) cpanminus, but I've heard from other people that its goals are similar to proto/pls's. | ||
23:09
tadzik left
|
|||
masak | takadonet: \o | 23:09 | |
takadonet | masak: how are u sir? | 23:10 | |
masak | takadonet: I'm at a hackathon, writin ur future installer :P | ||
takadonet | masak: nice | ||
masak: where is the hackathon? | |||
masak | in Lund, .se | ||
jnthn is mocking masak | 23:15 | ||
masak feels hollow inside :/ | |||
jnthn | :P | ||
I doubt that after all the curry... ;-) | |||
masak | 哈哈 | 23:17 | |
sorear | what? | 23:20 | |
23:23
tadzik joined
|
|||
masak | sorear: so, there's something slightly odd with actually writing "ha ha". we never used to do that in paper correspondance, for example. but using idiograms has no precedence, and feels both lively and globally hip. | 23:26 | |
23:26
meppl left
|
|||
masak | sorear: by an extraordinary coincidence, that character (pronounced HA1 in Mandarin) means "Pugs". | 23:26 | |
s/precedence/precedents/ | 23:27 | ||
23:31
takadonet left
|
|||
jnthn | Just for a little own dog food nomming, I started writing a simple little Perl 6 module. :-) github.com/jnthn/test-mock | 23:36 | |
masak | now added to pls. :) | 23:37 | |
jnthn | pls install test-mock | ||
;-) | |||
masak does :) | |||
23:49
ashleydev joined
23:54
sundar left
|
|||
sorear | masak: the dog breed? | 23:54 | |
23:54
Psyche^ joined
|
|||
masak | anyone have an idea how to test whether a directory is empty? | 23:54 | |
sorear: I think so. it was TimToady who said it once. | |||
sorear | I think readdir is the only way | 23:55 | |
23:56
tadzik left
23:58
Patterner left,
Psyche^ is now known as Patterner
|