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.
04:17 zarah joined, ascent_ joined 08:32 masak joined 13:00 ruoso joined 13:29 Matt-W left 16:02 ruoso joined 18:06 masak joined 18:12 viklund joined
masak viklund: hackathon! \\o/ 18:12
viklund masak: yahoo | 18:13
masak viklund: good try :P 18:14
ruoso masak, hi 18:19
masak ruoso: hello.
hackathon here tonight.
ruoso cool 18:20
masak we might do some porting of November to Web.pm, or some Hitomi implementation work.
haven't decided yet.
ruoso I was hoping pmichaud finish contextual vars, so I could rewrite your blog attempt using Faz
masak ruoso: looking forward to it.
ruoso but I probably need to write a compiler for the 18:21
controller Foo { action bar { ... } }
syntax
since rakudo doesn't support custom package_declarator and routine_declarator yet
masak seems we're going for the Hitomi prototype. 18:28
ruoso masak, in case you missed it.... I was able to work-around the lack of contextual variables 18:35
masak nice.
anything runnable?
ruoso yes 18:37
masak, I had pushed the last version just now
masak ok. 18:38
ruoso the example.pl shows how to access the request
masak will check.
ruoso the syntax is still bad...
because it is very verbose
but custom declarators will solve it in the long run
masak nice. 18:39
ruoso masak, notice the -> $name parameter in the viewblog closure
which is generated from the regex of the action
masak looks 18:40
ruoso you can have an arbitrary capturing in the regex
and that will be translated as arguments to the closures
also note that the Faz::Request class is just a placeholder... no actual type checking is made on it 18:41
ah... btw... in theory you can have named captures in the regex, which will then appear as named arguments to the closure 18:43
Tene masak: I noticed in my blog example that it would have been ideal to build an HTTP::Response, and ask Web to use that. 18:44
but that infrastructure isn't there 18:45
masak oh, pity. :/
what do you need?
ruoso yeah... the response object should be provided indeed
because it's the lower level that knows which kind of response should be provided 18:46
Tene something backend-neutral... like returning an H::R
all this $c.send-foo feels unwise to me 18:47
ruoso has the slight feeling that he and Tene are talking the opposite 18:48
Tene, you mean the response object to be provided alongside with the request?
or for the application to turn a abstract response into the actual low-level response?
s/application/framework/ 18:49
masak Tene: I'm not sure I see what you mean. I haven't looked closely at your code, only skimmed it.
Tene: please don't forget to blog about omgblog when you have time!
Tene: and please gloat appropriately about your 20 minutes compared to my 90. :)
the more fun it is to read, the better. :) 18:50
Tene ruoso: all I mean is that the app shouldn't have to know low-level details about the connection.
ruoso right...
but it should receive a response object and deal with it...
Tene yes
ruoso ok..
so we're saying the same thing...
Tene and my suggestion is for request() function to return an HTTP::Response object, or some such 18:51
I didn't see what you had been saying... no clue. :)
ruoso Tene, that's why contextual variables are for
you should be able to access the current request and response objects just as 18:52
$*request and $*response
Tene masak: OK, thanks for reminder... yesterday was hell.
should be able to tonight
ruoso: why context instead of just function arguments?
masak Tene: no worries. looking forward to the post.
ruoso Tene, because you would need to be sending them through a lot of methods...
and they are part of the current "context" 18:53
Tene OK
that sounds fine to me.
ruoso masak, I almost have yarn ported to FAz 19:35
masak ruoso: neat.
over here, we have gotten somewhere with the Hitomi prototype. 19:36
pair programming is very effective.
ruoso masak, http::daemon didn't work here... but I'll push the Faz version of yarn in faz' repo 19:40
masak ruoso: excellent.
ruoso masak, just pushed 19:42
see examples/yarn
masak ruoso: ok. 19:48
ruoso: you sure you pushed? 19:49
ruoso in faz repo, 19:50
not yarn's
masak ah, 'course.
masak runs proto update
ruoso Could not locate a method 'uri' to invoke on class 'Web::Request'. 19:51
hmmm
is it $request.path directly? 19:52
ah... 19:53
it's url
Could not locate a method 'url' to invoke on class 'Web::Request'. 19:55
not quite right yet
masak, any idea? 19:56
masak ruoso: sorry, distracted...
ruoso hmm... it seems the object returned by HTTP::Daemon has the url info, but, surprisingly, Web::Request hasn't 19:57
masak that's probably true. 20:00
ruoso any particular reason/ 20:01
?
masak Web::Request only has very minimal implementation so far.
only the bare necessities to work for Nibbler et al.
ruoso er...
masak aka "not entirely ported yet"
ruoso the url of the request is kinda minimal
masak I agree. 20:02
ruoso (btw... it's usually called uri)
masak I almost added it the other day.
ruoso: yes.
ruoso masak, do you think you could add a .uri support in request? 20:03
masak ruoso: sure.
but I'd rather not deviate too far from Rack without good reason.
ruoso I mean in Web::Request 20:04
not in the HTTP::Daemon part
masak yes, I understand.
Web::Request is modeled directly after Rack::Request.
ruoso I strongly suggest you take a look in Catalyst::Request
and HTTP::Body
masak will do.
ruoso masak, considering I'm playing with Faz+Yarn right now... do you think it would be possible for you to do the change in Web::Request soon? 20:07
masak ruoso: you'll have it by tomorrow. 20:08
ruoso: I'd do it now, but I don't want to interrupt the hackathon.
ruoso right... (but if you did, I would have Yarn+Faz working right away) 20:09
masak ruoso: you're very welcome to try and patch Web::Request yourself in the meantime. 20:13
ruoso is there a URI class? 20:15
masak in Web.pm? no. 20:16
yay, we've got pl:if working in Hitomi! 20:33
Tene sweet
masak it wasn't that hard, really, but it took some time to sort out all the loose ends.
viklund gist.github.com/110712 20:34
moritz_ that fails epically if you add other XML tags 20:46
my $str = '<ol pl:if="links">plink</ol><foo>sadf so</foo>';
=> Method 'postcircumfix:{ }' not found for invocant of class 'Failure'
masak moritz_: aye, viklund noticed exactly that.
the XML grammar is not very good. :/
moritz_ it should be <xmlcontent>* in rule node 20:47
masak aye.
ruoso: I will look more at your examples/yarn/yarn.pl tomorrow. it looks interesting. 20:49
ruoso masak, you probably want to take a look at lib/Yarn.pm 20:50
there's the interesting part...
;)
masak yes, I saw that. :)
ruoso I'm almost making it run... 20:51
one of the actions already partly works
masak cool.
did I mention that my version works? :P
ruoso heh... 20:52
masak just teasing, it really looks nice.
ruoso I'm struggling with the regex part for the / case
the /create already matches
masak I'm looking forward to looking at this, and at Faz, in detail. 20:53
ruoso: once it works, are you fine with me blogging about it?
ruoso for sure... 20:54
class URI { has $.path };
method uri { Web::Request::URI.new(:path(~%!env<SCRIPT_NAME>)) }
masak that's often a good way for me to grok things.
ruoso gah...
that was supposed to be in a paste bot...
but...
I'm doing that as a work-around for the missing uri method
but I guess we actually need a URI class to be implemente 20:55
masak ok.
November has one.
masak heads home to sleep
see y'all tomorrow!