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.
02:57 ilbot3 joined 15:53 ilbot3 joined 19:17 Ven`` joined
masak Ven``: I feel I need to add that I don't *know* for certain which model to go with (but I remember #212 tipping me firmly towards wrapping everything in blocks again), and that I'm very grateful to have someone to hash it out with 19:20
well. a short-term concern is "how can we make it work at all in 007?". a later concern is "what will be possible for Rakudo to adopt?" 19:21
Ven`` masak: I'm available right now if you want to discuss it 19:22
Ven`` is half-tempted to write a very simple Perl 6 grammar for a faux language that'd do that scope thing 19:27
oh, but you already did that, right?
github.com/masak/007/blob/master/s...ation/m.p6 19:29
masak only got so far 19:35
but yes, those are exactly the questions I'm exploring now 19:36
Ven`` is kinda tempted to take his own lisp-with-macro and try to add hygiene to add, if only to get a clue... 19:41
if we were to add scope to the variables themselves... how would we actually do that? 19:42
I'm starting to think about it, and I'm not actually sure.. 19:50
19:56 Ven` joined
masak if I correctly understand what you mean, it's what 007 has been doing for more than a year: Q::Identifier has an optional .frame for displacing the variable's scope 20:07
Ven` in which cases is it set? 20:09
masak it's set for variables that came from inside the quasi { ... } block 20:11
because those get displaced
20:12 Ven` joined
Ven` OK, but is that strictly for variables *directly* in the quasi block, or does it do that deeply? 20:13
masak depends what you mean
it holds for nested blocks in the quasi block
but not for unquotes
Ven` mh, I'm trying to get the result I want, but 007 is a tad slow :-P. 20:18
masak yeah, performance has never topped our priorirties... 20:19
Ven` well, it probably shouldn't. 20:22
Ok, so, for the example `macro f { quasi { sub g { my y = 4; } } }; f;` breaking, is the .frame flag use? 20:23
used*
masak good question 20:49
I think a balanced answer is that that is where the problems started, and I filed #212 to investigate 20:54
(sorry, keyboard trouble. my keyboard keeps emitting Rs even when I don't type them. had to type this in vim and then remove all the superfluous Rs.) 20:55
anyway, none of this is to say that a "Q::Identifier has a .frame" approach *can 20:56
't* work, just that #212 dug up big issues with it
Ven` right, yes 20:58
masak I think this is also what led me to want to understand scoping/quasis better 21:00
I can point to two major things I've learned since then: 21:01
1. injectiles (the fact that they even exist, and are necessary)
2. *some* kind of "refresh" seems necessary, not yet sure how
21:15 Ven` joined
Ven`` That's still a touchy subject. 21:28
I think the "refresh" is just going from an AST variable to a runtime one.