Perl 6 - the future is here, just unevenly distributed

IRC log for #6macros, 2015-07-18

| Channels | #6macros index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:36 vendethiel joined #6macros
04:36 vendethiel joined #6macros
05:56 vendethiel joined #6macros
06:36 vendethiel joined #6macros
07:41 vendethiel joined #6macros
09:53 vendethiel joined #6macros
22:19 * vendethiel pings masak
22:22 masak pong.
22:23 vendethiel masak: how hard would it be to convert that S17-improvements gist into macroooos?
22:23 vendethiel :D
22:23 masak would probably be an interesting exercise.
22:23 masak I mean, they are just syntactic sugar, after all.
22:24 vendethiel exactly
22:24 masak macros in their current form are not up for it.
22:24 masak but the keyword + expr + block thing is very very common.
22:24 masak I want macros to do that.
22:24 vendethiel no, but that hasn't stopped me in the past either
22:24 masak I have next to no idea how
22:27 vendethiel masak: with your "COMPILING.^declare-var" proposal
22:27 vendethiel how does it fit if I want lexical variable?
22:27 vendethiel as in
22:27 vendethiel quasi { my $a; {{{ $stuff-with-a }}}; }
22:28 masak well, first off, whatever's in your $stuff-with-a AST will have a hard time seeing your `my $a;`, due to hygiene.
22:28 vendethiel that's my question
22:29 masak it's a good question.
22:29 masak see, the COMPILING:: and :COMPILING things are always discussed in the context of quasis, never in the context of unquotes.
22:29 masak I'll need to ponder that one a bit.
22:32 masak well, ok:
22:32 masak (a) it seems there's a real need.
22:32 vendethiel i'm writing up something :)
22:32 masak (b) maybe AST "hardening" will actually make this one work out automatically.
22:39 vendethiel I kinda like where I'm going with my gist.
22:39 vendethiel except for the var.
22:41 masak there are two kinds of AST, based on how they're built.
22:41 masak "natural" ASTs come from actual source code in the program. they have an environment because everything in the source code does.
22:42 masak "synthetic" ASTs are built up from parts. the parts don't have an environment, and so neither does the AST.
22:42 vendethiel scala is interesting in this regards
22:42 masak but it needs one when it's spliced in, and so it gets one at the last minute -- the one of the surrounding code.
22:43 masak in that sense, synthetic ASTs are actually rather unhygienic. but I think that's good.
22:43 masak it kind of counterbalances a lot of the hygiene we have in the system :)
22:47 vendethiel my gist is *almost* ready
22:47 vendethiel .oO( hang in tight, we're crunching the latest macro for you )
22:48 masak ;)
22:51 vendethiel okay, ready
22:51 vendethiel https://gist.github.com/vendethiel/bff772fc084ca88bb253
22:53 * masak reads
22:53 masak QV::ar -> Q::Var ?
22:55 masak it looks intriguing.
22:55 masak I find I don't have much coherent to say about it; maybe more tomorrow when I'm awaker.
22:55 masak but I do note a potential problem already.
22:55 vendethiel yeah, of course :p
22:56 masak actually, two.
22:56 masak your macro parameter &block will never bind correctly, since an AST/Qtree isn't Callable
22:57 masak second, that `{{{&block}}}` there splices in a *natural* AST. hence, hygiene applies, and it can't see the `my {{{$var}}};`
22:59 vendethiel fixed
22:59 vendethiel well
23:00 vendethiel it should be able to see it
23:01 masak `$block where Q::Call` better written `Q::Call $block` ;)
23:02 masak oh, I see, you're replacing parts of the natural Qtree with synthetic ones.
23:02 masak then I take back my objection.
23:13 masak ah, and you solved the `whenever $supply -> $var { ... }` parsing problem by ignoring it ;)
23:13 vendethiel ;-)
23:14 masak in the fullness of time, I want a solid way to do that.
23:14 masak something better than `is parsed`
23:14 vendethiel suure.
23:14 vendethiel but not needed to whenever :P
23:15 masak sure, if you can live with that comma.
23:16 masak haha, maybe the solution could just be `macro whenever($expr, NO_COMMA, $xblock) { ... }` :P
23:17 masak though that feels like decidedly the wrong hook. ASTs are not parsing.
23:19 vendethiel lol :D
23:19 masak ok, my energy's run out. time for bed.
23:19 masak 'night
23:21 vendethiel gnight :)
23:21 vendethiel i'm just happy if I can provide a few pseudo-macros :P

| Channels | #6macros index | Today | | Search | Google Search | Plain-Text | summary