00:02 lucasb left 07:46 Ven`` joined 08:44 Ven`` left 09:33 Ven`` joined
Ven`` This was less obvious than I thought it'd be. But: gist.github.com/vendethiel/93257a2...2c5b770568 09:33
I think one of the interesting things is `(position n ',params..)`. I "bring" params in from the outer context (which probably wouldn't be necessary) and I replace it the nth argument from the definee macro 09:34
the reason why I don't need to return an unquote is interesting too I guess 09:37
09:46 Ven`` left 13:14 lucasb joined 13:20 Ven`` joined 13:27 Ven`` left 13:40 Ven`` joined
Ven`` OK, I have something that's more... visually helpful. 14:16
I added a html file to that gist, that shows the "phases" 14:17
14:17 Ven`` left
masak interesting 14:52
so... that `,body on the last line, it unquotes _all the way out_, not just one level of backtick?
(because that's basically what TimToady told me those many years ago, the bastard) 14:53
and, I mean, I agree with that nowadays 14:56
"you can only make holes in your outermost surrounding quasi"
15:47 Ven`` joined
Ven`` masak: er, not quite 15:47
when we're 2 levels deep (pink) in that `(progn...), we first escape back to level 1 (green) via ,@ 15:48
and then inside that level 1, we use "," again, so we escape from level 1 into level 0 (blue)
the color for the bunch of parens at the end is wrong, my bad
you can only escape one level *at a time*, but chaining is a-ok) 15:50
(I should've written something to do it for me so I wouldn't have to colorize it manually, but heh, yak-shaving...)
Ven`` represses the urge to do it now 15:51
17:00 Ven`` left 17:29 Ven`` joined
Ven`` masak: ok, I finally got it. You were right. The unquote we're creating on-the-fly makes no sense 17:32
but the mistake I believe we made is that we codewalk at the macro-generating-macro level, instead of the generated-macro one
so we have *no ways* to talk about the generatee's arguments. And that's where I got stuck for a bit writing my CL macro 17:33
if we return a defmacro instead, then *that* defmacro is a quasi, and *then* the unquote makes sense (but isn't actually needed since we can then just refer to arguments) 17:34
I added an Alma version to that gist. Please tell me if it makes sense. I think it does. 17:38
(this *is* sidestepping the problem, but I think my intuition was wrong because I was thinking "I know I can make that work in Lisp" rather than "I know this very specific thing works in Lisp")
(Now that I look back at the code I wrote during PerlCon, I'm not sure how I ended up being so confused, because pseudocode I wrote on the 1st or 2nd day did that find-pos-and-replace thing. Just not across phase boundaries) 18:50
19:24 Ven`` left
masak looks right to me, if we compensate for the inevitable handwaving that we have at present 19:53
I'm currently confused at line 4: `walk(` 19:54
oh!
that's clever
right, 'cus you're code-generating right in the macro... oooh 19:55
Ven``: I *like* you when you take Alma's particular constituents and run with them 19:56
somehow I feel like you just did something no-one's done with Alma before. something genuinely new 19:57
a walk() in a macro in a quasi...
recovering from that one: does the fact that we avoided generating unquotes during the walk this time mean that there's _always_ a way to avoid generating unquotes during a walk, or that we were lucky this time? 19:59