|
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:01
vendethiel- joined
08:49
vendethiel joined
10:15
vendethiel joined
13:01
Ven_ joined
|
|||
| Ven_ | masak: can I use your wisdom for a bit? | 13:01 | |
|
13:03
andreoss joined
|
|||
| masak | all I have available right now is questionable wisdom... :) | 13:05 | |
| andreoss | masak: {{{Q::Literal::None}}} should be None? | ||
| Ven_ | actually, it turns out I was right and my test was wrong. | 13:06 | |
| masak | andreoss: {{{new Q::Literal::None()}}}, probably | ||
| Ven_: ;) | |||
| Ven_ | > ((let id 5 (macro (name) (eval name))) id) | ||
| this now prints 5 in my lisp :) | |||
| masak | \\o/ | ||
| andreoss | masak: what is `new`? | ||
| masak | andreoss: it's a relatively recent keyword -- hold on, I'll get you the issue in question | 13:07 | |
| github.com/masak/007/issues/147 | |||
| Ven_ | I think I can consider this experiment over. I only want to implement quasiquoting, and I can say "I've implemented a lisp" | 13:08 | |
| masak | go for it | ||
| and then paste some cool nested unquoting here :) | |||
| Ven_ | (let x 3 ((let id 'x (macro (name) (eval name)) id)) | 13:09 | |
| also prints 3 | |||
| whew. | |||
| you were right ā once lambdas are here, macros are really easy to implement. | 13:10 | ||
| andreoss | m: macro m() { my q = new Q::Literal::None(); return quasi { {{{q}}} } ; }; say(m() == None); | ||
| Ven_ | my `run_macro_call` is 2-3 lines long | ||
| quasiquoting might be more fun to implement, though... sigh | 13:11 | ||
| masak | :) | ||
| Ven_ | though I think I'm gonna make good use of Perl 5's flattening behavior here | ||
| (all this has made me miss Perl 6 quite a bit) | |||
| masak | well, you still have it easier than 007 and Perl 6, I'd say | ||
| andreoss | shoul it even work now? | ||
| Ven_ | Oh, yeah, thousands of times easier: my macros are unhygienic | 13:12 | |
| andreoss | oh..it's 'new Q::Literal::None { }'; | 13:13 | |
| masak | andreoss: in 007 -- yes, but I can't currently make it work | ||
| andreoss: oh, right :) | |||
| Ven_ | also, I know see quasi is really only tied to syntax | 13:14 | |
| that's why it's gonna be so much easier for me. I only have turtles to deal with! | |||
| masak | yes | 13:15 | |
| andreoss | masak: also extra parenthesis around {{{}}} | ||
| masak | yeah, I can't get it to work either way | 13:18 | |
| Ven_ | masak: do we have anonymous macros, just like anonymous subs? | ||
| masak | also, I suspect I just found an untested regression in the middle of all the fail | ||
| Ven_: do you mean expression macros? no, not at present. haven't found them useful. | 13:19 | ||
| they could certainly *work*, it's just that... it seems to me macros are there to be named and (re-)used | |||
| Ven_ | the same certainly could be said for functions..? | 13:20 | |
| masak | no, because you pass the function, and it's useful by virtue of delayed calling | 13:22 | |
| andreoss | masak: how about anonymous objects (without indentifier)? | ||
| masak | there's no such mechanism for macros that would make anonymous macros useful | ||
| andreoss: `{ foo: 42, bar: 5 }` works | |||
| Ven_ | masak: bah, you people with your separated call-time vs run-time! | ||
| masak | oh, I stand a bit corrected | 13:24 | |
| we now know of cases where macros (*in quasis*) simply cannot be called directly because their argument ASTs are still unquotes | |||
| so yeah, maybe there is a case there | 13:25 | ||
| but it still feels a bit hypothetical, if you see what I mean | |||
|
13:26
vendethiel- joined
|
|||
| Ven_ | masak: ooh, Dyalog APL just announced that they're making Educational, Personal and Non-Commercial use of Dyalog APL completely free. | 13:30 | |
| masak | sweet | ||
| (but off topic, unless it's an APL dialect with macros) :P | |||
| Ven_ | I really need to investigate for a Inline::Dyalog module... | ||
| who knows if APL has macros *g* | 13:31 | ||
| masak | heh | 13:33 | |
|
13:48
pdcawley joined
20:06
ilbot3 joined
21:55
cgfbee joined
|
|||