6macros: discussing the finer points of Perl 6 macros, Qtrees, and how to stay sane | irclog: irclog.perlgeek.de/6macros/today
Set by moderator on 28 July 2015.
05:56 FROGGS joined 06:45 Ven joined
Ven 's trying to rebase etc 07:08
nope, giving up again. 07:10
it's making me fix the same conflict on <str> on the same line 10 times
okay, I think I did it actually 07:11
07:15 Ven joined 07:57 Ven joined 08:26 Ven joined 08:34 Ven joined 09:12 Ven joined 10:07 Ven joined 10:16 Ven joined 11:13 Ven joined 11:19 Ven joined 11:21 Ven joined 11:23 Ven joined 11:27 masak joined
masak I got logged out. I think a hack.p6c.org might've rebooted or something 11:28
masak backlogs
Ven: everything good rebase-wise?
Ven masak: look at the PR :P 11:29
masak oki
Ven and yes, moritz rebooted hack not too long ago
masak Ven: I'm currently working on property access, by the way.
Ven I just pushed the rebase
masak might mesh well with your PR :)
Ven I aborted the first rebase
re-rebased
and that one went well
vOv
masak github.com/masak/007/pull/37 11:30
why does the Travis build fail?
hm -- github.com/vendethiel/007/commit/9...82ed2dR105 11:32
stringification has moved from under you while you were working on that PR
it now looks like github.com/masak/007/issues/45
sorry 'bout the churn ;) lots of small stuffs happening on 007/master 11:33
Ven yeah, I know, I fixed it locally
I didn't push it yet
masak I'd still recommend you call the grammar rule 'property', not 'pair' 11:34
but, again, not gonna mergeblock you over it -- just gonna change it after the merge ;)
Ven renames stuff around 11:37
tests are green! ship it! 11:38
Ven is catching up on the CppCon videos as well 11:40
were was I headed at with this, already? I think I need the runtime stuff, and it'd be done?
masak yeah 11:42
before I merge, I'm planning to write a short list of things that are related to object literals and that are enabled/necessary once we merge your PR 11:43
I might even stick the list as a comment on the PR
Ven wrt the blog post 11:49
macro a { my $q = quasi { 3 }; quasi { say {{{ $a @ Expression }}}; }; a; 11:50
1) parse the quasi
2) splice $a in
3) replace the call to the macro with the spliced code
3) is uncontroversial 11:51
only the order of 1) and 2) might be 11:52
but if we do annotate the position, that's definitely to get this order
masak did you mean $q in both places? 11:58
Ven yeah. whoops :)
qwerty, azerty, probably
masak well, in the case of your code, you're lucky enough to have $q in the same scope as the unquote. in the cases where $q is a parameter, things have to be late-bound 11:59
and you have to do 1) first and 2) much later
that's basically the main point of the post
12:26 Ven joined 12:53 Ven joined
Ven yeah 12:56
that's the 3-lines summary
I don't think there's any other way to do it
masak right 12:57
hence, "abstract parsing"
you need to be able to, instead of feeding *text*/tokens to the parser, go "ok, let's say I gave you a... Q::Statement..." 12:58
and the parser would go "haode, then I would suddenly find myself in expect-the-next-statement mode"
$ perl6 bin/007 -e='my q = quasi { say("Three plus four is " ~ (3 + 4)) }; say(q.stmts()[0].expr().args()[0].rhs().lhs().value());' 13:22
3
\\o/
still got some cleanup to do, though... 13:23
13:32 Ven joined
Ven masak++ 13:44
masak pushed. 14:07
it should be quite easy to wire up that property lookup syntax to arbitrary object values 14:08
14:27 Ven joined
Ven wrt "let's say I give you a <..>" 14:43
wouldn't that mean you'd need to.. inject stuff to... fill in regexp?
token sub { 'sub' <name> <body> }; sub.inject(name => Q::...)
scary
masak yes, it's quite scary. the rabbit hole goes deep on this one. 14:48
like, #perl6 seems to agree that Qtrees will change action methods around a little. but this reveals that it'll change parsing around, too.
getting a good `is parsed` will probably necessitate that, as well 14:49
sometimes grammars feel like a slightly bad fit for this 14:51
but I don't see very clearly yet how it should all fit together
15:12 Ven joined
Ven well 15:12
it reminds me of jnthn's Grammar::Generative
but we only want to inject at some pos 15:13
like
[{has(Q::Block, 'block')} || <block>] 15:14
dunno
masak so, we're holding off on merging until github.com/vendethiel/007/commit/9...82ed2dR108 is in place, yes? 15:29
masak writes that list of things to do after the merge 15:30
Ven lol 15:42
student of mine said "I can write a json parser in 2 lines"
I got the brightest of them all :-)
I'm not sure how to go about eval, but I'll snoop around 15:43
16:02 FROGGS joined 19:07 vendethiel joined
masak I guess the eval from Val::Array is a bit close 23:49
let me know if you feel stuck, and I can help