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:22 FROGGS_ joined 02:48 ilbot3 joined 05:06 pdcawley joined 05:54 ilbot3 joined 06:25 ilbot3 joined 11:46 vendethiel joined
vendethiel \\o 11:46
12:21 vendethiel joined
masak o/ 12:24
vendethiel it's not scheme btw, it's clojure quasiquoting :P (answering yesterday's last remark) 12:27
masak ah, of course. 12:30
I'm thinking of putting together a gist (as suggested) "why Perl 6 `quasi` ASTs seem to need to have a lexical scope"
vendethiel please do :) 12:55
masak ok, here we go 14:49
I didn't have time to proof, and I didn't have time to write a summary
but here it is -- gist.github.com/masak/978d6e7c0ad131da0334
pdcawley: you might want to have a look, too ^ 14:50
detrain & 14:51
vendethiel "macro arguments ASTs", "quasi ASTs" no, those should be *exactly the same* 15:00
if foo is a macro, then the result from foo(a, b, c) 15:01
should be the same as if foo were a function, and you called foo(quasi { a }, quasi { b }, quasi { c })
also, I understand why perl6's operators are subs and not methods, but I dislike it 15:10
because that means this:
macro add(a, b){quasi{a+b}}; { sub infix:<+>(Klass, Klass) { ... }; add(Klass.new, Klass.new); } 15:11
will not work as expected
it's a bit like perl6 gets the worse of both worlds in that regard... We have custom operators, but we can't pass array-like structures, or otherwise we have to invent workarounds like "AT-INDEX" 15:12
so, yeah, my bit about clojure was mostly about that quasi capturing: I learned to see why 15:13
Just like clojure's reader (and others) walks to prepend the namespace to its identifiers, perl6 marks its quasi variables as lexical. 15:14
but, since we have a way around that in clojure, and we'll need one if we want to break hygiene, we need one such way as well in perl6
I'm not gonna go back to the "times" discussion we had before. There's an interesting fact I'm going to point at, though: in racket, if you want to be able to use "foo" in another level (template/syntax ...), you need to (require (for-syntax ...)) 15:16
each "execution level" has its own lexical scope. Like a 3d matrix 15:17
in perl 6, that ship sailed long ago: we already have "other times" (obviously BEGIN and al), and they share the lexical scope 15:18
15:54 Ven joined 15:56 Ven joined 16:12 Ven joined 16:41 Ven joined 16:56 Ven joined 17:12 Ven joined 17:27 Ven joined 17:41 Ven joined 18:12 Ven joined 18:48 Ven joined 18:57 Ven joined 19:00 Ven joined 19:17 FROGGS joined 19:28 Ven joined 20:11 Ven joined 20:13 Ven joined 20:24 Ven joined 20:42 Ven joined 20:59 Ven joined 21:12 Ven joined 21:45 Ven joined 22:01 Ven joined
Ven github.com/vendethiel/hydrate6/blo...ate.pm#L20 22:12
22:13 Ven joined
Ven I really don't like flattening :(. the whole containerization thing is often veeery confusing 22:13
the fact I can't just blindly any() is also a gotcha you need to be aware. 22:14
perl 6 has quite a few corner cases
22:37 Ven joined 22:44 Ven joined 22:58 Ven joined 22:59 Ven joined 23:13 Ven joined 23:32 Ven joined 23:44 Ven joined