pugs.blogs.com | pugscode.org | pugs.kwiki.org | paste: sial.org/pbot/perl6 | <stevan> Moose... it's the new Camel ":P | .pmc == PPI source filters!
Set by Alias_ on 16 March 2006.
00:23 merlyn joined 00:30 vel joined 00:31 vel joined 00:48 Quell joined 00:56 justatheory joined 01:01 GabrielVieira joined
GabrielVieira buH 01:01
01:09 ruoso joined 01:16 jisom joined
TimToady ruoso: <foo> always captures. Use <?foo> to suppress named capture. 01:22
arcady increasingly complicated syntax... 01:32
svnbot6 r9715 | fglock++ | pX//PCR - /opp.pl - operator precedence parser prototype
01:40 vel joined 01:47 amnesiac joined, justatheory joined 03:19 hexmode joined 03:22 Quell joined 03:23 vel joined 04:09 FurnaceBoy_ joined 04:18 jisom_ joined, mako132_ joined 04:30 Khisanth joined 04:43 qu1j0t3 joined 04:50 jisom joined 04:56 iblechbot joined 05:40 christo joined 05:54 christo left 06:22 vel joined 06:26 zamolxes joined 06:27 LumberCartel joined 06:45 drrho joined 06:56 GeJ joined
GeJ good morning folks 06:56
LumberCartel Hello GeJ. 07:00
07:08 elmex joined 07:10 ghenry joined 07:13 Aankhen`` joined 07:44 GeJ joined 08:06 Draconit_ joined
ingy I just realized you can `use Module::Compile;` to force any module into a pmc 09:23
which is kind of cool 09:24
it reads correctly, for sure
09:25 elmex joined
gaal audreyt: ping 09:26
ingy gaal: I think she said she's at $job for 2 more hours
gaal k, thanks. (I have the weirdest bug with YAML::Syck, but I'm not very lucky in narrowing it down) 09:27
also, moose. 09:28
09:31 xinming joined
ingy gaal: sorry about your bug... elk 09:31
I have a nasty bug of my own... 09:32
also, elk.
gaal also, #moose 09:33
ingy joins #elk 09:34
gaal: ping 09:37
rgs #elk ? 09:38
gaal ingy: ponk
ingy rgs, yeah!
rgs I suppose you're on #moose too.
ingy should <Foo::DATA> dwim?
gaal I don't think it does in p5....? 09:39
ingy goes to see how he did it in Spoon
gaal rgs: you'd think that eh!
rgs Text after __DATA__ but may be read via the filehandle C<PACKNAME::DATA>,
where C<PACKNAME> is the package that was current when the __DATA__
token was encountered.
gaal urp? but there be more than one! 09:40
file1: package Moose; __DATA__ xyzzy file2: package Moose; __DATA__ xyzzyier
which one wins?
rgs "wins" ?
by default DATA means __PACKAGE__::DATA 09:41
gaal which DATA do I get if I read Moose::DATA from somewhere that 'use'd both?
ingy that's what I thought
rgs then you can have seek() problems
ingy why is everything always so frickin hard?
gaal rgs: but file ne namespace
ingy hates programming
rgs gaal: yes, but as __DATA__ stops compilation anyway, you have to cope 09:42
gaal nonono
rgs perl 6 is better for that
gaal I meant,
rgs hates programmers
gaal I have two files that enter the same namespace
rgs aah.
interesting situation.
ingy easy to test
rgs the last parsed one wins
gaal ah, totally unpredictable. joy (hardly unexpected) 09:43
ingy better that way I think 09:44
theorbtwo Are you generating these files? Then put the data in strings, not __DATA__.
rgs I suppose you can close Package::DATA to get what you want
gaal there should be better ways to talk about compilation units than to conflate them with packages
rgs certainly
gaal (I say that every once in a while :/) 09:45
?eval "here I am"
09:51 nothingmuch joined
ingy I'm an idiot 09:54
but y'all knew that
gaal but we love you anyhow
ingy yeah yeah
the good news is that the DATA section now works correctly in both .pm and .pmc 09:55
and its tested 09:56
the bad news is that you can't (currently) compile the DATA section
it is exempt from compilation
which is the right default behavior 09:57
but it'd be nice to do it if you wanted to
but I can add that some day 09:58
the problem is that if you Filter the DATA section it kills the DATA file handle
which may be a bug in F::U::C 09:59
nothingmuch what if you reseek it?
ingy nothingmuch: that'd be too simple :p
nothingmuch IIRC the data file handle is basically the same filedescriptor that perl(1) uses to read the .pm
and if it sees __DATA__ it stops reading, and makes it into a filehandle
if you're filtering that it keeps reading 10:00
ingy so you'd need to know that correct byte offset
nothingmuch so you need to reset it when you're done playing with it
my $offset = tell DATA;
....
seek $offset, 0;
seek DATA, $offset, 0; 10:01
ingy patch for another day
you should see that parsing gymastics M::C is doing to find the __DATA__ line 10:02
nothingmuch seek DATA, -length("__DATA__"), SEEK_CUR; ? 10:03
btw, 0 in the other seek means SEEK_SET 10:04
there's also SEEK_END
ingy I have to get away from @annoying_people_in_this_cafe
&
nothingmuch how are they annoying?
10:04 Southen_ joined
ingy nothingmuch: don't start with me 10:05
I'm in a terrible mood from running a blue pen through the dryer
nothingmuch ouch 10:06
i'm really interested though
what are they doing? bugging you every 2 mins/
ingy nothingmuch: knock it off 10:07
nothingmuch okay okay 10:08
10:27 happyman joined 10:33 rgs_ joined 10:42 integral joined 10:44 rgs joined 11:00 KingDiamond joined
svnbot6 r9716 | szabgab++ | add Hebrew name of Gabor 11:21
r9717 | fglock++ | pX/PCR/opp.pl - new methods 11:33
szbalint :) 11:36
GeJ integral: thank you, you're a true mōæ½xF8ōæ½xF8se indeed 11:48
...better
integral rofl :)
ingy elk 11:51
11:59 iblechbot joined 12:00 chris2 joined 12:13 nothingmuch joined 12:27 Aragone is now known as Arathorn 12:37 Aankh|Clone joined
GeJ I'm getting confused. Is there some doc about the proper use of moose and elk. Are they specced? 12:41
Arathorn they're not perl6, are they? (other than being backports of perl6ish ideas into cpan?) 12:56
12:57 chihchun joined 13:13 Aankh|Clone is now known as Aankhen``
svnbot6 r9721 | fglock++ | pX/PCR/opp - implemented prefix/circumfix/postcircumfix/..., left/right/list/... 13:15
13:23 gabor529 joined
svnbot6 r9722 | fglock++ | * pX/../Pugs-Compiler-Rule/opp.pl - operator precedence parser 13:30
r9722 | fglock++ | - cleanup, more examples
13:36 Limbic_Region joined, nnunley joined 13:44 pmichaud joined
fglock pmichaud: hi! 13:45
pmichaud hello, fglock
fglock pmichaud: I'm prototyping an op precedence parser - it builds a p6 grammar 13:47
pmichaud excellent
how do you mean "it builds a p6 grammar", though?
fglock pmichaud: run svn.openfoundry.org/pugs/misc/pX/Co...ule/opp.pl 13:48
nnunley Hrm.... The tests against rule2 in misc/pX/Common/Pugs-Compiler-Rule/t/06-subrule.t look wrong to me. (<rule1>*) should only have one capture, which is made up of 0 or more matchines on rule1, right? 13:49
pmichaud svn up's
fglock nnunley: right - I'll fix it later, sorry 13:50
nnunley I can commit the fix, actually. Just confirming that I understood it correctly.
pmichaud fglock: interesting. It looks like it'll end up being slow to execute, though (rec-descent parsing usually is) 13:51
13:51 elmex joined
fglock pmichaud: yes - but it can be optimized a bit, for eliminating redundant comparisons 13:51
svnbot6 r9724 | nnunley++ | Fix the capture syntax. 13:52
Limbic_Region that's what makes pugs pugs - optimized for fun -Ofun
pmichaud I originally built the p6 rules parser using rec-descent, and it was really slow -- much slower than I expected
Limbic_Region become feature complete first - then worry about speed
pmichaud hmmm, what is rule r3 { <r2> <[> <parse> <]> } ?
specifically, the <[> and <]> ...? 13:53
fglock pmichaud: it will be \[ and \] when I cleanup the code...
pmichaud ah, okay
Juerd Maybe that should have been <'['> (which terribly breaks my fingers)
pmichaud makes sense
Juerd (And that's why I want bare '[' in regexes, without the surrounding <>)
pmichaud I finished my rewrite of the opp in Parrot last night so that it'll be able to handle listops 13:55
fglock pmichaud: I'm trying to find out how to implement 'is parsed'
Juerd And then bare $foo can interpolate as a *rule*, because "$foo" would be very intuitive and simple to type
fglock pmichaud: cool
pmichaud fglock: I haven't completely figured out 'is parsed' yet myself :-)
13:57 Qiang joined
fglock pmichaud: I'll make a try :) 14:00
14:03 elmex_ joined
svnbot6 r9725 | fglock++ | pX/PCR/opp - added 'is parsed' 14:03
fglock I just found some bugs 14:04
theorbtwo There's a place for optimization ideas when initially writing code. 14:06
That place is comments.
fglock pmichaud: it looks ok now
svnbot6 r9726 | fglock++ | pX/PCR/opp.pl - all rules are optional 14:09
14:12 elmex__ joined 14:38 justatheory joined 14:53 kisu joined 14:54 cheburawka1 joined, cheburawka1 left 14:55 chris2 joined 15:13 vel joined
svnbot6 r9727 | szabgab++ | more string related test 15:16
r9727 | szabgab++ | split.t fails now in one place, maybe due to a bug in is_deeply ?
15:35 siosiosios joined 15:45 turrepurre joined 16:04 rindolf joined 16:07 hexmode joined
rindolf How do I do type annotations in Perl 6? 16:13
Hi all! BTW.
PerlJam hello rindolf. 16:16
nothingmuch rindolf: see synopsis 6, and 4 i think 16:18
or maybe that's 2
anyway, it's all in the synopses
16:20 xinming joined
gabor529 should $a.tr work the same way as $a.trans or is tr gone ? 16:24
16:30 FurnaceBoy joined
TimToady if tr still exists, it's only as a quote-like operator. The method is always .trans. 16:33
PerlJam If y/// goes away, I'll be fine with that, but I've grown accustomed to tr/// and its mnemonicness. 16:41
16:48 Lorn__ is now known as Lorn_ 16:59 nnunley joined 17:02 GabrielVieira joined
GabrielVieira hi 17:03
17:16 DesreveR joined 17:17 bernhard joined
FurnaceBoy hi 17:22
GabrielVieira :) 17:24
17:25 jisom joined 17:34 amnesiac joined 17:36 SamB joined 17:48 ruoso joined 17:49 Guest37849 joined 18:01 ghenry joined
ruoso fglock, about test 06-subrule.t... the "fix" of the test in fact hidden the bug I wanted to show... 18:01
18:02 KingDiamond joined
ruoso fglock, I added 2 more tests to reveal the problem again... 18:03
svnbot6 r9728 | iblech++ | Usual svn props.
r9729 | ruoso++ | two more tests to 06-subrule.t... quantified subrules should return an array
ruoso in /(<rule>*)/... should $0 be an ARRAY, or only $0<rule>? 18:09
18:10 justatheory joined
rindolf nothingmuch: what is Q&D? 18:14
nothingmuch: in the context of search.cpan.org/dist/Test-TAP-Model...P/Model.pm 18:16
18:17 nothingmuch joined
TimToady ruoso: ordinarily $0 would represent a string, if you're matching against a string. 18:18
svnbot6 r9730 | iblech++ | * Restored PIL2JS so my planned live-demo at the Augsburger Linux-Infotag 2006 18:19
r9730 | iblech++ | (tomorrow; www.luga.de/Aktionen/LIT-2006/) works :)
r9730 | iblech++ | * The %PackageName::EXPORTS hashes are not declared properly on the
r9730 | iblech++ | -CPIL1-side, causing JS to abort while trying to access one of these
r9730 | iblech++ | hashes. Worked around.
r9730 | iblech++ | * use(...) is macro, defined in the P6 Prelude; it's no longer a magical
r9730 | iblech++ | Pugs.Prim. Remedy:
r9730 | iblech++ | * Manually declare a &use macro via -e 'macro use'...
r9730 | iblech++ | * Use -e 'use Foo;' instead of -MFoo (-M circumvents our macro).
r9730 | iblech++ | * (This is done automatically in PIL2JS.pm.)
r9730 | iblech++ | * Remaining problem (requiring DrIFT skills):
r9730 | iblech++ | Compiling Test.pm fails, as pugs attempts to emit a VCode. This is because
r9730 | iblech++ | there isn't a DrIFT instance for emitting VCodes.
r9730 | iblech++ | Adding a dummy instance works around this problem -- see
r9730 | iblech++ | perl5/PIL2JS/vcode-emission-hack.patch -- but unfortunately I don't know how
r9730 | iblech++ | to integrate this hack into src/Pugs/Internals.hs, from which
r9730 | iblech++ | src/Pugs/AST/Internals/Instances.hs is generated from.
r9730 | iblech++ | * Summary: With perl5/PIL2JS/vcode-emission-hack.patch applied, PIL2JS works
r9730 | iblech++ | again! :)
ruoso TimToady, but... what if <rule> returns a hash? 18:20
TimToady, like in P::C::R/t/06-subrule.t
TimToady, ok, this test does not returns a test
a hash, I mean 18:21
but basically... rule rule1 { \w }... rule rule2 { (<rule1>*) }...
if I match rule2 with abc
which would be the value of $0 18:22
"abc"?
or an array?
even if $0<rule1> is an array?
TimToady "abc". $0<rule1> would, I think, be the array of <rule2> match objects. 18:23
Now if you'd said (<rule1>)* it'd be the other way.
Or, actually, $0 would just be "a", $1, "b", etc. 18:24
assuming my caffeine level is high enough to actually think rationally.
ruoso $0 = 'a', $1 = 'b' is a little weird... 18:25
TimToady I'm not thinking straight. $0 would hold the array of matches in that case.
there's only one paren there, so it and everything it matches is accessed through $0. 18:26
s/paren/parenpair/
S05 should be clear on these things, but if not, we need to fix it. 18:27
bbiab--obviously need more caffeine... 18:28
ruoso TimToady, what I don't understand is what happens when in (<subrule>*) the subrule returns a hash....
what would $0 looks like 18:29
TimToady returns as in { return %foo } ?
or returns as in the Match object has named subrules?
those are different cases.
ruoso TimToady, as in rule { \w { return { char => 'a' } } 18:30
TimToady the first case you'd use $0<subrule>()<subkey> while the second is just $0<subrule><subsubrule>
unless there's an extra [0] in the middle there or some such.
ruoso but... what would $0 looks like? the string that matched? even if I explict returned something differrent? 18:31
TimToady $0 is always a Match object. You can use $0 as a string, it's going to evaluate { char => 'a' } in a string context if that is what is returned from a top-level rule. If it's returned from a lower-level rule, it's hidden in the %$/ somewhere, and the top level is just the matched string. 18:33
svnbot6 r9731 | ruoso++ | better defined tests
TimToady caffeine & 18:34
svnbot6 r9732 | ruoso++ | oops... the third test is redundant
18:45 Limbic_Region joined
TimToady s{hidden in the %$/}{hidden in the %$0} 18:46
18:50 elmex joined
TimToady Juerd: bare $foo must *not* interpolate as a rule, or you break $1 18:54
Limbic_Region offers TimToady 3 quarters, 2 dimes and a nickel 18:55
TimToady Thief to Judge: "But Your Honor, I thought the change would do me good." 18:56
Limbic_Region Judge to Thief: "So you won't mind doing a time in SingSing" 18:57
err s/time/dime/
wow - that lost any possibility for humor
TimToady and we give no quarter in that quarter...
Limbic_Region: the problem with "feature complete before fast" when it comes to recursive descent parsers is that it's really hard to insert new precedence levels, whereas if you target operator precedence in the middle from the start, it becomes almost trivial. 18:59
19:00 mago joined
TimToady Juerd: and while '[' is pretty, I really am trying to resist the urge to turn every non-alphanumeric character into a metacharacter... 19:02
Limbic_Region TimToady - then it isn't feature complete if one of your features is adaptability 19:11
TimToady one could define "adaptability" as the ability to withstand not being feature complete. 19:15
Limbic_Region yeah - I understand pmichaud's perspective
he went down that road - discovered that it didn't meet his needs for 2 reasons (speed and adaptability) 19:16
and was trying to help fglock out
TimToady indeed. pm is just dishing out what I "dished in" to him some time back... :) 19:17
Limbic_Region some lessons are better learned first hand 19:18
see
TimToady certainly.
Limbic_Region you learned it by doing it wrong first, pmichaud learned it by doing it wrong first, and now fglock will
TimToady which is basically the general course of parsing technology in CompSci in general, except... 19:19
that CS over-reacted and went to pure bottom-up (partly because of hardware limitations). 19:20
but I think the most humane way of parsing is a mixture of bottom up and top down.
nothingmuch nothingmuch.woobling.org/Context-Handle/
please comment, anyone
Limbic_Region is interested in hearing more but has to wander off for a bit 19:21
19:21 Phiend joined
TimToady nothingmuch: personally I think use of "Want" is a code smell, since it will always break eventually in any language that is not completely lazy. But maybe that's just me... 19:29
rindolf nothingmuch: hi!
nothingmuch: can I ask you some questions about Test::TAP::Model and Test::TAP::HTMLMatrix?
nothingmuch hi rindolf 19:31
sure
TimToady: that's why i tried to encapsulate it
rindolf nothingmuch: what is the purpose of the run() method?
nothingmuch: I don't see it called anywhere.
nothingmuch TimToady: i would like code smell to stay in just one place =)
preferably a module with a responsible maintainer
(not me ;-)
rindolf: it's what runs tests
TimToady sounds good--kinda like my approach to dwimmery: try to keep it all in one place
nothingmuch remember that this Test::TAP::Model is a subclass of Straps 19:32
or is it the other run?
TimToady (or in three or four places, in the case of Perl 6)
nothingmuch TimToady: i've typed wantarray, Want, want("FOO") and all that too many times when I was just trying to delegate.. that's what this module is solving
rindolf nothingmuch: there isn't a run in Straps either.
nothingmuch rindolf: look at the example in the top of the dist
then it's akin to run_tests in Harness itself
i don't really remember 19:33
but if it's there it's being used ;-)
especially with such an important name
in which package is this run?
run
This method runs the list of tests returned by get_tests.
this is from the TTM docs
rindolf nothingmuch: it's in Test::TAP::Model
nothingmuch okay 19:34
so that's the docs
rindolf nothingmuch: is it part of the Pugs usage?
nothingmuch i think it's a refactoring on top of Straps
no, TTM is completely generic
it's got nothing to do with pugs
rindolf nothingmuch: I See. 19:35
nothingmuch: so it's part of the interface, but not used by Pugs.
nothingmuch right
oh
no
rindolf nothingmuch: I see.
nothingmuch it's part of the interface
it may be used by pugs
i can't remember
oh
i remember
if you subclass Test::TAP::Model and you provide the get_tests method 19:36
then ->run will invoke run_tests( $self->get_tests );
this is both documented and readable in source, btw 19:37
rindolf nothingmuch: yes 19:39
svnbot6 r9733 | fglock++ | * pX/PCR/opp.pl - optimized for less backtracking 20:08
20:25 macli joined 20:33 GeJ joined 20:48 ruz joined 20:52 osfameron joined, sky_ joined 20:58 lisppaste3 joined
svnbot6 r9734 | iblech++ | * Added my updated "Perl 6, genau jetzt!" talk for the 6. Augsburger 21:20
r9734 | iblech++ | Linux-Infotag 2006 to docs/talks/README.
r9734 | iblech++ | * BTW, Audrey, you might be interested in my takahashi->LaTeX-preprocessor:
r9734 | iblech++ | xrl.us/takahashi2latex
r9734 | iblech++ | See xrl.us/lit06perl6sources for example sources (:sy off; very long
r9734 | iblech++ | lines). :)
gaal iblech! :) 21:30
pasteling "fglock" at 200.17.89.80 pasted "grammar generated by the opp.pl" (8 lines, 296B) at sial.org/pbot/16480 21:40
ruoso fglock, I was, at home, working out to make 'concat' rule op stop generating a new match object, but add the sub-matches to the parent match if match... what do you think about it 21:53
?
gaal iblech: got a test case for Test.pm not being broken? 21:54
ah, got it 21:56
21:59 weinig joined
fglock ruoso: it worked this way - but it is simpler to just create 'binary' matches 22:02
ruoso fglock, to create, maybe... to use it later... certinly not... :) 22:03
06-subrule.t now represents the need for it...
fglock, actually I was in doubt of * being implemented with [+]?
isn't it the opposite? 22:04
I mean, .+ is a shortcut to ..*
fglock ruoso: I'm too tired to find out :) - I just came from class 22:06
TimToady Not if . is really (foo). (foo)+ is different from (foo)(foo)*
ruoso fglock, but take a look at 06-subrule.t later... this is my point now... 22:07
TimToady It's the same general "you can rewrite this as that provided you ignore side effects" trick.
0 < func() < 10, or func() += 10 are other cases 22:08
ruoso TimToady, I see...
theorbtwo OTOH, .+ really is exactly eqiv to .{1,}, for any value of C<.>. 22:09
Erm, however you say that in p6-rules.
...and just plain . is equiv to .{1,1}. 22:10
TimToady yes. at one point we distinguised .? from .**{1} but lately we unified those too.
/guised/guished/ 22:11
theorbtwo .**{1} ?
TimToady s/^/s/
p5's .{1} is written .**{ something returning range }
where 1 is a degenerate range
22:11 nothingmuch joined
theorbtwo Ah, right. 22:11
TimToady but it's a general closure, as most anything in curlies is these days. 22:12
sorry, I meant .**{0..1} above there to be equiv to .? 22:13
Initial A5 had .? returning scalar that might be undef, but now it always returns a list of 0 or 1 elements, just like .**{0..1} 22:14
theorbtwo Ah, I grok now. 22:15
PerlJam .**{0..1} looks like so much syntax for something so simple 22:18
fglock ruoso: .* tries inf,..2,1,0 ('.+' or null); .*? tries 0,1,2... (null or '+?')
ruoso fglock, ok... 22:19
22:19 FurnaceBoy joined
theorbtwo PerlJam: So write .?, which is exactly the same thing. 22:20
TimToady PerlJam: the point is to Huffman code it according to frequence of usage, and the general form just isn't used often enough to justify a shorter syntax, especially since we want the closure to actually be a closure, but recognizably not of the other closure forms. 22:21
theorbtwo Hm, .*{closure} or .x{closure} is numonic with the "times" operator. 22:23
TimToady but ambiguous with .* {closure} unless you force space there.
** is illegal in current regexen, at least.
but yes, .*{...} is certainly one of the forms we considered... 22:24
theorbtwo OK.
theorbtwo isn't seriously suggesting things, just kind of thinking aloud. 22:25
TimToady np
theorbtwo ...while avoiding thinking about how to represent "nets" in ktechlab.
(Think wires && edges on a graph.) 22:26
22:32 chromatic joined
chromatic www.oreillynet.com/onlamp/blog/2006...tools.html 22:32
I figured that a short explanation of TGE and such might be interesting.
PerlJam chromatic++ 22:33
fglock chromatic: I was about to ask where I could read about p6 parsing strategies
chromatic Reading the Punie code is instructive, once you know what the pieces are and how they fit together... if you know PIR. 22:34
PerlJam There are far too many P-things these days parrot ponie punie past post pir pasm pppppp 22:36
chromatic: Does that mean that there's a punie-explained post in the future? :) 22:37
chromatic Possibly.
Perhaps. 22:38
Potentially.
nothingmuch nothingmuch.woobling.org/Config-Pac...Global-OO/ 22:39
please comment
fglock I'm looking for an explanation on where to use bottom-up/operator-precedence/top-down in p6 parsing 22:42
I have a general idea, but maybe someone have written about this 22:43
PerlJam fglock: that would be an interesting post too, if someone would write it up.
22:45 fglock left 22:46 fglock joined
TimToady fglock: groups.google.com/group/perl.perl6....1b5148c6b3 22:48
has some about it.
PerlJam is trying to cajole pmichaud into writing a short article on it, but he's too busy. 22:50
nothingmuch quotes TimToady from the hackathon:
top down when needed
bottom up when possible
jsut like the dynamic/static issue =)
if the parser fails bottom up it will try again top down 22:51
for better errors
and other stuff which I don't remember
23:05 ruoso joined 23:23 pdcawley_ joined 23:45 Khisanth joined
ruoso preparing a talk about the monastery 23:49