Sujet : Re: Which code style do you prefer the most?
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.cDate : 28. Feb 2025, 22:25:05
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vpt9jh$3r2n0$11@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : Pan/0.162 (Pokrosvk)
On Fri, 28 Feb 2025 22:12:40 +0600, Ar Rakin wrote:
Would you say that the Rust compiler's implementation is *close* to what
you expect?
Looking at this overview
<
https://doc.rust-lang.org/book/ch20-06-macros.html>, I think so.
The Rust compiler processes macros during tokenization ...
So does C, but Rust does seem to be doing it at the AST level, which is
the right way.
But note how they need two types of macros, one involving expanding a
template and the other allowing the more elaborate execution of arbitrary
code. In LISP-family languages (where the idea of AST-level macros came
from), there doesn’t need to be such a distinction.