Closed tajmone closed 6 years ago
Hi,
The comment
macro just discards its argument. It's not stored and not preprocessed. The macro just returns an empty string.
I guess it's the fastest pp macro ;-)
Thanks!
I still don't get the full picture ... when I define a macro how does PP store them in memory, as they are (raw definitions) or they are preprocessed to some extent?
What I means is: with the !define
macro I'm creating a custom macro that will be kept in memory for reuse later, when processing the document. If the macro's definition body contains other custom macros, or comments, etc, are these expanded to some level before the macro being defined gets actually stored in memory?
In other words: once parsed, are macros definitions stored in PP's memory as their textual definitions (as the user wrote them) or are they converted by PP to real code and stored as such?
I'm trying to get a clearer mental picture of how macros (and nested macros) definitions work.
There are two kinds of macros.
Hi, I wanted to ask if the
!comment
macro has any impact on a macros perfomance — ie: in my macros definition I'd like to keep a comment block with description and usage instructions inside the definition itself, like this:USAGE:
cat <<EOF | highlight -f -S \1 --no-trailing-nl --validate-input !ifdef(2)(\2) \4 EOF
The question is wether PP would then store the defined macro with all comments stripped off (ie: as if I wrote it without the comments) or wether the comments are kept as part of the macro definition and are parsed again at each macro occurence/invocation in the doc.
I'm sure this wouldn't have a significant performance hit anyway, but I'm just curious about it.