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.
Ven ugh, there I am, writing clojure and all, and forgetting 00:07
(defmacro x [] `(defn foo [] 1))
isn't going to work as intended *at all*
well, not from another namespace at least 00:09
masak: of note clojuredocs.org/clojure.walk/postwalk-replace 00:13
also hubpages.com/technology/Clojure-mac...ing-macros 00:14
00:16 Ven_ joined 00:18 FROGGS joined 00:50 FROGGS joined 02:32 pdcawley joined 02:48 ilbot3 joined
masak ...and we're back. 07:13
having slept on it, I'm not too worried about the linter problems. 07:15
I even have a hypothesis that doesn't require the world to be too screwed up and action-at-a-distance-y 07:16
namely that *something* in a for loop is going down the 'object term' parsing branch before it goes down the 'for loop body' branch 07:17
gonna re-enable those tests and test it now
...yes, that seems to be it. 07:21
in other words, allowing that whitespace after the '{' made term:objcet suddenly start to parse but then fail in the middle, but not before it had some other side effect that caused the linter test to fail 07:22
masak mumbles a Diax's Rake 07:24
well, there are two smaller mysteries inside that solved mystery: 07:25
(a) what (inside statement:for) calls term:object ?
(b) what (inside term:object) screws up the linter test ?
as to (a), it's the added logic that catches and throws an error on `say 1, 2` listop calls. 07:28
added a guard -- that fixes it. 07:30
that whole clause there is too big, though, and screws up the elegance of the EXPR rule
will open an issue about that 07:31
$ perl6 bin/007 -e='my agent = { speak() { say("Bond") } }; agent.speak()' 07:34
Type check failed in binding key; expected Str but got Q::Identifier
in block at /home/masak/ours/007/lib/_007/Q.pm:351
that's this line, by the way:
$obj.properties{$.ident} // die "no such property: $.ident";
(the line where I said it looked like it should say $.ident.name 07:35
)
changing it to that makes it work. 07:36
...but now there's a test failure. interesting. 07:44
oh. it was a malformed AST in the test. phew. 07:46
(it said `"a"` instead of `(ident "a")`)
07:46 FROGGS joined
masak getting off the train, bbl & 07:46
yeah, the whole "illegal listop" detection shenanigans gets a whole lot more brittle and dangerous once we have object syntax colliding with block syntax. 10:02
*especially* since many of the normal statement forms are <sym> <EXPR> <pblock>
I think I'm going to roll back 48eb3d immediately after this merge. it's not worth the heartache just for the nice error message. 10:03
ven/Ven_/vendethiel: please have a look-through/meta-review: github.com/masak/007/commit/2fbc86...509e062ead 10:06
if you're happy with what you see, I will merge into master. 10:07
masak starts a branch with the-things-to-do-after-merge 10:16
13:33 vendethiel joined
vendethiel had no idea you could "commit with", tbh :) 13:37
you were right to fix the Str/Identifier mismatch. The code was written that way on purpose, but with misunderstanding
14:08 Ven joined
masak "commit with" is just person A doing commit and person B doing amend (or rebase or cherry-pick) 14:09
Ven: re Str/Identifier -- basically, Str isn't an exposed "thing" in 007, neither on the Q level or on the Val level. it can only exist as an internal implementation detail. so when I saw it "bare" in the test AST it immediately stood out as amiss. 14:13
Ven fair enough :)
I admit I didn't generate a tree to try it
masak github.com/masak/007/commit/2fbc86...t-14381492 -- good point
and only now do I see that we only test for "some error", which is not a good test :) 14:14
Ven :)
masak fixing
Ven I should've assert-match'd
masak _007::Test has is-error for this
but it basically requires you to go and create the X:: type too 14:15
I might do that while I'm at it
Ven ..yeah, might be good to do it now 14:16
not letting it linger
masak aye
Ven I have some macro talk for after that
masak looking forward to it
I'm on a train, so my replies will be intermittent
Ven ah, ok 14:17
going back home? You seen to be back to a timezone alike mine
(maybe you checked the two links I left yesterday?.. or rather early this night?)
masak I'm back to UTC+01:00, yes. 14:19
didn't check the links yet.
Ven ok :) 14:20
masak heh -- the AST was more wrong (missing a `stexpr`), further hammering down the "don't test for general failure" point ;) 14:21
passed -- running general `prove`. 14:23
Ven: new and improved, please double check: github.com/masak/007/commit/fd02a5...3354aad6ac 14:28
Ven <?{ $<termish>[*-1].ast ~~ Q::Identifier }> 14:29
I'm not sure what's that for, btw?
masak it's a stopgap thing to placate the failing linter tests
Ven ok
masak I have a commit here to apply after your merge
that removes that whole error checking
Ven ok!
masak and makes EXPR nice and simple again
Ven good
looks good!
:) 14:30
masak merged, pushed.
Ven++
Ven \\o/ 14:31
sorry for the time it took, though 14:32
masak np
also pushed the queud-up commits :)
getting off the train soon :)
a high-ish priority is to handle the check list in that PR 14:33
culminating in an updated web page
Ven don't you want to move that checklist to the issue instead?
masak yes, good idea. please feel free to. 14:34
detrain &
Ven did do done 14:57
15:50 Ven joined 16:12 Ven joined
Ven I'm just gonna start talking, and preface with: this is in context of a clojure project github.com/vendethiel/ideas-luminus.clj 16:27
I've been toying with this project for a LONG time, as the first commit was in april 2014 16:28
still, I didn't get much done, because I felt like I didn't get to have much fun. So I decided to use macros (obvious!)
as the project is web-based, I decided to write some macros to automate the CRUD stuff yet 16:30
so, of course, I started writing a macro that read: `(defn foo-bar [] ...)
..that didn't go well 16:31
the walker appends the namespace to any identifier. so when used from another module, it declared my-macros/foo-bar, and didn't work at all, of course. 16:32
so, I used name. an example of such an use can be found here: stackoverflow.com/questions/7650458...in-a-macro
(I changed my solution since then in my repo)
if that reminds you of lexical scopes in p6 (clojure also is, but its lexical scope is `let`-based) and name <=> melt, well, same for me ;-) 16:33
16:51 Ven joined 17:14 Ven joined
masak interesting. will look more closely later. 17:41
20:17 FROGGS joined
masak as for the SO question/answer, I think I understand both the question and answer roughly. but I'm still a slow reader when it comes to anything with Scheme and quasiquoting. 21:14
23:29 pdcawley_ joined