|
|
|
|
|
by steveklabnik
2885 days ago
|
|
And in cases where you don’t, various combinators let you handle common patterns more easily too. You can also write it Go style if you prefer; we started off with exactly that, then moved to a macro, then turned that macro into ?. That all being said, none of that feels very Go-like, so it makes sense that they haven’t followed what we did. |
|
If you're only familiar with macros from C or C++ take a look. The basic idea is that your macro fictions don't use input text and output text. Instead they accept an Abstract Syntax Tree and return a known AS THE. That way the expansion plays well with the grammer.
It also manages separate variable scopes well. You only get bleed if you want it.
I used to shudder at the thought of macros but I'm convinced. Java or Go could use them reasonably I think.
I'm not a rust programer so my understand is probably a little wrong. I'm not intimately familiar with all of the details. Correct me if I'm mistaken!