2009 -- the year of November. <november-wiki.org> <github.com/viklund/november> <irclog.perlgeek.de/november-wiki> <nopaste.snit.ch>
Set by moderator on 7 April 2009.
Tene zarah: msg masak Check out this grammar/actions for parsing hitomi stuff: gist.github.com/102833 00:05
zarah Tene: You have no new messages.
Tene zarah: tell masak Check out this grammar/actions for parsing hitomi stuff: gist.github.com/102833
zarah Consider it noted.
00:34 sri_kraih joined 04:06 sri_kraih_ joined 07:10 masak joined
masak Tene: re xml grammar/actions: cool! will try it. 07:12
Tene not sure what you wanted to do with it, but that looks more productive than the approach you had in the hitomi draft 07:13
moritz_ masak: I've just done some action method hacking for JSON - now that pmichaud++ fixed the segfault, they are a nice alternative aagain
github.com/moritz/json/ 07:14
zarah moritz_'s link is also tinyurl.com/daxza8
masak Tene: I'm sure it is. :) though at this point, before trying the code, I'm not sure how you managed to make actions do what we need. I've yet to figure out how in my mind.
moritz_: nice. 07:15
Tene moritz_: I also got some work done on my POE-alike
moritz_ afk
Tene erm, masak
masak aye, I realized.
Tene tab-complete--
masak Tene: this week for Web.pm, I'll primarily look at November, and try to make it use Web.pm for Requests and Responses. 07:16
will also try to think of what else we need in terms of basic structure.
Tene pleasedieinafire.net:2080/43608 07:17
zarah Tene's link is also tinyurl.com/dhnvdq
masak looks good. 07:18
Tene long way to go, but still fun.
oh, want me to commit that hitomi draft?
masak due to the nature of how pick() currently works/is specced, that one will fail if you restrict the $name param to Str. :)
Tene: yes, please. 07:19
Tene: and a general go-ahead on all similar requests in the future.
Tene Okay.
masak it's source-controlled, and we want as much of our ideas as possible in there.
Tene Okay, then I'll feel free to stomp all over your stuff. :) 07:20
masak absolutely. 07:21
masak tries Tene's Hitomi prototype
Tene: okay, so it does do what my parser did, but not what I tried to make it do. what that was might not have been entirely clear. 07:25
what I tried to make it do was to react on those pe:if and pe:for attributes. 07:26
Tene masak: I wasn't really clear on what you wanted it to do, so I just built a tree of XML nodes.
masak aye.
this is a good start, at least. I like that we're using actions; that seems like a generally good idea. 07:27
Tene nodnod
masak we're mangling whitespace right now. that's not good.
and the big thing will be when we can parse and react on the pe: attributes. 07:28
masak looks at hitomi-example.xml
so, my idea was something like this: the value of a pe:if attribute is a runnable Perl 6 expression. 07:29
in this case, it tries to call the sub 'links'.
Tene will there only ever be one pe:xxx attr in a node? 07:30
masak I'm not 100% sure how the connection between the templating and the rest of the program will work here, so I'm being deliberately minimal.
Tene: I think so.
don't see when several are needed.
Tene OK
masak having several should probably be an error, at least for now.
Tene Should be pretty easy, then. Find any pe:xxx in the attrs, and then have a dispatch table, maybe with 'when' 07:31
masak and let's start with pe:if and pe:for, because those are the only two I know about.
Tene someone should also combine <node> amd <empty>
moritz_ if you're mangling whitespaces, it means that somebody doesn't use .chunks as they should :-)
masak moritz_: not sure we can use it all the way here.
moritz_: we're interested in the XML hierarchy as well. 07:32
Tene I wasn't really intending to reserialize it exactly like that... that was just a demo to show that we had the full tree.
masak specifically, we want to intervene at those pe:xxx stops.
moritz_ masak: .chunks returns match objects for captures
masak moritz_: aha. cool.
so the value of a pe:if attr is a Perl 6 expression, whereas the value of a pe:for is the part that can appear between 'for ' and ' {' in Perl 6. 07:33
not sure how we'll enforce that, yet. 07:34
would probably be best to hook into Rakudo's Perl 6 parser somehow.
ok, so one of the goals for today is to make the Hitomi prototype work with the example XML and an example 'list' sub. 07:35
I'll go make the latter now.
s/list/links/ 07:36
moritz_ eval?
masak moritz_: Perl 6 injection.
in a user-written template, but still. 07:37
not ideal.
moritz_ then you shouldn't make Perl 6 syntax a feature
masak moritz_: I just want it to accept what it's meant to accept, and nothing more. 07:38
something like <EXPR> -> <SIGNATURE>
moritz_ you know, Template::Toolkit ended up parsing its own crappy Perl 5 dialect 07:39
masak aye. let's not do that.
moritz_ I really want to avoid that :-)
masak we have a built-in parser in Perl 6.
let's use it.
moritz_ many catalyst examples actually trigger database queries from the templates 07:40
that's... scary
masak hm. 07:41
sounds a bit too powerful.
moritz_ actually I worry about error handling, for example 07:42
well, it allows method calls
and DBIx::Class defers DB queries until the point where they are needed
masak error handling in templates?
moritz_ well, if your template triggers a database error, where will you handle it? 07:43
masak right.
moritz_ at that point you already left the Controller method
masak until I see the need, I don't plan to do database queries from templates.
will ask mst about it, though. 07:44
gist.github.com/103016 # example sub 'links' 07:58
Tene I know I can make it work… but I need to go to sleep. 08:01
If you don't have it done by the next time I have time available, I'll work on it.
masak goodie. 08:02
I'll give it a try.
need to learn about .chunks and actions anyway. :)
Tene: sleep well.
Tene yeah, I'm a lot less knowledgeable about that .chunks stuff...
if you could get it to preserve whitespace and such, that would be awesome 08:03
moritz_ I've used .chunks earlier today for processing the <string> rule in json
11:02 zarah joined 11:21 zarah joined, ascent_ joined 11:25 wayland76 joined 11:49 ruoso joined 15:53 omega joined
masak @tell Tene I had high hopes for being able to traverse the XML tree, but I had to give up. heading home now -- you are welcome to give it a go. 16:10
zarah Consider it noted.
Tene what are you wanting to do with it, exactly? 16:11
zarah Tene: You have new messages. Write '/msg zarah @messages' to read them.
Tene @massage
masak Tene: hm, I explained it in detail on #perl6. will link to that explanation, hold on.
zarah Tene: 51 s ago, masak said I had high hopes for being able to traverse the XML tree, but I had to give up. heading home now -- you are welcome to give it a go.
masak irclog.perlgeek.de/perl6/2009-04-28#i_1100539 16:12
zarah masak's link is also tinyurl.com/d3kpl9
masak for now, it'd be enough if it did the first thing flawlessly, and then just shouted "SPECIAL" or something as soon as it found a 'pe:' attribute. 16:13
for extra bonus points, it would actually DTRT with the 'links' sub I posted earlier. 16:14
masak packs up and heads home 16:15
23:56 moritz_ joined