perl6-projects.org/ | nopaste: sial.org/pbot/perl6 | evalbot: 'perl6: say 3;' | irclog: irc.pugscode.org/ | UTF-8 is your friend! Set by moritz_ on 4 May 2009. |
|||
00:01
rdice left
|
|||
jnthn | Well, Rakudo builds under it fine here. Haven't benchmarked it, but it'd probably shave some off our spectest run if it improves every startup... | 00:21 | |
Anyways, sleep...night all | |||
00:25
buubot left
00:26
buubot joined
00:31
bacek__ joined
00:36
Kisu left
00:40
[particle] left,
Kisu joined
00:42
wollmers left,
eternaleye joined
00:52
nbrown joined
01:04
avar joined
01:10
avar left,
avar joined
01:15
agentzh left
|
|||
s1n | so was it changed to have self refer to whatever is constructed at the time of use? | 01:19 | |
dalek | kudo: r4d7fe56 | pmichaud++ | src/ops/perl6.ops: Revise d86c014 (NotFound++) a bit so that we're not mixing our types as much. |
01:21 | |
01:21
ZuLuuuuuu joined
01:26
Whiteknight left
01:29
c9s_ joined
|
|||
meppl | good night | 01:29 | |
01:31
c9s left,
meppl left
01:32
c9s_ is now known as c9s
01:38
agentzh joined
01:40
ZuLuuuuuu left
02:01
cdarroch left,
Kisu left
02:10
s1n left,
hercynium left
02:11
s1n joined
02:19
alester_ joined
02:32
nihiliad joined
|
|||
s1n | moritz_: ping | 02:44 | |
02:50
avar left,
avar joined
02:51
alester_ left
03:02
nbrown left
03:14
alester_ joined
|
|||
mikehh | I am still failing t/spec/S09-subscript_slice/slice.rakudo - rakudo (4d7fe56) on parrot r38475 | 03:15 | |
./perl6 t/spec/S09-subscript_slice/slice.rakudo - runs through all the tests says # FUDGED! then Segmentation fault | 03:16 | ||
03:18
skids left
|
|||
mikehh | that's om Kubuntu Jaunry (9.04) Amd64 | 03:18 | |
s/om/on/ | |||
all the other spectests pass | 03:19 | ||
in the test - ok 1..11, ok 12..19 (SKIP), ok 20..25, nok ok 26..27 (TODO), # FUDGED!, Segmentation fault | 03:25 | ||
s/nok/not/ and Jaunty in prev | 03:27 | ||
avar | mikehh: (I'm not a parrot or rakudo dev): If you compile parrot with "-ggdb3 -O0" cflags and run that under gdb you could produce a more useful bug report | 03:50 | |
e.g. $ gdb ./perl6 | |||
run t/spec/S09-subscript_slice/slice.rakudo | |||
bt full | |||
but your setup is common enough that they'll probably find out about this soon enough if they haven't already | |||
04:03
SamB left
04:06
SamB joined
|
|||
pmichaud | (segfault on slice.t) Yes, I get that segfault also. It's not a rakudobug, really -- it's something segfaulting on Parrot exit. | 04:17 | |
04:38
mikehh is now known as mikehh_,
mikehh_ is now known as mikehh__
04:41
mikehh__ is now known as mikehh
04:42
SamB left
04:59
alc joined
05:06
jhuni joined
05:39
nihiliad left
05:43
ejs joined
05:44
orafu joined
05:48
justatheory left
05:55
DemoFreak joined
06:06
wollmers joined
06:12
orafu left
06:13
orafu joined
06:20
masak joined
|
|||
moritz_ | s1n: pong | 06:20 | |
masak | good morrow, socketcamels. | 06:21 | |
mberends | good morrow, mask | 06:22 | |
moritz_ | h h | ||
06:22
ejs left
|
|||
masak does a Jim Carrey impersonation | 06:23 | ||
mberends | masak: thanks for the netstat info. could you please check out a test for me? | 06:24 | |
masak | mberends: certainly. | 06:25 | |
mberends | masakbot: cd ~/rakudo; svn up t/spec; ./perl6 t/spec/S32-io/IO-Socket-INET.t | 06:27 | |
masak | output: PASS | 06:28 | |
mberends | :D | 06:29 | |
masak | mberends++ | ||
moritz_ | now we need to find out what happens if somebody has no netcat installed | 06:30 | |
06:30
FurnaceBoy left
|
|||
mberends will try that immediately | 06:31 | ||
moritz_: ok, it works without either netcat or socat. Would you advise inflicting this socket test on spectest users? | 06:36 | ||
moritz_ | mberends: in principle, yes. But I'd like to have jnthn++ test it on windows first | 06:37 | |
06:38
eMaX left
|
|||
mberends | O NOES! it cannot work on windows because of the shelly things. It should skip everything silently though. | 06:38 | |
06:39
zamolxes joined
|
|||
mberends | but good idea. let's wait until it's rakudo-am in Bratislava. | 06:39 | |
masak | if ($*OS ~~ Suck) { ... } | ||
mberends | in Dutch slang pipe === blowjob | 06:40 | |
masak | no, I meant the other way around. them that don't hav'em suck. | 06:41 | |
mberends | true | ||
06:43
meppl joined
|
|||
mberends | with tests in place I have the courage to tinker with IO::Socket::INET a little more. | 06:44 | |
masak | tests++ | 06:48 | |
mberends hands the proto pumpkin to masak | |||
moritz_ | let's add it to the spectests.t and have $people complain if it doesn't work somewhere ;-) | ||
masak | :) | 06:49 | |
mberends | ;-) works here! what do you mean, tests fail? must be your setup! | 06:50 | |
masak | mberends: I'm holding another pumpkin at present. says "$work" on it. have to put the proto pumpkin here on the ground along with the other spheroid objects. | ||
rakudo: say { a => 1, b => 1 }.invert.perl | 06:52 | ||
p6eval | rakudo 4d7fe5: OUTPUTĀ«[1 => "a", 1 => "b"]ā¤Ā» | ||
masak submits rakudobug | |||
06:52
alester_ left,
avar left,
avar joined,
iblechbot joined
|
|||
moritz_ | why? | 06:53 | |
mberends | duplicate key | ||
moritz_ | .invert returns a list. | ||
mberends | ah, not a hash | 06:54 | |
masak | reading spec now. | ||
I don't seem to find that this is an error. | |||
maybe my brain isn't synched with the latest spec... | |||
moritz_ | rakudo: my %h; %h.push: { a => 1, b => 1 }.invert; say %h.perl | ||
p6eval | rakudo 4d7fe5: OUTPUTĀ«{"1" => ["a", "b"]}ā¤Ā» | ||
masak | moritz_: ah. | 06:55 | |
masak stands down red rakudo-alert | |||
mberends | next yak: pure Perl 6 Net::SMTP for command line rakudobugs | 06:56 | |
masak | yay! | ||
06:58
ElectricHeavyLan left
|
|||
moritz_ | let's make Perl 6 attractive for spammers ;-) | 06:58 | |
mberends | imagine the questions in #perl6 in 6 months time | 06:59 | |
"hello, I want send email w/attachment. can u help with this?" | 07:00 | ||
moritz_ hopes that in 6 months the questions will be like this: "this last release was *so* cool - how can I help?" | 07:01 | ||
masak | moritz_: you should blog-post an FAQ with only questions like that. prime people in the right direction. :) | 07:03 | |
ok, #perl6. I'm a bit stumped with .invert at present. maybe you can help me. | |||
rakudo: say $*IN.slurp.join.comb.map(-> $k {$k=>1}).perl | 07:04 | ||
p6eval | rakudo 4d7fe5: OUTPUTĀ«["Land" => 1, "der" => 1, "Berge," => 1, "Land" => 1, "am" => 1, "Strome," => 1, "Land" => 1, "der" => 1, "Ćcker," => 1, "Land" => 1, "der" => 1, "Dome," => 1, "Land" => 1, "der" => 1, "HƤmmer," => 1, "zukunftsreich!" => 1, "Heimat" => 1, "bist" => 1, "du" => 1, "groĆer" => 1, | ||
.."S... | |||
masak | now, I'd like to invert this list of pairs. | ||
how do I do that? | |||
should be easy, right? | |||
moritz_ | what do you mean by "invert"? | ||
invert each pair? | |||
rakudo: say $*IN.slurp.join.comb.map(-> $k {$k=>1}).map(*.invert).perl | 07:05 | ||
p6eval | rakudo 4d7fe5: OUTPUTĀ«Method 'invert' not found for invocant of class 'Perl6Pair'ā¤current instr.: 'parrot;P6metaclass;!whatever_dispatch_helper' pc 243809 (src/gen_metaop.pir:8)ā¤Ā» | ||
moritz_ | rakudo: say $*IN.slurp.join.comb.map(-> $k {$k=>1}).map(*.hash.invert).perl | ||
p6eval | rakudo 4d7fe5: OUTPUTĀ«Method 'invert' not found for invocant of class 'Block'ā¤current instr.: 'parrot;P6metaclass;dispatch' pc 243614 (src/gen_actions.pir:0)ā¤Ā» | ||
moritz_ | rakudo: say $*IN.slurp.join.comb.map(-> $k {$k=>1}).map({.hash.invert}).perl | 07:06 | |
p6eval | rakudo 4d7fe5: OUTPUTĀ«[1 => "Land", 1 => "der", 1 => "Berge,", 1 => "Land", 1 => "am", 1 => "Strome,", 1 => "Land", 1 => "der", 1 => "Ćcker,", 1 => "Land", 1 => "der", 1 => "Dome,", 1 => "Land", 1 => "der", 1 => "HƤmmer,", 1 => "zukunftsreich!", 1 => "Heimat", 1 => "bist", 1 => "du", 1 => "groĆer", | ||
..1 ... | |||
masak | thank you. | ||
moritz_ | (chained method calls don't work with *) | ||
masak | in the past few seconds, I've realized I don't need to invert. :) | 07:07 | |
but that's ok, I have a new problem. | |||
rakudo: %*h.push: $*IN.slurp.join.comb.map(-> $k {$k=>1}); say %*h.perl | |||
p6eval | rakudo 4d7fe5: OUTPUTĀ«{}ā¤Ā» | ||
masak | I would expect something non-empty. | ||
moritz_ | rakudo: our %*h; %*h.push: $*IN.slurp.join.comb.map(-> $k {$k=>1}); say %*h.perl | 07:08 | |
p6eval | rakudo 4d7fe5: OUTPUTĀ«get_pmc_keyed_str() not implemented in class 'String'ā¤current instr.: '_block14' pc 68 (EVAL_20:51)ā¤Ā» | ||
masak | huh? | ||
moritz_ | IMHO both are "ouch" | ||
masak | double rakudobug coming up! | ||
rakudo: %*h.push: 1 => 2; %*h.perl.say | 07:10 | ||
p6eval | rakudo 4d7fe5: OUTPUTĀ«{}ā¤Ā» | ||
masak | rakudo: our %*h | 07:13 | |
p6eval | rakudo 4d7fe5: OUTPUTĀ«get_pmc_keyed_str() not implemented in class 'String'ā¤current instr.: '_block14' pc 63 (EVAL_11:49)ā¤Ā» | ||
masak | rakudo: our $*h | 07:14 | |
p6eval | rakudo 4d7fe5: ( no output ) | ||
dalek | kudo: r4d3a38f | (Moritz Lenz)++ | t/spectest.data: run socket tests, mberendes++ |
||
Matt-W | Morning | 07:20 | |
masak | Matt-W: o/ | ||
rakudo: my %h; %h.push: $*IN.slurp.join.comb.map(-> $k {$k=>1}); say +.value, "\t", .key for %h.pairs.sort({ -.value }) | |||
p6eval | rakudo 4d3a38: OUTPUTĀ«5 Landā¤4 derā¤3 Ćsterreich,ā¤3 Ćsterreich!ā¤2 duā¤2 vielgerĆ¼hmtesā¤2 vielgeprĆ¼ftesā¤2 inā¤2 undā¤2 vielgeliebtesā¤1 Berge,ā¤1 amā¤1 Strome,ā¤1 Ćcker,ā¤1 Dome,ā¤1 HƤmmer,ā¤1 zukunftsreich!ā¤1 Heimatā¤1 bistā¤1 groĆerā¤1 Sƶhne,ā¤1 | ||
..Volk,ā¤1 begnadetā¤1 fĆ¼rā¤1 dasā¤1 Schƶne,ā¤1 HeiĆā¤1 umfehdet,ā¤1 wildā¤1 umst... | |||
masak | should have taken the 10 most frequent. | 07:21 | |
rakudo: my %h; %h.push: $*IN.slurp.join.comb.map(-> $k {$k=>1}); say +.value, "\t", .key for %h.pairs.sort({ -.value })[^10] | |||
p6eval | rakudo 4d3a38: OUTPUTĀ«5 Landā¤4 derā¤3 Ćsterreich,ā¤3 Ćsterreich!ā¤2 duā¤2 vielgerĆ¼hmtesā¤2 vielgeprĆ¼ftesā¤2 inā¤2 undā¤2 vielgeliebtesā¤Ā» | ||
mberends | nice | ||
masak | I'm a bit bummed at the '-> $k { $k => 1 }' thing, though. | 07:22 | |
07:22
ejs joined
|
|||
masak | it's needed because just '{ $_ => 1 }' is interpreted as a hash, and map gets sad. | 07:24 | |
maybe overloading map to take a Hash would save a lot of future FAQ grief... | |||
OTOH, maybe it would cause some grief also. | 07:25 | ||
mberends | implementing map on a hash might delay Christmas :/ | 07:26 | |
masak | mberends: no, that's not what I meant. | ||
mberends: I meant that when the Code is accidentally a Hash, it should DWIM. | 07:27 | ||
for example [email@hidden.address] $_ => 1 })' | |||
it looks like it should work... | |||
Matt-W | There's some rule about when {} is a Hash and when it's a Callable | ||
masak | Matt-W: aye. | 07:28 | |
mberends | whitespace as syntax ? | ||
masak | as far as I'm concerned, it's a good rule. | ||
07:28
eMaX joined
|
|||
masak | it's still a bit surprising when it bites you, though. | 07:28 | |
mberends: no, whitespace is not a part of it. | |||
meeting & | 07:29 | ||
07:29
jhuni left
|
|||
moritz_ | if it's a list of pairs inside, it's a hash. otherwise it's a block. | 07:31 | |
Matt-W | and of course $_ => 1 looks like a pair | ||
moritz_ | {; $_ => 1 } is the common Perl 5 disambiguation | ||
07:34
ejs1 joined,
H1N1[A] left
|
|||
Matt-W | Isn't this somewhere that the * would be useful? | 07:35 | |
moritz_ | like * => 1? | 07:37 | |
rakudo: say <a b c>.map(* => 1).perl | |||
p6eval | rakudo 4d3a38: OUTPUTĀ«Parameter type check failed; expected something matching but got something of type Pair() for expr in call to mapā¤current instr.: 'die' pc 16538 (src/builtins/control.pir:225)ā¤Ā» | ||
moritz_ | no. | 07:38 | |
rakudo: say (* => 1).perl | |||
p6eval | rakudo 4d3a38: OUTPUTĀ«!whatever_dispatch_helper => 1ā¤Ā» | ||
07:38
ejs left
|
|||
moritz_ | rakudo: say *.perl | 07:38 | |
p6eval | rakudo 4d3a38: OUTPUTĀ«!whatever_dispatch_helperā¤Ā» | ||
moritz_ | that looks so wrong. | 07:39 | |
07:39
H1N1[A] joined
|
|||
moritz_ summons masak | 07:39 | ||
Matt-W | rakudo: say (<a b c>.map: * => 1).perl | ||
p6eval | rakudo 4d3a38: OUTPUTĀ«Parameter type check failed; expected something matching but got something of type Pair() for expr in call to mapā¤current instr.: 'die' pc 16538 (src/builtins/control.pir:225)ā¤Ā» | ||
Matt-W | bah | 07:40 | |
okay so you can't fool it into doing that | |||
std: say <a b c>.map(* => 1).perl | |||
p6eval | std 26674: OUTPUTĀ«ok 00:02 35mā¤Ā» | ||
moritz_ | it just constructs a Pair | ||
07:40
H1N1[A] is now known as H1N1
|
|||
Matt-W | You can do things like map(*.methodname) though | 07:41 | |
interesting | |||
Is that a bug, or intentional | |||
moritz_ | I don't know | 07:42 | |
Matt-W | Neither do I | ||
Maybe masak knows | |||
When his meeting is done | |||
moritz_ hopes that TimToady knows :-) | |||
Matt-W | Yes I hope so too | 07:44 | |
Because if he doesn't... | |||
07:47
ejs2 joined
07:58
ejs1 left
|
|||
moritz_ just created his first binary from a Perl 6 program | 08:17 | ||
08:18
donaldh joined
08:21
elmex joined,
bacek__ left
|
|||
masak is back from the meeting | 08:28 | ||
I think it's a bug. | |||
masak submits rakudobug | |||
hm, wait. | 08:33 | ||
where are expressions like (* - 1) documented in the spec? S09? | |||
moritz_ | S02 | 08:34 | |
Most of the built-in numeric operators treat an argument of * as indicating the desire to create a function of a single unknown, so: | 08:35 | ||
* - 1 | |||
produces a function of a single argument: | |||
{ $_ - 1 } | |||
masak | 'numeric'. | ||
so, not a bug. | |||
moritz_ | no, it's the .perl output that looks weird to me | ||
masak | oh. | 08:36 | |
masak resumes submitting | |||
moritz_ | rakudo: say (* => 1).perl | ||
p6eval | rakudo 4d3a38: OUTPUTĀ«!whatever_dispatch_helper => 1ā¤Ā» | ||
masak | well, that's obbviously wrong. | ||
pugs_svn | r26675 | wollmers++ | precised reason for rakudo skip | 08:37 | |
08:39
elmex left
08:44
elmex joined
|
|||
Matt-W | so is that perhaps a bug in infix:<=>> | 08:45 | |
moritz_ | rakudo: say *.perl | ||
p6eval | rakudo 4d3a38: OUTPUTĀ«!whatever_dispatch_helperā¤Ā» | ||
moritz_ | no. | 08:46 | |
it's much simpler :) | |||
masak | it's just piping showing through. | ||
moritz_ | rakudo: say *.isa(Whatever) | ||
Matt-W | Oooh your piping is showing! Scandalous! | ||
p6eval | rakudo 4d3a38: OUTPUTĀ«!whatever_dispatch_helperā¤Ā» | ||
moritz_ | there is a slight problem | 08:47 | |
masak | rakudo: say ?(*) | ||
p6eval | rakudo 4d3a38: OUTPUTĀ«1ā¤Ā» | ||
moritz_ | who to decide which methods should generate a closure? | 08:48 | |
Matt-W | Something consistent | ||
moritz_ | since Whatever ~~ Any, most interesting methods (defined in Any) are also existing methods on Whatever | ||
masak | rakudo: say Whatever.flip | ||
p6eval | rakudo 4d3a38: OUTPUTĀ«)(revetahWā¤Ā» | ||
masak | :) | 08:49 | |
moritz_ | :-) | ||
masak | we should have a .flip that also flips parens. | ||
and turns 'b' into 'd'. | |||
moritz_ | that would be .mirror :-) | ||
masak | right. | ||
moritz_ | .oO( Text::UpsideDown ) |
08:50 | |
mberends | :) in the days of single sided floppy disks, once installed a splash screen on the second side that displayed a reversed message saying "Error: diskette upside down" | 08:54 | |
masak | moritz_: ĀæĘuıɄŹĒÉÆos Ēq ŹÉÉ„Ź Ź,upŹnoM | 08:55 | |
mberends | wow! | 08:56 | |
masak | www.fileformat.info/convert/text/upside-down.htm | ||
09:01
ejs2 left
09:12
kidd` joined
09:16
donaldh_ joined,
donaldh_ left
09:21
alc left
|
|||
pugs_svn | r26676 | wollmers++ | rakudo skip | 09:30 | |
09:31
ejs2 joined
|
|||
moritz_ | wollmers: please prefix commit messages to the test suite with [t/spec' | 09:31 | |
[t/spec] actually | |||
afk | |||
10:05
ejs2 left
|
|||
wollmers | moritz_: ACK | 10:08 | |
10:15
Muixirt joined
|
|||
jnthn | H H | 10:35 | |
moritz_ | LL HL TH VWLLSS LLSPK | 10:36 | |
10:38
icwiener joined
|
|||
arnsholt | E A S OE? | 10:42 | |
10:45
zamolxes left
|
|||
masak | arnsholt: well, you wouldn't be able to distinguish between "OH HAI" and "NO WAI", for example... | 10:46 | |
moritz_ | masak, literal: in last year's GSOC we had weekly IRC meetings with status reports, much like #parrotsketch... what do you think about doing it like that this year? (once the coding time has started, of course) | 10:48 | |
arnsholt | masak: Yeah. It's just that it's a natural extension of the no-vowels thing. I'm a sucker for language games | 10:49 | |
Which is part of the reason I like Perl as much as I do, I suspect =) | |||
moritz_ | Muixirt: my complains are not that there are no possiblities for optimization, but that the default thing (whiche 90% of all people use) sucks | 10:50 | |
masak | moritz_: +1 | 10:51 | |
(for the meetin idea) | |||
s/in/ing/ | |||
pugs_svn | r26677 | wollmers++ | [t/spec] fudge and unfudge for current rakudo | ||
masak | arnsholt: Perl is definitely the language for people who like languages. | 10:52 | |
Muixirt | moritz_, but if parrot isn't ready (the fast cores) rakudo users have to wait | 10:53 | |
Matt-W | arnsholt, masak: Definitely! | ||
wollmers | masak: true for me, mostly because regex and \p{} | 10:54 | |
Muixirt | moritz_, did you watch the Lars Bak video? | 10:55 | |
moritz_ | Muixirt: I know. no reason not to rant. | ||
and "no" to the video | |||
wollmers | masak: I do NLP and NER in ~300 languages with Perl 5 | 10:56 | |
masak | wollmers: nice. | 10:57 | |
jnthn has got a backtrace of the slice.t crash, but it isn't making it especially obvious what's wrong... | 10:59 | ||
11:02
payload joined
|
|||
jnthn | Ugh. And it fails in a different way under -G. | 11:03 | |
masak | I'm still thinking about putting together a grant application for summer Rakudo work. I have another idea which might be considered to be on the critical path as well. | 11:05 | |
all those collection classes, Bag, HashSet, and the like. | |||
Muixirt | moritz_, what a pity :-) the was a passage in the talk that reminded me instantly about parrot/rakudo | 11:06 | |
moritz_, of course i don't know whether Lars Bak looked at parrot/rakudo, and, of course, i might got it wrong | 11:07 | ||
jnthn | masak: They need to get done at some point. :-) | ||
masak | yes. and they need a bit of spec work and tests as well. | ||
jnthn | Indeed. | ||
masak | I think it could be a nice summer project. | ||
jnthn | Same. | ||
masak | the advantage of doing it in one concentrated time period is that there might actually be some consistence to the design. :) | 11:08 | |
s/ce/cy/ | |||
ugh. | |||
wollmers | moritz_: Should all Unicode related tests go from some-file.t to somefile.unicode.t? | ||
moritz_ | wollmers: no | 11:09 | |
11:09
payload left
|
|||
moritz_ | wollmers: Unicode is integral part of Perl 6, no need to separate them | 11:09 | |
wollmers | moritz_: UTF-8;-) | 11:10 | |
masak | Set, Bag, KayHash, KeySet, and KeyBag. | 11:12 | |
11:12
hcchien left,
hcchien joined
|
|||
moritz_ | masak: "container types" | 11:12 | |
masak | Mr Bloch's tutorial on Java's collections really opened my eyes to the richness of collections in Java, and the need to do this well. java.sun.com/docs/books/tutorial/co...index.html | 11:13 | |
I should perhaps start by tentatively translating all the code in that tutorial. | |||
...and blogging about it. :) | |||
jnthn | :-) | ||
moritz_ | mberends: the socket test passes here when run separately, but fails one (the third) when run during 'make spectest' | 11:15 | |
at least on one machine | |||
11:16
spx2 left
|
|||
jnthn | Ouch. | 11:17 | |
rakudo: my @array = (3,7,9,11); say @array[0..1] | |||
p6eval | rakudo 4d3a38: OUTPUTĀ«37ā¤Ā» | ||
jnthn | Can somebody try running that but with Parrot's -G on? | 11:18 | |
e.g. ../../parrot perl6.pbc -e ' my @array = (3,7,9,11); say @array[0..1]' | |||
oops | |||
-G after parrot | |||
Try it with and without and let me know if you see a difference in the output too. | |||
moritz_ | maximum recursion depth exceeded | ||
current instr.: 'parrot;Int;succ' pc 5513 (src/classes/Int.pir:81) | |||
jnthn | Same here. :-( | ||
moritz_ | (with -G) | ||
and 37 without -G | 11:19 | ||
jnthn | OK, reproducable at least. Hmm. | ||
(This is from the slice.t issue) | |||
11:20
donaldh left,
donaldh joined
|
|||
jnthn | Not quite sure, what to make of this. | 11:20 | |
It's almost like a GC bug that makes things work. | 11:21 | ||
(But in slice.t our luck runs out and we segfault during exit) | |||
If I fudge out all the tests in slice.t that do ranges inside postcircumfix:<[ ]> then the segv goes away. | 11:23 | ||
s1n | masak: "In general, it is good API design practice not to make users pay for a feature they don't use." (from the introduction, always been a good quote) | 11:26 | |
masak | s1n: nod. | 11:32 | |
jnthn files a ticket with this discoveries, not wanting to spend all day debugging a GC issue. | 11:42 | ||
11:47
mmayr joined,
mmayr is now known as desertm4x
11:53
fridim_ joined
12:03
kidd` left
12:05
ruoso joined
|
|||
ruoso | Hello! | 12:07 | |
masak | ruoso: o/ | 12:08 | |
ruoso | masak, how's everything in web.pm? | 12:10 | |
masak | ruoso: there's progress. | 12:11 | |
ruoso | I kinda lost track of it... do you have a dispatcher already? | 12:12 | |
masak | ruoso: I'm not sure about the big picture yet. there's a lot of details to get lost in. but I like working on it. | ||
ruoso: ihrd has been working on something called Routes. don't know how close to an actual dispatcher that is. | |||
ruoso | is it in the github repo? | ||
masak | yes. | 12:13 | |
ruoso | do you have a link to that specific part of the code? | 12:14 | |
masak | aye, hold on. | ||
github.com/masak/web/blob/master/lib/Routes.pm | 12:15 | ||
I don't know too much about it -- only that I recognize parts of it from the Dispatcher.pm code in November, that one also written by ihrd++, | 12:16 | ||
and that Routes is said to have ties to the model in some way. | |||
ruoso | hmm... I miss the use of context variable | 12:22 | |
s | |||
masak | ruoso: I haven't seen this code in actual use yet. it's what I feel is missing right now, an actual use. | 12:23 | |
now that we have sockets and the Web.pm request/response groundwork, we should really focus on pushing things out onto the browser, so that we can see them. | 12:24 | ||
ruoso | masak, what happen to the idea of using a generic role for Request and Response? | 12:30 | |
s/happen/happened/ | |||
12:31
donaldh left
|
|||
masak | ruoso: what was that idea again? I vaguely recall us talking about it, but not why that was preferrable... :/ | 12:31 | |
ruoso | because it would make the framework useable in more situations | 12:32 | |
masak | that's a generic answer. | ||
ruoso: put it like this: the current model works for Rack, why won't it for us? | |||
ruoso | it's the other way around | 12:33 | |
I'd like to use it for non-web things | |||
or at leasy | |||
non http | |||
masak | ruoso: ah, now I remember. | ||
ruoso | github.com/masak/web/blob/2b4a056b0...doc/stages | ||
masak | ruoso: you know, non-http is really outside of the scope of our grant. | 12:34 | |
ruoso | as I said | ||
at that time | |||
I don't expect you to implement non-http | |||
masak | right. | ||
ruoso | I just asks for it to be possible for someone else to do it | ||
masak | yes. | ||
ruoso | i.e.: me | ||
(as I already did with catalyst...) | |||
masak | at that time, I didn't know as much about Rack's Request and Response as I do now. | 12:35 | |
12:36
abra joined
12:37
zev left
|
|||
ruoso | masak, github.com/masak/web/blob/2b4a056b0...work-roles | 12:38 | |
12:38
ZuLuuuuuu joined
|
|||
ruoso | that was my sketch at that time, in case you don't recall | 12:38 | |
masak | ruoso: I recall. | 12:39 | |
12:40
zev joined
|
|||
masak | ruoso: is there something in particular that I can relay to ihrd, the one tasked with implementing this part of Web.pm? | 12:40 | |
ruoso | two things specially | ||
one is the use of contextual variables | |||
masak | (I know he has health problems in the family, so he's not very available right now.) | 12:41 | |
pugs_svn | r26678 | wollmers++ | [t/spec] fudge test for rakudo; softlink | ||
ruoso | the other is the different stages of the action processing | ||
masak | I will tell him when he's around. | 12:43 | |
12:44
Jedai left
12:45
[particle] joined
|
|||
Matt-W | masak: oh yes, I read your blog about Web.pm and I thought that using parse actions to generate a tree, and then doing top-down processing on the resulting tree is probably going to be very common. | 12:56 | |
masak | Matt-W: I believe so. | 12:57 | |
dalek | kudo: rd500f20 | jnthn++ | src/pmc/p6invocation.pmc: More work on P6Invocation. There'll be room for optimization, but this serves well as at least a POC. |
||
masak | Matt-W: I also believe a good project at this point, for whoever has the time to do it, would be to pair up XPath and Match objects. | ||
wolverian | would it make sense to compile xpath to rules? probably not. | 12:59 | |
masak | wolverian: it might make sense to compile them to code. | 13:00 | |
wolverian | easier to wrap an xpath engine inside a Match impl, or so. | ||
yeah, but that is a pain. | 13:01 | ||
moritz_ | since PGE can't do matches on anything but strings... no way | ||
masak | moritz_: you could convert the Match tree to a string :) | ||
moritz_ sends the waves of agonizing pain that this statement caused back to masak | 13:02 | ||
masak | aie. :) | ||
jnthn | woo. p6invocation has come together more easily than expected. | 13:05 | |
13:05
payload joined
|
|||
wolverian | convert Match to XML and then run xpath on *that* | 13:06 | |
13:09
exodist joined
|
|||
Matt-W | replace PGE with an xpath engine | 13:09 | |
make everything be XML internally | |||
<assign><my identifier="a" /><string value="foo" /></assign> | 13:10 | ||
Matt-W runs and hides | |||
jnthn | I once saw a library that let you declare regexes in .Net using the query expression syntax. | 13:11 | |
Matt-W | that sounds like a nice thing for xml people | ||
mberends | moritz_: t/spec/S32-io/IO-Socket-INET.t randomly fails tests 2 and 3 when run repeatedly. Using ' netstat --tcp --all --numeric' at the same time shows the tested socket in TIME_WAIT state. Let me try to change the socket options before keeping this in spectest.data. | 13:12 | |
jnthn | A lot of folks in the .Net world don't really seem to grok regexes, and write all kinds of string manip code that a regex woulda handled for them much more easily. | 13:14 | |
Matt-W | you have to give them some slack | 13:16 | |
a lot of them probably came from C++ | |||
and nobody ever introduced them to boost::regex or PCRE | |||
jnthn | Oh, quite possibly, yes. | ||
13:17
FurnaceBoy joined
|
|||
Matt-W | Or on the web side, they game from VBScript | 13:17 | |
jnthn | Aye. | ||
Matt-W | And .NET doesn't really encourage use of Regex, it just provides it | ||
jnthn | C# 3.0 is a good language, and the .Net stuff ain't so bad either, but the code I see by a lot of people might as well have been written in VBScript or Java. | 13:18 | |
Matt-W | People don't use it like they should | ||
jnthn | It goes for any language though. | ||
Matt-W | Absolutely | 13:19 | |
jnthn | It's not like everyone uses Perl like they should. :-) | ||
Matt-W | I've met a fair few people who work with .NET but have no idea how they could benefit from lambda functions | ||
jnthn | Aye. | ||
Matt-W | Whereas when I've worked in .NET I use them all the time | ||
But that's because I'm a functional programmer whenever I get the chance | |||
dalek | kudo: ree10f59 | jnthn++ | (2 files): Method on P6Invocation to check if we have more candidates, and tests for it. |
13:20 | |
jnthn | There's also a camp of people in the .Net world who are along the lines of, "object orientation is the one true paradigm and these extra things pollute the purity of it". | ||
Matt-W | Urgh | ||
No no no | |||
OO is much easier if you mix in some functional stuff | |||
jnthn | I know, but when they announced anonymous methods in C# 2.0, I was pretty horrified by the number of comments along those lines that I saw. | 13:21 | |
Matt-W | Particularly if you're playing with threads or event-driven programming | ||
ruoso | jnthn, taking an old question... do we have a plan for @list.reduce being called with a multi with varying arity? | ||
Matt-W | It's just ignorance | ||
jnthn | ruoso: Not that I'm aware of... | ||
Matt-W | And I don't think anonymous delegates sit outside the OO paradigm at all | ||
All you have to do is say 'code is an object' | |||
masak | jnthn, ruoso: what's the issue? is there a small piece of code that highlights it? | 13:22 | |
jnthn | Oh, for sure. | ||
ruoso: Part of me still wonders if that's a task for a module. | |||
ruoso | masak, the muti-based action dispatcher would require it in order to be sane | ||
Matt-W | jnthn: they'd probably also consider Smalltalk's object system to be wrong though :) | ||
13:22
ejs2 joined
|
|||
masak | ruoso: I assumed that's why you asked, yes. | 13:23 | |
Matt-W: c2.com/cgi/wiki?ClosuresAndObjectsAreEquivalent | |||
13:25
nihiliad joined
13:28
dalek left
|
|||
Matt-W | masak: I love those pages, where you find your opinion being modified as you read all the arguments on the way down | 13:28 | |
13:28
dalek joined
|
|||
masak | Matt-W: me too. | 13:28 | |
Matt-W | frustrating meeting & | 13:29 | |
13:29
sri_kraih_ joined
|
|||
jnthn | oh noes I forgot lunch | 13:29 | |
13:30
sri_kraih left
|
|||
ruoso .oO( good thing to be to the west, so I get a reminder for lunch by people who forgot lunch ) | 13:30 | ||
masak | jnthn: Google Imeages search for "oh noes I forgot lunch" gave this: www.ramblestrip.com/pictures/lolcat...sletgo.jpg | 13:31 | |
jnthn | :-D | 13:32 | |
13:34
dalek left,
dalek joined
13:38
amoc left
13:48
desertm4x left
|
|||
pugs_svn | r26679 | lwall++ | [STD] start contextualizing language braids for user-overridability | 13:50 | |
TimToady | ruoso> one is the use of contextual variables | 13:53 | |
13:53
amoc joined
|
|||
TimToady | I'm curious whether this is ++ or -- | 13:53 | |
ruoso | this is that he was supposed to use contextual variables, and he's not | ||
TimToady | okay, good :) | 13:54 | |
13:54
PacoLinux joined
|
|||
TimToady | (I hope) | 13:54 | |
since STD uses 'em all over the place, probably places where it shouldn't... | |||
ruoso | TimToady, take a look at github.com/masak/web/blob/2b4a056b0...work-roles | ||
13:55
pmurias joined
|
|||
TimToady | extra semi on line 50 | 13:57 | |
PerlJam | TimToady: can you make perl give error messages like that? :-) | 13:59 | |
TimToady | sometimes | ||
the fact that the next statement is "if $.foo;" is indicative | 14:00 | ||
sort on line 90 missing its : | |||
wolverian | can line 20 be self.?begin-closure(self)? though that looks rather weird. | ||
TimToady | the bindings in regex should be = rather than := these days | 14:01 | |
that's just an optional call, okay if it fails | |||
wolverian | and $_.priority can be .priority | ||
14:02
donaldh joined
|
|||
TimToady | line 110 has --> for -> | 14:02 | |
masak fixes those issues | |||
TimToady++ | |||
wolverian | lines 155-156 have extra ;s | 14:03 | |
and are they missing ...s | |||
? | |||
PerlJam | the extra semicolons there are harmless. | ||
masak | probably. | ||
aye. | 14:04 | ||
removed them anyway. | |||
wolverian++ PerlJam++ | |||
TimToady | and for some reason STD doesn't like the CONTROL block, but probably a STD bug | 14:05 | |
also, it didn't like the use of URI without declaraiton | |||
wolverian | can self.*foo be written .*foo? :) | ||
TimToady | not unless $_ === self | ||
wolverian | yeah, well, it is there. I mean the syntax .? syntax without the preceding noun. | 14:06 | |
masak | at this point I'd like to point out that this is only a draft. :) | ||
wolverian | s:1st/syntax// | ||
TimToady | std: say .*foo | ||
wolverian | masak: but it is so much fun to bikeshed... | ||
p6eval | std 26679: OUTPUTĀ«ok 00:02 35mā¤Ā» | ||
wolverian | ah, yeah. thanks. :) | ||
PerlJam | masak: but does rakudo reasonably grok most of it? | ||
TimToady | well, it mighta found a STD bug | ||
masak | wolverian: absolutely. don't mind me. :) | ||
PerlJam: I have no idea. I think so. | |||
TimToady | ah, no, it's confused because ControlExceptionDetach isn't declared | 14:07 | |
so it assumes it's a listop and eats the block | |||
masak | ah. | ||
not much I can do about that, 'sides creating the real thing. | |||
TimToady | well, could perhaps give a better error message | ||
after noting that we assumed ControlExceptionDetach was a listop | 14:08 | ||
masak | well, if you insist. :) | ||
TimToady | I insist, therefore I exist. | ||
Caesar's version of it :) | 14:09 | ||
masak | :) | ||
.oO( ControlExceptionDetach iacta est... ) |
|||
14:10
azawawi joined
|
|||
azawawi | hi * | 14:10 | |
14:11
skids joined
|
|||
wolverian | .oO( *.hi($azawawi) ) |
14:11 | |
14:14
PhatEddy joined
|
|||
PhatEddy | rakudo: package A::B {}; say ~A::B; say ~A | 14:16 | |
p6eval | rakudo ee10f5: OUTPUTĀ«Bā¤invoke() not implemented in class 'NameSpace'ā¤current instr.: '_block14' pc 84 (EVAL_20:51)ā¤Ā» | ||
PhatEddy | looking at RT #62900 and will probably use above as test ... | 14:17 | |
rakudo: package A::B {}; say ~A::B | |||
p6eval | rakudo ee10f5: OUTPUTĀ«Bā¤Ā» | ||
PhatEddy | is that right ? | ||
PerlJam | It doesn't look right to me. | ||
jnthn eated a cheezburger! | |||
PerlJam | Your first snippet looked like 2 bugs to me. | 14:18 | |
masak | ...both of which are in RT already... | 14:19 | |
PhatEddy | just looking at adding (or documenting tests). If I find the RT for ~A::B I will note the # ... | 14:20 | |
masak looks | 14:22 | ||
PerlJam | The tests aren't annotated with RT#s are they? | ||
PhatEddy | I did a search on both rt #s in t/spec | 14:23 | |
masak | nope. the RT tickets are Rakudo-specific. | ||
PerlJam | I would be neat if there were a way to do that though | ||
masak | PhatEddy: alternatively, it might be that A::B actually should stringify to 'B'... | 14:24 | |
PerlJam | then when jonathan or pmichaud or whoever implements something, it could say "because these tests pass, these RT#s have been fixed" or something | ||
masak | PerlJam: I do that in almost all of my Perl 6 projects. | 14:25 | |
PerlJam: I mark things up with a RAKUDO comment and an RT number. | |||
PerlJam | rakudo: package A::B {}; say A::B.perl; | ||
p6eval | rakudo ee10f5: OUTPUTĀ«Null PMC access in getprop()ā¤current instr.: 'parrot;P6object;HOW' pc 60 (runtime/parrot/library/P6object.pir:100)ā¤Ā» | ||
PerlJam | I wonder if that should work | 14:26 | |
14:26
SamB joined
|
|||
masak | it shouldn't throw that error, at least. | 14:26 | |
masak submits rakudobug | |||
PerlJam | right | ||
jnthn | aye | ||
I'm not entirely sure what it should do. | |||
But not that. Never that. :-) | |||
PerlJam | rakudo: class A::B {}; say A::B.perl | 14:27 | |
p6eval | rakudo ee10f5: OUTPUTĀ«A::Bā¤Ā» | ||
PerlJam | (just checking :) | ||
PhatEddy | PerlJam: afaik we CAN add these tests to spec with fudges reading "#?rakudo todo 'RT #NNNNN'" | ||
masak | rakudo: package A {}; say A.perl | ||
p6eval | rakudo ee10f5: OUTPUTĀ«Null PMC access in getprop()ā¤current instr.: 'parrot;P6object;HOW' pc 60 (runtime/parrot/library/P6object.pir:100)ā¤Ā» | ||
PerlJam | rakudo: class A::B {}; say A::B.WHAT | 14:28 | |
p6eval | rakudo ee10f5: OUTPUTĀ«A::B()ā¤Ā» | ||
PerlJam | I guess it doesn't matter if the class names are just Foo or if they are Foo::Bar::Baz | ||
14:29
iblechbot left
|
|||
ruoso | jnthn, is there a way to implement a control exception in rakudo already? | 14:31 | |
jnthn | ruoso: Not sure, Tene would know. I really haven't been following the exceptions work very closely. | 14:32 | |
ruoso | Tene? | ||
jnthn | I haven't seen it done yet, though. | ||
ruoso | are you there? | 14:33 | |
jnthn | I think he said he was quite busy this week...try leaving a message. | ||
ruoso | I'll try to get that sketch code I posted above to work in rakudo | ||
14:35
goksie joined
14:36
PhatEddy left
14:37
[particle]1 joined
14:41
payload left
|
|||
ruoso | rakudo: role A::B { } | 14:45 | |
p6eval | rakudo ee10f5: ( no output ) | ||
Tene | ruoso: what do you want to know about exceptions? | ||
ruoso | Tene, how can I declare a custom control exception in rakudo? | 14:46 | |
14:46
mizioumt joined
|
|||
Tene | You can't. | 14:47 | |
pugs_svn | r26680 | lwall++ | [STD] improve error message on accidental listops | ||
14:47
abra left
|
|||
Tene | if you can show me what that should look like in rakudo, I can implement it for you, but it might take me a few days. | 14:48 | |
ruoso | Tene, well... I guess it's just a subclass of ControlException | 14:49 | |
that you can call .throw on | |||
Tene | and CONTROL blocks catch all subclasses of ControlException? | 14:50 | |
ruoso | the way you say it seems to imply that they would also be seen by CATCH blocks | 14:51 | |
but it's more like | |||
.throw on a control exception will look for a CONTROL block | |||
just as | |||
14:51
frodwith joined
|
|||
ruoso | .throw in a failure will look for a CATCH block | 14:52 | |
Tene | can you put this stuff in a spec test? | ||
14:52
azawawi left
|
|||
ruoso | right... I just won't be able to do it now... I notice you when I have it there... | 14:53 | |
Tene | thank you | ||
as jnthn said, I'm really busy with work this week, but I should have some time available. | |||
TimToady | rakudo: my %h; %h.push: $*IN.slurp.join.comb.[^3] | 14:54 | |
p6eval | rakudo ee10f5: OUTPUTĀ«Trailing item in Hash.pushā¤Ā» | ||
Tene | also, has "Is ControlException a role or a class" been debated already? | ||
TimToady | rakudo: say $*IN.slurp.join.comb.[^3] | 14:55 | |
ruoso | Tene, every built-in type is a role | ||
p6eval | rakudo ee10f5: OUTPUTĀ«LandderBerge,ā¤Ā» | ||
TimToady | rakudo: say $*IN.slurp.comb.[^3] | ||
p6eval | rakudo ee10f5: OUTPUTĀ«LandderBerge,ā¤Ā» | ||
TimToady | rakudo: say $*IN.comb.[^3] | ||
Tene | OK | ||
p6eval | rakudo ee10f5: OUTPUTĀ«IO()<0xb5fe8808>Use of uninitialized valueā¤Use of uninitialized valueā¤ā¤Ā» | ||
TimToady | aw | ||
jnthn | Anybody know where in the specs Selector is defined? | 14:56 | |
jnthn can't find it... | |||
ruoso | pmichaud, github.com/masak/web/blob/2b4a056b0...work-roles in line 102 is failing to parse... any clue | ||
? | |||
jnthn, if you happen to have any clue of the above, I'd apreciate | |||
jnthn | ruoso: what error? | 14:57 | |
TimToady | jnthn: perhaps it's really Matcher | ||
ruoso | Statement not terminated properly at line 27, near "$<_parent_" | ||
jnthn | ruoso: oh, because Perl 6closures in regexes aren't implemented yet. | ||
TimToady: I'll look for that. It's mentioned in the spec for WALK. | 14:58 | ||
:omit(Selector) # only classes that don't match selector | |||
ruoso | jnthn, how do I workaround it? | ||
TimToady | S29 sez: subset Matcher of Object where { $_.can('ACCEPTS') }; | ||
ruoso | jnthn, considering the specific case, which is what I need to do | 14:59 | |
TimToady | masak: anyway, you don't need .slurp.join | ||
and shouldn't even need the .slurp since .comb is supposed to work on filehandles | |||
ruoso lunch... brb & | 15:00 | ||
jnthn | ruoso: Actually looking at the error, it may be that we don't ahve := either... | ||
TimToady | ruoso: I already said above that regex binding doesn't use := | 15:02 | |
15:03
payload joined
|
|||
TimToady | std: / $x := (.) / | 15:04 | |
p6eval | std 26680: OUTPUTĀ«##### PARSE FAILED #####ā¤Unrecognized regex metacharacter at /tmp/YtuKJvUOTD line 1:ā¤------> / $x := (.) /ā¤ expecting any of:ā¤ quantifierā¤ regex atomā¤ rxinfixā¤ wsā¤Other potential difficulties:ā¤ Variable $x is not predeclared at | ||
../tmp/YtuKJvUOTD line 1:ā¤------> [... | |||
TimToady | shower & | 15:05 | |
masak | TimToady: .slurp.join ... I should take up coffee, it seems. :) | 15:07 | |
TimToady: re .comb and filehandles: cool! didn't know that. | |||
TimToady: I don't believe .comb is currently specced to work on filehandles, though. | 15:08 | ||
dalek | kudo: 8009acf | jnthn++ | src/parser/actions.pm: Add lexical slot for dispatcher to store candidate list holder in methods. |
15:10 | |
15:12
riffraff joined
15:14
aaronpk joined
15:15
goksie left
|
|||
[particle]1 | candidate list holder? | 15:16 | |
15:16
[particle]1 is now known as [particle]-
|
|||
aaronpk | moritz_: is it possible to modify your irclog bot to also log usernames? | 15:16 | |
[particle]- | aaronpk: what's not logged? irclog.perlgeek.de/perl6/today | 15:17 | |
jnthn | [particle]-: Think callnext, etc. | ||
skids | rakudo: @a = $*IN.lines; @a[0..2].say; | ||
[particle]- | jnthn: so, list of lists? | ||
p6eval | rakudo ee10f5: OUTPUTĀ«Scope not found for PAST::Var '@a' in ā¤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:105)ā¤Ā» | ||
skids | rakudo: my @a = $*IN.lines; @a[0..2].say; | ||
p6eval | rakudo ee10f5: OUTPUTĀ«Land der Berge, Land am Strome,Land der Ćcker, Land der Dome,Land der HƤmmer, zukunftsreich!ā¤Ā» | 15:18 | |
aaronpk | [particle]-: the username associated with the nick. on my channel, usernames correspond to the person's real name, while their nick can change. | ||
jnthn | [particle]-: No, a P6Invocation...I think. :-) | ||
[particle]- | i need to review a few of jnthn++'s commits today | 15:19 | |
jnthn | [particle]-: I'm not really expecting to get this lot right on the first attempt. Done some planning of course, but taking more the "baby steps" approach. :-) | ||
15:20
donaldh left
15:21
donaldh joined
|
|||
[particle]- | so, is this P6Invocation a cache that gets invalidated if a method is injected into the class/object after the initial invocation? | 15:22 | |
jnthn | [particle]-: No, it's more iterator-ish. | ||
It'll need to end up doing Iterator-ish stuff. | 15:24 | ||
[particle]- | so if a multi is added/deleted during dispatch, it'll DTRT? | ||
jnthn | It's not just about multi. | ||
[particle]- | yes, that's an example. | ||
jnthn | And it's generated per invocation (for now...) | ||
No, it's not about caching at all. | |||
It's also missing most of what it'll eventually need. | 15:25 | ||
Baiscally at the moment we do something like... | |||
$P0 = find_method obj, 'name' | |||
[particle]- | will it work like for @a { @a.pop } ? | ||
jnthn | $P0(...) | ||
[particle]- | ...i'm thinking about edge cases again... | 15:26 | |
jnthn | Apart from callmethodcc encapsulates it a bit...but it boils down to a find_method and then an invoke vtable call. | ||
[particle]- | ok | ||
that makes sense. | |||
jnthn | Anyway, find_method instead of handing back just the method will wrap it up in one of these, and give it enough stuff that it can (lazily usually) produce the rest of the candidates if needed. | ||
15:27
abra joined
|
|||
jnthn | It will also on invoke fudge itself into the lexpad of the method it invokes. | 15:27 | |
That way, callnext anf friends can find this thing and use it to obtain the Next Thing to invoke. | |||
At the moment it's not that far along. | |||
My plan for now is to just handle the $foo.*@candidates() case. | 15:28 | ||
Where we already have a list of candidates. | |||
[particle]- | yeah, i get the idea. seems it's pretty clear in your head, at least at this level | ||
jnthn | Well, still various bits to figure out, and the current way isn't as performant as I'd like to end up with. | 15:29 | |
But so far, things have gone pretty smoothly. | 15:30 | ||
Fudging the thing into the lexpad Just Worked at least...got a short PIR test script for P6Invocation checked in. | |||
Anyway, now I'm diverting attention to the meta-class stuff. | 15:31 | ||
TimToady | masak: ./S32-setting-library/Str.pod:You may also comb lists and filehandles. C<+$*IN.comb> counts the words on | ||
jnthn | Want to get a bunch of things added into there, or a first cut. | ||
Then try and write .WALK entirely in terms of the meta-class methods. | |||
masak | TimToady: oh, ok. | 15:32 | |
TimToady | rakudo: $*IN.lines(3).say | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Land der Berge, Land am Strome,Land der Ćcker, Land der Dome,Land der HƤmmer, zukunftsreich!ā¤Ā» | ||
masak | TimToady: mind if I mention it in IO.pod too? | ||
TimToady | skids: ^ | ||
not at all | |||
masak mentions | |||
jnthn | Plus the tedious work of going through Rakudo and finding everywhere we cheated and didn't use the metaclass and really should be... | ||
jnthn digs back in | |||
skids | rakudo: regex ldb12l { ^^ Land .* $$ <.ws> ^^ Land .* $$ } ; join("\n", $*IN.lines(3)).match(/<ldb12l>/).say; | 15:33 | |
p6eval | rakudo 8009ac: OUTPUTĀ«Land der Berge, Land am Strome,ā¤Land der Ćcker, Land der Dome,ā¤Land der HƤmmer, zukunftsreich!ā¤Ā» | ||
[particle]- | convert to metaclass access first, then rip out old code? | ||
jnthn | Well, more replace the code that doesn't use the metaclass to use the metaclass. | 15:34 | |
skids | rakudo: rule ldb2 { ^^ Land .* $$ }; regex ldb12 { ^^ Land .* $$ <ldb2> }; join("\n", $*IN.lines(3)).match(/<ldb12>/).say; | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Land der Berge, Land am Strome,ā¤Land der Ćcker, Land der Dome,ā¤Land der HƤmmer, zukunftsreich!ā¤Ā» | ||
jnthn | At some point I think we'll need to give Rakudo its own metaclass distinct from the one used by the toolchain stuff. | 15:35 | |
[particle]- | but not yet. | ||
TimToady | skids: . match everything, did you mean \N? | 15:36 | |
or are you testing backtracking? | |||
jnthn | Not yet, but probably not too far into the future. | ||
skids | I'm trying to figure out why embedding a rule in a regex is doing non-dwimmy things with $$ and ^^. | 15:37 | |
rakudo: rule ldb2 { ^^ Land .* $$ }; regex ldb12 { ^^ Land .* $$ <ldb2> }; join("\n", $*IN.lines(2)).match(/<ldb12>/).say; | |||
jnthn | Anyway, this should get us towards having our representation vs metaclass story somewhat more sorted out. | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Land der Berge, Land am Strome,ā¤Land der Ćcker, Land der Dome,ā¤Ā» | ||
TimToady | what do you "mean" by .? | ||
skids | Bizarre, I must be doing something different on my script here. | ||
TimToady | .* is going to match multiple lines | 15:38 | |
PerlJam | skids: perhaps you want \N instead of . ? | ||
skids | Erm, . == end of English sentence | ||
:-) | |||
PerlJam | skids: or maybe you want to make * less greedy ? | ||
TimToady | are you trying to match one line? | 15:39 | |
skids | No, it's actually doing what I want, just not on my own install. | ||
15:57
ilogger2 joined
15:58
SamB joined
|
|||
jnthn | rakudo: sub foo() { }; say &foo.name | 15:58 | |
p6eval | rakudo 8009ac: OUTPUTĀ«Method 'name' not found for invocant of class 'Perl6Sub'ā¤current instr.: 'parrot;P6metaclass;dispatch' pc 243661 (src/gen_actions.pir:0)ā¤Ā» | ||
moritz_ | aaronpk: what do you mean? user names appear in the log | ||
aaronpk | moritz_: i only see a "nick" column, no "username" column | 16:00 | |
moritz_ | aaronpk: what would you want to appear in the username? | ||
16:00
cognominal joined
|
|||
moritz_ | the ircname? | 16:00 | |
aaronpk | when i join an irc server i enter a "nick" and a "username". in my channel, usernames correspond to people's real names, while the nick can change. i want to log their real names too | 16:01 | |
moritz_ | aaronpk: that's not available in the channels I log, so I won't implent it. Of course you're free to do it yourself | 16:02 | |
afk | |||
aaronpk | moritz_: in this channel your username is set to "i=moritz". that's the field i'm trying to get to | 16:03 | |
16:03
hercynium joined
|
|||
skids | rakudo: rule ldb2 { ^^ Land \N* $$ }; regex ldb12 { ^^ Land \N* $$ <ldb2> }; join("\n", $*IN.lines(3)).match(/<ldb12>/).say; | 16:03 | |
p6eval | rakudo 8009ac: OUTPUTĀ«Land der Ćcker, Land der Dome,ā¤Land der HƤmmer, zukunftsreich!ā¤Ā» | ||
Matt-W | Woohoo, another working day over | 16:04 | |
skids | OK, why does that match the second two lines and not the first two, tuens out to be my problem. | ||
16:04
eMaX joined
|
|||
pmichaud | ruoso: (line 102) PGE might not like the leading underscore in the rule name. I'm also pretty sure it doesn't know what to do with <$act.regex> | 16:08 | |
good morning, #perl6 | 16:10 | ||
Tene | good morning, pmichaud | ||
16:10
justatheory joined
|
|||
masak | good time of day, pmichaud. | 16:11 | |
jnthn | morning, pmichaud | ||
skids | rakudo: rule l { ^^ L $$ }; "\n\nL".match(/<l>/).say; | 16:12 | |
p6eval | rakudo 8009ac: OUTPUTĀ«ā¤ā¤Lā¤Ā» | ||
skids | rakudo: rule l { ^^ L $$ }; "\nL\n".match(/<l>/).say; | ||
p6eval | rakudo 8009ac: OUTPUTĀ«ā¤Ā» | ||
skids | rakudo: rule l { ^^ L $$ }; "L\n\n".match(/<l>/).say; | ||
p6eval | rakudo 8009ac: OUTPUTĀ«ā¤Ā» | ||
jnthn | pmichaud: It turns out that I can use multis to make the old and current forms of the metaclass methods co-exist. | 16:14 | |
pmichaud | jnthn: excellent. | ||
jnthn | pmichaud: Added the other variants locally just throwing exceptions, then ran through all of the p6object, nqp, pge and rakudo tests to make sure we never call the wrong one. All passing. | ||
ruoso | pmichaud, but it was supposed to accept the leading underscore, right? | ||
pmichaud | ruoso: yes, it should. | ||
ruoso | righ | 16:15 | |
pmichaud | rakudo: regex _abc { foo }; "xyz foo bar".match(/<_abc>/).say; | ||
p6eval | rakudo 8009ac: OUTPUTĀ«fooā¤Ā» | ||
pmichaud | hmm, looks like the leading underscore isn't the problem. | ||
ruoso | yeah... it still fails here... | 16:16 | |
pmichaud | Okay, I think it's the <$act.regex> that it's having difficulty. | ||
ruoso | let me get it into a variable first | ||
pmichaud | probably won't help -- PGE doesn't know what to do with (Perl 6) variables yet. | ||
ruoso | hmm... | 16:17 | |
how do I work-around it? | |||
pmichaud | maybe put it into a sub variable | ||
my ®ex = $act.regex; | |||
.... / <regex> / | |||
that might work. | 16:18 | ||
ruoso | cool | ||
gone to another problem now | |||
how do I work around the { make $act } | 16:19 | ||
? | |||
16:19
goksie joined,
icwiener_ joined
|
|||
pmichaud | that one's tougher. | 16:19 | |
I'm not sure how to grab $act reliably. | 16:20 | ||
ruoso | maybe using a closure... | ||
and invoking it with <foo> | |||
how should a closure be written to replace { make $act }? | 16:22 | ||
pmichaud | I'm not sure. | ||
ruoso | does it receive the match object as argument? | 16:23 | |
pmichaud | {{ ... }} will get a match object in the 'match' register... but the internals are PIR | ||
one could do | |||
{{ match.'!make'( ... ) }} | |||
but I'm not sure how to get $act | |||
ruoso | right... | 16:24 | |
in the previous suggestion | |||
I created a perl 6 level closure that is invoked as a rule | |||
does this rule receive the outer match? | |||
pmichaud | yes, the current match object is the invocant. | ||
(I'm not sure that's correct Perl 6, but that's what PGE does.) | |||
ruoso | so, in theory, I could call the same method in Perl 6 level, couldn't i? | 16:25 | |
like... | |||
moritz_ | + my $m = $Ā¢.explain_mystery(); | ||
TimToady++ | |||
ruoso | my &cl = -> $match { $match."!make"( $act ) }; | ||
pmichaud | sub make_act( $/ ) { make $act } # might work | ||
ruoso | just calling make ? | ||
pmichaud | make always works on its caller's lexical $/ | 16:26 | |
which we set to the invocant parameter here. | |||
ruoso | cool | ||
it parses, at least ;) | |||
pmichaud, hmm... it doesn't seem to support <@subregexes> | |||
pmichaud | anything dealing with Perl 6 level variables we don't support yet. | 16:27 | |
PerlJam | rakudo: %*h.push: 1 => 2; %*h.perl.say | ||
p6eval | rakudo 8009ac: OUTPUTĀ«{}ā¤Ā» | ||
ruoso | right... right... | ||
pmichaud | Keep in mind that Parrot has only had working lexicals in the last 6 months. PGE hasn't had a chance to catch up on that yet. | ||
PerlJam | rakudo: %*h = (); %*h.push: 1 => 2; %*h.perl.say | ||
p6eval | rakudo 8009ac: OUTPUTĀ«{"1" => 2}ā¤Ā» | ||
ruoso | pmichaud, right... I assume I could as well write a closure to emulate <@subregexes>... | 16:28 | |
pmichaud | ruoso: likely. | ||
ruoso | should it return a new match? | 16:29 | |
pmichaud | yes. | ||
ruoso | or false, if none match | ||
pmichaud | it returns a false match if no match | ||
ruoso | is it? | ||
pmichaud | it always returns a match | ||
ruoso | how do i get a false match? | ||
in Perl 6 | |||
pmichaud | in PGE, set the match's .to value to be less than its .from | ||
that indicates a boolean false | 16:30 | ||
ruoso | less or equal? or just less | ||
pmichaud | less | ||
equal means a zero-length match. | |||
(but successful) | |||
ruoso | ok | ||
PerlJam | rakudo: %*h = 1; %*h.push: 1 => 2; %*h.perl.say | 16:31 | |
p6eval | rakudo 8009ac: OUTPUTĀ«Odd number of elements found where hash expectedā¤current instr.: 'parrot;Perl6Hash;!STORE' pc 9254 (src/classes/Hash.pir:237)ā¤Ā» | ||
PerlJam | rakudo: %*h.push: 1 => 2; %*h.perl.say | ||
p6eval | rakudo 8009ac: OUTPUTĀ«{}ā¤Ā» | ||
pmichaud | shouldn't %*h be giving errors as undeclared on all of these? | ||
Infinoid | pmichaud: (PGE catching up with parrot lexicals) is that a pmichaud-only task, or is it something you can use some help with? | 16:32 | |
pmichaud | s/shouldn't/should/ | ||
PerlJam | dunno | ||
Infinoid | (I've been meaning to learn some more about that side of parrot.) | ||
PerlJam | (I would guess yes, but I haven't read the spec on globals recently) | ||
pmichaud | Infinoid: since PGE's parser is about to be significantly rewritten to match STD's version of regexes, I'm not sure I'd inflict it on anyone else. | ||
PerlJam | rakudo: eval "%*h = 1"; %*h.perl.say; %*h.push: 1=>2; %*h.perl.say; | 16:33 | |
Infinoid | Oh, that does sound daunting. Oh well, I'm still a willing victim for lesser tasks | ||
p6eval | rakudo 8009ac: OUTPUTĀ«{}ā¤{"1" => 2}ā¤Ā» | ||
TimToady | in STD a false match is a return of (), since the model is using lazy lists to represent possible paths forward | ||
but we're not returning match objects, rather cursors | |||
lists of cursors | |||
ruoso | rakudo: "a" ~~ /a/; my $clone = $/.clone; $clone.to = $clone.from - 1; say $clone.perl; | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Match.new(ā¤ # WARNING: this is not working perl codeā¤ # and for debugging purposes onlyā¤ ast => "",ā¤ Str => "",ā¤ from => 0,ā¤ to => -1,ā¤)ā¤Ā» | 16:34 | |
pmichaud | ruoso: right now I think that creating a new Match object (via Match.new) returns one that is "false" | ||
TimToady: a regex should generally return Match objects, though, yes ? | |||
ruoso | rakudo: my $m = Match.new; say $m.perl; | ||
p6eval | rakudo 8009ac: OUTPUTĀ«too few arguments passed (1) - 3 params expectedā¤current instr.: 'parrot;PGE;Match;new' pc 28 (compilers/pge/PGE/Match.pir:57)ā¤Ā» | ||
pmichaud | arggh. | 16:35 | |
moritz_ | rakudo: my $m = Match.new(0, 1); say $m.erl | ||
pmichaud | ruoso: okay, false lead I guess. Sorry about that. | ||
p6eval | rakudo 8009ac: OUTPUTĀ«positional inside named args at position 2ā¤current instr.: 'parrot;PGE;Match;new' pc 28 (compilers/pge/PGE/Match.pir:57)ā¤Ā» | ||
moritz_ | rakudo: my $m = Match.new(0, 1); say $m.perl | ||
p6eval | rakudo 8009ac: OUTPUTĀ«positional inside named args at position 2ā¤current instr.: 'parrot;PGE;Match;new' pc 28 (compilers/pge/PGE/Match.pir:57)ā¤Ā» | ||
ruoso | pmichaud, is it ok to clone the input match? | ||
moritz_ | rakudo: my $m = Match.new(:from(0), :to(1)); say $m.perl | ||
pmichaud | ruoso: yes. You might even ben able to do $/.new | ||
p6eval | rakudo 8009ac: OUTPUTĀ«invalid arg type in named portion of argsā¤current instr.: 'parrot;PGE;Match;new' pc 28 (compilers/pge/PGE/Match.pir:57)ā¤Ā» | ||
TimToady | pmichaud: a regex should return something that *does* Match; in STD it also happens to be a Cursor | ||
and an instance of the current language | 16:36 | ||
pmichaud | TimToady: okay, got it. | ||
16:36
azawawi joined
|
|||
TimToady | all the .MATCHIFY methods make sure the current Cursor looks like a valid Match object | 16:37 | |
moritz_ | wollmers: r26676 confuses me - why did you fudge that test? was it failing? | ||
TimToady | and also happen to call the implicit reduction action, which is why we don't need {*} | 16:38 | |
ruoso | pmichaud, hmm... how do I invoke another regex from inside the closure? should I just use the sub form? | ||
pmichaud | ruoso: yes, that should work. | ||
jnthn | pmichaud: If we're going to add a parrotopaque kinda PMC (along the lines of p6opaque without without the Perl 6 specific bits...will add thsoe in a subclass), should it be a dynpmc? Is this something we need to ask about in parrotsketch? | 16:39 | |
ruoso | okay... it compiles now... | ||
pasteling | "ruoso" at 189.97.249.112 pasted "work-around over <@subregexes>" (17 lines, 422B) at sial.org/pbot/36399 | 16:40 | |
pmurias | ruoso: out of curiosity what are you using Perl 6 rules for? | ||
pmichaud | jnthn: I still haven't figured out the criteria for what should be a dynpmc and what shouldn't. | ||
ruoso | pmurias, I'm working on getting the regex based dispatch for the web framework | 16:41 | |
pmichaud, does the above paste look sane? | |||
TimToady | ruoso: in the STD model, you always invoke as a method using some Cursor or other | ||
jnthn | pmichaud: OK, I'll try and remember to ask in #ps. | ||
ruoso | TimToady, I'm not sure what that means... | ||
pmichaud | jnthn: allison has been mentioning that things like CodeString ought to become dynpmcs | 16:42 | |
TimToady | there's no such thing as an implicit "current match state" | ||
it's all explicitly represented with Cursor objects, which you can think of as a kind of continuation | |||
ruoso | right... | ||
jnthn | pmichaud: I don't mind if it's a dynpmc or core myself, just would rather know and do it right first time. | ||
ruoso | TimToady, but how does that look like in code? | ||
TimToady | so {{ return () }} means there are no more possibilities to try | ||
pmichaud | what's the advantage to having it as a dynpmc? | ||
TimToady | ruoso: see STD.pm :) | 16:43 | |
it's all over the place | |||
16:43
lambdabot joined
|
|||
pmichaud | TimToady: how closely do you feel that PGE needs to follow that particular model ? | 16:43 | |
jnthn | pmichaud: Only needs to be in memory if it's being used by something, so doesn't bulk up the Parrot executable I guess. | ||
TimToady | methods are called self.meth or $Ā¢.meth | ||
ruoso | TimToady, right... but I don't have a grammar here | ||
pmichaud | jnthn: let's put it this way. Anything using PGE or PCT will end up using P6object. | 16:44 | |
jnthn | pmichaud: However, as it's going to be used by everything that uses the compiler tools...otoh, so is CodeString... | ||
TimToady | where self is the state upon entering the regex, and $Ā¢ is the current match state passed into the closure | ||
ruoso | I just have a bunch of anon regexes | ||
pmichaud | jnthn: right, which is why I didn't understand why CodeString ought to become a dynpmc. | ||
jnthn | pmichaud: Me either, since PCT is the likely route for most people building compilers. | ||
pmichaud | I mean, if it's _always_ used, then having it as a dynpmc would seem to actually slow things down and increase resource usage. | 16:45 | |
jnthn | Right. | ||
ruoso | does rakudo support $Ā¢? | ||
TimToady | ruoso: those are called by assuming the current namespace is a class, and token is a method | ||
pmichaud | ruoso: not yet. | ||
TimToady | even if the current namespace isn't really a class | ||
moritz_ | that's easy in Perl 5 ;-) | ||
jnthn | pmichaud: OK, let's try get a general answer form allison in #ps since it would seem whatever applies to CodeString is the rule to follow for parrotopaque. | 16:46 | |
pmichaud | I still haven't gotten my brain completely around the 'what is a Cursor and what does it do?' yet. | ||
jnthn: sounds good. | |||
ruoso | so I presume the paste above is the sanest way to do it in current parrot/rakudo | ||
pmichaud | yes, keeping in mind that the @subregexes isn't going to handle backtracking into the regex the way it's written there. | 16:47 | |
ruoso | you mean the closure wouldn't backtrack... | 16:48 | |
pmichaud | right | ||
so once it finds a match, you're stuck with that one. | |||
ruoso | ok... I think I don't need it to backtrack at this point... | 16:49 | |
and since it's a work-around... I think it's enough as it is now... | |||
pmichaud | (in case my earlier message got overlooked in the flood) | 16:50 | |
16:50
lambdabot left
|
|||
pmichaud | TimToady: how closely do you feel that PGE ought to be following STD's model of Cursor/Match interaction? | 16:50 | |
16:53
lambdabot joined
|
|||
TimToady | closely enough that the closures in STD run :) | 16:58 | |
but the basic distinction is that Cursors are immutable, and backtracking consists only of throwing away Cursors, not modifying anything to its privious state | 16:59 | ||
17:00
hercynium left
|
|||
TimToady | having mutable match states is just asking for reentrancy problems | 17:00 | |
see P5 | |||
that being said, one of the optimizations that STD does is re-using cursors that can't backtrack due to ratcheting. but that's cheating | 17:02 | ||
17:03
barney joined
|
|||
pmichaud | yes, I'm not quite sure how this all maps into PGE's current model, where backtracking states are actually managed by the program counter | 17:03 | |
and backtracking instantly jumps back to the point of the backtrack | |||
[particle]- | timtoady: does that break with :keepall? | 17:04 | |
moritz_ | I think that's orthogonal | ||
pmichaud | I don't mind chucking PGE's current model in favor of something else... but I need to understand the something else a bit clearer. | ||
moritz_ | :keepall is about keeping matches, backtracking is about finding them | ||
[particle]- | i'm not clear on the semantics of :keepall, i should reread before asking. wondered if it kept the state of the backtracking, too. how 'all' is 'all'? | 17:06 | |
17:06
pmurias_ joined
|
|||
moritz_ | :keepall forces non-capturing subrules to capture | 17:07 | |
TimToady | I should probably split out the methods in Cursor.pmc a little better, but basically all the methods starting at _MATCHIFY are the regex engine | ||
moritz_ | and it also augments matched literals with match positions etc | ||
but it doesn't provide backtracking information | |||
pmichaud | TimToady: okay, that's a very useful guidepost. | 17:08 | |
TimToady | everything down to sub bless | ||
after that is longest token extractor | |||
ruoso introduces "Faz" - the action dispatching framework... github.com/ruoso/faz/tree/master | |||
[particle]- | simple comments in the code could help others | 17:09 | |
TimToady | 'couse, none of it makes much sense without seeing how it's called from STD.pmc | ||
ruoso | unfortunally it dies with Null PMC at this point ;) | ||
moritz_ | STD.pm is version 5.0.0.alpha? ;-) | ||
pugs_svn | r26681 | lwall++ | [STD] correct version, moritz++ | 17:10 | |
TimToady | and that STD.pmc code has two basic forms, depending on ratcheting | 17:11 | |
the ratchet code is assiduously avoiding calls to lazymap(), since that's slow to emulate in p5 | |||
jnthn | I'm trying to get the varous orderings that WALK suppots into my head. | 17:12 | |
Can somebody review gist.github.com/107058 ? | |||
TimToady | my nefarious plan is to retarget viv at some point to putting out rakudo code | ||
it would be nice if lazy lists were implemented by then :) | |||
moritz_ | TimToady: thanks for your p6l mail | 17:13 | |
pmichaud | TimToady: they're on their way, actually. | ||
pugs_svn | r26682 | azawawi++ | [S:H:P6] Added 'tmp_prefix' to control where STD stores its temporary files. | ||
17:13
pmurias_ left
|
|||
ruoso | pmichaud, I'm getting a null pmc and I'm not sure where it is coming from... the code is the one at github.com/ruoso/faz/tree/master | 17:13 | |
jnthn | In what I just pasted breadth and ascendent end up looking the same. Can somebody explain the difference to me? | ||
TimToady | I use roles heavily too, which would be much more difficult in p5 without moose | ||
jnthn | (or show me an example where it differs) | 17:14 | |
pmichaud | ruoso: in general I refer Null PMC accesses in class-related stuff to jnthn++ :-) | ||
jnthn | ruoso: in general I refer Null PMC accesses in regex related stuff to pmichaud++ | ||
;-) | |||
[particle]- | ascendent isn't F E B A C D? | ||
jnthn | [particle]-: Maybe but that'd make it the same as pre-order. ;-) | ||
17:15
eMaX left
|
|||
[particle]- | ah, hrmm. | 17:15 | |
TimToady | moritz_: actually sent that mail earlier, but my mailq was clogged | ||
PerlJam | jnthn: you just don't have enough node to elucidate the difference adequately :) | ||
jnthn | PerlJam: You got a better example? | ||
moritz_ | TimToady: np, from your commits I figured that while the syntax was a bit wrong, it couldn't be all that bad ;-) | ||
17:16
ejs joined
|
|||
jnthn | PerlJam: I can't think of one right off that makes it clearer... | 17:16 | |
PerlJam | me either. | ||
jnthn | PerlJam: Or does it more show up when a class appears multiple times in an inheritance hierarchy? | ||
Ah, OK. | |||
[particle]- | what i you hook the A over the C? | 17:17 | |
TimToady | still working on the tests that try to modify regex syntax though. need to work out syntax for deriving new sublanguages inline | ||
merely declaring a token doesn't make it a token for the language you're using for the rest of the block | |||
pugs_svn | r26683 | azawawi++ | [Cursor] Added 'tmp_prefix' to control where STD stores its temporary files. | 17:18 | |
TimToady | and have to be able to derive new Q or Regex language while not in those languages too | ||
moritz_ | hrm | ||
TimToady | what we have is five or six different langauges braided together | ||
and normal Perl has to be able to redefine any of the braids for the lexical scope | 17:19 | ||
ruoso | jnthn, btw... the null pmc issue was because the role was indirectly loaded, so the parser recognized the name, but the name wasn't installed in the current namespace | ||
jnthn | [particle]-: Not much different from what I can see | ||
TimToady | something like language Q { token backslash:<Y> {...} } | ||
17:19
icwiener-_- joined
|
|||
jnthn | ruoso: Ah, are you using nested namespaces? | 17:19 | |
ruoso | yes... | 17:20 | |
Faz::Action::Chained | |||
jnthn | Those are quirky at the moment. | ||
ruoso | but it solves it if I use explicitly | ||
jnthn | OK, but you wrote a role inside one of them. That's probably what it didn't like. | ||
Matt-W | yeah I have to do that | ||
moritz_ | TimToady: but if it's available in regexes and not double quoted strings... should it still go into language Q? | ||
jnthn | OK. | ||
TimToady | and the current rule_backslash category is completely bogus | ||
no, then it'd go into Regex | |||
ruoso | jnthn, it still don't support yada methods in roles, right? | ||
TimToady | what's going on from the user's point of view is that $?Regex or some such is redefined for the rest of the scope | 17:21 | |
jnthn | ruoso: no | ||
TimToady | from the view of the compiler it's a dynamic variable $*Regex | ||
[particle]- | jnthn: i'd wander over to #moose and ask stevan or nothingmuch | 17:22 | |
TimToady | that's what my previous change to STD did, make dynamic variables for the braids | ||
jnthn | [particle]-: Yeah, good plan. Will do so after dinner. | ||
TimToady | (already had one for $*LANG, but just generalized the braiding notion) | ||
(a lot of these context vars probably want to be tied to the Cursor eventually instead; I'm using dynamic scoping at the moment for speed under P5) | 17:23 | ||
ruoso | rakudo: class A { method a { say 'a' } }; class B { has A $.other is rw = A.new handles a }; say B.new.a; | 17:25 | |
p6eval | rakudo 8009ac: OUTPUTĀ«Statement not terminated properly at line 1, near "handles a "ā¤ā¤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)ā¤Ā» | ||
TimToady | basically, as soon as the user starts redefining the current language, all the affected languages in the braid become anonymous grammars | ||
ruoso | rakudo: class A { method a { say 'a' } }; class B { has A $.other is rw handles <a> = A.new }; say B.new.a; | 17:26 | |
p6eval | rakudo 8009ac: OUTPUTĀ«Unable to set lvalue on PAST::Val nodeā¤current instr.: 'parrot;PAST;Val;lvalue' pc 623 (src/PAST/Node.pir:163)ā¤Ā» | ||
TimToady | I already do that for infix:<foo> and such, but needs to extend to explicit derivation with a mixed in new grammar (including by import) | ||
ruoso | how do I define an attribute that is rw, that handles some methods and has a default value? | 17:27 | |
TimToady | well, enuff branedump | ||
pmichaud | TimToady++ # thanks for branedump, very helpful | ||
moritz_ | better braindump than brain dumb | ||
jnthn | ruoso: Hmm. That doesn't look wrong... | ||
rakudo: class A { method a { say 'a' } }; class B { has A $.other handles <a> = A.new }; say B.new.a; | 17:28 | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Unable to set lvalue on PAST::Val nodeā¤current instr.: 'parrot;PAST;Val;lvalue' pc 623 (src/PAST/Node.pir:163)ā¤Ā» | ||
[particle]- | is it parsing <a> = A.new ? | ||
17:28
ejs left
|
|||
jnthn | That's be surprising... | 17:28 | |
ruoso | std: class A { method a { say 'a' } }; class B { has A $.other is rw handles <a> = A.new }; say B.new.a; | 17:29 | |
jnthn | rakudo: class A { method a { say 'a' } }; class B { has A $.other handles <a> }; say B.new(a => A.new).a; | ||
p6eval | std 26683: OUTPUTĀ«ok 00:03 38mā¤Ā» | ||
rakudo 8009ac: OUTPUTĀ«aā¤1ā¤Ā» | |||
17:29
estrabd joined
|
|||
pmichaud | jnthn: | 17:29 | |
rule trait_verb { [ | $<sym>=[of|returns] <typename> | $<sym>=[handles] <EXPR> | |||
note <EXPR> | |||
jnthn | That'd be it... | 17:30 | |
pmichaud | so that ends up grabbing <a> = A.new | ||
jnthn checks STD | |||
[particle]- | there you go. | ||
jnthn | rule trait_verb:handles {<sym> <noun> } | ||
That's the one. | |||
jnthn will fix later tonight | 17:31 | ||
pugs_svn | r26684 | azawawi++ | [S:H:P6] version 0.51 includes tmp_prefix and latest STD | 17:32 | |
jnthn | OK, dinner time, before #parrotsketch | ||
17:35
icwiener_ left
|
|||
TimToady | pmichaud: one other note about Cursor.pmc, the quantifying methods are tagged with r, g, f for ratchet, greedy, frugal | 17:38 | |
and _rev is for reverse matching for afterness | |||
17:42
LylePerl joined
17:43
szabgab joined
|
|||
ruoso | rakudo: class A { has $!rx; method do { $!rx = / some regex / }; }; A.new.do; #pmichaud | 17:48 | |
p6eval | rakudo 8009ac: OUTPUTĀ«Null PMC access in isa_pmc()ā¤current instr.: 'parrot;PGE;Match;new' pc 33 (compilers/pge/PGE/Match.pir:65)ā¤Ā» | ||
ruoso | rakudo: class A { has $!rx; method do { $!rx = / some regex /; 1}; }; A.new.do; #pmichaud | ||
p6eval | rakudo 8009ac: ( no output ) | ||
ruoso | if the regex fall out as the implicit return, it causes the null pmc | ||
rakudo: class A { has $!rx; method do { $!rx }; }; A.new.do; #pmichaud | 17:49 | ||
p6eval | rakudo 8009ac: ( no output ) | ||
ruoso | rakudo: class A { has $!rx; method do { $!rx = 1}; }; A.new.do; #pmichaud | ||
p6eval | rakudo 8009ac: ( no output ) | ||
ruoso | it's regex related | 17:50 | |
pmichaud | rakudo: class A { has $!rx; method do { $!rx = { say 1; } }; }; A.new.do; | ||
p6eval | rakudo 8009ac: ( no output ) | ||
ruoso submitted rakudobug | |||
pmichaud | rakudo: class A { has $!rx; method do { $!rx = regex { some regex} }; }; A.new.do; | 17:51 | |
p6eval | rakudo 8009ac: OUTPUTĀ«Null PMC access in isa_pmc()ā¤current instr.: 'parrot;PGE;Match;new' pc 33 (compilers/pge/PGE/Match.pir:65)ā¤Ā» | ||
pmichaud | It's trying to do a match. | ||
ruoso | why? | ||
pmichaud | something is causing the regex to be evaluated in boolean context. | ||
ruoso | ah | ||
sure... at some point later | |||
maybe | |||
pmichaud | I mean as part of returning the regex. | ||
rakudo: class A { has $!rx; method do { $_ = 'foo'; $!rx = regex { some regex} }; }; A.new.do; | 17:52 | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Null PMC access in isa_pmc()ā¤current instr.: 'parrot;PGE;Match;new' pc 33 (compilers/pge/PGE/Match.pir:65)ā¤Ā» | ||
pmichaud | hmm. | ||
[particle]- | rakudo: sub a { my $x = / some regex; }; 1; | 17:53 | |
p6eval | rakudo 8009ac: ( no output ) | ||
[particle]- | rakudo: sub a { my $x = / some regex; }; a(); | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Null PMC access in isa_pmc()ā¤current instr.: 'parrot;PGE;Match;new' pc 33 (compilers/pge/PGE/Match.pir:65)ā¤Ā» | 17:54 | |
[particle]- | rakudo: sub a { my $x = / some regex /; }; a(); | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Null PMC access in isa_pmc()ā¤current instr.: 'parrot;PGE;Match;new' pc 33 (compilers/pge/PGE/Match.pir:65)ā¤Ā» | ||
[particle]- | interesting that the first one parsed. | ||
pmichaud | yes, looks like a bug in the regex parser. | ||
ruoso | rakudo: my $x = /some regex/; $x | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Null PMC access in isa_pmc()ā¤current instr.: 'parrot;PGE;Match;new' pc 33 (compilers/pge/PGE/Match.pir:65)ā¤Ā» | ||
ruoso | rakudo: my $x = /some regex/; | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Null PMC access in isa_pmc()ā¤current instr.: 'parrot;PGE;Match;new' pc 33 (compilers/pge/PGE/Match.pir:65)ā¤Ā» | 17:55 | |
ruoso | rakudo: my $x = /some regex/; 1 | ||
p6eval | rakudo 8009ac: ( no output ) | ||
pmichaud | oh, wait. It might be a p6eval bug. | ||
p6eval is trying to evaluate the result of A.new.do | |||
I'm building and testing locally, though. | |||
[particle]- | ah, of course. | 17:56 | |
17:56
goksie left
|
|||
pmichaud | okay, I get it locally also. | 17:56 | |
nm. | |||
ruoso | it fails in rakudo directly as well | ||
pmichaud | Yes, I see it here. | ||
17:56
eMaX joined
|
|||
pmichaud | rakudo: class A { has $!rx; method do { $!rx = regex { some regex } }; }; A.new.do; 1; | 17:57 | |
p6eval | rakudo 8009ac: ( no output ) | ||
pmichaud | there. | ||
It's not a regex bug, at least not directly. :-) | |||
[particle]- | i found a parse bug, though :) | ||
pmichaud | Something is trying to evaluate the return value of the program, and *that's* where the bug occurs. | ||
ruoso | yes... it sure looks like something outside rakudo itself | ||
pmichaud | anyway, the error occurs when the program itself returns a regex. | 17:58 | |
rakudo: class A { has $!rx; method do { $!rx = regex { some regex } }; }; $_ = 'foo'; A.new.do; | 17:59 | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Null PMC access in isa_pmc()ā¤current instr.: 'parrot;PGE;Match;new' pc 33 (compilers/pge/PGE/Match.pir:65)ā¤Ā» | ||
pmichaud | okay, I think I know how to resolve this one. | 18:00 | |
18:00
hercynium joined
|
|||
pmichaud | jnthn: ping (when back from dinner) | 18:05 | |
jnthn: actually, dog needs a walk -- I'll catch you during #ps | 18:08 | ||
afk | |||
ruoso | rakudo: sub foo { say $*foo }; my $foo is context = 'hello'; foo(); | 18:10 | |
p6eval | rakudo 8009ac: OUTPUTĀ«Use of uninitialized valueā¤ā¤Ā» | ||
ruoso | rakudo: sub foo { say $+foo }; my $foo is context = 'hello'; foo(); | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Scope not found for PAST::Var '$+foo' in fooā¤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:105)ā¤Ā» | ||
TimToady | std: sub foo { say $+foo }; my $foo is context = 'hello'; foo(); | 18:11 | |
p6eval | std 26684: OUTPUTĀ«Potential difficulties:ā¤ The + twigil is deprecated, use the * twigil instead at /tmp/mKDTftjOXl line 1:ā¤------> sub foo { say $+foo }; my $foo is context = 'hello'; fooā¤ok 00:02 36mā¤Ā» | ||
ruoso | TimToady, I was aware of that... I was just wondering if rakudo was still with the old syntax... since $*foo didn't work | 18:13 | |
TimToady | what I figgered | ||
I was just curious what std would say | |||
ruoso | rakudo: sub foo { say $*foo }; my $foo is context; $foo = 'hello'; foo(); | 18:14 | |
p6eval | rakudo 8009ac: OUTPUTĀ«Use of uninitialized valueā¤ā¤Ā» | ||
TimToady | it's possible rakudo still treats $* as global | ||
moritz_ | I think it never did "real" context vars | 18:15 | |
ruoso | it also seems that PGE doesn't like Perl 6 closures | ||
18:16
Jedai joined
|
|||
ruoso | rakudo: sub foo { my sub bar { }; return / foo <bar> /; }; my $rx = foo; say 'a' ~~ $rx; | 18:17 | |
p6eval | rakudo 8009ac: OUTPUTĀ«ā¤Ā» | ||
ruoso | rakudo: sub foo { my sub bar { }; return / foo <bar> /; }; my $rx = foo; say 'foo ' ~~ $rx; | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Unable to find regex 'bar'ā¤Null PMC access in invoke()ā¤current instr.: 'parrot;PGE;Grammar;' pc 614 (EVAL_19:239)ā¤Ā» | ||
pmichaud | jnthn: reping | 18:24 | |
(PGE doesn't like Perl 6 closures) -- sure, this is a long-standing issue. :-) | |||
rakudo still treats $* as global, yes. | 18:25 | ||
ruoso | pmichaud, is there any support for context vars? | 18:27 | |
pmichaud | in regexes? | ||
or in general? | |||
short answer is no, rakudo doesn't haven't them yet. We have the pieces in place for them, though. | 18:28 | ||
ruoso | hmm... too bad | ||
PerlJam | rakudo: say a => 3; # what's going on here? | 18:29 | |
p6eval | rakudo 8009ac: OUTPUTĀ«ā¤Ā» | ||
18:29
ElectricHeavyLan joined
|
|||
pmichaud | rakudo: say (a=>3); | 18:29 | |
p6eval | rakudo 8009ac: OUTPUTĀ«a 3ā¤Ā» | ||
moritz_ | p6eval: say() seemms to ignore named arguments | ||
pmichaud | ah yes. | ||
moritz_ | sorry, meant PerlJam | ||
pmichaud | it's a named arg. | ||
PerlJam | got it. | ||
does say have any named args to accept? | |||
moritz_ | no | 18:30 | |
18:30
goksie joined
|
|||
moritz_ | at least I can't think of any | 18:30 | |
ruoso | pmichaud, it seems I can't even use "my sub &foo" in the regex | 18:32 | |
pmichaud | ruoso: I don't entirely understand... but basically PGE doesn't have any clue about how to parse things that aren't regex syntax. | 18:34 | |
ruoso | the problem is not parsing | 18:35 | |
pmichaud | then I fall back on the "I don't entirely understand" part. | ||
ruoso | the problem is that it will look the symbol somewhere else, not in the lexical scope where the rx was defiend | 18:36 | |
pmichaud | it's possible that the regexes aren't properly lexically scoped, yes. See earlier statement about "PGE hasn't caught up to Parrot lexicals yet." | ||
ruoso | are you aware on a way to make it work? | 18:37 | |
(I'm open to useing PIR where needed...) | |||
pmichaud | not off the top of my head. I'm sorry if it sounds like I'm being obstructionist... I just have more problems on my plate than time to fix them all. | ||
ruoso | pmichaud, it didn't sound like that... ;) | 18:38 | |
skids | IMO say should pass named args to Str. | ||
pmichaud | okay, good. I just know I'm providing more issues than answers at the moment, and that's not a mode I'm happy about being in. | 18:39 | |
skids: hmm? | |||
skids | If you want to override say with named arguments for a class, and also Str, then youhave to write in a custom say that passes named args to Str | 18:40 | |
ruoso | pmichaud, anyway... I'll leave that code there for now then... the issues I'm blocking are contextual variables and closures in the regex.... | ||
skids | IMO that should be the default behavior. | ||
pmichaud | ruoso: noted. I might be able to get contextuals working relatively quickly. | ||
jnthn | pmichaud: I'm back now | ||
pmichaud | jnthn: question on P6metaclass refactors. Ideally, what should the first argument to add_method, add_attribute, etc. be? | 18:41 | |
jnthn | The "prototype" (which is an instance of the representation, and what will be our proto-object.) | 18:42 | |
18:42
icwiener-_- left
|
|||
pmichaud | I think I'd like the refactored versions to accept *only* prototypes, then. | 18:42 | |
and not be calling 'get_parrotclass' to figure it out. | |||
jnthn | Indeed, but we don't have those yet. :-) | ||
pmichaud | the deprecated versions can do the mapping to the prototype if needed. | 18:43 | |
i.e., I don't want them to accept parrotclasses, names of classes, namespaces, etc. | |||
jnthn | yes, understood. I'll try and remember that once I get parrotopaque in place; yell at me if I forget. :-) | ||
pmichaud | in looking at traces of things (especially signature binds) we end up making *lots* of calls to get_parrotclass. I'd like to optimize that out for cases where we know the incoming argument is well behaved. | 18:44 | |
And I'd like to enforce a bit more strictness on callers to only work through the prototype and not be able to pass "whatever" and have P6object dwim... at least not for those metaclass methods. | 18:45 | ||
(things like 'register', 'new_class', etc. can still have some dwimminess) | |||
japhb | Anyone have a link for a screenshot (or online javascript page) showing Perl 6 syntax highlighting that includes {} interpolating into a string? I'm trying to explain the coolness to a friend, and it's clear I need a visual aid .... | ||
moritz_ | japhb: wait a sec... | 18:46 | |
japhb | moritz_: than queue | ||
jnthn | Ah, signature binds. Another area that'll want some opt. :-) | ||
pmichaud | well, that would be a first step. Basically, we end up doing lots of get_parrotclass stuff whenever we're doing a typematch, and part of the reason is because the existing methods are more forgiving than they should be about the type object. | 18:47 | |
moritz_ | japhb: feather.perl6.nl/~azawawi/html/spec...ion.t.html has a few basic examples | 18:48 | |
ruoso | pmichaud, jnthn, the faz project is in github.com/ruoso/faz/tree ... I'll leave it there while I have those blockers... but just noting the repo so you can play with it around if you like... | ||
japhb | moritz_: excellent. I'll go wandering around near there. | 18:49 | |
moritz_ | japhb: if you like vim, you can get svn.pugscode.org/pugs/util/perl6.vim | ||
it hilights interpolating closures correctly | 18:50 | ||
japhb | I'll recommend that too him, he's a vim guy. | ||
pmichaud | I wonder if perl6.vim should be distributed with Rakudo, also. | ||
moritz_ | if so, we should get the latest version from github.com/hinrik/perl-vim/ | ||
japhb | pmichaud: that seems like a win. | 18:51 | |
moritz_ | (oh, it's github.com/hinrik/vim-perl actually) | 18:52 | |
[particle]- | but it violates dry | ||
japhb | [particle]: git submodule ... no need to copy | ||
But it can be packaged into the releases. And (hopefully) kept in sync with changes to Rakudo. | 18:53 | ||
18:54
ElectricHeavyLan left
|
|||
japhb | (The power of submodules was the one thing I thought git was really missing ... and then it got them.) | 18:55 | |
moritz_ | japhb: do you know an introductory document to them? | ||
japhb | moritz_: Hmmm, I stumbled over one a couple weeks back. Lemme see if I can find it. | 18:56 | |
moritz_: A couple github links show up in my history: github.com/guides/developing-with-submodules and github.com/guides/using-git-submodu...ck-plugins | 18:58 | ||
18:58
LylePerl left
|
|||
PerlJam | japhb: you didn't think partial checkouts were something git was missing too? | 19:00 | |
japhb | Hmmm, and a quick scan of the Git User Manual's chapter 8 looks decent: www.kernel.org/pub/software/scm/git...submodules | ||
moritz_ | japhb: thanks | ||
japhb | PerlJam: Yes and no ... there are a couple repos for which a partial checkout would have been nice for me, but I always found it infuriating in my earlier SCM days when I had to expand my checkout scope ... so I eventually got in the habit of always checking out full repos. This is a lot easier when a clone is a fast operation. Unlike, say, in SVK. | 19:02 | |
OR git-svn for that matter. | |||
(And to finish the flip side of the thought ... the Venn diagram describing the interaction of the MPlayer and FFMPEG repos was what convinced me submodules weren't just nice, but basically essential to maintain some semblance of sanity and convenience. Apparently those projects felt the same.) | 19:07 | ||
19:11
wolv joined
19:13
barney left
|
|||
japhb | rakudo: say "Perl 6 is { Ā« magic "sufficiently advanced technology" Ā».pick.uc }" | 19:14 | |
p6eval | rakudo 8009ac: OUTPUTĀ«Unable to parse block; couldn't find final '}' at line 1, near "\x{ab} magic \"s"ā¤ā¤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)ā¤Ā» | ||
japhb | std: say "Perl 6 is { Ā« magic "sufficiently advanced technology" Ā».pick.uc }" | 19:15 | |
p6eval | std 26684: OUTPUTĀ«ok 00:04 36mā¤Ā» | ||
19:15
donaldh joined
|
|||
japhb | std: say "Perl 6 is { Ā« magic 'sufficiently advanced technology" Ā».pick.uc }" | 19:15 | |
p6eval | std 26684: OUTPUTĀ«ok 00:04 36mā¤Ā» | ||
pmichaud | rakudo doesn't parse Ā« yet, I don't think. | ||
japhb | pmichaud: Ah! | ||
19:16
minazo joined
|
|||
pmichaud | rakudo: say "Perl 6 is { << magic 'sufficiently advanced technology" >>.pick.uc }" | 19:16 | |
p6eval | rakudo 8009ac: OUTPUTĀ«Perl 6 is MAGICā¤Ā» | ||
pmichaud | rakudo: say "Perl 6 is { << magic 'sufficiently advanced technology" >>.pick.uc }" | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Perl 6 is MAGICā¤Ā» | ||
pmichaud | rakudo: say "Perl 6 is { << magic 'sufficiently advanced technology" >>.pick.uc }" | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Perl 6 is ADVANCEDā¤Ā» | ||
pmichaud | rakudo: say "Perl 6 is { << magic "sufficiently advanced technology" >>.pick.uc }" | ||
PerlJam | heh | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Perl 6 is MAGICā¤Ā» | ||
japhb | pmichaud: had a misquote | ||
pmichaud | rakudo: say "Perl 6 is { << magic "sufficiently advanced technology" >>.pick.uc }" | ||
p6eval | rakudo 8009ac: OUTPUTĀ«Perl 6 is SUFFICIENTLY ADVANCED TECHNOLOGYā¤Ā» | ||
PerlJam | the << >> parser could look for quotes and warn | 19:17 | |
japhb | pmichaud: Is there any reason for Ā« Ā» to be difficult to parse? Or is it Unicode problems raising their collective ugly heads? | 19:19 | |
pmichaud | Unicode problems. | ||
jnthn | The one with Parrot hashes and unicode keys? | ||
pmichaud | I think so, yes. | ||
19:20
donaldh left,
donaldh joined
|
|||
japhb | Is there a way to weight the choice of a .pick ? | 19:21 | |
(Other than copying terms to make appropriate ratios) | |||
moritz_ | no | ||
19:21
goksie left
|
|||
moritz_ | you could sort on weight * rand(), and then take the first one | 19:22 | |
or so | |||
japhb | Hmmm, actually, that's not a bad idea, mixed with some of MJD's discussions on algorithms for finding smallest terms "nearly correct" fractions | ||
s/that's/copying terms/ | |||
well, you get the point. | 19:23 | ||
jnthn | rakudo: my @values = 1,2,3; my @weights = 2, 4, 2; say @values >>xx<< @weights; | ||
p6eval | rakudo 8009ac: OUTPUTĀ«11222233ā¤Ā» | ||
jnthn | ^ easy way to do the copying terms way | ||
19:23
donaldh left
|
|||
japhb | jnthn: nice! | 19:23 | |
19:23
donaldh joined
|
|||
arnsholt | But having an optional weights parameter might be better_ | 19:23 | |
s/_/?/ | 19:24 | ||
moritz_ | rakudo: my %w = a => 1, b => 2, c => 3; <a b c>.sort( { rand * %w{$_} }).[0].say | ||
arnsholt | If the array to pick from is large, starting to copy might be an unreasonable suggestion | ||
jnthn | arnsholt: multi pick(@list, @weights) { ... } | ||
p6eval | rakudo 8009ac: OUTPUTĀ«aā¤Ā» | ||
moritz_ | rakudo: my %w = a => 1, b => 2, c => 3; <a b c>.sort( { rand * %w{$_} }).[0].say | ||
p6eval | rakudo 8009ac: OUTPUTĀ«cā¤Ā» | ||
moritz_ | rakudo: my %w = a => 1, b => 2, c => 3; for 1..10 {<a b c>.sort( { rand * %w{$_} }).[*-1].print } | 19:25 | |
arnsholt | moritz_: Right. That works too | ||
p6eval | rakudo 8009ac: OUTPUTĀ«bbccccbccaĀ» | ||
moritz_ | ... if I do it right, yes ;-) | ||
japhb | moritz_: nice. | ||
moritz_ | arnsholt: pick with weight is a nice feature for a library, IMHO | ||
japhb | moritz_: sure, I've got no problem with that at all. It certainly feels more like library functionality than core to me .... | 19:26 | |
19:26
azawawi left
|
|||
arnsholt | Yeah, it sounds like a reasonably common operation | 19:26 | |
19:26
ZuLuuuuuu joined
19:34
lisppaste3 joined
19:35
donaldh left
|
|||
ruoso later & | 19:51 | ||
19:59
wolv left
20:04
amoc joined
20:06
amoc left,
wolv joined
|
|||
dalek | kudo: cfc5e82 | pmichaud++ | docs/spectest-progress.csv: spectest-progress.csv update: 379 files, 11011 passing, 0 failing |
20:11 | |
20:17
amoc joined
|
|||
jnthn | rakudo: multi foo() { }; my @a; @a.push(&foo) | 20:18 | |
p6eval | rakudo cfc5e8: ( no output ) | ||
20:25
PhatEddy joined
|
|||
PhatEddy | rakudo: enum B <a> ; say B::a | 20:26 | |
p6eval | rakudo cfc5e8: OUTPUTĀ«0ā¤Ā» | ||
PhatEddy | rakudo: enum A <a> ; say A::a | ||
p6eval | rakudo cfc5e8: OUTPUTĀ«0ā¤Ā» | ||
jnthn | :-) | ||
(Though that much worked just fine before the recent refactor...) | 20:27 | ||
PhatEddy | rakudo: class A { say "This is class $?PACKAGE" } | 20:28 | |
p6eval | rakudo cfc5e8: OUTPUTĀ«Scope not found for PAST::Var '$?PACKAGE' in ā¤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:105)ā¤Ā» | ||
PhatEddy | that one was closed once I think | ||
jnthn | rakudo: class A { say $?PACKAGE } | 20:29 | |
p6eval | rakudo cfc5e8: OUTPUTĀ«Scope not found for PAST::Var '$?PACKAGE' in ā¤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:105)ā¤Ā» | ||
jnthn | rakudo: module A { say $?PACKAGE } | ||
p6eval | rakudo cfc5e8: OUTPUTĀ«Scope not found for PAST::Var '$?PACKAGE' in ā¤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:105)ā¤Ā» | ||
jnthn | Yeah, I thoguht so too. | ||
PhatEddy | was RT #59484 | ||
working on package tests ... | 20:30 | ||
20:38
rewt left
20:43
LadyLunacy joined
20:52
Kyosuke_Kiryu joined
|
|||
PhatEddy | rakudo: package Simple { sub pkg { $?PACKAGE } } | 21:01 | |
p6eval | rakudo cfc5e8: OUTPUTĀ«Scope not found for PAST::Var '$?PACKAGE' in pkgā¤current instr.: 'parrot;PCT;HLLCompiler;panic' pc 146 (src/PCT/HLLCompiler.pir:105)ā¤Ā» | ||
21:04
mizioumt1 joined
21:07
payload joined
21:09
iblechbot joined
21:12
rewt joined,
ejs joined
21:15
hercynium left
|
|||
PhatEddy | rakudo: package Simple{class Bar {sub baz {'hi'}}}; say Simple::Bar.new.baz; | 21:19 | |
p6eval | rakudo cfc5e8: OUTPUTĀ«Could not locate a method 'baz' to invoke on class 'Simple::Bar'.ā¤current instr.: 'die' pc 16538 (src/builtins/control.pir:225)ā¤Ā» | ||
PhatEddy | oops | ||
dalek | kudo: 9a1cacd | jnthn++ | (2 files): Add .^methods and .^isa introspection methods. Also bump us up to the Parrot build where I put in the P6object changes that are needed to go with this. |
21:20 | |
kudo: c77bd19 | jnthn++ | : Merge branch 'master' of [email@hidden.address] |
|||
PhatEddy | rakudo: package Simple{class Bar {method baz {'hi'}}}; say Simple::Bar.new.baz; | ||
p6eval | rakudo cfc5e8: OUTPUTĀ«hiā¤Ā» | ||
21:23
Kisu joined
21:25
ejs left
21:26
nihiliad joined
21:33
iblechbot left,
amoc left
21:35
amoc joined
21:45
LadyLunacy left
21:52
wknight8111 joined
|
|||
dalek | kudo: 53f7059 | jnthn++ | src/parser/ (2 files): STD tracking: handles trait verb followed by noun, not EXPR. |
21:59 | |
22:02
skids joined
|
|||
PhatEddy | rakudo: package A { enum B <a> }; package P { role B {}; class C does P::B {} } | 22:02 | |
p6eval | rakudo c77bd1: OUTPUTĀ«The type P::B does not exist. at line 1, near "{} }"ā¤ā¤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:86)ā¤Ā» | 22:03 | |
PhatEddy | rakudo: package A { enum B_different <a> }; package P { role B {}; class C does P::B {} } | ||
p6eval | rakudo c77bd1: ( no output ) | ||
hatseflats | so how are method collisions handled in perl6 when a role has a method named like a method contained in the class importing it? | 22:04 | |
jnthn | The method in the class always wins. | 22:05 | |
hatseflats | so there is no late binding? | ||
hmmm | |||
jnthn | Two roles both trying to bring in methods of the same name, without any method in the class to resolve it, is an error though (at composition time) | ||
(e.g. compile time) | |||
[particle]- | class construction time | 22:06 | |
hatseflats | veering a bit off, wouldn't it be better to throw an error regardless? | ||
jnthn | No, since in Perl 6 writing a method in the class is *the* mechanism for conflict resolution. | ||
PhatEddy | In that example above - any good reason for the role and enum in different packages to conflict? | 22:07 | |
hatseflats | okay | ||
jnthn | PhatEddy: No, it's an error. | ||
rakudo: role A { method m { } }; role B { method m { } }; class C does A does B { } | |||
p6eval | rakudo 53f705: OUTPUTĀ«A conflict occurred during role composition due to method 'm'.ā¤current instr.: '!meta_compose' pc -614965 ((unknown file):-1)ā¤Ā» | ||
jnthn | rakudo: role A { method m { } }; role B { method m { } }; class C does A does B { method m { } } | ||
p6eval | rakudo 53f705: ( no output ) | ||
hatseflats | so besides the difference in overriding behavoir and conflicting imports, and that roles do not add to the inheritance chain, are there any other differences, technically, between extending and using a role? | 22:08 | |
or traits for that matter | |||
jnthn | Yes and no. | 22:09 | |
[particle]- | extending? | ||
jnthn | [particle]-: synonym for inheriting | ||
For example, a role can also be used as a mix-in. | |||
Also, roles are immutable. Classes are mutable. | |||
hatseflats | my bad, I seem to be mixing terminology a lot, I'm not used to perl, and draw a lot of the vocabulary from other sources | ||
and a mix-in would be a non-abstract version of a role, correct? | 22:10 | ||
jnthn | No, a mix-in is just applying a role to an object on a per-object basis. | ||
hatseflats | oh, okay | ||
ah yes, that trick is particularly interesting | 22:11 | ||
jnthn | Well, I guess you could say we have the action of mixing in (a verb) more than a construct that we call a mix-in (a noun). | ||
Thus you mix in a role. :-) | |||
PerlJam sprinkles chocolate and pecans and cinnamon on his vanilla ice cream and starts mixing. | |||
hatseflats | I see :) | ||
I'm asking because I'm trying to develop a bit or a nice language as part of my school project, and since the perl userbase seems to have the most exp. points, so to speak, on the subject, I ask here. | 22:12 | ||
In my case, roles will be classes that are used as roles | 22:13 | ||
[particle]- | jnthn: we need to be careful about language, because so many oo framworks have different meanings for different words, so i asked. | ||
jnthn | [particle]-: Yes, you're right. | ||
[particle]-: I move between a bunch of different ones all the time... | |||
[particle]- | like, perl 6 roles are smalltalk traits, 'cept our roles have state | 22:14 | |
jnthn | What we call attributes, C# calls fields, and its attributes are something every different... | ||
[particle]- | yep, attributes versus properties, too | ||
hatseflats | others call them members | ||
jnthn | And what Perl 6 calls a trait (mixing in a role to something at compile time) is not what smalltalk calls a trait. | 22:15 | |
well | |||
that's not quite what Perl 6 calls a trait, but it's often the upshot... | 22:16 | ||
hatseflats | that's kinda... confusing | ||
regardless, thanks for the info | |||
PerlJam | If only they all used standardized terminology ... | ||
22:17
simcop2387 joined
|
|||
hatseflats | heh | 22:17 | |
'they all' | |||
pugs_svn | r26685 | lwall++ | [Containers] some work on various structures related to KeyHash | 22:20 | |
r26685 | lwall++ | define .pick to work rationally on structures whose values represent weights. | |||
22:22
Jedai left
|
|||
TimToady | I'd be open to renaming 'traits' to something less confusing | 22:23 | |
hatseflats | how about, non-inheriting, non-overriding, non-instantiatable classes | 22:25 | |
jnthn | TimToady: I'm not so fussed....SmallTalk ain't *that* mainstream. | ||
If Java used it to mean something else, I'd probably feel differently. | |||
22:26
hercynium joined
|
|||
hatseflats | someone has to set a trend | 22:26 | |
antiquated words get revised meanings all the time | |||
who's to say that Java won't pick up on Perl-style traits and roles | |||
or maybe we'll have world peace and Perl and Python will combine into one language | |||
PerlJam | hatseflats: what makes you think that world would be peaceful? | 22:27 | |
hatseflats | everyone will be too busy trolling on the internet on the subject to make war? | 22:28 | |
arnsholt | PerlJam: But at least we would be able to focus on the really important questions | 22:29 | |
Like which editor people should use =) | |||
hatseflats | heh | ||
jnthn | Notepad!!! | ||
PerlJam | arnsholt: you use vi to edit perl 6 (see how vi and 6 are the same? :) | ||
arnsholt | PerlJam: Obviously. vi is the one true editor, after all =) | 22:30 | |
TimToady | well, but Python and E-lisp are both just dialects of Perl 6... | ||
hatseflats | *cringe* | ||
jnthn | oh hey, that means so is lolcode... | ||
PerlJam | arnsholt: yeah ... even if it's skin looks like vim, it's still got vi on the insides somewhere. | ||
What *isn't* a dialect of perl 6 ? | 22:31 | ||
arnsholt | Yeah. vim is just vi with makeup on | ||
TimToady | strawberries | ||
black holes | |||
PerlJam | TimToady: now you're tempting the Damian. | ||
TimToady | probably quarks, but we're not sure | ||
hatseflats | I'd say Basic is a pretty safe bet to claim as not-perl based | ||
TimToady | you don't understand; Perl 6 can easily mutate into *any* other computer language | 22:32 | |
even Basic | |||
jnthn | { use Basic; 10: PRINT "HELLO" } | ||
hatseflats | if that's true | ||
TimToady | you forgot the 'goto 10' | ||
hatseflats | than isn't perl just scheme with a fancy community? | 22:33 | |
TimToady | well, lisp with a syntax | ||
the eventual goal is to convert Paul Graham :) | 22:34 | ||
PerlJam | That's more Haskell | ||
hatseflats | yeah... how would one classify haskell | ||
as if the gods created the world with it, but then ditched it and wrote the bulk of the things on it in perl | 22:35 | ||
TimToady | well, you can end a Perl program with a right paren | ||
in any case, the universe would consider indentation as syntax to be magical action at a distance, unless there are particles travelling back and forth between the text and the left margin | 22:37 | ||
.oO(spaces, the final frontier) |
|||
hatseflats | heh... hehehe :) | 22:38 | |
PerlJam | use Acme::Bleach | ||
22:38
Kyosuke_Kiryu left
|
|||
TimToady | well, when Haskell gets around to inventing the QM monad, the universe will implode as self-referential, I expect | 22:40 | |
pmichaud | and here I figured that a self-reference was what kicked the whole thing off in the first place. | ||
hatseflats | sorry, ah whatshamacallit monad? | ||
TimToady | fortunately monads are still one-dimensional | ||
QM = Quantum Mechanical | 22:41 | ||
pmichaud | Someone overflowed the stack somewhere and this universe is the result. | ||
22:41
Kyosuke_Kiryu joined
|
|||
jnthn | rakudo: sub foo() { my @a = 1; return @a; }; my @x = foo(); say @x[0].perl; | 22:41 | |
p6eval | rakudo 53f705: OUTPUTĀ«1ā¤Ā» | ||
PerlJam | The big thing in haskell is arrows now, not monads. (which works well for entropy and time and such) | ||
japhb | PerlJam: OK, last time I looked at Haskell, I had figured out monads, more or less. What are arrows now? | 22:42 | |
TimToady | better monads :) | ||
japhb | oh. | ||
PerlJam | japhb: www.haskell.org/arrows/ | ||
japhb | "But if you're using a structure that's very like a monad, but isn't one, maybe it's an arrow." | 22:43 | |
heh | |||
PerlJam | or it could be Higgs Boson | ||
TimToady | maybe we should rename traits to arrows and confuse everyone | 22:44 | |
hatseflats | how would that be more confusing? | ||
PerlJam | hatseflats: are you saying that we've reached maximal confusion? There is no more? | 22:45 | |
TimToady | well, I guess an argument can be made that everyone is already confused | ||
hatseflats | PerlJam: if the universe dies of maximal entropy, why not a similar fate for us humans | ||
jnthn | pmichaud: ping | 22:46 | |
pmichaud | jnthn: pong | ||
jnthn | oh hai | ||
pmichaud | also | ||
jnthn: ping :-) | |||
jnthn | I'm doing something like | ||
@classes = self.^isa(); | |||
lambdabot | Unknown command, try @list | ||
jnthn | That method is implemented in PIR | ||
And creates an Array and returns it. .return (the_array) | 22:47 | ||
Which ends up with @classes containing a first element that is that array. | |||
However, that differs from the case I fed to Rakudo above. | |||
Am I doing something obviously stupid? | |||
(the isa method is implemented in PIR, i mean) | |||
pmichaud | rakudo: sub foo() { my @a = 1; @a }; my @x = foo(); say @x[0].perl; | ||
p6eval | rakudo 53f705: OUTPUTĀ«1ā¤Ā» | 22:48 | |
TimToady | well, returns should generally be returning Captures, if they don't know what context they'll be used | ||
pmichaud | is the_array really an Array? | ||
jnthn | result_list = get_hll_global 'Array' | ||
result_list = result_list.'new'() | |||
... | |||
.return (result_list) | |||
hatseflats | say $*IN; | ||
err | |||
rakudo: say $*IN; | 22:49 | ||
? | |||
p6eval | rakudo 53f705: OUTPUTĀ«IO()<0xb6b73668>ā¤Ā» | ||
pmichaud | jnthn: afaik, that should work out okay. I'd probably want to see more detailed code. | ||
You could try $P0 = result_list.'list'(); return $P0 | |||
pugs_svn | r26686 | lwall++ | [STD] make lookup of $?FOO overridable in derived languages | ||
pmichaud | i.e., to see the definition of whateveris handling '.^isa' | 22:50 | |
hatseflats | rakudo: say $*IN.lines().pick(); | ||
p6eval | rakudo 53f705: OUTPUTĀ«Hast seit frĆ¼hen Ahnentagenā¤Ā» | ||
hatseflats | ah yes, the austrian anthem | 22:51 | |
jnthn | pmichaud: If I do .perl of the thingy that I'm returning inside the method it's [A] | ||
So looks right | |||
Let me get you a link though... | |||
pmichaud | well, several things will cause it to return [A] though. | ||
indeed, I wonder if it's in fact a reference to an array somehow. | |||
jnthn | github.com/rakudo/rakudo/blob/53f70...assHOW.pir | 22:52 | |
methods below has the same issue. | 22:53 | ||
pmichaud | oh, fwiw, the line | ||
result_list = get_hll_global 'Array' | |||
is going to be wrong. | |||
japhb | PerlJam: Thanks for the Arrows link. Makes sense, but brain didn't expand. Which either means they are common sense, or I'm missing something. | ||
jnthn | pmichaud: Because...? | 22:54 | |
japhb | Perhaps "common sense if monads are already understood" | ||
pmichaud | because this code is running in the 'parrot' HLL namespace. | ||
hatseflats | haha | ||
jnthn | Ah. | ||
pmichaud | and Rakudo's 'Array' protoobject will be in a different namespace. | ||
jnthn | Yes, yes. | ||
22:55
amoc left
|
|||
jnthn | Well, that said, by the time we get .HLL in place, Rakudo's metaclass and P6object may be been broken out. | 22:55 | |
pmichaud | could be. | ||
jnthn | (As in, Rakudo may have its own one in its own HLL) | ||
pmichaud | at any rate, most array-like-stuff will end up being in RPA | ||
i.e., Parrot's RPA will map to Rakudo's Array | |||
is the code in 'isa' "new code", or has it been around a while? | 22:56 | ||
jnthn | New. | ||
Though it'll change once get_parrotclass stops being needed. | |||
pmichaud | right. | ||
jnthn | Just trying to fill out the metaclass enough so that I can ween other places off using Parrot classes. | 22:57 | |
pmichaud | some things to try | ||
(1) use new 'Perl6Array' instead of going through the 'Array' protoobject. I'm just curious if it makes a difference. | |||
(2) find out what result_list.'PARROT'() says | |||
oddly, when I run it on my box it appears to do the assignment correctly. | 22:59 | ||
hatseflats | why choose arrays to be pseudo or proto-objects? | ||
jnthn | oh, hmm | ||
pmichaud | $ cat y | ||
my @isa = 1.^isa(); | |||
say @isa.perl; | |||
$ ./perl6 y | |||
[Int, Any] | |||
$ | |||
jnthn | oh, hmm | ||
What if that's Int.^isa() ? | 23:00 | ||
Oh, ugh, that is quite bogus too (should just be Any - the Int is coming because we inherit from Parrot's Integer) | |||
pmichaud | $ cat z | ||
my @isa = Int.^isa(); | |||
say @isa.perl; | |||
$ ./perl6 z | |||
[Int, Any] | |||
$ | |||
^H^H^H^H^H^H[B[B[B[A[A | |||
doesn't 'parents' end up returning the class itself in the list? | 23:01 | ||
istr that the first element of introspecting parents was that it returned the class itself. | 23:02 | ||
jnthn | I think ^isa by default is just the immediate parents | ||
Not the full MRO. | 23:03 | ||
pmichaud | I think that Parrot's "parents" is the full mro. | ||
maybe not, checking. | |||
jnthn | No, there's two things | ||
hatseflats | perl5: say 42; | ||
jnthn | parents and all_parents | ||
First is immediates, second is MRO. | 23:04 | ||
pmichaud | you're correct. | ||
but yes, technically, Int has two parents right now. | |||
jnthn | I think something odd is going on though. | ||
Because a shorter snippet just gave me the answer I expected... | |||
23:06
H1N1 joined
|
|||
pmichaud | I think I'm going to add "is vtable(...)" as one of our allowed traits. | 23:07 | |
23:07
kane___ joined
|
|||
pmichaud | so we can write vtable functions in the setting. | 23:07 | |
jnthn | Were we not going to just map 'em all in Object? | 23:08 | |
pmichaud | I'm not sure they always map. | ||
I might go that approach to begin with. | |||
jnthn | OK, no objections from me if you need it. | 23:09 | |
Guess it'll be a compiler-handled trait rather than one we dispatch on. | |||
pmichaud | I was going to handle it the same as the other sub traits. | ||
i.e., it would call sub_trait_vtable and do the vtable insertion. | |||
at least as a first cut, since that's easy (and consistent with our other trait handling) | 23:10 | ||
but maybe I'll go with mapping them all in Object for now. | 23:11 | ||
(these are with respect to refactoring List and Array) | |||
jnthn | That's fine. | ||
I'm not going to be doing traits for a bit. | |||
pmichaud | Somehow it seems I spend most of my time rewriting/refactoring existing code. :-| | 23:12 | |
I guess that's normal, though. | 23:13 | ||
jnthn | Heh, in the next couple of weeks I've probably gotta re-write all of the method dispatcher, .*, .+, .?, wrap, unwrap... | ||
pmichaud | I'm glad to let you do that :-) | ||
jnthn | Gah. :-( So I take the code out of the setting, pretty much copy-paste, into a separate .p6 file and it works... :-| | 23:14 | |
TimToady | bootstrap dependency? | ||
jnthn | TimToady: Maybe, but then I'm struggling to think where. The code isn't being called until everything else is compiled... | 23:15 | |
pmichaud | oh, on a related topic | ||
I think we might get to the point soon where we ship with a "bootstrapping" settings.pir | 23:16 | ||
this is used to compile the real settings, which then replace it. | |||
jnthn | I'd been thinking we might end up with that. | ||
pmichaud | same here. | ||
but I'm getting to the point where I really prefer to be writing things in p6 (with inline PIR) than pure PIR. | 23:17 | ||
jnthn | Some things are getting quite a nuisance now. | ||
hatseflats | stupid question, but why does it make sense that I can access a package created outside the local scope? | ||
jnthn | Like, if you re-declare a variable in the setting. | ||
Then warn uses join which isn't existing until we've compiled the setting. | 23:18 | ||
And so you never get the error. | |||
pmichaud | warn could always use the opcode join :-) | ||
jnthn | It just whines about not finding join. | ||
pmichaud | but yes, our bootstrapping version could provide a join that warn can use. | ||
jnthn | Yeah of course. It's just an example of the sort of problem. | ||
Like, most of IO is defined in the setting. | 23:19 | ||
pmichaud | that is then replaced by the 'real' join. | ||
jnthn | say() just delegates. | ||
To $*OUT.say | |||
Which doesn't exist. | |||
So you stick a say(...) in actions.pm for debugging and it fails. | |||
TimToady | hmm, an exported method has an implicit *%_, which might explain say( a => 42 ) throwing away the pair | 23:20 | |
jnthn | (which sucks when you're trying to debug...) | ||
pmichaud | TimToady: yes, I was thinking that earlier. | ||
But I think it may also related to the discussion on pairs in list(...) and hash(...) | 23:21 | ||
*relate | |||
TimToady | maybe we can refine the automatic *%_ rule somehow | ||
pmichaud | for the time being, we could probably have say() warn if it gets any named params. | ||
Is there a strong reason for the automatic *%_ rule? | 23:22 | ||
jnthn | pmichaud: this is odd... | ||
say "before loop: " ~ @classes.perl; | |||
for @classes -> $class { | |||
say $class.perl(); | |||
} | |||
Output | |||
before loop: [A] | |||
[A] | |||
pmichaud | jnthn: it's possible that .perl is subtly modifying its invocant somehow. | 23:23 | |
I know that there was some other oddities with .perl recently. | |||
what is @classes.PARROT; reporting? | 23:24 | ||
jnthn | True, but it's consistent with what goes wrong next... | ||
(Which is that I do $class.^methods and it gives me the methods of Array... | |||
) | |||
I change the .perl to .PARROT and get | 23:25 | ||
before loop: Perl6Array | |||
Perl6Scalar->Perl6Array | |||
pmichaud | aha | ||
yes, something is converting @classes into a Perl6Scalar | |||
meppl | good night | 23:26 | |
jnthn | Note the second line is inside the loop | ||
e.g. say $class.PARROT | |||
pmichaud | try @classes[0].PARROT | ||
(before the loop) | |||
wait. | 23:27 | ||
I might know. What exactly is *in* @classes at this point? | |||
jnthn | As far as I can see nothing shoulda touched it other than what came back from @classes = self.^isa(); | ||
23:27
PhatEddy left,
ZuLuuuuuu left
|
|||
pmichaud | try @classes[0].PARROT | 23:27 | |
we know that @classes is a Perl6Array, I need to know its first element. | 23:28 | ||
jnthn | I do say 'before loop @classes[0]: ' ~ @classes[0].PARROT; | ||
and the output is just | |||
before loop @classes[0]: | |||
(e.g. .PARROT gives nothing) | |||
pmichaud | because it's an (unnamed) proto. | ||
protoobjects don't get class names by default. | 23:29 | ||
jnthn | ah, yes | ||
pmichaud | which proto is it? | ||
jnthn | I just defined two classes | ||
class A { method x() { say 1 } } | |||
class B is A { method x() { say 2 } } | |||
And it'd be A's proto | |||
pmichaud | testing. | ||
and @classes is.... B.^isa() ? | 23:30 | ||
jnthn | aye | ||
pmichaud | you have some local mods in place? | 23:31 | |
jnthn | The method I'm writing in the setting | 23:33 | |
oh | |||
And the return value to list thing you suggested. | |||
pmichaud | what's the method you're writing in the setting? | ||
jnthn | WALK | ||
(at least partly as an attempt at proof-of-concept of the introspection stuff...) | 23:34 | ||
pmichaud | on my system: nopaste.snit.ch/16478 | ||
can I see what you have for WALK ? | |||
jnthn | one second, I'm just pulling it out of the setting into an is also to make sure it's really not setting specific... | 23:35 | |
pmichaud | oh, I know what else it might be. | ||
What *other* methods do you have defined in there...? | |||
jnthn | Just git stash'd what i had before. | ||
pmichaud | and what class is this being defined in? | ||
jnthn | Object. | 23:36 | |
pmichaud | Yes, that's the problem. | ||
jnthn | OH NOES | ||
Yes, I think I can guess where this one is going... :-( | |||
pmichaud | Object has its own "list" method, and that's being called as part of the 'list' function. | ||
because | |||
for @classes -> $class { ... } | |||
is really | |||
for list(@classes) -> $class { .... } | 23:37 | ||
but | |||
because Parrot sticks its methods into the namespace | |||
and because IMCC short-circuits to any named sub in the same namespace | |||
you're not getting the global version of list(), you're getting Object's version of .list() | |||
which returns a list of itself. | |||
i.e., what you're getting is the same as | |||
for Object::list(@classes) -> $class { ... } | 23:38 | ||
jnthn | Yeah. Ugh. | ||
pmichaud | I _really_ wish we could get that particular namespace bug fixed. | 23:39 | |
jnthn | you're right... | ||
nopaste.snit.ch/16479 | 23:40 | ||
That works, but s/Any/Object/ (to add it to Object) and if blows up. | |||
pmichaud | right, because Any doesn't have a 'list' method/sub defined. | 23:41 | |
jnthn | Can't believe we just lost another hour to a stupid Parrot fail attempt at optimization. | ||
pmichaud | so IMCC doesn't do the short-circuit optimization. | ||
Perhaps the workaround/solution here is to get PCT to always use :method('name') when generating methods. | |||
And give the sub an empty or nonsense or otherwise mangled name. | |||
jnthn | Only works if it's not an our method though... | 23:42 | |
The others need to be in the ns. | |||
pmichaud | hmmm? | ||
jnthn | If it's an our method it has to go in the NS. | ||
I'm not sure what stuff in the setting counts for on that front though. | |||
pmichaud | do we have anything that really makes use of 'our methods'? | ||
jnthn | I'm not sure. Is it the default? | 23:43 | |
The point is more, do other people have code that is making use of them... | |||
pmichaud | no, the question is, "what is Spec"? | ||
if people have code that relies on it, and it's not spec, then I'm not too worried about breaking it. | |||
jnthn | Sure. | 23:44 | |
I don't know which is spec...checking... | |||
pmichaud | but I don't remember that methods go into the namespace. This was discussed recently. | ||
I thought they stayed out of the namespace unless 'is export' was present. | |||
(I can be misremembering this.) | |||
jnthn | Unlike with most other declarations, C<method> declarations do not | 23:45 | |
default to C<our> semantics, or even C<my> semantics, but rather | |||
C<has> semantics. | |||
You're right. | |||
pmichaud | right | ||
and the sentence after that. | |||
jnthn | yes, that's the upshot of what I pasted. | ||
pmichaud | I don't think anyone is using 'our' | ||
if they are, we can certainly arrange for it to go back into the namespace | 23:46 | ||
jnthn | sure | ||
and lo and behold | |||
.namespace ['Perl6Object'] | |||
-.sub 'list' :method | |||
+.sub '' :method('list') | |||
Solve the issue. | |||
pmichaud | oh, do that for now. | ||
My apologies that it wasn't done sooner. | |||
We should do that for most built-in methods. | |||
jnthn | No, no, sorry for dragging you into the debugging. | ||
I shoulda guessed that one sooner... | 23:47 | ||
pmichaud | it often trips me up | ||
I didn't realize you were working inside of Object. | |||
jnthn | I did know about Parrot's failtimization. | ||
pmichaud | more to the point, however. | ||
because I've also had it happen in settings code | |||
I think I should update PCT to allow :nsentry | |||
and then Rakudo should default to :nsentry('') unless 'our' is present. | 23:48 | ||
that way the sub can still have a name, but we control where it goes in the namespace. | |||
jnthn | *nod* | ||
23:49
c1sung joined
|
|||
pmichaud | this of course, is the other reason we should probably start doing p6-with-inline-PIR instead of pure PIR, to avoid these sorts of things in the first place. | 23:50 | |
afk for a while -- need a walk. | 23:52 | ||
23:53
mizioumt1 left
|