Add Rust macro counter-example

This commit is contained in:
2020-09-03 13:23:14 +03:00
parent 651654bbc5
commit 025f98f38c

View File

@@ -635,6 +635,8 @@ alias UIBin<*>, UBin<*> = IBin<false, *>
Macro code can generate other macro code. Macro code can generate other macro code.
The algorithm is to evaluate immediate macros (e.g. `{% %}`) immediately once they are met in the code by some lexer, but evaluate delayed macros (e.g. `\{% %}`) only when the time is right, for example, per specialization. The algorithm is to evaluate immediate macros (e.g. `{% %}`) immediately once they are met in the code by some lexer, but evaluate delayed macros (e.g. `\{% %}`) only when the time is right, for example, per specialization.
This allows to avoid embarrassing situations like [this](https://github.com/diesel-rs/diesel/blob/master/diesel/src/macros/tuples.rs) in Rust.
Apart from simply `print "Debug"`, Lua contains powerful debugging facilities, e.g. `debug()`. Apart from simply `print "Debug"`, Lua contains powerful debugging facilities, e.g. `debug()`.
This means that you can debug your compilation, even with breakpoints from an IDE! This means that you can debug your compilation, even with breakpoints from an IDE!