pugscode.org/ | nopaste: sial.org/pbot/perl6 | ?eval [~] <m oo se> | We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/
Set by diakopter on 11 July 2007.
meppl good night 01:11
moritz_ good localtime() everybody 06:46
spinclad g'localtime(), @all 07:36
masak g'localtime(), spinclad
spinclad good morrow to you, good sir! 07:45
moritz_ is too dumb for kp6 debugging 07:46
spinclad and to you, good moritz_, good morrow! 07:48
spinclad is too lagged by a thrashing firefox to do much tonight 07:51
moritz_ are coroutines (with yield instead of return) and gather/take isomorphic? 08:25
assuming lazy gather/take, that is 08:37
spinclad hmm. i suspect coroutines will be more general, as not constrained to a producer/consumer assymetry, but i'm not sure Perl 6 coroutines, in particular, have all the power i'm thinking of. 08:39
certainly every yield point has a signature of what is yielded there, both on the calling side (yield ...) and the receiving side (... := coroutine(...)); 08:43
moritz_ ah right, yield can probably propagate a different context than take 08:45
spinclad and as i have understood coroutines, a signature back when the receiving side asks it to go on.
spinclad the simplest case keeps these signatures fixed for the life of the coroutining pair; but with careful architecture this needn't be the case, and perhaps usefully so. 08:47
iow, you could have sets A and B of yield points that have different interfaces; but they would have to stay in sync on both sides. 08:48
i wouldn't be surprised if this could be better expressed another way, though. 08:51
say, as a persistent object with two different methods. 08:52
spinclad well, back to thrashing, and bed. g'night, @all 08:55
spinclad &
TimToady I don't think they're isomorphic. coroutines are limited to returning from the current "sub", while a take can return from any gather in the outer dynamic scope. 09:20
though, as with loop controls, it should probably prefer a visible outer lexical scope over a hidden dynamic scope, even if the dynamic scope is inside the lexically scoped gather 09:22
that is, it should probably search for a gather by the same policy as S04:807 09:24
(and thereabouts) 09:25
moritz_ TimToady: thanks
TimToady and could even potentially have labelled gathers, and FOO.take() 09:26
meppl good morning 09:31
moritz_ I'm off, see you on sunday ;)
TimToady later 09:32
meppl good bye mortiz 09:33
pmurias fglock: you can now only write emitter for kp6 in mp6 10:35
*emitters
fglock pmurias: yes 10:36
because the AST is an mp6 object
TimToady note, I just changed the precedence of x, xx and ~ 10:37
TimToady also, to get my fixed pugs compile perl5_init had to refer to &environ rather than &env. this might break the build elsewhere... 10:39
fglock TimToady: is it ok to refactor the regex AST to avoid left-recursion?
TimToady where does it do left-recursion?
fglock I mean, to allow left recursion, without infinite loop 10:40
TimToady why would you need it? 10:42
everything calls a lower rule, except things that have some other token on the left
pmurias you want to turn token left {<left> <something>} into token {<something>+} 10:43
?
fglock yes, for example
pmurias isn't the later clearer 10:44
?
fglock hmm - I need it a while ago, it would make some grammar simpler to write - I'll try to find it 10:47
needed
TimToady it tends to completely screw up longest-token matching 10:48
pmurias fglock: fixing $foo.bar.baz? 10:50
fglock pmurias: that would be one case, but it is should probably be fixed with some precedence algorithm, for flexibility 10:52
reading en.wikipedia.org/wiki/Left_recursion 10:53
lambdabot Title: Left recursion - Wikipedia, the free encyclopedia
TimToady re-zzz & 10:55
pmurias fglock: left recursion is hard to understand with a NFA mindset 10:56
fglock hmm - mindsets make certain things harder to understand 11:01
pmurias fglock: and somethings easy, luckily you aren't limited to one 11:07
fglock reading on NFA too
pmurias got confused is the perl regex engine an NFA? 11:12
fglock I read that Perl 5.10 optimizes snippets to [DN]FA when possible 11:18
pmurias i think it is (without the nonregular features) with backtracking being transitons withought taking any input 11:20
avar fglock: it doesn't 11:21
pmurias would a perl build script be better than a Makefile? 11:23
avar something that could run on all makes would be a good start 11:25
but if you're going to write it in pure-perl it'll be troublesome to write and to get it to work with makemaker
pmurias avar: is Module::Build an option? 11:29
avar why do you want to use that? 11:30
pmurias just looking at it, it dosn't use make at all 11:31
avar people generally seem to dislike it
anyway depending on make isn't a problem, but depending on GNU make is 11:32
you could write perl code in the .PL file to do the patsubst thing and /%.pm
pmurias dlocaus++ wrote it 11:33
avar: but the whole Makefile.PL feels hackish 11:35
avar sure 11:41
fglock pugs: &say 11:50
exp_evalbot OUTPUT[\:(@?1 is copy) {}{Prim ([Pugs.AST.Internals.Val] -> Pugs.AST.Eval.Eval Pugs.AST.Internals.Val)}␤]
fglock what does this mean? 11:51
pmurias avar: do you dislike Module::Build youself?
pugs: sub a {};&a
exp_evalbot OUTPUT[\sub :(@_) "$_" := "Scalar" #<Scalar:0xb72c899c>␤ "@_" := "Array" #<Array:0xb72c756c>␤ "&?ROUTINE" := "Sub" #<Sub:0xb6604cec>␤ "&?BLOCK" := "Sub" #<Sub:0xb6604cec> {"&a" := "Sub" #<Sub:0xb722ec30>, "$_" := "Scalar" #<Scalar:0xb72d2cd8>␤
.. "@_...]
avar pmurias: I just know it routinely breaks my cpan installs by opening dialogs during make test or something
because it insists on not installing things in the normal perl module tree or something 11:52
fglock how about to add the AST to the 'Code' object, to allow serialization? 11:55
pmurias sounds resonable
fglock &print.perl would just return "&print" ? 11:56
pmurias fglock: or 'sub {...}' 11:57
fglock pmurias: "&print" can be eval'ed back
pmurias fglock: yes 11:58
pmurias Grammar/Sub.pm and Grammar/Term.pm give compile error in onion 11:59
fglock pmurias: isn't it a perltidy error? 12:01
I got errors on embedded slashes in regexes
pmurias fglock: could be 12:02
fglock pmurias: I added a --noperltidy option to script/kp6 12:02
pmurias & 12:06
fglock hmm - how to represent the environment when doing $closure.perl ? 12:09
agentzh fglock: js's version just prints the environmental variable referenced in the function body verbatim :) 12:11
fglock agentzh: same with pugs 12:15
I'll use that 12:16
agentzh :)
pmurias fglock: everything else in Onion works 12:47
s/works/compiles/
fglock pmurias: I'll take a look later 12:48
is it in Onion/ ?
pmurias v6-Onion 12:49
fglock: have you checked in --noperltidy? 12:50
fglock looking
pmurias: it is in v6-KindaPerl6/script/kp6 12:53
and Makefile.PL
KP6_TARGET=KP6-BOOT perl Makefile.PL 12:54
pmurias fglock: found it 12:57
avar -C'perl5 -notidy' 13:28
.oO( option syntax )
fglock lunch & 13:35
bbkr i wrote card 'war' game simulation (code at bbkr.org/~bbkr/card_war_game.pl) that shows some PERL6 features. do you think it's worth adding to examples? 16:20
[particle] sure! 16:21
avar bbkr: s/uniq operator/uniq method/ 16:22
bbkr ok 16:23
[particle] p5 question: can a block have multiple labels? 16:24
avar yes
[particle] what's the syntax? foo: bar: {...} ? 16:25
avar yes
blocks don't have labels, you can put them everywhere you put a statement
[particle] c:\usr\local\ack>perl -e"foo: bar: { 1 }"
syntax error at -e line 1, near "foo: bar:"
avar $ perl -wle 'loop: 1; loop_two: for (1..2) {}' 16:26
urgh
sh-3.1$ perl -wle 'loop: 1; loop_two: for (1..2) { last loop}'
Label not found for "last loop" at -e line 1.
sh-3.1$ perl -wle 'loop: 1; loop_two: for (1..2) { last loop_two }'
sh-3.1$
I'm wrong apperently
avar thinking in C
[particle] yeah, i'm used to c labelling too :( 16:27
funktio $ perl -le 'outer: { inner: for (1..2) { print } }'
[particle] i guess that's what i'll have to do. funktio++
avar loop: do {{ loop_two: for (1..2) { last loop } }} <= I think this works 16:28
funktio avar: Label not found for "last loop" at -e line 1. 16:29
[particle] yeah, do doesn't take labels
you can't use next or last inside do
avar you can if you have a do with two brackets 16:30
do {{ last }} 16:31
funktio interesting 16:32
[particle] i guess then you'd need do { label: { last label } }
funktio yeah, it's last()ing the bare block, not do
dlocaus [particle]: ping 19:02