|
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 19 March 2015. |
|||
|
19:05
Mouq joined
|
|||
| Mouq | irclog.perlgeek.de/6macros/2015-03-21#i_10317283 huh? | 19:10 | |
| vendethiel: My suggestion was to take "is parsed /<call> + % '|'/" and turn it into "infix:<|> (AST::Call @calls)" | 19:11 | ||
| vendethiel | Mouq: if you devine infix:<|>(Ast::Call @), then no other macro can use | | ||
| + it really shouldn't be defined "locally" | 19:13 | ||
| it's like we need a mechanism to change the scope inside the argument list | |||
| (which would be insane, but is basically what macros do :P) | |||
| Mouq | Ohhh, I see what you mean now. My bad | ||
| FWIW, I understand that it's just an example, but I'm still against "is parsed". My approach is that the macro should define an API with which it can be called, which is then implemented with a "macrorule" or similar. I'm not sure this really helps with your case | 19:23 | ||
| vendethiel | I just said "is parsed" as an example ;-) | 19:25 | |
| I don't want regexp-based parsing. | |||
| Mouq | Potentially, though, there could be an "has arg_sep<|>" | ||
| vendethiel | not, that could never work, not flexible enough | ||
| where's the precedence declaration, for example | |||
| Mouq | True | 19:26 | |
| Also would interact badly with infix:<|> | |||
| Although, really, in Perl 6 wouldn't that example look like: `adt Maybe (Just[::T], Nothing)` ? | 19:33 | ||
| ( `Maybe[::T]` I suppose) | 19:34 | ||
| vendethiel | could. | 19:37 | |
| we don't have "adt" nor in compilers neither in the spec, tho | |||
| (AFAIK) | 19:38 | ||
| would be good as a macro... | |||
| Mouq | No, just in terms of making it fit into the language | 19:41 | |
| For example, I assume the reason you use calls in elixir version is because type names are always UpperCased? | 19:43 | ||
| Whereas we can do better here | |||
| vendethiel | yeah | 19:54 | |
| Foo(x) is a syntax error. | 19:55 | ||
| hence I need to format it + use Module.concat. | 19:56 | ||
| masak | whoa, backlog | 19:57 | |
|
21:15
Ven joined
|
|||